net472_PropertyGridHelpers.Attributes_ResourcePathAttribute - dparvin/PropertyGridHelpers GitHub Wiki

ResourcePathAttribute class

Specifies a resource path for use with the ImageTextUIEditor class.

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Property)]
public class ResourcePathAttribute : Attribute

Public Members

name description
ResourcePathAttribute(…) Initializes a new instance of the ResourcePathAttribute class with the specified resource path.
static Get(…) Gets the ResourcePathAttribute for the specified Enum value.
ResourceAssembly { get; } Gets the resource assembly.
ResourcePath { get; } Gets the resource path associated with the property or enum value.
GetAssembly() Resolves the assembly object from the stored assembly name.

Remarks

This attribute is applied to properties or enum values to specify the resource path that the ImageTextUIEditor should use when displaying images. It can also be applied to classes for use with the LocalizedTypeDescriptionProvider to specify the resource path for localized text for the Categories, Descriptions and Display names.

Examples

[ResourcePath(nameof(TestControl))]
[TypeDescriptionProvider(typeof(LocalizedTypeDescriptionProvider))]
public partial class TestControl : UserControl
{
    [LocalizedCategory("Category_Layout")]
    [LocalizedDescription("Description_Scrollbar")]
    [LocalizedDisplayName("DisplayName_Scrollbar")]
    [Editor(typeof(FlagEnumUIEditor<EnumTextConverter<ScrollBars>>), typeof(UITypeEditor))]
    [TypeConverter(typeof(EnumTextConverter<ScrollBars>))]
    [DefaultValue(ScrollBars.None)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
    [EditorBrowsable(EditorBrowsableState.Always)]
    [Bindable(true)]
    public ScrollBars Scrollbars
    {
        get => _Scrollbars;
        set => _Scrollbars = value;
    }
}

See Also

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