I am using PropertyEditor in .NET 3.5 application to allow users edit settings contained in some serialized class. This application requires localization to support multiple languages. Localized strings implemented using standard .NET Resources.
PropertyEditor requires category, display name and description to be set via attributes. Example below:
[CategoryAttribute("Some category"),
DisplayNameAttribute("Some name"),
DescriptionAttribute("Some description"),
EditorAttribute(typeof(SomeEditor), typeof(System.Drawing.Design.UITypeEditor))]
public SomeType SomeValue {get; set;}
But compiler does not allow me to use resource string in attribute value, changing first line like this:
[CategoryAttribute(Resources.labels.SomeCategory),
Produces error: "The expression being assigned to 'App.Settings.SomeCategory' must be constant."
Can anyone help me how to properly localize property editor in WinForms?