protected virtual void CreateToolWindowMenu(ToolWindowInfo windowInfo)
        {
            if (windowInfo.ToolWindow == null)
            {
                return;
            }

            ToolStripMenuItem menu = new ToolStripMenuItem(
                windowInfo.MenuText,
                windowInfo.MenuImage);

            windowInfo.ToolWindow.DockStateChanged += (s, e) =>
                                                      menu.Checked = (windowInfo.ToolWindow.DockState != DockState.Hidden);
            menu.Checked = (windowInfo.ToolWindow.DockState != DockState.Hidden);
            menu.Visible = windowInfo.IsEnabled;
            menu.Tag     = windowInfo;
            windowInfo.EnabledChanged += (s, e) =>
            {
                menu.Visible = windowInfo.IsEnabled;
                UpdateViewMenu();
            };

            menu.Click += (s, e) => ShowToolWindow(windowInfo);

            if (ViewMenuItem != null)
            {
                ViewMenuItem.DropDownItems.Add(menu);
                UpdateViewMenu();
            }
        }
 protected virtual bool IsToolWindowEnabled(ToolWindowInfo windowInfo)
 {
     if (windowInfo == null)
     {
         return(false);
     }
     return(windowInfo.IsEnabled);
 }
 protected void ShowToolWindow(ToolWindowInfo windowInfo, bool dockDefault)
 {
     CheckToolWindow(windowInfo);
     windowInfo.ToolWindow.Show(workspace);
     if (dockDefault)
     {
         windowInfo.ToolWindow.DockDefault();
     }
 }
 private void CheckToolWindow(ToolWindowInfo windowInfo)
 {
     if (windowInfo == null)
     {
         throw new ArgumentNullException("windowInfo");
     }
     if (windowInfo.ToolWindow == null)
     {
         throw new ArgumentNullException("windowInfo.ToolWindow");
     }
 }
        /// <summary>
        /// Registers a tool window that has just been created with the Layout service.
        /// </summary>
        /// <param name="windowInfo">The tool window info.</param>
        protected virtual void RegisterToolWindow(ToolWindowInfo windowInfo)
        {
            CheckToolWindow(windowInfo);

            if (LayoutService != null)
            {
                LayoutService.RegisterToolWindow(FormId, windowInfo.ToolWindow);
            }
            toolWindowInfos.Add(windowInfo.ToolWindow.Guid, windowInfo);

            OnToolWindowInfoRegistered(windowInfo);
        }
 /// <summary>
 /// Called when a tool window info is registered.
 /// </summary>
 /// <param name="windowInfo">The window info.</param>
 protected virtual void OnToolWindowInfoRegistered(ToolWindowInfo windowInfo)
 {
 }
 protected void HideToolWindow(ToolWindowInfo windowInfo)
 {
     CheckToolWindow(windowInfo);
     windowInfo.ToolWindow.Hide();
 }
 protected void ShowToolWindow(ToolWindowInfo windowInfo)
 {
     ShowToolWindow(windowInfo, false);
 }
Example #9
0
        /// <summary>
        /// Creates the tool windows.
        /// </summary>
        protected override void CreateToolWindows()
        {
            var logWindowInfo = new ToolWindowInfo<LogWindow>();
            logWindowInfo.ToolWindow = new LogWindow(false);
            base.RegisterToolWindow(logWindowInfo);

            var certificateStoreWindowInfo = new ToolWindowInfo<CertificateStoreWindow>();
            certificateStoreWindowInfo.ToolWindow = new CertificateStoreWindow();
            base.RegisterToolWindow(certificateStoreWindowInfo);

            var documentManagerWindowInfo = new ToolWindowInfo<DocumentManagerWindow>();
            documentManagerWindowInfo.ToolWindow = new DocumentManagerWindow();
            base.RegisterToolWindow(documentManagerWindowInfo);

            var propertiesWindowInfo = new ToolWindowInfo<PropertiesWindow>();
            propertiesWindowInfo.ToolWindow = new PropertiesWindow();
            base.RegisterToolWindow(propertiesWindowInfo);

            var cerfificateListWindowInfo = new ToolWindowInfo<CertificateListWindow>();
            cerfificateListWindowInfo.ToolWindow = new CertificateListWindow();
            base.RegisterToolWindow(cerfificateListWindowInfo);
        }