コード例 #1
0
 public static IEnumerable <PropertyInfoEx> GetPropertiesEx(this Type type, BindingFlags bindingFlags = PUBLIC_ISTANCE_STATIC, bool enableCaching = true)
 {
     if (enableCaching)
     {
         return(PropertyInfoExCache.GetPropertiesEx(type, bindingFlags));
     }
     else
     {
         return(type.GetProperties(bindingFlags).Select(x => new PropertyInfoEx(x, false)));
     }
 }
コード例 #2
0
 public static PropertyInfoEx GetPropertyEx(this PropertyInfo PropertyInfo, bool enableCaching = true)
 {
     if (enableCaching)
     {
         return(PropertyInfoExCache.GetPropertyEx(PropertyInfo));
     }
     else
     {
         return(new PropertyInfoEx(PropertyInfo, false));
     }
 }
コード例 #3
0
 public static IReadOnlyDictionary <string, PropertyInfoEx> GetPropertiesExDic(this Type type, BindingFlags bindingFlags = PUBLIC_ISTANCE_STATIC, bool enableCaching = true)
 {
     if (enableCaching)
     {
         return(PropertyInfoExCache.GetPropertiesExDic(type, bindingFlags));
     }
     else
     {
         return(new ReadOnlyDictionary <string, PropertyInfoEx>(
                    type.GetProperties(bindingFlags).ToDictionary(x => x.Name, x => new PropertyInfoEx(x, false))));
     }
 }
コード例 #4
0
 public static PropertyInfoEx GetPropertyEx(this Type type, string name, BindingFlags bindingFlags = PUBLIC_ISTANCE_STATIC, bool enableCaching = true)
 {
     if (enableCaching)
     {
         return(PropertyInfoExCache.GetPropertyEx(type, name, bindingFlags));
     }
     else
     {
         var f = type.GetProperty(name, bindingFlags);
         if (f == null)
         {
             return(null);
         }
         return(new PropertyInfoEx(f, false));
     }
 }