Re: Culture neutral Description Attribute?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 08/30/04


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


Relevant Pages

  • Jtable cell navigation problem
    ... I hava a jtable with custom controls and there are two kinds of custom ... One is derived from jtextfield and the other one derives ... After that i've tried to capture the tab key in the text field on ...
    (comp.lang.java.gui)
  • Re: Help on Creating a Custom Permission
    ... It is the first bit of news that I have found that explains why the custom ... >> Does anyone have any advice on how to create my own Custom Permission? ... > PrincipalPermissionAttribute currently derives from ... > CodeAccessSecurityAttribute, even though it's not related to code access ...
    (microsoft.public.dotnet.security)
  • Re: child type cannot be used as generic type parameter
    ... KlientEntity derives from KlientBase ... Jon Skeet - ... If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: child type cannot be used as generic type parameter
    ... KlientEntity derives from KlientBase ... Jon Skeet - ... If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)