net90_PropertyGridHelpers.Attributes_LocalizedCategoryAttribute - dparvin/PropertyGridHelpers GitHub Wiki

LocalizedCategoryAttribute class

Attribute for specifying a localized category name for a property or event.

[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event)]
public class LocalizedCategoryAttribute : LocalizedTextAttribute
parameter description
resourceKey The key used to retrieve the localized category name from the resource file.

Public Members

name description
LocalizedCategoryAttribute(…) Attribute for specifying a localized category name for a property or event.
static Get(…) Gets the LocalizedCategoryAttribute from the specified context.

Remarks

This attribute allows category names displayed in property grids to be localized by retrieving the category name from a resource file. If your class has a ResourcePathAttribute applied to it, the resource key will be looked up in the resource file specified by that attribute.

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** ⚠️