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; }
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); }
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); }
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)); }
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))); }