示例#1
0
 private static void initializeType(Type t)
 {
     if (!t.IsSubclassOf(typeof(Enumerated <>)))
     {
         return;
     }
     FieldInfo[] fields = t.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public);
     if ((int)fields.Length > 0)
     {
         fields[0].GetValue(null);
     }
     EnumeratedRepository <T> .initializeType(t.BaseType);
 }
示例#2
0
 static EnumeratedRepository()
 {
     EnumeratedRepository <T> ._inner = new Dictionary <string, IEnumerated>(StringComparer.Ordinal);
     EnumeratedRepository <T> .initializeType(typeof(T));
 }