Type.GetEnumValues Type.GetEnumValues Type.GetEnumValues Type.GetEnumValues Method

定義

傳回目前列舉類型中常數的值陣列。Returns an array of the values of the constants in the current enumeration type.

public:
 virtual Array ^ GetEnumValues();
public virtual Array GetEnumValues ();
abstract member GetEnumValues : unit -> Array
override this.GetEnumValues : unit -> Array
Public Overridable Function GetEnumValues () As Array

傳回

包含值的陣列。An array that contains the values. 陣列的項目依列舉常數的二進位值 (也就是不帶正負號值) 排序。The elements of the array are sorted by the binary values (that is, the unsigned values) of the enumeration constants.

例外狀況

目前的類型不是列舉。The current type is not an enumeration.

適用於