public static void CreateAndStoreDataHolderDefinitions(Assembly asm) { foreach (Type type in asm.GetTypes()) { if (((IEnumerable <DataHolderAttribute>)type.GetCustomAttributes <DataHolderAttribute>()) .Count <DataHolderAttribute>() > 0) { DataHolderDefinition holderDefinition = DataHolderMgr.CreateDataHolderDefinition(type); DataHolderMgr.DataHolderDefinitions.Add(holderDefinition.Name, holderDefinition); } } }
public static Dictionary <string, DataHolderDefinition> CreateDataHolderDefinitionMap(Assembly asm) { Dictionary <string, DataHolderDefinition> dictionary = new Dictionary <string, DataHolderDefinition>(); foreach (Type type in asm.GetTypes()) { if (((IEnumerable <DataHolderAttribute>)type.GetCustomAttributes <DataHolderAttribute>()) .Count <DataHolderAttribute>() > 0) { DataHolderDefinition holderDefinition = DataHolderMgr.CreateDataHolderDefinition(type); dictionary.Add(holderDefinition.Name, holderDefinition); } } return(dictionary); }
public static List <DataHolderDefinition> CreateDataHolderDefinitionList(Assembly asm) { List <DataHolderDefinition> holderDefinitionList = new List <DataHolderDefinition>(); foreach (Type type in asm.GetTypes()) { if (type.Name == "PetLevelStatInfo") { type.ToString(); } if (((IEnumerable <DataHolderAttribute>)type.GetCustomAttributes <DataHolderAttribute>()) .Count <DataHolderAttribute>() > 0) { DataHolderDefinition holderDefinition = DataHolderMgr.CreateDataHolderDefinition(type); holderDefinitionList.Add(holderDefinition); } } return(holderDefinitionList); }
public static DataHolderDefinition CreateDataHolderDefinition <T>() where T : IDataHolder { return(DataHolderMgr.CreateDataHolderDefinition(typeof(T))); }
public static DataHolderDefinition[] CreateDataHolderDefinitionArray(Assembly asm) { return(DataHolderMgr.CreateDataHolderDefinitionList(asm).ToArray()); }