예제 #1
0
 public static T Value <T>(int i) => Safe.Run(()
                                              => (T)Value(typeof(T), i), default(T));
예제 #2
0
 public static int Count(Type type) => Safe.Run(()
                                                => Enum.GetValues(type).Length, -1);
예제 #3
0
 public static object Value(Type type, int i) =>
 Safe.Run(() => {
     var v = Enum.GetValues(type);
     return(v.GetValue(i));
 }, null);