EnumExtensionsGetNameTEnum Method
Retrieves the name of the constant in the specified enumeration that has the specified value.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static string? GetName<TEnum>(
this TEnum value
)
where TEnum : struct, new()
<ExtensionAttribute>
Public Shared Function GetName(Of TEnum As {Structure, New}) (
value As TEnum
) As String
public:
[ExtensionAttribute]
generic<typename TEnum>
where TEnum : value class, gcnew()
static String^ GetName(
TEnum value
)
[<ExtensionAttribute>]
static member GetName :
value : 'TEnum -> string when 'TEnum : struct, new()
- value TEnum
- The enum value whose name is required.
- TEnum
- The type of the enum value.
StringA string containing the name of the enumerated
value, or
if no such constant is found.In Visual Basic and C#, you can call this method as an instance method on any object of type
TEnum. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).