private void CreateModelEditorController(string aspect) { var allLayers = CurrentObject.GetAllLayers(_masterModel).ToList(); _currentObjectModel = allLayers.Single(@base => @base.Id == CurrentObject.Name); _masterModel = _modelLoader.ReCreate(); // foreach (var layer in allLayers) // ModelApplicationHelper.RemoveLayer(layer); foreach (var layer in allLayers) { ModelApplicationHelper.AddLayer(_masterModel, layer); } RuntimeMemberBuilder.AddFields((IModelApplication)_masterModel, XpandModuleBase.Dictiorary); DisposeController(); _modelEditorViewController = new ModelEditorViewController((IModelApplication)_masterModel, null); _modelEditorViewController.SetControl(Control); _modelEditorViewController.LoadSettings(); if (aspect != CaptionHelper.DefaultLanguage) { _masterModel.CurrentAspectProvider.CurrentAspect = aspect; } _modelEditorViewController.CurrentAspectChanged += ModelEditorViewControllerOnCurrentAspectChanged; _modelEditorViewController.SaveAction.ExecuteCompleted += SaveActionOnExecuteCompleted; _modelEditorViewController.Modifying += Model_Modifying; _modelEditorViewController.ChangeAspectAction.ExecuteCompleted += ChangeAspectActionOnExecuteCompleted; }
void LoadApplicationModels(bool loadResources, ModelApplicationBase model) { var userDiffLayer = model.LastLayer; ModelApplicationHelper.RemoveLayer(model); // ((ModelApplicationBase)Application.Model).ReInitLayers(); var customModelDifferenceStoreEventArgs = new CreateCustomModelDifferenceStoreEventArgs(); OnCreateCustomModelDifferenceStore(customModelDifferenceStoreEventArgs); if (!customModelDifferenceStoreEventArgs.Handled) { new XpoModelDictionaryDifferenceStore(Application, GetPath(), customModelDifferenceStoreEventArgs.ExtraDiffStores, loadResources).Load(model); } ModelApplicationHelper.AddLayer((ModelApplicationBase)Application.Model, userDiffLayer); RuntimeMemberBuilder.AddFields(Application.Model, Dictiorary); }
public void Load() { var model = (ModelApplicationBase)Application.Model; var userDiff = model.LastLayer; ModelApplicationHelper.RemoveLayer(model); foreach (var roleModel in GetActiveRoleDifferenceObjects()) { roleModel.GetModel(model); } ModelApplicationHelper.AddLayer(model, userDiff); var modelDifferenceObjects = GetActiveDifferenceObjects().ToList(); if (!modelDifferenceObjects.Any()) { SaveDifference(model); return; } CombineWithActiveDifferenceObjects(model.LastLayer, modelDifferenceObjects); RuntimeMemberBuilder.AddFields((IModelApplication)model, XpandModuleBase.Dictiorary); }
private void ObjectSpaceOnCommitted(object sender, EventArgs args) { RuntimeMemberBuilder.AddFields(Application.Model, XpandModuleBase.Dictiorary); }