public static IEnumerable <FieldInfoEx> GetFieldsEx(this Type type, BindingFlags bindingFlags = PUBLIC_ISTANCE_STATIC, bool enableCaching = true) { if (enableCaching) { return(FieldInfoExCache.GetFieldsEx(type, bindingFlags)); } else { return(type.GetFields(bindingFlags).Select(x => new FieldInfoEx(x, false))); } }
public static FieldInfoEx GetFieldEx(this FieldInfo fieldInfo, bool enableCaching = true) { if (enableCaching) { return(FieldInfoExCache.GetFieldEx(fieldInfo)); } else { return(new FieldInfoEx(fieldInfo, false)); } }
public static IReadOnlyDictionary <string, FieldInfoEx> GetFieldsExDic(this Type type, BindingFlags bindingFlags = PUBLIC_ISTANCE_STATIC, bool enableCaching = true) { if (enableCaching) { return(FieldInfoExCache.GetFieldsExDic(type, bindingFlags)); } else { return(new ReadOnlyDictionary <string, FieldInfoEx>( type.GetFields(bindingFlags).ToDictionary(x => x.Name, x => new FieldInfoEx(x, false)))); } }
public static FieldInfoEx GetFieldEx(this Type type, string name, BindingFlags bindingFlags = PUBLIC_ISTANCE_STATIC, bool enableCaching = true) { if (enableCaching) { return(FieldInfoExCache.GetFieldEx(type, name, bindingFlags)); } else { var f = type.GetField(name, bindingFlags); if (f == null) { return(null); } return(new FieldInfoEx(f, false)); } }