Click or drag to resize

ExtensionsReflectionGetDisplayNameTEnum Method

Returns the name value of the DisplayNameAttribute of the enum member

Namespace:  Cauldron
Assembly:  Cauldron.Activator (in Cauldron.Activator.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public static string GetDisplayName<TEnum>(
	this TEnum enumValue
)
where TEnum : struct, new(), IConvertible

Parameters

enumValue
Type: TEnum
The enum member value

Type Parameters

TEnum
The enum type

Return Value

Type: String
The value of DisplayName. Returns null if the enum member has no DisplayNameAttribute

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . 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).
See Also