net90_PropertyGridHelpers.UIEditors_FlagEnumUIEditor - dparvin/PropertyGridHelpers GitHub Wiki
A reusable UITypeEditor for editing [Flags]-decorated enums in a PropertyGrid using a drop-down checklist.
public class FlagEnumUIEditor : DropDownVisualizer<FlagCheckedListBox>
name | description |
---|---|
FlagEnumUIEditor() | Initializes a new instance of the FlagEnumUIEditor class, configuring the drop-down checklist style. |
This editor hosts a FlagCheckedListBox
inside a drop-down and is intended for use with enumerations marked with the FlagsAttribute. The drop-down allows users to select multiple values by checking corresponding options. The control handles bitwise logic internally, updating the composite enum value based on the user's selection. Example usage:
[Editor(typeof(FlagEnumUIEditor), typeof(UITypeEditor))]
public MyFlagsEnum Options { get; set; }
To customize the display text for enum values, consider using FlagEnumUIEditor
with an EnumConverter.
- class DropDownVisualizer<TControl>
- class FlagCheckedListBox
- namespace PropertyGridHelpers.UIEditors
- assembly PropertyGridHelpers
- FlagEnumUIEditor.cs