net90_PropertyGridHelpers.Attributes_EnumTextAttribute_EnumTextAttribute - dparvin/PropertyGridHelpers GitHub Wiki
Specifies a user-friendly text representation for an Enum field, primarily for display in a property grid or UI elements.
public EnumTextAttribute(string text)
parameter | description |
---|---|
text | The display text for the Enum field. |
This attribute can be applied to individual Enum fields to provide a custom display text. This is useful when showing Enum values in a PropertyGrid, dropdowns, or UI components where a more descriptive label is needed instead of the raw Enum name.
public enum Status
{
[EnumText("Pending Approval")]
Pending,
[EnumText("Approved")]
Approved,
[EnumText("Rejected")]
Rejected
}
- class EnumTextAttribute
- namespace PropertyGridHelpers.Attributes
- assembly PropertyGridHelpers