예제 #1
0
 public void ReadMeConvFromANumberType()
 {
     // Conversion from a numeric type to an enum type
     YourEnum val0 = EnumUtil.FromByte <YourEnum>(2);
     YourEnum val1 = EnumUtil.FromSByte <YourEnum>(2);
     YourEnum val2 = EnumUtil.FromInt16 <YourEnum>(2);
     YourEnum val3 = EnumUtil.FromUInt16 <YourEnum>(2);
     YourEnum val4 = EnumUtil.FromInt32 <YourEnum>(2);
     YourEnum val5 = EnumUtil.FromUInt32 <YourEnum>(2);
     YourEnum val6 = EnumUtil.FromInt64 <YourEnum>(2L);
     YourEnum val7 = EnumUtil.FromUInt64 <YourEnum>(2UL);
     YourEnum val8 = EnumUtil.FromSingle <YourEnum>(2f);
     YourEnum val9 = EnumUtil.FromDouble <YourEnum>(2.0);
 }