コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public static DataHolderDefinition CreateDataHolderDefinition <T>() where T : IDataHolder
 {
     return(DataHolderMgr.CreateDataHolderDefinition(typeof(T)));
 }
コード例 #5
0
 public static DataHolderDefinition[] CreateDataHolderDefinitionArray(Assembly asm)
 {
     return(DataHolderMgr.CreateDataHolderDefinitionList(asm).ToArray());
 }