/// <summary> /// Initializes the workbench. /// </summary> /// <param name="init">The initializer</param> public static void InitializeWorkbench(IWorkbenchInitializer init) { if (!_init) { instance = new Workbench(init); _init = true; WorkbenchInitialized(instance, EventArgs.Empty); } }
/// <summary> /// Initializes the workbench. /// </summary> public static void InitializeWorkbench(IWorkbenchInitializer init) { if (!_init) { instance = new Workbench(init); _init = true; WorkbenchInitialized(instance, EventArgs.Empty); } }
/// <summary> /// Initializes a new instance of the WorkbenchBase class /// </summary> /// <param name="init"></param> protected WorkbenchBase(IWorkbenchInitializer init) : this() { _workbenchInitializer = init; _toolstrips = new Dictionary <string, ToolStrip>(); _toolstripRegions = new Dictionary <string, ToolbarRegion>(); this.Icon = _workbenchInitializer.GetIcon(); this.WindowState = init.StartMaximized ? FormWindowState.Maximized : FormWindowState.Normal; contentPanel = new DockPanel(); contentPanel.ActiveDocumentChanged += OnActiveDocumentChanged; contentPanel.DocumentStyle = DocumentStyle.DockingWindow; contentPanel.ShowDocumentIcon = true; contentPanel.Dock = DockStyle.Fill; contentPanel.DockLeftPortion = 250; contentPanel.DockBottomPortion = 150; contentPanel.DockRightPortion = 250; menu = _workbenchInitializer.GetMainMenu(this); toolStripContainer = new ToolStripContainer(); toolStripContainer.ContentPanel.Controls.Add(contentPanel); toolStripContainer.Dock = DockStyle.Fill; this.Controls.Add(toolStripContainer); ctxToolbar = new ContextMenuStrip(); menu.ContextMenuStrip = ctxToolbar; toolStripContainer.TopToolStripPanel.ContextMenuStrip = ctxToolbar; toolStripContainer.BottomToolStripPanel.ContextMenuStrip = ctxToolbar; toolStripContainer.LeftToolStripPanel.ContextMenuStrip = ctxToolbar; toolStripContainer.RightToolStripPanel.ContextMenuStrip = ctxToolbar; toolbar = _workbenchInitializer.GetMainToolStrip(this); toolbar.Stretch = true; toolbar.Tag = BASE_TOOLSTRIP; AddToolbar(toolbar.Tag.ToString(), toolbar, ToolbarRegion.Top, true); //NOXLATE status = new StatusStrip(); statusLabel = new ToolStripStatusLabel(); status.Items.Add(statusLabel); this.Controls.Add(menu); this.Controls.Add(status); // Use the Idle event to update the status of menu and toolbar items. Application.Idle += OnApplicationIdle; }
/// <summary> /// Initializes a new instance of the Workbench class /// </summary> /// <param name="init">The workbench initializer</param> public Workbench(IWorkbenchInitializer init) : base(init) { }
/// <summary> /// Initializes a new instance of the WorkbenchBase class /// </summary> /// <param name="init"></param> protected WorkbenchBase(IWorkbenchInitializer init) : this() { _workbenchInitializer = init; _toolstrips = new Dictionary<string, ToolStrip>(); _toolstripRegions = new Dictionary<string, ToolbarRegion>(); this.Icon = _workbenchInitializer.GetIcon(); this.WindowState = init.StartMaximized ? FormWindowState.Maximized : FormWindowState.Normal; contentPanel = new DockPanel(); contentPanel.ActiveDocumentChanged += OnActiveDocumentChanged; contentPanel.DocumentStyle = DocumentStyle.DockingWindow; contentPanel.ShowDocumentIcon = true; contentPanel.Dock = DockStyle.Fill; contentPanel.DockLeftPortion = 250; contentPanel.DockBottomPortion = 150; contentPanel.DockRightPortion = 200; menu = _workbenchInitializer.GetMainMenu(this); toolStripContainer = new ToolStripContainer(); toolStripContainer.ContentPanel.Controls.Add(contentPanel); toolStripContainer.Dock = DockStyle.Fill; this.Controls.Add(toolStripContainer); ctxToolbar = new ContextMenuStrip(); menu.ContextMenuStrip = ctxToolbar; toolStripContainer.TopToolStripPanel.ContextMenuStrip = ctxToolbar; toolStripContainer.BottomToolStripPanel.ContextMenuStrip = ctxToolbar; toolStripContainer.LeftToolStripPanel.ContextMenuStrip = ctxToolbar; toolStripContainer.RightToolStripPanel.ContextMenuStrip = ctxToolbar; toolbar = _workbenchInitializer.GetMainToolStrip(this); toolbar.Stretch = true; toolbar.Tag = BASE_TOOLSTRIP; AddToolbar(toolbar.Tag.ToString(), toolbar, ToolbarRegion.Top, true); //NOXLATE status = new StatusStrip(); statusLabel = new ToolStripStatusLabel(); status.Items.Add(statusLabel); this.Controls.Add(menu); this.Controls.Add(status); // Use the Idle event to update the status of menu and toolbar items. Application.Idle += OnApplicationIdle; }