public static void InitializeWorkbench()
 {
     workbench = new DefaultWorkbench();
     MessageService.MainForm = workbench;
     PropertyService.PropertyChanged += new PropertyChangedEventHandler(WorkbenchSingleton.TrackPropertyChanges);
     ResourceService.LanguageChanged += delegate {
         workbench.RedrawAllComponents();
     };
     caller = new STAThreadCaller(workbench);
     workbench.InitializeWorkspace();
     workbench.SetMemento(PropertyService.Get<Properties>("WorkbenchMemento", new Properties()));
     workbench.WorkbenchLayout = new SdiWorkbenchLayout();
     OnWorkbenchCreated();
 }
 public void Attach(IWorkbench workbench)
 {
     this.wbForm = (DefaultWorkbench) workbench;
     this.wbForm.SuspendLayout();
     this.wbForm.Controls.Clear();
     this.dockPanel = new DockPanel();
     this.dockPanel.DocumentStyle = DocumentStyle.DockingWindow;
     this.dockPanel.ActiveAutoHideContent = null;
     this.dockPanel.Dock = DockStyle.Fill;
     this.mainMenuContainer = new AutoHideMenuStripContainer(this.wbForm.TopMenu);
     this.mainMenuContainer.Dock = DockStyle.Top;
     this.toolBarPanel = new ToolStripPanel();
     if (this.wbForm.ToolBars != null)
     {
         this.toolBarPanel.Controls.AddRange(this.wbForm.ToolBars);
     }
     this.toolBarPanel.Dock = DockStyle.Top;
     this.statusStripContainer = new AutoHideStatusStripContainer((StatusStrip) StatusBarService.Control);
     this.statusStripContainer.Dock = DockStyle.Bottom;
     this.wbForm.Controls.Add(this.dockPanel);
     this.wbForm.Controls.Add(this.toolBarPanel);
     this.wbForm.Controls.Add(this.mainMenuContainer);
     this.wbForm.Controls.Add(this.statusStripContainer);
     this.wbForm.MainMenuStrip = this.wbForm.TopMenu;
     this.LoadLayoutConfiguration();
     this.ShowPads();
     this.ShowViewContents();
     this.RedrawAllComponents();
     this.dockPanel.ActiveDocumentChanged += new EventHandler(this.ActiveMdiChanged);
     this.dockPanel.ActiveContentChanged += new EventHandler(this.ActiveContentChanged);
     this.ActiveMdiChanged(this, EventArgs.Empty);
     this.wbForm.ResumeLayout(false);
     PropertyService.Get<Properties>("SkyMap.Net.Gui.FullscreenOptions", new Properties()).PropertyChanged += new PropertyChangedEventHandler(this.TrackFullscreenPropertyChanges);
 }