protected override void OnDeactivated() { if (_modificationsViewController != null) { _modificationsViewController.SaveAction.Executing -= action_Executing; _modificationsViewController.SaveAndNewAction.Executing -= action_Executing; _modificationsViewController.SaveAndCloseAction.Executing -= action_Executing; _modificationsViewController = null; } base.OnDeactivated(); }
protected override void OnActivated() { base.OnActivated(); _modificationsController = Frame.GetController <ModificationsController>(); if (Enabled) { _modificationsController.SaveAction.Executing += SaveOnExecuting; _modificationsController.SaveAndCloseAction.Executing += SaveOnExecuting; _modificationsController.SaveAndNewAction.Executing += SaveOnExecuting; View.ObjectSpace.Committing += ObjectSpaceOnCommitting; } }
protected override void OnActivated() { base.OnActivated(); _previousObject = null; if (Enabled()) { _newObjectViewController = Frame.GetController <NewObjectViewController>(); _newObjectViewController.ObjectCreating += NewObjectViewControllerOnObjectCreating; _newObjectViewController.ObjectCreated += newObjectViewController_ObjectCreated; _modificationsController = Frame.GetController <ModificationsController>(); _modificationsController.SaveAndNewAction.Executing += SaveAndNewAction_Executing; } }
protected override void OnActivated() { base.OnActivated(); if (((IModelObjectViewOptimisticConcurrencyControl)View.Model).OptimisticConcurrencyControl) { _modificationsViewController = Frame.GetController <ModificationsController>(); if (_modificationsViewController != null) { _modificationsViewController.SaveAction.Executing += action_Executing; _modificationsViewController.SaveAndNewAction.Executing += action_Executing; _modificationsViewController.SaveAndCloseAction.Executing += action_Executing; } } }
protected override void OnActivated() { base.OnActivated(); InitSearchObjectActionItems(); if (typeof(ISearchObject).IsAssignableFrom(View.ObjectTypeInfo.Type)) { DetailView dv = View as DetailView; if (dv != null) { foreach (ListPropertyEditor editor in dv.GetItems <ListPropertyEditor>()) { if (editor.PropertyName == SearchResultsCollectionName) { editor.ControlCreated += new EventHandler <EventArgs>(editor_ControlCreated); } } RefreshController refreshController = Frame.GetController <RefreshController>(); if (refreshController != null) { refreshController.RefreshAction.Active[ActiveKeySearchObject] = false; } RecordsNavigationController recordsNavigationController = Frame.GetController <RecordsNavigationController>(); if (recordsNavigationController != null) { recordsNavigationController.PreviousObjectAction.Active[ActiveKeySearchObject] = false; recordsNavigationController.NextObjectAction.Active[ActiveKeySearchObject] = false; } ModificationsController modificationsController = Frame.GetController <ModificationsController>(); if (modificationsController != null) { modificationsController.SaveAction.Active[ActiveKeySearchObject] = false; modificationsController.SaveAndCloseAction.Active[ActiveKeySearchObject] = false; modificationsController.CancelAction.Active[ActiveKeySearchObject] = false; } DeleteObjectsViewController deleteObjectsViewController = Frame.GetController <DeleteObjectsViewController>(); if (deleteObjectsViewController != null) { deleteObjectsViewController.DeleteAction.Active[ActiveKeySearchObject] = false; } NewObjectViewController newObjectViewController = Frame.GetController <NewObjectViewController>(); if (newObjectViewController != null) { newObjectViewController.NewObjectAction.Active[ActiveKeySearchObject] = false; } } SearchObjectAction.Active[ActiveKeySearchObject] = false; } }
protected override void OnDeactivated() { ModificationsController modificationsController = Frame.GetController <ModificationsController>(); if (modificationsController != null) { modificationsController.Active[GetType().Name] = true; } RecordsNavigationController recordsNavigationController = Frame.GetController <RecordsNavigationController>(); if (recordsNavigationController != null) { recordsNavigationController.Active[GetType().Name] = true; } base.OnDeactivated(); }
protected override void OnDeactivated() { // Unsubscribe from previously subscribed events and release other references and resources. if (DeleteController != null) { DeleteController.Active.RemoveItem(Key); DeleteController = null; } if (NewController != null) { NewController.Active.RemoveItem(Key); NewController = null; } if (refreshController != null) { refreshController.Active.RemoveItem(Key); refreshController = null; } if (modificationsController != null) { modificationsController.Active.RemoveItem(Key); modificationsController = null; } if (recordsNavigationController != null) { recordsNavigationController.Active.RemoveItem(Key); recordsNavigationController = null; } if (resetViewSettingsController != null) { resetViewSettingsController.Active.RemoveItem(Key); resetViewSettingsController = null; } if (openObjectController != null) { openObjectController.Active.RemoveItem(Key); openObjectController = null; } base.OnDeactivated(); }
protected override void OnActivated() { base.OnActivated(); SubscribeToEventsFromDictionaries(); SubscribeToEvents(); _refreshController = Frame.GetController <RefreshController>(); if (_refreshController != null) { _refreshController.RefreshAction.Executed += RefreshAction_Executed; } _modificationsController = Frame.GetController <ModificationsController>(); if (_modificationsController != null) { _modificationsController.CancelAction.Executed += CancelAction_Executed; } PrepareView(); }
protected override void OnDeactivated() { RefreshController refreshController = Frame.GetController <RefreshController>(); if (refreshController != null) { refreshController.Active.RemoveItem(InactiveForWelcomeObject); } RecordsNavigationController recordsNavigationController = Frame.GetController <RecordsNavigationController>(); if (recordsNavigationController != null) { recordsNavigationController.Active.RemoveItem(InactiveForWelcomeObject); } ModificationsController modificationsController = Frame.GetController <ModificationsController>(); if (modificationsController != null) { modificationsController.Active.RemoveItem(InactiveForWelcomeObject); } base.OnDeactivated(); }
protected override void OnActivated() { base.OnActivated(); RefreshController refreshController = Frame.GetController <RefreshController>(); if (refreshController != null) { refreshController.Active[InactiveForWelcomeObject] = (View.ObjectTypeInfo.Type != typeof(WelcomeObject)); } RecordsNavigationController recordsNavigationController = Frame.GetController <RecordsNavigationController>(); if (recordsNavigationController != null) { recordsNavigationController.Active[InactiveForWelcomeObject] = (View.ObjectTypeInfo.Type != typeof(WelcomeObject)); } ModificationsController modificationsController = Frame.GetController <ModificationsController>(); if (modificationsController != null) { modificationsController.Active[InactiveForWelcomeObject] = (View.ObjectTypeInfo.Type != typeof(WelcomeObject)); } }
private void ViewController1_Activated(object sender, EventArgs e) { detailViewController = Frame.GetController <ModificationsController>(); detailViewController.SaveAndNewAction.Executing += SaveAndNewAction_Executing; Frame.ViewChanged += Frame_ViewChanged; }
protected override void OnActivated() { base.OnActivated(); // Perform various tasks depending on the target View. //Delete DeleteController = Frame.GetController <DeleteObjectsViewController>(); if (DeleteController != null) { DeleteController.Active[Key] = !(View.ObjectTypeInfo.Type == typeof(MauIn) && View is ListView); } //New NewController = Frame.GetController <NewObjectViewController>(); if (NewController != null) { NewController.Active[Key] = !(View.ObjectTypeInfo.Type == typeof(MauIn) && View is ListView); } //Refresh refreshController = Frame.GetController <RefreshController>(); if (refreshController != null) { refreshController.Active[Key] = !(View.ObjectTypeInfo.Type == typeof(MauIn) && View is ListView); } //Modification modificationsController = Frame.GetController <ModificationsController>(); if (modificationsController != null) { modificationsController.Active[Key] = !(View.ObjectTypeInfo.Type == typeof(MauIn) && View is ListView); } //recordsNavigationController recordsNavigationController = Frame.GetController <RecordsNavigationController>(); if (recordsNavigationController != null) { recordsNavigationController.Active[Key] = !(View.ObjectTypeInfo.Type == typeof(MauIn) && View is ListView); } // Reset View Settings resetViewSettingsController = Frame.GetController <ResetViewSettingsController>(); if (resetViewSettingsController != null) { resetViewSettingsController.Active[Key] = !(View.ObjectTypeInfo.Type == typeof(MauIn) && View is ListView); } //Open object openObjectController = Frame.GetController <OpenObjectController>(); if (openObjectController != null) { openObjectController.Active[Key] = !(View.ObjectTypeInfo.Type == typeof(MauIn) && View is ListView); } }