AllReady.Extensions.EnumerableExtensions.GetDisplayName C# (CSharp) Метод

GetDisplayName() публичный статический Метод

Retrieves the Display attribute of an enum.
public static GetDisplayName ( this enumValue ) : string
enumValue this
Результат string
        public static string GetDisplayName(this Enum enumValue)
        {
            return enumValue.GetType()
                            .GetMember(enumValue.ToString())
                            .First()
                            .GetCustomAttribute<DisplayAttribute>()
                            .GetName();  // GetName (vs. Name) ensures that the localized string will be returned if using the ResourceType attribute property.
        }
EnumerableExtensions