net472_PropertyGridHelpers.Attributes_LocalizedEnumTextAttribute - dparvin/PropertyGridHelpers GitHub Wiki

LocalizedEnumTextAttribute class

Specifies a localized text representation for an enum field or property, retrieving its display text from a resource file at runtime.

[AttributeUsage(AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field)]
public class LocalizedEnumTextAttribute : LocalizedTextAttribute

Public Members

name description
LocalizedEnumTextAttribute(…) Initializes a new instance of the LocalizedEnumTextAttribute class.
static Get(…) Retrieves the LocalizedEnumTextAttribute applied to the given value, if present. (2 methods)

Remarks

Initializes a new instance of the LocalizedEnumTextAttribute class to link an enum field or property to a resource string key.

Examples

public enum Status
{
    [LocalizedEnumText("PendingApproval")]
    Pending,

    [LocalizedEnumText("Approved")]
    Approved,

    [LocalizedEnumText("Rejected")]
    Rejected
}

See Also

⚠️ **GitHub.com Fallback** ⚠️