Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetEnumUnderlyingType()

virtual Type System.Type.GetEnumUnderlyingType ( )
inlinevirtualinherited

Reimplemented in System.Reflection.Emit.EnumBuilder, System.Reflection.SignatureType, and System.RuntimeType.

Definition at line 1035 of file Type.cs.

1036 {
1037 if (!IsEnum)
1038 {
1039 throw new ArgumentException(SR.Arg_MustBeEnum, "enumType");
1040 }
1041 FieldInfo[] fields = GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
1042 if (fields == null || fields.Length != 1)
1043 {
1044 throw new ArgumentException(SR.Argument_InvalidEnum, "enumType");
1045 }
1046 return fields[0].FieldType;
1047 }
virtual bool IsEnum
Definition Type.cs:227
FieldInfo[] GetFields()
Definition Type.cs:616

References System.SR.Arg_MustBeEnum, System.SR.Argument_InvalidEnum, System.Reflection.FieldInfo.FieldType, System.Type.GetFields(), and System.Type.IsEnum.

Referenced by System.ComponentModel.ReflectPropertyDescriptor.ReflectPropertyDescriptor(), System.Enum.GetUnderlyingType(), and System.Type.IsEnumDefined().