/// <include file='doc\WindowPane.uex' path='docs/doc[@for="WindowPane.Dispose1"]' />
        /// <devdoc>
        ///     Called when this tool window pane is being disposed.
        /// </devdoc>
        override protected void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (control != null)
                {
                    try
                    {
                        if (control is IDisposable)
                        {
                            control.Dispose();
                        }
                    }
                    catch (Exception e)
                    {
                        System.Diagnostics.Debug.Fail(String.Format("Failed to dispose {0} controls.\n{1}", this.GetType().FullName, e.Message));
                    }
                    control = null;
                }

                IVsWindowFrame windowFrame = (IVsWindowFrame)this.Frame;
                if (windowFrame != null)
                {
                    // Note: don't check for the return code here.
                    windowFrame.CloseFrame((uint)__FRAMECLOSE.FRAMECLOSE_SaveIfDirty);
                }
            }
            base.Dispose(disposing);
        }
        public SccProviderToolWindow() : base(null)
        {
            // set the window title
            this.Caption = Resources.ResourceManager.GetString("ToolWindowCaption");

            // set the CommandID for the window ToolBar
            this.ToolBar = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.imnuToolWindowToolbarMenu);

            // set the icon for the frame
            this.BitmapResourceID = CommandId.ibmpToolWindowsImages;     // bitmap strip resource ID
            this.BitmapIndex      = CommandId.iconSccProviderToolWindow; // index in the bitmap strip

            control = new SccProviderToolWindowControl();
        }
        public SccProviderToolWindow()
            : base(null)
        {
            // set the window title
            this.Caption = Resources.ResourceManager.GetString("ToolWindowCaption");

            // set the CommandID for the window ToolBar
            this.ToolBar = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.imnuToolWindowToolbarMenu);

            // set the icon for the frame
            this.BitmapResourceID = CommandId.ibmpToolWindowsImages;  // bitmap strip resource ID
            this.BitmapIndex = CommandId.iconSccProviderToolWindow;   // index in the bitmap strip

            control = new SccProviderToolWindowControl();
        }
        public SccProviderToolWindow() : base(null)
        {
            // set the window title
            this.Caption = Resources.ResourceManager.GetString("ToolWindowCaption");

            // set the CommandID for the window ToolBar
            this.ToolBar = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.imnuToolWindowToolbarMenu);

            // set the icon for the frame
            this.BitmapResourceID = CommandId.ibmpToolWindowsImages;     // bitmap strip resource ID
            this.BitmapIndex      = CommandId.iconSccProviderToolWindow; // index in the bitmap strip

            control = new SccProviderToolWindowControl();

            // Initialize the toolwindow colors to respect the current theme
            SetDefaultColors();

            // Sign up to theme changes to keep the colors up to date
            VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged;
        }
        public SccProviderToolWindow() :base(null)
        {
            // set the window title
            Caption = Resources.ResourceManager.GetString("ToolWindowCaption");

            // set the CommandID for the window ToolBar
            ToolBar = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.imnuToolWindowToolbarMenu);

            // set the icon for the frame
            BitmapResourceID = CommandId.ibmpToolWindowsImages;  // bitmap strip resource ID
            BitmapIndex = CommandId.iconSccProviderToolWindow;   // index in the bitmap strip

            control = new SccProviderToolWindowControl();

            // Initialize the toolwindow colors to respect the current theme
            SetDefaultColors();

            // Sign up to theme changes to keep the colors up to date
            VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged;
        }
        /// <summary>
        /// Releases the unmanaged resources used by the ToolWindow and optionally releases the managed resources.
        /// </summary>
        /// <param name="disposing">
        /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
        /// </param>
        override protected void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Unsubscribe from theme changed events
                VSColorTheme.ThemeChanged -= VSColorTheme_ThemeChanged;

                if (control != null)
                {
                    try
                    {
                        if (control is IDisposable)
                            control.Dispose();
                    }
                    catch (Exception e)
                    {
                        System.Diagnostics.Debug.Fail(string.Format("Failed to dispose {0} controls.\n{1}", GetType().FullName, e.Message));
                    }
                    control = null;
                } 
                
                IVsWindowFrame windowFrame = (IVsWindowFrame)Frame;
                if (windowFrame != null)
                {
                    // Note: don't check for the return code here.
                    windowFrame.CloseFrame((uint)__FRAMECLOSE.FRAMECLOSE_SaveIfDirty);
                }
            }
            base.Dispose(disposing);
        }
        /// <include file='doc\WindowPane.uex' path='docs/doc[@for="WindowPane.Dispose1"]' />
        /// <devdoc>
        ///     Called when this tool window pane is being disposed.
        /// </devdoc>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (control != null)
                {
                    try
                    {
                        if (control is IDisposable)
                            control.Dispose();
                    }
                    catch (Exception e)
                    {
                        System.Diagnostics.Debug.Fail(String.Format("Failed to dispose {0} controls.\n{1}", this.GetType().FullName, e.Message));
                    }
                    control = null;
                }

                IVsWindowFrame windowFrame = (IVsWindowFrame)this.Frame;
                if (windowFrame != null)
                {
                    // Note: don't check for the return code here.
                    windowFrame.CloseFrame((uint)__FRAMECLOSE.FRAMECLOSE_SaveIfDirty);
                }
            }
            base.Dispose(disposing);
        }