Open sandboxFocus

Property UnderlyingType

UnderlyingType

Gets or sets the underlying integral type of the enum. The default value is Int32.

Declaration
SpecialType UnderlyingType { get; set; }
Property Value
Type Description
SpecialType
Remarks

The language allows one of Byte, SByte, Int16, UInt16, Int32, UInt32, Int64 and UInt64. The setter throws an ArgumentOutOfRangeException for any other value.

Setting this property after a member has been added throws an InvalidOperationException, because the value of a member is validated against the underlying type when the member is added.

See Also