Esempio n. 1
0
        public static void InitializeWorkbench()
        {
            workbench = new DefaultWorkbench();
            MessageService.MainForm = workbench;

            caller = new STAThreadCaller(workbench);

            workbench.InitializeWorkspace();

            workbench.WorkbenchLayout = new SdiWorkbenchLayout();
        }
        public void Attach(IWorkbench workbench)
        {
            wbForm = (DefaultWorkbench)workbench;
            wbForm.SuspendLayout();
            wbForm.IsMdiContainer = true;

            dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
            dockPanel.ActiveAutoHideContent = null;

            WeifenLuo.WinFormsUI.Docking.DockPanelSkin                   dockPanelSkin1                   = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin();
            WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin               autoHideStripSkin1               = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin();
            WeifenLuo.WinFormsUI.Docking.DockPanelGradient               dockPanelGradient1               = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
            WeifenLuo.WinFormsUI.Docking.TabGradient                     tabGradient1                     = new WeifenLuo.WinFormsUI.Docking.TabGradient();
            WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin               dockPaneStripSkin1               = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin();
            WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient           dockPaneStripGradient1           = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient();
            WeifenLuo.WinFormsUI.Docking.TabGradient                     tabGradient2                     = new WeifenLuo.WinFormsUI.Docking.TabGradient();
            WeifenLuo.WinFormsUI.Docking.DockPanelGradient               dockPanelGradient2               = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
            WeifenLuo.WinFormsUI.Docking.TabGradient                     tabGradient3                     = new WeifenLuo.WinFormsUI.Docking.TabGradient();
            WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient();
            WeifenLuo.WinFormsUI.Docking.TabGradient                     tabGradient4                     = new WeifenLuo.WinFormsUI.Docking.TabGradient();
            WeifenLuo.WinFormsUI.Docking.TabGradient                     tabGradient5                     = new WeifenLuo.WinFormsUI.Docking.TabGradient();
            WeifenLuo.WinFormsUI.Docking.DockPanelGradient               dockPanelGradient3               = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
            WeifenLuo.WinFormsUI.Docking.TabGradient                     tabGradient6                     = new WeifenLuo.WinFormsUI.Docking.TabGradient();
            WeifenLuo.WinFormsUI.Docking.TabGradient                     tabGradient7                     = new WeifenLuo.WinFormsUI.Docking.TabGradient();
            this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
            this.dockPanel.ActiveAutoHideContent = null;
            this.dockPanel.Dock          = System.Windows.Forms.DockStyle.Fill;
            this.dockPanel.DockBackColor = System.Drawing.SystemColors.Control;
            this.dockPanel.Location      = new System.Drawing.Point(0, 49);
            this.dockPanel.Name          = "dockPanel";
            this.dockPanel.Size          = new System.Drawing.Size(657, 264);

            dockPanelGradient1.EndColor          = System.Drawing.SystemColors.ControlLight;
            dockPanelGradient1.StartColor        = System.Drawing.SystemColors.ControlLight;
            autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
            tabGradient1.EndColor                                    = System.Drawing.SystemColors.Control;
            tabGradient1.StartColor                                  = System.Drawing.SystemColors.Control;
            tabGradient1.TextColor                                   = System.Drawing.SystemColors.ControlDarkDark;
            autoHideStripSkin1.TabGradient                           = tabGradient1;
            dockPanelSkin1.AutoHideStripSkin                         = autoHideStripSkin1;
            tabGradient2.EndColor                                    = System.Drawing.SystemColors.ControlLightLight;
            tabGradient2.StartColor                                  = System.Drawing.SystemColors.ControlLightLight;
            tabGradient2.TextColor                                   = System.Drawing.SystemColors.ControlText;
            dockPaneStripGradient1.ActiveTabGradient                 = tabGradient2;
            dockPanelGradient2.EndColor                              = System.Drawing.SystemColors.Control;
            dockPanelGradient2.StartColor                            = System.Drawing.SystemColors.Control;
            dockPaneStripGradient1.DockStripGradient                 = dockPanelGradient2;
            tabGradient3.EndColor                                    = System.Drawing.SystemColors.ControlLight;
            tabGradient3.StartColor                                  = System.Drawing.SystemColors.ControlLight;
            tabGradient3.TextColor                                   = System.Drawing.SystemColors.ControlText;
            dockPaneStripGradient1.InactiveTabGradient               = tabGradient3;
            dockPaneStripSkin1.DocumentGradient                      = dockPaneStripGradient1;
            tabGradient4.EndColor                                    = System.Drawing.SystemColors.ActiveCaption;
            tabGradient4.LinearGradientMode                          = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            tabGradient4.StartColor                                  = System.Drawing.SystemColors.GradientActiveCaption;
            tabGradient4.TextColor                                   = System.Drawing.SystemColors.ActiveCaptionText;
            dockPaneStripToolWindowGradient1.ActiveCaptionGradient   = tabGradient4;
            tabGradient5.EndColor                                    = System.Drawing.SystemColors.Control;
            tabGradient5.StartColor                                  = System.Drawing.SystemColors.Control;
            tabGradient5.TextColor                                   = System.Drawing.SystemColors.ControlText;
            dockPaneStripToolWindowGradient1.ActiveTabGradient       = tabGradient5;
            dockPanelGradient3.EndColor                              = System.Drawing.SystemColors.ControlLight;
            dockPanelGradient3.StartColor                            = System.Drawing.SystemColors.ControlLight;
            dockPaneStripToolWindowGradient1.DockStripGradient       = dockPanelGradient3;
            tabGradient6.EndColor                                    = System.Drawing.SystemColors.GradientInactiveCaption;
            tabGradient6.LinearGradientMode                          = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            tabGradient6.StartColor                                  = System.Drawing.SystemColors.GradientInactiveCaption;
            tabGradient6.TextColor                                   = System.Drawing.SystemColors.ControlText;
            dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6;
            tabGradient7.EndColor                                    = System.Drawing.Color.Transparent;
            tabGradient7.StartColor                                  = System.Drawing.Color.Transparent;
            tabGradient7.TextColor                                   = System.Drawing.SystemColors.ControlDarkDark;
            dockPaneStripToolWindowGradient1.InactiveTabGradient     = tabGradient7;
            dockPaneStripSkin1.ToolWindowGradient                    = dockPaneStripToolWindowGradient1;
            dockPanelSkin1.DockPaneStripSkin                         = dockPaneStripSkin1;
            this.dockPanel.Skin = dockPanelSkin1;

            dockPanel.Dock = DockStyle.Fill;
            wbForm.Controls.Add(dockPanel);
            wbForm.Controls.Add(wbForm.TopToolStrip); //添加工具条
            wbForm.Controls.Add(wbForm.TopMenu);      //添加主菜单

            LoadConfiguration();

            ShowPads();
            //ShowViewContents();
            RedrawAllComponents();

            wbForm.ResumeLayout(false);
        }