Determines if a given value (string, value or instance) is one of the defined values of the specified enumeration.
[Visual Basic] Public Shared Function IsDefined( _ ByVal enumType As Type, _ ByVal value As Object _ ) As Boolean [C#] public static bool IsDefined( Type enumType, object value ); [C++] public: static bool IsDefined( Type* enumType, Object* value ); [JScript] public static function IsDefined( enumType : Type, value : Object ) : Boolean;
true if value is one of the defined values of enumType; otherwise, false.
Exception Type | Condition |
---|---|
ArgumentNullException | The enumType or value parameter is a null reference (in Visual Basic Nothing). |
ArgumentException | The enumType parameter is not an Enum type.
The value is from an enumeration that differs in type from enumType. The type of value is not an underlying type of, enumType. |
ExecutionEngineException | The enumeration has an unsupported underlying type. |