Επεξεργασία

Κοινή χρήση μέσω


Enum.GetValuesAsUnderlyingType Method

Definition

Overloads

GetValuesAsUnderlyingType(Type)

Retrieves an array of the values of the underlying type constants in a specified enumeration.

GetValuesAsUnderlyingType<TEnum>()

Retrieves an array of the values of the underlying type constants in a specified enumeration type.

GetValuesAsUnderlyingType(Type)

Source:
Enum.cs
Source:
Enum.cs
Source:
Enum.cs

Retrieves an array of the values of the underlying type constants in a specified enumeration.

public:
 static Array ^ GetValuesAsUnderlyingType(Type ^ enumType);
public static Array GetValuesAsUnderlyingType (Type enumType);
static member GetValuesAsUnderlyingType : Type -> Array
Public Shared Function GetValuesAsUnderlyingType (enumType As Type) As Array

Parameters

enumType
Type

An enumeration type.

Returns

An array that contains the values of the underlying type constants in enumType.

Exceptions

enumType is null.

enumType is not an enumeration type.

Remarks

You can use this method to get enumeration values when it's hard to create an array of the enumeration type. For example, you might use this method for the MetadataLoadContext enumeration or on a platform where run-time code generation is not available.

Applies to

GetValuesAsUnderlyingType<TEnum>()

Source:
Enum.cs
Source:
Enum.cs
Source:
Enum.cs

Retrieves an array of the values of the underlying type constants in a specified enumeration type.

public:
generic <typename TEnum>
 where TEnum : value class static Array ^ GetValuesAsUnderlyingType();
public static Array GetValuesAsUnderlyingType<TEnum> () where TEnum : struct;
static member GetValuesAsUnderlyingType : unit -> Array (requires 'Enum : struct)
Public Shared Function GetValuesAsUnderlyingType(Of TEnum As Structure) () As Array

Type Parameters

TEnum

An enumeration type.

Returns

An array that contains the values of the underlying type constants in TEnum.

Remarks

You can use this method to get enumeration values when it's hard to create an array of the enumeration type. For example, you might use this method for the MetadataLoadContext enumeration or on a platform where run-time code generation is not available.

Applies to