Type.IsEnumDefined(Object) 方法

定义

返回一个值,该值指示当前的枚举类型中是否存在指定的值。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

要测试的值。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.

valuenullvalue is null.

value 类型不能为枚举的基础类型。value is of a type that cannot be the underlying type of an enumeration.

适用于