net90_PropertyGridHelpers.Converters_OnlySelectableTypeConverter - dparvin/PropertyGridHelpers GitHub Wiki

OnlySelectableTypeConverter class

Provides a type converter that restricts input to selectable values only.

public class OnlySelectableTypeConverter : StringConverter

Public Members

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.

Remarks

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.

Examples

[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; }

See Also

⚠️ **GitHub.com Fallback** ⚠️