/// <summary>
        ///     Dispose of resources used by the designer tool window.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing)
                {
                    SystemEvents.UserPreferenceChanged -= OnUserPreferenceChanged;
                    VSColorTheme.ThemeChanged          -= VSColorTheme_ThemeChanged;

                    if (_deferredExpandAllNodes != null)
                    {
                        _deferredExpandAllNodes.Dispose();
                        _deferredExpandAllNodes = null;
                    }

                    if (_containerControl != null)
                    {
                        _containerControl.Dispose();
                        _containerControl = null;
                    }

                    if (_treeControl != null)
                    {
                        _treeControl.Dispose();
                        _treeControl = null;
                    }

                    if (vsEventBroadcaster != null)
                    {
                        vsEventBroadcaster.Dispose();
                    }
                    _treeProvider = null;
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }
        /// <summary>
        ///     Dispose of resources used by the designer tool window.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing)
                {
                    SystemEvents.UserPreferenceChanged -= OnUserPreferenceChanged;
                    VSColorTheme.ThemeChanged -= VSColorTheme_ThemeChanged;

                    if (_deferredExpandAllNodes != null)
                    {
                        _deferredExpandAllNodes.Dispose();
                        _deferredExpandAllNodes = null;
                    }

                    if (_containerControl != null)
                    {
                        _containerControl.Dispose();
                        _containerControl = null;
                    }

                    if (_treeControl != null)
                    {
                        _treeControl.Dispose();
                        _treeControl = null;
                    }

                    if (vsEventBroadcaster != null)
                    {
                        vsEventBroadcaster.Dispose();
                    }
                    _treeProvider = null;
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }
 /// <summary>
 ///     Construct the designer tool window.
 /// </summary>
 /// <param name="serviceProvider"></param>
 protected TreeGridDesignerToolWindow(IServiceProvider serviceProvider)
     : base(serviceProvider)
 {
     _deferredExpandAllNodes = new DeferredRequest(ExpandAllDeferred);
 }
 /// <summary>
 ///     Construct the designer tool window.
 /// </summary>
 /// <param name="serviceProvider"></param>
 protected TreeGridDesignerToolWindow(IServiceProvider serviceProvider)
     : base(serviceProvider)
 {
     _deferredExpandAllNodes = new DeferredRequest(ExpandAllDeferred);
 }
        public override void OnInitialize()
        {
            base.OnInitialize();

            // select the shape that is closest to the origin, but defer until after the view is fully rendered
            if (_deferredInitialSelection != null)
            {
                _deferredInitialSelection.Dispose();
            }

            _deferredInitialSelection = new DeferredRequest(SetInitialSelectionCallback);
            _deferredInitialSelection.Request();
        }
 protected override void Dispose(bool disposing)
 {
     try
     {
         if (disposing)
         {
             if (_deferredInitialSelection != null)
             {
                 _deferredInitialSelection.Dispose();
                 _deferredInitialSelection = null;
             }
         }
     }
     finally
     {
         base.Dispose(disposing);
     }
 }