void EditModelCore() { var winApplication = (WinApplication)Application; if (!winApplication.ShowViewStrategy.CloseAllWindows()) { return; } var differenceStore = (ModelDifferenceStore)typeof(XafApplication).Invoke(winApplication, "CreateUserModelDifferenceStore"); differenceStore?.SaveDifference(((ModelApplicationBase)winApplication.Model).LastLayer); var oldAspectProvider = ((ModelApplicationBase)winApplication.Model).CurrentAspectProvider; try { ((ModelApplicationBase)winApplication.Model).CurrentAspectProvider = new CurrentAspectProvider(oldAspectProvider.CurrentAspect); using (Form modelEditorForm = ModelEditorViewController.CreateModelEditorForm(winApplication)) { modelEditorForm.ShowDialog(); if (modelEditorForm is IModelEditorSettings) { differenceStore?.SaveDifference(((ModelApplicationBase)winApplication.Model).LastLayer); } } } finally { ((ModelApplicationBase)winApplication.Model).CurrentAspectProvider = oldAspectProvider; } try { winApplication.CallMethod("ShowStartupWindow"); } catch (Exception e) { winApplication.HandleException(e); winApplication.Exit(); } }
protected override Form CreateModelEditorForm() { var controller = new ModelEditorViewController(Model, CreateUserModelDifferenceStore()); ModelDifferenceStore modelDifferencesStore = CreateModelDifferenceStore(); if (modelDifferencesStore != null) { var modulesDiffStoreInfo = new List<ModuleDiffStoreInfo> { new ModuleDiffStoreInfo(null, modelDifferencesStore, "Model") }; controller.SetModuleDiffStore(modulesDiffStoreInfo); } return new ModelEditorForm(controller, new SettingsStorageOnModel(((IModelApplicationModelEditor)Model).ModelEditorSettings)); }
public static Form CreateModelEditorForm(WinApplication winApplication) { var modelDifferenceStore = (ModelDifferenceStore)typeof(XafApplication).Invoke(winApplication, "CreateUserModelDifferenceStore"); var controller = new ModelEditorViewController(winApplication.Model, modelDifferenceStore); var modelDifferencesStore = (ModelDifferenceStore) typeof(XafApplication).Invoke(winApplication, "CreateModelDifferenceStore"); if (modelDifferencesStore != null) { var modulesDiffStoreInfo = new List<ModuleDiffStoreInfo> { new ModuleDiffStoreInfo(null, modelDifferencesStore, "Model") }; controller.SetModuleDiffStore(modulesDiffStoreInfo); } return new ModelEditorForm(controller, new SettingsStorageOnModel(((IModelApplicationModelEditor)winApplication.Model).ModelEditorSettings)); }
protected override Form CreateModelEditorForm() { var controller = new ModelEditorViewController(Model, CreateUserModelDifferenceStore()); ModelDifferenceStore modelDifferencesStore = CreateModelDifferenceStore(); if (modelDifferencesStore != null) { var modulesDiffStoreInfo = new List <ModuleDiffStoreInfo> { new ModuleDiffStoreInfo(null, modelDifferencesStore, "Model") }; controller.SetModuleDiffStore(modulesDiffStoreInfo); } return(new ModelEditorForm(controller, new SettingsStorageOnModel(((IModelApplicationModelEditor)Model).ModelEditorSettings))); }
public static Form CreateModelEditorForm(WinApplication winApplication) { var modelDifferenceStore = (ModelDifferenceStore)typeof(XafApplication).Invoke(winApplication, "CreateUserModelDifferenceStore"); var controller = new ModelEditorViewController(winApplication.Model, modelDifferenceStore); var modelDifferencesStore = (ModelDifferenceStore)typeof(XafApplication).Invoke(winApplication, "CreateModelDifferenceStore"); if (modelDifferencesStore != null) { var modulesDiffStoreInfo = new List <ModuleDiffStoreInfo> { new ModuleDiffStoreInfo(null, modelDifferencesStore, "Model") }; controller.SetModuleDiffStore(modulesDiffStoreInfo); } return(new ModelEditorForm(controller, new SettingsStorageOnModel(((IModelApplicationModelEditor)winApplication.Model).ModelEditorSettings))); }
protected override Form CreateModelEditorForm() { return(ModelEditorViewController.CreateModelEditorForm(this)); }