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. |
override GetStandardValues(…) | Gets a list of resource paths. |
override GetStandardValuesExclusive(…) | Gets the standard values exclusive. |
override GetStandardValuesSupported(…) | Gets the standard values supported. |
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