本文整理汇总了C#中ModelApplicationBase.AddLayer方法的典型用法代码示例。如果您正苦于以下问题:C# ModelApplicationBase.AddLayer方法的具体用法?C# ModelApplicationBase.AddLayer怎么用?C# ModelApplicationBase.AddLayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelApplicationBase
的用法示例。
在下文中一共展示了ModelApplicationBase.AddLayer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddLayers
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);
}
示例2: AddLayersCore
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);
}
}
}
示例3: RefreshLayers
static void RefreshLayers(ModelApplicationBase application, Func<ModelApplicationBase, ModelApplicationBase> func) {
var modelApplicationBases = new List<ModelApplicationBase>();
var lastLayer = application.LastLayer;
application.RemoveLayer(lastLayer);
var afterSetup = application.LastLayer;
application.RemoveLayer(afterSetup);
while (application.LastLayer.Id != "Unchanged Master Part") {
ModelApplicationBase modelApplicationBase = application.LastLayer;
modelApplicationBase = func.Invoke(modelApplicationBase);
if (modelApplicationBase!=null)
modelApplicationBases.Add(modelApplicationBase);
application.RemoveLayer(application.LastLayer);
}
modelApplicationBases.Reverse();
foreach (var modelApplicationBase in modelApplicationBases) {
application.AddLayer(modelApplicationBase);
}
application.AddLayer(afterSetup);
application.AddLayer(lastLayer);
}
示例4: GetModelUnSafe
void GetModelUnSafe(ModelApplicationBase modelApplicationBase, ModelDifferenceObject modelDifferenceObject) {
var afterSetupLayer = GetAfterSetupLayer(modelApplicationBase);
modelApplicationBase.AddLayer(afterSetupLayer);
modelDifferenceObject.GetModel(modelApplicationBase);
modelApplicationBase.RemoveLayer(afterSetupLayer);
}
示例5: CreateResourceRoleModels
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") {
model.RemoveLayer(model.LastLayer);
}
model.RemoveLayer(roleMarker);
model.AddLayer(lastLayer);
}