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