public static void InitializeWorkbench() { workbench = new DefaultWorkbench(); MessageService.MainForm = workbench; caller = new STAThreadCaller(workbench); workbench.InitializeWorkspace(); workbench.WorkbenchLayout = new SdiWorkbenchLayout(); //display mapview IViewContent browserPane = new MapViewPane(); browserPane.TitleName = "view1"; if (browserPane != null) { WorkbenchSingleton.Workbench.ShowView(browserPane); } //link layertree and mapview foreach (PadDescriptor item in workbench.PadContentCollection) { LayerTree tree = item.PadContent as LayerTree; if (tree != null) { DotSpatial.Controls.Legend legend = tree.Control as DotSpatial.Controls.Legend; ((browserPane as MapViewPane).Control as MapView).MapControl.Legend = legend; break; } } }
public void Attach(IWorkbench workbench) { wbForm = (DefaultWorkbench)workbench; wbForm.SuspendLayout(); wbForm.IsMdiContainer = true; dockPanel = new WeifenLuo.WinFormsUI.DockPanel(); dockPanel.ActiveAutoHideContent = null; 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); }