My control inherites from ScrollableControl and overrides the BackColor
property. The DescriptionFromAttribute inherits from the
DescriptionAttribute to return localized information. The same for the
CategoryFrom.
______________________________________
[CategoryFrom("Behavior"), DescriptionFrom("BackColorDescription"),
DefaultValue(typeof(Color), "Color.WhiteSmoke")]
public override Color BackColor
{
...
}
______________________________________
The definition of the DescriptionFrom class is (for your information):
______________________________________
public class DescriptionFromAttribute :
System.ComponentModel.DescriptionAttribute
{
public DescriptionFromAttribute(string attribute) : base(attribute)
{
this.attribute = attribute;
}
protected string attribute;
public override string Description
{
get
{
return this.DescriptionValue = Resources.GetString(attribute);
}
}
}
}
______________________________________
These inherited attributes work well for user-defined properties and do
return localized information but not for overriden properties. Is it a
bug or is it my code?
Thanks for your help.
_______________________________________
Francois M.Vanderseypen
The Netron Project - Generic diagramming, graph-drawing and
graph-layout kit for .Net
http://www.netronproject.com