예제 #1
0
        public void Attach(IWorkbench workbench)
        {
            wbForm = (DefaultWorkbench)workbench;
            wbForm.SuspendLayout();
            wbForm.Controls.Clear();

            ToolStripContainer tsc = new ToolStripContainer();

            tsc.Dock = DockStyle.Fill;
            tsc.TopToolStripPanel.Controls.AddRange(wbForm.ToolBars);
            tsc.TopToolStripPanel.Controls.Add(wbForm.TopMenu);

            tsc.BottomToolStripPanel.Controls.Add(StatusBarService.Control);

            SplitContainer splitContainer = new SplitContainer();

            splitContainer.Dock = DockStyle.Fill;

            documentTabs      = new WorkbenchTabControl(this);
            documentTabs.Dock = DockStyle.Fill;
            splitContainer.Panel2.Controls.Add(documentTabs);

            padTabs           = new TabControl();
            padTabs.Multiline = true;
            padTabs.Dock      = DockStyle.Fill;
            splitContainer.Panel1.Controls.Add(padTabs);

            tsc.ContentPanel.Controls.Add(splitContainer);

            wbForm.Controls.Add(tsc);
            wbForm.ResumeLayout(false);
        }
예제 #2
0
        public static void InitializeWorkbench()
        {
            LayoutConfiguration.LoadLayoutConfiguration();
            StatusBarService.Initialize();
            DomHostCallback.Register();             // must be called after StatusBarService.Initialize()
            ParserService.InitializeParserService();
            Project.CustomToolsService.Initialize();

            workbench = new DefaultWorkbench();
#endif
            MessageService.MainForm = workbench;

            PropertyService.PropertyChanged += new PropertyChangedEventHandler(TrackPropertyChanges);
            ResourceService.LanguageChanged += delegate { workbench.RedrawAllComponents(); };

            caller = new STAThreadCaller(workbench);

            workbench.InitializeWorkspace();

            workbench.SetMemento(PropertyService.Get(workbenchMemento, new Properties()));

            workbench.WorkbenchLayout = new SdiWorkbenchLayout();

            OnWorkbenchCreated();
        }
예제 #3
0
        public void Attach(IWorkbench workbench)
        {
            wbForm = (DefaultWorkbench)workbench;
            wbForm.SuspendLayout();
            wbForm.Controls.Clear();

            mainMenuContainer      = new AutoHideMenuStripContainer(wbForm.TopMenu);
            mainMenuContainer.Dock = DockStyle.Top;

            statusStripContainer      = new AutoHideStatusStripContainer((StatusStrip)StatusBarService.Control);
            statusStripContainer.Dock = DockStyle.Bottom;

            toolBarPanel = new ToolStripPanel();
            if (wbForm.ToolBars != null)
            {
                toolBarPanel.Controls.AddRange(wbForm.ToolBars);
            }
            toolBarPanel.Dock = DockStyle.Top;

            dockPanel      = new DockPanel();
            dockPanel.Dock = DockStyle.Fill;
            dockPanel.RightToLeftLayout = true;

            // Known issues with certain DocumentStyles:
            //   DockingMdi:
            //    - this is the default value
            //    - after switching between layouts, text editor tooltips sometimes do not show up anymore
            //   DockingSdi:
            //    - in this mode, the tab bar is not shown when there is only one open window
            //   DockingWindow:
            //    - SharpDevelop 2.x used this mode
            //    - it was also the only mode supported by the early DockPanelSuite versions used by SharpDevelop 1.x

            dockPanel.DocumentStyle = DocumentStyle.DockingWindow;

            wbForm.Controls.Add(dockPanel);
            wbForm.Controls.Add(toolBarPanel);
            wbForm.Controls.Add(mainMenuContainer);
            wbForm.Controls.Add(statusStripContainer);
            wbForm.MainMenuStrip = wbForm.TopMenu;
            // dock panel has to be added to the form before LoadLayoutConfiguration is called to fix SD2-463

            LoadLayoutConfiguration();
            ShowPads();

            ShowViewContents();

            RedrawAllComponents();

            dockPanel.ActiveDocumentChanged += new EventHandler(ActiveMdiChanged);
            dockPanel.ActiveContentChanged  += new EventHandler(ActiveContentChanged);
            ActiveMdiChanged(this, EventArgs.Empty);

            wbForm.ResumeLayout(false);

            Properties fullscreenProperties = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.FullscreenOptions", new Properties());

            fullscreenProperties.PropertyChanged += TrackFullscreenPropertyChanges;
        }
