Type.IsEnumDefined(Object) Type.IsEnumDefined(Object) Type.IsEnumDefined(Object) Type.IsEnumDefined(Object) Method

定義

傳回值,這個值表示指定的值是否存在於目前的列舉類型中。Returns a value that indicates whether the specified value exists in the current enumeration type.

public:
 virtual bool IsEnumDefined(System::Object ^ value);
public virtual bool IsEnumDefined (object value);
abstract member IsEnumDefined : obj -> bool
override this.IsEnumDefined : obj -> bool
Public Overridable Function IsEnumDefined (value As Object) As Boolean

參數

value
Object Object Object Object

要測試的值。The value to be tested.

傳回

如果指定的值是目前列舉類型的成員,則為 true,否則為 falsetrue if the specified value is a member of the current enumeration type; otherwise, false.

例外狀況

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

value 的類型不能是列舉的基礎類型。value is of a type that cannot be the underlying type of an enumeration.

適用於