Beispiel #1
0
 public static string Name <T>(Expression <Func <T, object> > ex)
 {
     return(Safe.Run(() => name(ex.Body), string.Empty));
 }
Beispiel #2
0
 public static string Name <T>(Expression <Action <T> > ex)
 {
     return(Safe.Run(() => name(ex.Body), string.Empty));
 }
Beispiel #3
0
 public static CultureInfo[] GetCultures(CultureTypes types)
 {
     return(Safe.Run(() => CultureInfo.GetCultures(types),
                     new CultureInfo[0]));
 }
Beispiel #4
0
 public static RegionInfo ToRegionInfo(CultureInfo info)
 {
     return(info is null
         ? null
         : Safe.Run(() => new RegionInfo(info.LCID), null));
 }
Beispiel #5
0
 public static T Value <T>(int i)
 {
     return(Safe.Run(() => (T)Value(typeof(T), i), default(T)));
 }
Beispiel #6
0
 public static int Count(Type type)
 {
     return(Safe.Run(() => Enum.GetValues(type).Length, -1));
 }