471,317 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Overriden attribute does not work on overriden methods

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

Dec 3 '05 #1
0 903

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Gabriel Genellina | last post: by
reply views Thread by Michele Simionato | last post: by
4 posts views Thread by Donnal Walter | last post: by
5 posts views Thread by Soledad Vel | last post: by
6 posts views Thread by Adam Donahue | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.