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 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(); }
public static void InitializeWorkbench() { workbench = new DefaultWorkbench(); MessageService.MainForm = workbench; caller = new STAThreadCaller(workbench); workbench.InitializeWorkspace(); workbench.WorkbenchLayout = new SdiWorkbenchLayout(); }
public static void InitializeWorkbench() { workbench = new DefaultWorkbench(); //MessageService..MainForm = workbench; caller = new STAThreadCaller(workbench); workbench.InitializeWorkspace(); //设置工作台layout,同时将工作带在workbench.WorkbenchLayout的set方法中传递进去 workbench.WorkbenchLayout = new SdiWorkbenchLayout(); }
public static void InitializeWorkbench(IWorkbench workbench, IWorkbenchLayout layout) { WorkbenchSingleton.workbench = workbench; //DisplayBindingService.InitializeService(); LayoutConfiguration.LoadLayoutConfiguration(); //FileService.InitializeService(); StatusBarService.Initialize(); //DomHostCallback.Register(); // must be called after StatusBarService.Initialize() ParserService.InitializeParserService(); //Bookmarks.BookmarkManager.Initialize(); //Project.CustomToolsService.Initialize(); //Project.BuildModifiedProjectsOnlyService.Initialize(); workbench.Initialize(); workbench.SetMemento(PropertyService.Get(workbenchMemento, new Core.Properties())); caller = new STAThreadCaller(workbench.MainForm); WinFormsMessageService.DialogOwner = workbench.MainForm; WinFormsMessageService.DialogSynchronizeInvoke = workbench.MainForm; //RemoveXButton(WorkbenchSingleton.MainForm.Handle.ToInt32()); PropertyService.PropertyChanged += new PropertyChangedEventHandler(TrackPropertyChanges); ResourceService.LanguageChanged += delegate { workbench.RedrawAllComponents(); }; ApplicationStateInfoService.RegisterStateGetter(activeContentState, delegate { return(WorkbenchSingleton.Workbench.ActiveContent); }); // attach workbench layout -> load pads workbench.WorkbenchLayout = layout; OnWorkbenchCreated(); // initialize workbench-dependent services: // Project.ProjectService.InitializeService(); NavigationService.InitializeService(); workbench.ActiveContentChanged += delegate { LoggingService.Debug("ActiveContentChanged to " + workbench.ActiveContent); }; workbench.ActiveViewContentChanged += delegate { LoggingService.Debug("ActiveViewContentChanged to " + workbench.ActiveViewContent); }; workbench.ActiveWorkbenchWindowChanged += delegate { LoggingService.Debug("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow); }; }
/// <summary> /// Makes a call GUI threadsafe. WARNING: This method waits for the result of the /// operation, which can result in a dead-lock when the main thread waits for a lock /// held by this thread! /// </summary> public static R SafeThreadFunction <A, R>(Func <A, R> method, A arg1) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); return((R)caller.Call(method, new object[] { arg1 })); }
/// <summary> /// Makes a call GUI threadsafe without waiting for the returned value. /// </summary> public static void SafeThreadAsyncCall <A, B, C>(ActionF <A, B, C> method, A arg1, B arg2, C arg3) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.BeginCall(method, new object[] { arg1, arg2, arg3 }); }
/// <summary> /// Makes a call GUI threadsafe without waiting for the returned value. /// </summary> public static void SafeThreadAsyncCall <A>(Action <A> method, A arg1) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.BeginCall(method, new object[] { arg1 }); }
/// <summary> /// Makes a call GUI threadsafe without waiting for the returned value. /// </summary> public static void SafeThreadAsyncCall(ActionF method) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.BeginCall(method, new object[0]); }
/// <summary> /// Makes a call GUI threadsafe. WARNING: This method waits for the result of the /// operation, which can result in a dead-lock when the main thread waits for a lock /// held by this thread! /// </summary> public static void SafeThreadCall <A, B>(ActionF <A, B> method, A arg1, B arg2) { STAThreadCaller caller = new STAThreadCaller(_hostServices.Wb as Form); caller.Call(method, new object[] { arg1, arg2 }); }
public static void InitializeWorkbench() { PropertyService.PropertyChanged += new PropertyChangedEventHandler(WorkbenchSingleton.TrackPropertyChanges); caller = new STAThreadCaller((Form)workbench); OnWorkbenchCreated(); }
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(); }