asp.net.ph

Enum.IsDefined Method

System Namespace   Enum Class


Returns an indication whether a constant with a specified value exists in a specified enumeration.

[ VB ]
<Serializable>
Public Shared Function IsDefined ( _
   ByVal enumType As Type, _
   ByVal value As Object _
) As Boolean

[ C# ]
[Serializable]
public static bool IsDefined (
   Type enumType,
   object value
);

[ C++ ]
[Serializable]
public: static bool IsDefined (
   Type* enumType,
   Object* value
);

[JScript ]
public Serializable
static function IsDefined (
   enumType : Type,
   value : Object
) : Boolean;

Parameters

enumType
An enumeration type.
value
The value or name of a constant in enumType.

Return Value

true if a constant in enumType has a value equal to value; otherwise, false.

Exceptions


Exception Type Condition
ArgumentNullException enumType or value is a null reference ( Nothing in Visual Basic ).
ArgumentException enumType is not an Enum.

-or-

The type of value is not an enumType.

-or-

The type of value is not an underlying type of enumType.

ExecutionEngineException value is not type SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, or UInt64.

See Also

Enum Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph