protected override void OnCurrentObjectChanged() { _modelLoader = new ModelLoader(CurrentObject.PersistentApplication.ExecutableName); InterfaceBuilder.SkipAssemblyCleanup = true; _masterModel = _modelLoader.GetMasterModel(false); InterfaceBuilder.SkipAssemblyCleanup = false; base.OnCurrentObjectChanged(); }
protected override void ReplaceLayer(ModelApplicationBase model, ModelApplicationBase layer, bool isCurrentUserModel, ShowViewParameters showViewParameters){ var showViewStrategyBase = (WinShowViewStrategyBase)Application.ShowViewStrategy; var modelApplicationBase = ((ModelApplicationBase)Application.Model); var lastLayer = modelApplicationBase.LastLayer; modelApplicationBase.RemoveLayer(lastLayer.Id); var dummyLayer = modelApplicationBase.CreatorInstance.CreateModelApplication(); dummyLayer.Id = lastLayer.Id; ModelApplicationHelper.AddLayer(modelApplicationBase, dummyLayer); var keyValue = ObjectSpace.GetKeyValue(View.CurrentObject); var objectType = View.ObjectTypeInfo.Type; var modelDetailView = View.Model; showViewStrategyBase.CloseAllWindows(); base.ReplaceLayer(model, layer, isCurrentUserModel,showViewParameters); showViewStrategyBase.ShowStartupWindow(); var xafApplication = ApplicationHelper.Instance.Application; var objectSpace = xafApplication.CreateObjectSpace(); var objectByKey = objectSpace.GetObjectByKey(objectType,keyValue); showViewStrategyBase = (WinShowViewStrategyBase)xafApplication.ShowViewStrategy; showViewParameters.CreatedView = xafApplication.CreateDetailView(objectSpace, modelDetailView, true, objectByKey); showViewStrategyBase.ShowView(showViewParameters, new ShowViewSource(null,null)); }
protected IEnumerable<ModelApplicationBase> GetAllLayers(IEnumerable<ModelDifferenceObject> differenceObjects, ModelApplicationBase master) { if (GetttingNonAppModels(differenceObjects)) differenceObjects = differenceObjects.Where(o => o.CombineOrder < CombineOrder); var modelApplicationBases = differenceObjects.Distinct().Select(differenceObject => differenceObject.GetModel(master)); modelApplicationBases = modelApplicationBases.Concat(new List<ModelApplicationBase> { GetModel(master) }); return modelApplicationBases; }
void AddLayers(ModelApplicationBase modelApplication, ApplicationModulesManager applicationModulesManager, PathInfo pathInfo) { var resourceModelCollector = new ResourceModelCollector(); var dictionary = resourceModelCollector.Collect(applicationModulesManager.Modules.Select(@base => @base.GetType().Assembly), null); AddLayersCore(dictionary.Where(pair => !PredicateLastLayer(pair, pathInfo)), modelApplication); ModelApplicationBase lastLayer = modelApplication.CreatorInstance.CreateModelApplication(); modelApplication.AddLayer(lastLayer); }
protected internal override void OnDifferenceObjectSaving(ModelDifferenceObject userModelDifferenceObject, ModelApplicationBase model) { var userStoreObject = ((UserModelDifferenceObject)userModelDifferenceObject); if (!userStoreObject.NonPersistent) { userModelDifferenceObject.CreateAspectsCore(model); base.OnDifferenceObjectSaving(userModelDifferenceObject, model); } CombineModelFromPermission(model); }
public static void AddLayerBeforeLast(this ModelApplicationBase application, ModelApplicationBase layer) { ModelApplicationBase lastLayer = application.LastLayer; if (lastLayer.Id != "After Setup" && lastLayer.Id != "UserDiff") throw new ArgumentException("LastLayer.Id", lastLayer.Id); ModelApplicationHelper.RemoveLayer(application); ModelApplicationHelper.AddLayer(application, layer); ModelApplicationHelper.AddLayer(application, lastLayer); }
IEnumerable<ModelApplicationBase> RemoveLayers(ModelApplicationBase modelApplicationBase, IEnumerable<string> strings) { var modelApplicationBases = new List<ModelApplicationBase>(); while (modelApplicationBase.LastLayer.Id != "Unchanged Master Part") { if (!(strings.Contains(modelApplicationBase.LastLayer.Id))) modelApplicationBases.Add(modelApplicationBase.LastLayer); ModelApplicationHelper.RemoveLayer(modelApplicationBase.LastLayer); } return modelApplicationBases; }
Dictionary<string, ModelDifferenceObjectInfo> GetLoadedModelDifferenceObjectInfos(ModelApplicationBase model) { Dictionary<string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos = GetLoadedModelApplications(model); if (!loadedModelDifferenceObjectInfos.Any()) if (ObjectSpace.IsServerSide() || !(Application is ServerApplication)) return CreateNew(model); else return loadedModelDifferenceObjectInfos; return loadedModelDifferenceObjectInfos; }
public static void ReadFromModel(this ModelXmlReader modelXmlReader, ModelApplicationBase modelNode, ModelApplicationBase readFrom, Func<string, bool> aspectNamePredicate) { for (int i = 0; i < readFrom.AspectCount; i++) { string aspect = readFrom.GetAspect(i); string xml = new ModelXmlWriter().WriteToString(readFrom, i); if (!(string.IsNullOrEmpty(xml))) new ModelXmlReader().ReadFromString(modelNode, aspect, xml); } }
void LoadApplicationModels(bool loadResources, ModelApplicationBase model) { var userDiffLayer = model.LastLayer; ModelApplicationHelper.RemoveLayer(model); 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.CreateRuntimeMembers(Application.Model); }
void CombineWithActiveDifferenceObjects(ModelApplicationBase model, IEnumerable<ModelDifferenceObject> modelDifferenceObjects) { var reader = new ModelXmlReader(); foreach (var modelDifferenceObject in modelDifferenceObjects) { foreach (var aspectObject in modelDifferenceObject.AspectObjects) { var xml = aspectObject.Xml; if (!string.IsNullOrEmpty(xml)) reader.ReadFromString(model, modelDifferenceObject.GetAspectName(aspectObject), xml); } } }
public override void SaveDifference(ModelApplicationBase model) { if (model != null) { _objectSpace = _application.CreateObjectSpace() as ObjectSpace; ModelDifferenceObject modelDifferenceObject = GetActiveDifferenceObject(model.Id) ?? GetNewDifferenceObject(_objectSpace) .InitializeMembers(model.Id == "Application" ? Application.Title : model.Id, Application.Title, Application.GetType().FullName); OnDifferenceObjectSaving(modelDifferenceObject, model); } }
public override void Load(ModelApplicationBase model) { base.Load(model); var modelDifferenceObjects = GetActiveDifferenceObjects().ToList(); if (modelDifferenceObjects.Count() == 0) { SaveDifference(model); return; } CombineWithActiveDifferenceObjects(model, modelDifferenceObjects); }
void AddLayersCore(IEnumerable<KeyValuePair<string, ResourceInfo>> layers, ModelApplicationBase modelApplication) { IEnumerable<KeyValuePair<string, ResourceInfo>> keyValuePairs = layers; foreach (var pair in keyValuePairs) { ModelApplicationBase layer = modelApplication.CreatorInstance.CreateModelApplication(); layer.Id = pair.Key; modelApplication.AddLayer(layer); var modelXmlReader = new ModelXmlReader(); foreach (var aspectInfo in pair.Value.AspectInfos) { modelXmlReader.ReadFromString(layer, aspectInfo.AspectName, aspectInfo.Xml); } } }
void CombineModelFromPermission(ModelApplicationBase model) { if (SecuritySystem.Instance is ISecurityComplex && IsGranted()) { var space = Application.CreateObjectSpace(); ModelDifferenceObject difference = GetDifferenceFromPermission((XPObjectSpace)space); var master = new ModelLoader(difference.PersistentApplication.ExecutableName).GetMasterModel(true); var diffsModel = difference.GetModel(master); new ModelXmlReader().ReadFromModel(diffsModel, model); difference.CreateAspectsCore(diffsModel); space.SetModified(difference); space.CommitChanges(); } }
public void AddLayers(string modelApplicationPrefix, Dictionary<string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos, ModelApplicationBase model) { var modelXmlReader = new ModelXmlReader(); var assemblies = _xafApplication.Modules.Select(module => module.GetType().Assembly); var resourceModelCollector = new ResourceModelCollector(); foreach (var keyValuePair in resourceModelCollector.Collect(assemblies, modelApplicationPrefix)) { var modelDifferenceObjectInfo = GetModelDifferenceObjectInfo(modelApplicationPrefix, loadedModelDifferenceObjectInfos, keyValuePair.Key, model); foreach (var aspectInfo in keyValuePair.Value.AspectInfos) { modelXmlReader.ReadFromString(modelDifferenceObjectInfo.Model, aspectInfo.AspectName, aspectInfo.Xml); } modelDifferenceObjectInfo.ModelDifferenceObject.CreateAspects(modelDifferenceObjectInfo.Model); } }
ModelDifferenceObjectInfo GetModelDifferenceObjectInfo(string prefix, Dictionary<string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos, string resourceName, ModelApplicationBase model) { ModelDifferenceObject activeDifferenceObject; ModelApplicationBase modelApplicationBase; if (!loadedModelDifferenceObjectInfos.ContainsKey(resourceName)) { activeDifferenceObject = FindDifferenceObject(resourceName, prefix) ?? CreateDifferenceObject(resourceName, prefix); modelApplicationBase = activeDifferenceObject.GetModel(model); } else { var loadedModelDifferenceObjectInfo = loadedModelDifferenceObjectInfos[resourceName]; activeDifferenceObject = loadedModelDifferenceObjectInfo.ModelDifferenceObject; modelApplicationBase = loadedModelDifferenceObjectInfo.Model; } return new ModelDifferenceObjectInfo(activeDifferenceObject, modelApplicationBase); }
Dictionary<string, ModelDifferenceObjectInfo> GetLoadedModelDifferenceObjectInfos(ModelApplicationBase model) { Dictionary<string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos = GetLoadedModelApplications(model); if (loadedModelDifferenceObjectInfos.Count() == 0) { var modelDifferenceObjectInfos = new Dictionary<string, ModelDifferenceObjectInfo>(); var application = model.CreatorInstance.CreateModelApplication(); application.Id = XpandModuleBase.Application.Title; model.AddLayerBeforeLast(application); var modelDifferenceObject = ObjectSpace.CreateObject<ModelDifferenceObject>().InitializeMembers(application.Id); modelDifferenceObjectInfos.Add(application.Id, new ModelDifferenceObjectInfo(modelDifferenceObject, application)); loadedModelDifferenceObjectInfos = modelDifferenceObjectInfos; } return loadedModelDifferenceObjectInfos; }
public override void Load(ModelApplicationBase model) { base.Load(model); foreach (var roleModel in this.GetActiveRoleDifferenceObjects()) roleModel.GetModel(base.Application.Model as ModelApplicationBase); var modelDifferenceObjects = GetActiveDifferenceObjects().ToList(); if (modelDifferenceObjects.Count() == 0) { SaveDifference(model); return; } CombineWithActiveDifferenceObjects(model, modelDifferenceObjects); }
public override void Load(ModelApplicationBase model) { var extraDiffStoresLayerBuilder = new ExtraDiffStoresLayerBuilder(); var language = model.Application.PreferredLanguage; if (UseModelFromPath()) { return; } var loadedModelDifferenceObjectInfos = GetLoadedModelDifferenceObjectInfos(model); extraDiffStoresLayerBuilder.AddLayers(loadedModelDifferenceObjectInfos, _extraDiffStores); if (_loadResources) CreateResourceModels(model, loadedModelDifferenceObjectInfos); if (model.Application.PreferredLanguage != language) { Application.SetLanguage(model.Application.PreferredLanguage); } ObjectSpace.CommitChanges(); }
void CombineModelFromPermission(ModelApplicationBase model) { if (SecuritySystem.Instance is ISecurityComplex && IsGranted()) { var space = Application.CreateObjectSpace(typeof(ModelDifferenceObject)); ModelDifferenceObject difference = GetDifferenceFromPermission((XPObjectSpace)space); if (difference != null) { InterfaceBuilder.SkipAssemblyCleanup = true; var master = new ModelLoader(difference.PersistentApplication.ExecutableName, XafTypesInfo.Instance).GetMasterModel(true,info => info.AssignAsInstance()); InterfaceBuilder.SkipAssemblyCleanup = false; var diffsModel = difference.GetModel(master); new ModelXmlReader().ReadFromModel(diffsModel, model); difference.CreateAspectsCore(diffsModel); space.SetModified(difference); space.CommitChanges(); } } }
void LoadApplicationModels(bool loadResources, ModelApplicationBase model) { var userDiffLayers = new List<ModelApplicationBase>(); while (model.LastLayer != null && model.LastLayer.Id != "After Setup"){ userDiffLayers.Add(model.LastLayer); ModelApplicationHelper.RemoveLayer(model); } if (model.LastLayer == null) throw new ArgumentException("Model.LastLayer null"); var customModelDifferenceStoreEventArgs = new CreateCustomModelDifferenceStoreEventArgs(); OnCreateCustomModelDifferenceStore(customModelDifferenceStoreEventArgs); if (!customModelDifferenceStoreEventArgs.Handled){ new XpoModelDictionaryDifferenceStore(Application, GetPath(), customModelDifferenceStoreEventArgs.ExtraDiffStores, loadResources).Load(model); } userDiffLayers.Reverse(); foreach (var layer in userDiffLayers){ ModelApplicationHelper.AddLayer((ModelApplicationBase)Application.Model, layer); } }
public ModelApplicationBase GetModel(ModelApplicationBase master) { if (!master.IsMaster) { throw new ArgumentException("IsNotMaster", "master"); } if (master.LastLayer.Id != "After Setup") throw new ArgumentException("master.LastLayer", master.LastLayer.Id); Guard.ArgumentNotNull(Name, "Name"); var layer = master.CreatorInstance.CreateModelApplication(); layer.Id = Name; master.AddLayerBeforeLast(layer); var modelXmlReader = new ModelXmlReader(); foreach (var aspectObject in AspectObjects) { if (!(string.IsNullOrEmpty(aspectObject.Xml))) modelXmlReader.ReadFromString(layer, GetAspectName(aspectObject), aspectObject.Xml); } _currentModel = layer; return layer; }
static void RefreshLayers(ModelApplicationBase application, Func<ModelApplicationBase, ModelApplicationBase> func) { var modelApplicationBases = new List<ModelApplicationBase>(); var lastLayer = application.LastLayer; ModelApplicationHelper.RemoveLayer(application); var afterSetup = application.LastLayer; ModelApplicationHelper.RemoveLayer(application); while (application.LastLayer.Id != "Unchanged Master Part") { ModelApplicationBase modelApplicationBase = application.LastLayer; modelApplicationBase = func.Invoke(modelApplicationBase); if (modelApplicationBase != null) modelApplicationBases.Add(modelApplicationBase); ModelApplicationHelper.RemoveLayer(application); } modelApplicationBases.Reverse(); foreach (var modelApplicationBase in modelApplicationBases) { ModelApplicationHelper.AddLayer(application, modelApplicationBase); } ModelApplicationHelper.AddLayer(application, afterSetup); ModelApplicationHelper.AddLayer(application, lastLayer); }
public override void Load(ModelApplicationBase model) { Tracing.Tracer.LogVerboseSubSeparator("ModelDifference -- Adding Layers to application model "); var extraDiffStoresLayerBuilder = new ExtraDiffStoresLayerBuilder(); var language = model.Application.PreferredLanguage; if (UseModelFromPath()) { return; } var loadedModelDifferenceObjectInfos = GetLoadedModelDifferenceObjectInfos(model); extraDiffStoresLayerBuilder.AddLayers(loadedModelDifferenceObjectInfos, _extraDiffStores); if (_loadResources) { Tracing.Tracer.LogVerboseSubSeparator("ModelDifference -- CreateResourceModels"); CreateResourceModels(model, loadedModelDifferenceObjectInfos); } if (model.Application.PreferredLanguage != language) { Application.SetLanguage(model.Application.PreferredLanguage); } Tracing.Tracer.LogVerboseSubSeparator("ModelDifference -- Layers added to application model"); ObjectSpace.CommitChanges(); Tracing.Tracer.LogVerboseSubSeparator("ModelDifference -- Application model saved to the database"); }
private void SaveViewDifferences(ModelApplicationBase model) { if (SaveModelDifference.viewId != null) { var xml = new ModelXmlWriter().WriteToString(model, 0); var document = new XmlDocument(); document.LoadXml(xml); var xpath = string.Format("/Application/Views/DetailView[@Id='{0}']", SaveModelDifference.viewId); var viewNode = document.SelectSingleNode(xpath); if (viewNode != null) { var settings = new XmlWriterSettings(); settings.Indent = true; settings.OmitXmlDeclaration = true; var stringBuilder = new System.Text.StringBuilder(); using (var writer = XmlWriter.Create(stringBuilder, settings)) { viewNode.WriteTo(writer); } SaveModelDifference.viewXml = stringBuilder.ToString(); } } }
public static void InsertLayer(this ModelApplicationBase application, int index, ModelApplicationBase layer) { application.CallMethod("InsertLayerAtInternal", layer, index); }
public void CreateAspectsCore(ModelApplicationBase model) { var modelXmlWriter = new ModelXmlWriter(); for (int i = 0; i < model.AspectCount; i++) { var xml = modelXmlWriter.WriteToString(model, i); string name = GetAspectName(model.GetAspect(i)); AspectObjects.Filter = CriteriaOperator.Parse("Name=?", name); if (AspectObjects.Count == 0) AspectObjects.Add(new AspectObject(Session) { Name = name }); AspectObjects[0].Xml = xml; AspectObjects.Filter = null; } }
public virtual IEnumerable<ModelApplicationBase> GetAllLayers(ModelApplicationBase master) { return GetAllLayers(new QueryModelDifferenceObject(Session).GetActiveModelDifferences(persistentApplication.UniqueName, null).Where(differenceObject => differenceObject.Oid != Oid), master); }
public static void ReadFromModel(this ModelXmlReader modelXmlReader, ModelApplicationBase modelNode, ModelApplicationBase readFrom) { ReadFromModel(modelXmlReader, modelNode, readFrom, null); }
public ModelDifferenceObjectInfo(ModelDifferenceObject modelDifferenceObject, ModelApplicationBase model) { ModelDifferenceObject = modelDifferenceObject; Model = model; }
public static void InsertLayer(this ModelApplicationBase application, ModelApplicationBase layer) { application.InsertLayer(application.LayersCount - 1, layer); }
public static ModelApplicationBase GetLayer(this ModelApplicationBase modelApplicationBase, int index) { return((ModelApplicationBase)((List <ModelNode>)modelApplicationBase.GetPropertyValue("Layers"))[index]); }
public static ModelApplicationBase GetLayer(this ModelApplicationBase modelApplicationBase, string id) { var modelNodeWrapper = modelApplicationBase.GetLayers().FirstOrDefault(wrapper => wrapper.ModelNode.Id == id); return(modelNodeWrapper != null ? (ModelApplicationBase)modelNodeWrapper.ModelNode : null); }
public static void RemoveLayer(this ModelApplicationBase application) { ModelApplicationHelper.RemoveLayer(application); }
public static List <ModelNodeWrapper> GetLayers(this ModelApplicationBase modelApplicationBase) { return(((List <ModelNode>)modelApplicationBase.GetPropertyValue("Layers")).Select(node => new ModelNodeWrapper(node)).ToList()); }
public static void RemoveLayer(this ModelApplicationBase application, string id) { RefreshLayers(application, @base => @base.Id == id ? null : @base); }
public static void AddLayer(this ModelApplicationBase application, ModelNode layer) { ModelApplicationHelper.AddLayer(application, (ModelApplicationBase)layer); }
public virtual void Load(ModelApplicationBase model) { Load(model, GetAspect()); }
public void CreateAspects(ModelApplicationBase model) { var master = (ModelApplicationBase)model.Master; CreateAspects(model, master); }
public static void ReplaceLayer(this ModelApplicationBase application, ModelApplicationBase layer) { RefreshLayers(application, @base => application.LastLayer.Id == layer.Id ? layer : @base); }
Dictionary <string, ModelDifferenceObjectInfo> GetLoadedModelDifferenceObjectInfos(ModelApplicationBase model) { Dictionary <string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos = GetLoadedModelApplications(model); return(!loadedModelDifferenceObjectInfos.Any() ? CreateNew(model) : loadedModelDifferenceObjectInfos); }
static void ReadFromOtherLayers(IEnumerable <ModelApplicationBase> modelApplicationBases, ModelApplicationBase modelApplicationBase) { foreach (var applicationBase in modelApplicationBases.Cast <IModelApplication>()) { var mergedDifferenceStrategy = ((IModelOptionsMergedDifferenceStrategy)applicationBase.Options); if (mergedDifferenceStrategy != null) { var xml = mergedDifferenceStrategy.Xml(); if (!string.IsNullOrEmpty(xml)) { xml = string.Format("<Application>{0}</Application>", xml); new ModelXmlReader().ReadFromString(modelApplicationBase, "", xml); } } } }
void CreateResourceRoleModels(ResourcesLayerBuilder resourcesLayerBuilder, Dictionary <string, ModelDifferenceObjectInfo> loadedModelDifferenceObjectInfos, ModelApplicationBase model) { var roleMarker = model.CreatorInstance.CreateModelApplication(); roleMarker.Id = "RoleMarker"; model.AddLayerBeforeLast(roleMarker); resourcesLayerBuilder.AddLayers(RoleApplicationPrefix, loadedModelDifferenceObjectInfos, model); var lastLayer = model.LastLayer; while (model.LastLayer.Id != "RoleMarker") { ModelApplicationHelper.RemoveLayer(model); } ModelApplicationHelper.RemoveLayer(model); ModelApplicationHelper.AddLayer(model, lastLayer); }
ModelApplicationBase CreateInheritanceLayer(ModelNode node, ModelApplicationBase applicationBase, ModelMergedDifferenceInfo mergedDifference, ModelApplicationBase master) { var modelApplication = node.CreatorInstance.CreateModelApplication(); var targetViewId = ((ModelNode)mergedDifference.TargetView).Id; modelApplication.Id = string.Format("{0}_" + applicationBase.Id, targetViewId); new ModelXmlReader().ReadFromModel(modelApplication, applicationBase); var application = ((IModelApplication)modelApplication); RemoveUnrelatedNodes(mergedDifference, application); application.Views[mergedDifference.MergedViewId].Id = targetViewId; var modelSources = ((IModelSources)application); modelSources.BOModelTypes = ((IModelSources)master).BOModelTypes; modelSources.Modules = ((IModelSources)master).Modules; modelSources.Controllers = ((IModelSources)master).Controllers; modelSources.Localizers = ((IModelSources)master).Localizers; modelSources.EditorDescriptors = new EditorDescriptors(((IModelSources)master).EditorDescriptors); return(modelApplication); }
public static List <ModelNodeWrapper> GetLayers(this ModelApplicationBase modelApplicationBase) { var propertyInfo = typeof(ModelNode).GetProperty("Layers", BindingFlags.Instance | BindingFlags.NonPublic); return(((List <ModelNode>)propertyInfo.GetValue(modelApplicationBase, null)).Select(node => new ModelNodeWrapper(node)).ToList()); }
ModelEditorViewController GetController(FileModelStore fileModelStore, ModelApplicationBase modelApplication) { return(new ModelEditorViewController((IModelApplication)modelApplication, fileModelStore)); }
public override void Load(ModelApplicationBase model) { LoadCore(model); }
void AddLayersCore(IEnumerable <KeyValuePair <string, ResourceInfo> > layers, ModelApplicationBase modelApplication) { IEnumerable <KeyValuePair <string, ResourceInfo> > keyValuePairs = layers; foreach (var pair in keyValuePairs) { ModelApplicationBase layer = modelApplication.CreatorInstance.CreateModelApplication(); layer.Id = pair.Key; ModelApplicationHelper.AddLayer(modelApplication, layer); var modelXmlReader = new ModelXmlReader(); foreach (var aspectInfo in pair.Value.AspectInfos) { modelXmlReader.ReadFromString(layer, aspectInfo.AspectName, aspectInfo.Xml); } } }
protected IEnumerable <ModelApplicationBase> GetAllLayers(IEnumerable <ModelDifferenceObject> differenceObjects, ModelApplicationBase master) { var modelDifferenceObjects = differenceObjects.ToList(); if (GetttingNonAppModels(modelDifferenceObjects)) { modelDifferenceObjects = modelDifferenceObjects.Where(o => o.CombineOrder < CombineOrder).ToList(); } var modelApplicationBases = modelDifferenceObjects.Distinct().Select(differenceObject => differenceObject.GetModel(master)); modelApplicationBases = modelApplicationBases.Concat(new List <ModelApplicationBase> { GetModel(master) }); return(modelApplicationBases); }
AspectObject GetActiveAspect(ModelApplicationBase modelApplicationBase) { return AspectObjects.FirstOrDefault(o => o.Name == GetAspectName(modelApplicationBase.CurrentAspect)); }
AspectObject GetActiveAspect(ModelApplicationBase modelApplicationBase) { return(AspectObjects.FirstOrDefault(o => o.Name == GetAspectName(modelApplicationBase.CurrentAspect))); }
public static Platform GetPlatform(this ModelApplicationBase applicationBase) { return(((IModelApplication)applicationBase).GetPlatform()); }
public virtual IEnumerable <ModelApplicationBase> GetAllLayers(ModelApplicationBase master) { return(GetAllLayers(new QueryModelDifferenceObject(Session).GetActiveModelDifferences(_persistentApplication.UniqueName, null) .Where(differenceObject => differenceObject.Oid != Oid), master)); }