src/Misc/EFTools/DesignXmlCore/Base/Shell/TreeGridDesignerToolWindow.cs
/// <summary>
///     Overriden to create the VirtualTreeControl hosted in the tool window
/// </summary>
/// <returns></returns>
Overriden to create the VirtualTreeControl hosted in the tool window
Overriden to create the VirtualTreeControl hosted in the tool window
protected override void OnToolWindowCreate()
        {
            Debug.Assert(_containerControl == null, "containerControl should be null at the beginning of OnCreate");
            _treeProvider = new VariableColumnTree(1);
            _treeControl = new TreeGridDesignerTreeControl(this);
            _treeControl.SelectionMode = SelectionMode.One;
            _treeControl.LabelEditSupport = VirtualTreeLabelEditActivationStyles.ImmediateMouse
                                            | VirtualTreeLabelEditActivationStyles.Explicit;
            _treeControl.HasHorizontalGridLines = true;
            _treeControl.HasVerticalGridLines = false;
            _treeControl.ShowToolTips = true;
            _treeControl.MultiColumnTree = _treeProvider as IMultiColumnTree;
            _treeControl.IsDragSource = false;
            _treeControl.MultiColumnHighlight = true;
            _treeControl.StandardCheckBoxes = true;
            _treeControl.SelectionChanged += OnTreeSelectionChanged;
            _treeControl.LabelEditControlChanged += OnLabelEditControlChanged;
            _treeControl.Site = new TreeGridDesignerSite(this);
            _treeControl.ContextMenuInvoked += OnContextMenu;
            var defaultColumnsCollection = DefaultColumns;
            if (defaultColumnsCollection != null)
            {
                _treeControl.DefaultColumns = defaultColumnsCollection;
            }
            _containerControl = CreateContainer();
            _containerControl.SetWatermarkInfo(WatermarkInfo);
            _containerControl.WatermarkVisible = true;
            _containerControl.AccessibilityObject.Name = AccessibilityName;
            SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged;
            NativeMethods.SendMessage(
                _treeControl.Handle, NativeMethods.WM_UPDATEUISTATE, (NativeMethods.UIS_CLEAR | (NativeMethods.UISF_HIDEFOCUS << 16)), 0);
            vsEventBroadcaster = new VSEventBroadcaster(this);
            vsEventBroadcaster.Initialize();
            vsEventBroadcaster.OnFontChanged += vsEventBroadcaster_OnFontChanged;
            SetFonts();
            SetTreeControlThemedColors();
            VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged;
        }
protected override void OnToolWindowCreate ( ) { Debug . Assert ( _containerControl == null , " " ) ; _treeProvider = new VariableColumnTree ( 1 ) ; _treeControl = new TreeGridDesignerTreeControl ( this ) ; _treeControl . SelectionMode = SelectionMode . One ; _treeControl . LabelEditSupport = VirtualTreeLabelEditActivationStyles . ImmediateMouse | VirtualTreeLabelEditActivationStyles . Explicit ; _treeControl . HasHorizontalGridLines = true ; _treeControl . HasVerticalGridLines = false ; _treeControl . ShowToolTips = true ; _treeControl . MultiColumnTree = _treeProvider as IMultiColumnTree ; _treeControl . IsDragSource = false ; _treeControl . MultiColumnHighlight = true ; _treeControl . StandardCheckBoxes = true ; _treeControl . SelectionChanged += OnTreeSelectionChanged ; _treeControl . LabelEditControlChanged += OnLabelEditControlChanged ; _treeControl . Site = new TreeGridDesignerSite ( this ) ; _treeControl . ContextMenuInvoked += OnContextMenu ; var defaultColumnsCollection = DefaultColumns ; if ( defaultColumnsCollection != null ) { _treeControl . DefaultColumns = defaultColumnsCollection ; } _containerControl = CreateContainer ( ) ; _containerControl . SetWatermarkInfo ( WatermarkInfo ) ; _containerControl . WatermarkVisible = true ; _containerControl . AccessibilityObject . Name = AccessibilityName ; SystemEvents . UserPreferenceChanged += OnUserPreferenceChanged ; NativeMethods . SendMessage ( _treeControl . Handle , NativeMethods . WM_UPDATEUISTATE , ( NativeMethods . UIS_CLEAR | ( NativeMethods . UISF_HIDEFOCUS << 16 ) ) , 0 ) ; vsEventBroadcaster = new VSEventBroadcaster ( this ) ; vsEventBroadcaster . Initialize ( ) ; vsEventBroadcaster . OnFontChanged += vsEventBroadcaster_OnFontChanged ; SetFonts ( ) ; SetTreeControlThemedColors ( ) ; VSColorTheme . ThemeChanged += VSColorTheme_ThemeChanged ; }
Overriden to create the VirtualTreeControl hosted in the tool window
Overriden to create the VirtualTreeControl hosted in the tool window
// set up tree data // set up tree control // create container control which handles the watermark // Listen for user preference changes.  We use this to update our fonts due to high-contrast changes. // we always want focus rectangles to be drawn // set the font based on VS settings
None