Beispiel #1
0
 public static IEnumerable <ConstructorInfoEx> GetConstructorsEx(this Type type, BindingFlagsEx bindingFlags, bool enableCaching = true)
 {
     if (enableCaching)
     {
         return(ConstructorInfoExCache.GetConstructorsExDic(type, (BindingFlags)bindingFlags).Values);
     }
     else
     {
         return(type.GetConstructors((BindingFlags)bindingFlags).Select(x => new ConstructorInfoEx(x, false)));
     }
 }
Beispiel #2
0
 public static IReadOnlyDictionary <string, ConstructorInfoEx> GetConstructorsExDic(this Type type, BindingFlags bindingFlags = PUBLIC_ISTANCE_STATIC, bool enableCaching = true)
 {
     if (enableCaching)
     {
         return(ConstructorInfoExCache.GetConstructorsExDic(type, bindingFlags));
     }
     else
     {
         return(new ReadOnlyDictionary <string, ConstructorInfoEx>(
                    type.GetConstructors(bindingFlags).ToDictionary(x => x.Name, x => new ConstructorInfoEx(x, false))));
     }
 }