net90_PropertyGridHelpers.UIEditors_ResourcePathEditor - dparvin/PropertyGridHelpers GitHub Wiki

ResourcePathEditor class

Provides a UITypeEditor that enables selection of embedded resource paths from a dropdown list in the PropertyGrid.

public class ResourcePathEditor : UITypeEditor

Public Members

name description
ResourcePathEditor() Initializes a new instance of the ResourcePathEditor class, using the appropriate resource base name extractor for the current target framework.
override IsDropDownResizable { get; } Gets a value indicating whether the dropdown UI is resizable.
override EditValue(…) Edits the specified value using a dropdown list of resource base names.
override GetEditStyle(…) Returns the editing style of the editor, which is DropDown.
override GetPaintValueSupported(…) Indicates whether this editor supports painting a visual representation of a value.

Remarks

This editor dynamically retrieves available resource paths from the owning assembly and presents them as selectable values. It is commonly used in conjunction with the OnlySelectableTypeConverter to restrict editing to valid, predefined options and to prevent users from manually typing arbitrary values.

Examples

[AllowBlank(includeItem: true, resourceItem: "Blank_ResourcePath")]
[LocalizedCategory("Category_TestItems")]
[LocalizedDescription("Description_ResourcePath")]
[LocalizedDisplayName("DisplayName_ResourcePath")]
[Editor(typeof(ResourcePathEditor), typeof(UITypeEditor))]
[TypeConverter(typeof(OnlySelectableTypeConverter))]
public string ResourcePath { get; set; }

See Also

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