Пример #1
0
 private static void Load(Type type)
 {
     using (ServiceBussiness sb = new ServiceBussiness())
     {
         foreach (FieldInfo fieldInfo in type.GetFields())
         {
             if (fieldInfo.IsStatic)
             {
                 object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(ConfigPropertyAttribute), false);
                 if (customAttributes.Length != 0)
                 {
                     ConfigPropertyAttribute attrib = (ConfigPropertyAttribute)customAttributes[0];
                     fieldInfo.SetValue((object)null, GameProperties.LoadProperty(attrib, sb));
                 }
             }
         }
     }
 }
Пример #2
0
 private static void Load(Type type)
 {
     using (ServiceBussiness sb = new ServiceBussiness())
     {
         foreach (FieldInfo f in type.GetFields())
         {
             if (!f.IsStatic)
             {
                 continue;
             }
             object[] attribs = f.GetCustomAttributes(typeof(ConfigPropertyAttribute), false);
             if (attribs.Length == 0)
             {
                 continue;
             }
             ConfigPropertyAttribute attrib = (ConfigPropertyAttribute)attribs[0];
             f.SetValue(null, GameProperties.LoadProperty(attrib, sb));
         }
     }
 }
Пример #3
0
 private static void Load(Type type)
 {
     using (ServiceBussiness serviceBussiness = new ServiceBussiness())
     {
         FieldInfo[] fields = type.GetFields();
         for (int i = 0; i < fields.Length; i++)
         {
             FieldInfo fieldInfo = fields[i];
             if (fieldInfo.IsStatic)
             {
                 object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(ConfigPropertyAttribute), false);
                 if (customAttributes.Length != 0)
                 {
                     ConfigPropertyAttribute attrib = (ConfigPropertyAttribute)customAttributes[0];
                     fieldInfo.SetValue(null, GameProperties.LoadProperty(attrib, serviceBussiness));
                 }
             }
         }
     }
 }