System Namespace Enum Class
Retrieves the name of the constant in the specified enumeration that has the specified value.
[ VB ]
<Serializable>
Public Shared Function GetName ( _
ByVal enumType As Type, _
ByVal value As Object _
) As String
[ C# ]
[Serializable]
public static string GetName (
Type enumType,
object value
);
[ C++ ]
[Serializable]
public: static String* GetName (
Type* enumType,
Object* value
);
[JScript ]
public Serializable
static function GetName (
enumType : Type,
value : Object
) : String;
- enumType
- An enumeration.
- value
- The value of a particular enumerated constant in terms of its underlying type.
A string containing the name of the enumerated constant in enumType whose value is value, or a null reference ( Nothing in Visual Basic ) if no such constant is found.
Exception Type |
Condition |
ArgumentNullException |
enumType or value is a null reference ( Nothing in Visual Basic ). |
ArgumentException |
enumType is not an Enum.
-or-
value is neither of type enumType nor does it have the same underlying type as enumType.
|
Enum Members