net90_PropertyGridHelpers.UIEditors_FlagEnumUIEditor 1 - dparvin/PropertyGridHelpers GitHub Wiki
A generic UITypeEditor for editing flag-style enums in a PropertyGrid, with support for customized display text using a specified EnumConverter.
public class FlagEnumUIEditor<T> : DropDownVisualizer<FlagCheckedListBox>
where T : EnumConverter, new()
parameter | description |
---|---|
T | The EnumConverter type used to convert enum values to user-friendly display text. Must have a parameterless constructor. |
name | description |
---|---|
FlagEnumUIEditor() | Initializes a new instance of the FlagEnumUIEditor class. |
This editor uses a FlagCheckedListBox
hosted in a dropdown and allows multiple values to be selected for enums decorated with the FlagsAttribute. The generic parameter T allows you to specify a custom converter, such as EnumTextConverter
, to localize or stylize enum values. Example:
[Editor(typeof(FlagEnumUIEditor<EnumTextConverter<MyEnum>>), typeof(UITypeEditor))]
[TypeConverter(typeof(EnumTextConverter<MyEnum>))]
public MyEnum Options { get; set; }
- class DropDownVisualizer<TControl>
- class FlagEnumUIEditor
- class FlagCheckedListBox
- class EnumTextConverter<T>
- namespace PropertyGridHelpers.UIEditors
- assembly PropertyGridHelpers
- FlagEnumUIEditor.cs