Example #1
0
        /// <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);
        }
Example #2
0
        public SubmittedChangelistsToolWindow()
            : base(null)
        {
            // set the window title
            this.Caption = Resources.SubmittedChangelistsToolWindow_Caption;

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

            // set the icon for the frame
#if VS2008
            this.BitmapResourceID = 507;     // CommandId.ibmpSubmittedToolWindowsImage;  // bitmap strip resource ID
            this.BitmapIndex      = 3;       // 0;   // index in the bitmap strip
#else
            this.BitmapResourceID = 508;     // CommandId.ibmpSubmittedToolWindowsImage;  // bitmap strip resource ID
            this.BitmapIndex      = 3;       // 0;   // index in the bitmap strip
#endif
            using (DpiAwareness.EnterDpiScope(DpiAwarenessContext.SystemAware))
            {
                control      = new SubmittedChangelistsToolWindowControl();
                control.Dock = DockStyle.Fill;
            }
        }