-
Notifications
You must be signed in to change notification settings - Fork 1
net90_PropertyGridHelpers.Attributes_LocalizedCategoryAttribute
dparvin edited this page Jun 29, 2025
·
13 revisions
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. |
| name | description |
|---|---|
| LocalizedCategoryAttribute(…) | Attribute for specifying a localized category name for a property or event. |
| static Get(…) | Gets the LocalizedCategoryAttribute from the specified context. |
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.
[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;
}
}- class LocalizedTextAttribute
- namespace PropertyGridHelpers.Attributes
- assembly PropertyGridHelpers
- LocalizedCategoryAttribute.cs