Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        public static Dictionary <string, ResourceInfo> ResourceInfos(IEnumerable <ModuleBase> modules)
        {
            var resourceModelCollector = new ResourceModelCollector();
            var moduleAssemblies = modules.Select(module => module.GetType().Assembly);
            var assemblies = new[] { typeof(XpandModuleBase).Assembly }.Concat(moduleAssemblies);

            return(resourceModelCollector.Collect(assemblies, ""));
        }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
 public static Dictionary<string, ResourceInfo> ResourceInfos(IEnumerable<ModuleBase> modules){
     var resourceModelCollector = new ResourceModelCollector();
     var moduleAssemblies = modules.Select(module => module.GetType().Assembly);
     var assemblies = new[]{typeof (XpandModuleBase).Assembly}.Concat(moduleAssemblies);
     return resourceModelCollector.Collect(assemblies, "");
 }