Re: Culture neutral Description Attribute?
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 08/30/04
- Next message: Mel Weaver: "Adding a new row"
- Previous message: Jon Skeet [C# MVP]: "Re: Convert byte array to string"
- In reply to: Vagabond Software: "Culture neutral Description Attribute?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 30 Aug 2004 20:11:36 +0100
Vagabond Software <carlfenley-X-@-X-san.rr.com> wrote:
> I have added a few custom Description Attributes to an assembly. I
> have read that in order to make those Attributes culture neutral, I
> would have to create a custom Attribute class derived from
> System.ComponentModel.DescriptionAttribute and override the
> Description property to perform the appropriate lookup.
>
> This seems to break on of the 'Attribute' rules, that all attributes
> should be derived from System.Attribute.
It doesn't break it at all, as DescriptionAttribute derives from
Attribute.
> Though I can derive a class from either, it is not obvious to me how
> to perform the "appropriate lookup".
Well, presumably you'd read the appropriate version of all the
descriptions from the resources, and then return the one from the
required culture.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Mel Weaver: "Adding a new row"
- Previous message: Jon Skeet [C# MVP]: "Re: Convert byte array to string"
- In reply to: Vagabond Software: "Culture neutral Description Attribute?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|