net90_PropertyGridHelpers.Converters_OnlySelectableTypeConverter - dparvin/PropertyGridHelpers GitHub Wiki
Provides a type converter that restricts input to selectable values only.
public class OnlySelectableTypeConverter : StringConverter
name | description |
---|---|
OnlySelectableTypeConverter() | The default constructor. |
override ConvertFrom(…) | Converts from a string to a element in an Enum. |
override GetStandardValues(…) | Returns a list of resource paths found in the current instance’s assembly, suitable for selection in a property grid editor or a dropdown. |
override GetStandardValuesExclusive(…) | |
override GetStandardValuesSupported(…) |
This converter is used with the ResourcePathEditor
to prevent users from manually editing text in the PropertyGrid, while still allowing selection from a predefined dropdown list.
[AllowBlank(includeItem: true, resourceItem: "Blank_ResourcePath")]
[LocalizedCategory("Category_TestItems")]
[LocalizedDescription("Description_ResourcePath")]
[LocalizedDisplayName("DisplayName_ResourcePath")]
[Editor(typeof(ResourcePathEditor), typeof(UITypeEditor))]
[TypeConverter(typeof(OnlySelectableTypeConverter))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public string ResourcePath { get; set; }
- class AllowBlankAttribute
- class ResourcePathEditor
- namespace PropertyGridHelpers.Converters
- assembly PropertyGridHelpers
- OnlySelectableTypeConverter.cs