示例#1
0
        public static object Enum(Type t)
        {
            var count = GetEnum.Count(t);
            var index = Int32(0, count);

            return(GetEnum.Value(t, index));
        }
示例#2
0
 public static T Enum <T>()
 {
     return(Safe.Run(() => {
         var c = GetEnum.Count <T>();
         if (c == 0)
         {
             return default(T);
         }
         var i = Int32(0, c - 1);
         return GetEnum.Value <T>(i);
     }, default(T)));
 }