예제 #4
0
        public static void InitializeWorkbench(System.Type workbenchtype)
        {
            LayoutConfiguration.LoadLayoutConfiguration();
            StatusBarService.Initialize();
            DomHostCallback.Register();             // must be called after StatusBarService.Initialize()
            ParserService.InitializeParserService();
            Project.CustomToolsService.Initialize();

            workbench = (ICSharpCode.SharpDevelop.Gui.DefaultWorkbench)Activator.CreateInstance(workbenchtype);
예제 #5
0
        public void Attach(IWorkbench workbench)
        {
            wbForm = (DefaultWorkbench)workbench;
            wbForm.SuspendLayout();
            wbForm.Controls.Clear();
            toolStripContainer = new ToolStripContainer();
            toolStripContainer.SuspendLayout();
            toolStripContainer.Dock = DockStyle.Fill;

            mainMenuContainer      = new AutoHideMenuStripContainer(((DefaultWorkbench)wbForm).TopMenu);
            mainMenuContainer.Dock = DockStyle.Top;

            statusStripContainer      = new AutoHideStatusStripContainer((StatusStrip)StatusBarService.Control);
            statusStripContainer.Dock = DockStyle.Bottom;

            dockPanel = new WeifenLuo.WinFormsUI.DockPanel();
            dockPanel.DocumentStyle = DocumentStyles.DockingWindow;
            this.dockPanel.Dock     = System.Windows.Forms.DockStyle.Fill;

            Panel helperPanel = new Panel();

            helperPanel.Dock = DockStyle.Fill;
            helperPanel.Controls.Add(dockPanel);
            toolStripContainer.ContentPanel.Controls.Add(helperPanel);

            toolStripContainer.ContentPanel.Controls.Add(mainMenuContainer);
            toolStripContainer.ContentPanel.Controls.Add(statusStripContainer);

            wbForm.Controls.Add(toolStripContainer);
            // dock panel has to be added to the form before LoadLayoutConfiguration is called to fix SD2-463

            LoadLayoutConfiguration();
            ShowPads();

            ShowViewContents();

            RedrawAllComponents();

            dockPanel.ActiveDocumentChanged += new EventHandler(ActiveMdiChanged);
            dockPanel.ActiveContentChanged  += new EventHandler(ActiveContentChanged);
            ActiveMdiChanged(this, EventArgs.Empty);

            toolStripContainer.ResumeLayout(false);
            wbForm.ResumeLayout(false);

            Properties fullscreenProperties = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.FullscreenOptions", new Properties());

            fullscreenProperties.PropertyChanged += TrackFullscreenPropertyChanges;
        }
예제 #6
0
		public void Attach(IWorkbench workbench)
		{
			wbForm = (DefaultWorkbench)workbench;
			wbForm.SuspendLayout();
			wbForm.Controls.Clear();
			toolStripContainer = new ToolStripContainer();
			toolStripContainer.SuspendLayout();
			toolStripContainer.Dock = DockStyle.Fill;
			
			mainMenuContainer = new AutoHideMenuStripContainer(((DefaultWorkbench)wbForm).TopMenu);
			mainMenuContainer.Dock = DockStyle.Top;
			
			statusStripContainer = new AutoHideStatusStripContainer((StatusStrip)StatusBarService.Control);
			statusStripContainer.Dock = DockStyle.Bottom;
			
			dockPanel = new WeifenLuo.WinFormsUI.DockPanel();
			dockPanel.DocumentStyle = DocumentStyles.DockingWindow;
			this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
			
			Panel helperPanel = new Panel();
			helperPanel.Dock = DockStyle.Fill;
			helperPanel.Controls.Add(dockPanel);
			toolStripContainer.ContentPanel.Controls.Add(helperPanel);
			
			toolStripContainer.ContentPanel.Controls.Add(mainMenuContainer);
			toolStripContainer.ContentPanel.Controls.Add(statusStripContainer);
			
			wbForm.Controls.Add(toolStripContainer);
			// dock panel has to be added to the form before LoadLayoutConfiguration is called to fix SD2-463
			
			LoadLayoutConfiguration();
			ShowPads();
			
			ShowViewContents();
			
			RedrawAllComponents();
			
			dockPanel.ActiveDocumentChanged += new EventHandler(ActiveMdiChanged);
			dockPanel.ActiveContentChanged += new EventHandler(ActiveContentChanged);
			ActiveMdiChanged(this, EventArgs.Empty);
			
			toolStripContainer.ResumeLayout(false);
			wbForm.ResumeLayout(false);
			
			Properties fullscreenProperties = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.FullscreenOptions", new Properties());
			fullscreenProperties.PropertyChanged += TrackFullscreenPropertyChanges;
		}
		public void Attach(IWorkbench workbench)
		{
			wbForm = (DefaultWorkbench)workbench;
			wbForm.SuspendLayout();
			wbForm.Controls.Clear();
			
			mainMenuContainer = new AutoHideMenuStripContainer(wbForm.TopMenu);
			mainMenuContainer.Dock = DockStyle.Top;
			
			statusStripContainer = new AutoHideStatusStripContainer((StatusStrip)StatusBarService.Control);
			statusStripContainer.Dock = DockStyle.Bottom;
			
			toolBarPanel = new ToolStripPanel();
			if (wbForm.ToolBars != null) {
				toolBarPanel.Controls.AddRange(wbForm.ToolBars);
			}
			toolBarPanel.Dock = DockStyle.Top;
			
			dockPanel = new DockPanel();
			dockPanel.Dock = DockStyle.Fill;
			dockPanel.RightToLeftLayout = true;
			
			// Known issues with certain DocumentStyles:
			//   DockingMdi:
			//    - this is the default value
			//    - after switching between layouts, text editor tooltips sometimes do not show up anymore
			//   DockingSdi:
			//    - in this mode, the tab bar is not shown when there is only one open window
			//   DockingWindow:
			//    - SharpDevelop 2.x used this mode
			//    - it was also the only mode supported by the early DockPanelSuite versions used by SharpDevelop 1.x
			
			dockPanel.DocumentStyle = DocumentStyle.DockingWindow;
			
			wbForm.Controls.Add(dockPanel);
			wbForm.Controls.Add(toolBarPanel);
			wbForm.Controls.Add(mainMenuContainer);
			wbForm.Controls.Add(statusStripContainer);
			wbForm.MainMenuStrip = wbForm.TopMenu;
			// dock panel has to be added to the form before LoadLayoutConfiguration is called to fix SD2-463
			
			LoadLayoutConfiguration();
			ShowPads();
			
			ShowViewContents();
			
			RedrawAllComponents();
			
			dockPanel.ActiveDocumentChanged += new EventHandler(ActiveMdiChanged);
			dockPanel.ActiveContentChanged += new EventHandler(ActiveContentChanged);
			ActiveMdiChanged(this, EventArgs.Empty);
			
			wbForm.ResumeLayout(false);
			
			Properties fullscreenProperties = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.FullscreenOptions", new Properties());
			fullscreenProperties.PropertyChanged += TrackFullscreenPropertyChanges;
		}