Beispiel #1
0
 private static ModuleArtifact CreateArtifact(ModuleChild moduleChild, ModuleArtifactType moduleArtifactType,IObjectSpace objectSpace, Type type){
     var moduleArtifact = objectSpace.CreateObject<ModuleArtifact>();
     moduleArtifact.Name = type.Name;
     moduleArtifact.Type = moduleArtifactType;
     moduleArtifact.ModuleChilds.Add(moduleChild);
     return moduleArtifact;
 }
Beispiel #2
0
        private static ModuleArtifact CreateArtifact(ModuleChild moduleChild, ModuleArtifactType moduleArtifactType, IObjectSpace objectSpace, Type type)
        {
            var moduleArtifact = objectSpace.CreateObject <ModuleArtifact>();

            moduleArtifact.Name = type.Name;
            moduleArtifact.Type = moduleArtifactType;
            moduleArtifact.ModuleChilds.Add(moduleChild);
            return(moduleArtifact);
        }
Beispiel #3
0
        public static bool IsValidArtifactType(this ModuleArtifactType moduleArtifactType, Type type)
        {
            switch (moduleArtifactType)
            {
            case ModuleArtifactType.ViewItem:
                return(IsViewItem(type));

            case ModuleArtifactType.ListEditor:
                return(IsListEditor(type));

            case ModuleArtifactType.Controller:
                return(IsController(type));

            case ModuleArtifactType.Permission:
                return(IsPermission(type));

            case ModuleArtifactType.BusinessObject: {
                return(IsBusinessObject(type));
            }
            }
            return(false);
        }
Beispiel #4
0
 public static Dictionary<Type, ModuleArtifact> CreateArtifacts(this ModuleChild moduleChild, Type moduleType, ModuleArtifactType moduleArtifactType) {
     var artifactTypes = moduleType.Assembly.GetTypes().Where(type => !type.IsAbstract).Where(type => moduleArtifactType.IsValidArtifactType(type)).ToArray();
     var objectSpace = moduleChild.XPObjectSpace();
     return artifactTypes.ToList().ToDictionary(type => type, type => CreateArtifact(moduleChild, moduleArtifactType, objectSpace, type));
 }
Beispiel #5
0
        public static Dictionary <Type, ModuleArtifact> CreateArtifacts(this ModuleChild moduleChild, Type moduleType, ModuleArtifactType moduleArtifactType)
        {
            var artifactTypes = moduleType.Assembly.GetTypes().Where(type => !type.IsAbstract).Where(type => moduleArtifactType.IsValidArtifactType(type)).ToArray();
            var objectSpace   = moduleChild.XPObjectSpace();

            return(artifactTypes.ToList().ToDictionary(type => type, type => CreateArtifact(moduleChild, moduleArtifactType, objectSpace, type)));
        }