By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

Regionalisation of attributes?

P: n/a
I have an attribute Description applied to the public interface items
of my usercontrol so that the developer knows what each property is
for e.g.:

'------------------------------------------------------------------------
<Description("Sets the spooler pooling interval"> _
Public Property Timeslice As Integer
'...
End Property

'------------------------------------------------------------------------

How do I make it so that the description will appear in French on a
French developer's machine etc.?

Thanks in advance,
Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Merrion,
I wish I had the link handy, I remember an example someplace. :-(

You need to define your own DescriptionAttribute (inheriting from
DescriptionAttribute) and override the Description property. In your
overridden property you would localize the DescriptionValue field.

The only thing I am finding right now is the description of the
DescriptionValue property:
http://msdn.microsoft.com/library/de...ValueTopic.asp

Something along the lines of the DescriptionLocalizableAttribute found in
the Microsoft Content Management Server 2002.
http://msdn.microsoft.com/library/de...classtopic.asp

Hope this helps
Jay
"Merrion" <Du**********@bigfoot.com> wrote in message
news:d5**************************@posting.google.c om...
I have an attribute Description applied to the public interface items
of my usercontrol so that the developer knows what each property is
for e.g.:

'------------------------------------------------------------------------
<Description("Sets the spooler pooling interval"> _
Public Property Timeslice As Integer
'...
End Property

'------------------------------------------------------------------------

How do I make it so that the description will appear in French on a
French developer's machine etc.?

Thanks in advance,
Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

Jul 19 '05 #2

P: n/a
Thatnks - inheriting from DescriptionAttribute worked. Ironic that
the word Localizable should itself need Locali(s/z)ing.

Have done the same for CategoryAttribute and overriden
"GetLocalizedString" as per the documentation...but is it possible for
an attribute to get the type name of the thing it is applied to? The
reason being that the resourcemanager that returns the description and
category attribute needs to know which component type it is being
called to return the localised string for.

Thanks in advance,
Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message news:<eU**************@TK2MSFTNGP12.phx.gbl>...
Merrion,
I wish I had the link handy, I remember an example someplace. :-(

You need to define your own DescriptionAttribute (inheriting from
DescriptionAttribute) and override the Description property. In your
overridden property you would localize the DescriptionValue field.

The only thing I am finding right now is the description of the
DescriptionValue property:
http://msdn.microsoft.com/library/de...ValueTopic.asp

Something along the lines of the DescriptionLocalizableAttribute found in
the Microsoft Content Management Server 2002.
http://msdn.microsoft.com/library/de...classtopic.asp

Hope this helps
Jay
"Merrion" <Du**********@bigfoot.com> wrote in message
news:d5**************************@posting.google.c om...
I have an attribute Description applied to the public interface items
of my usercontrol so that the developer knows what each property is
for e.g.:

'------------------------------------------------------------------------
<Description("Sets the spooler pooling interval"> _
Public Property Timeslice As Integer
'...
End Property

'------------------------------------------------------------------------

How do I make it so that the description will appear in French on a
French developer's machine etc.?

Thanks in advance,
Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

Jul 19 '05 #3

P: n/a
Merrion,
Add a parameter to your derived class's constructor that is the type that
the Attribute is being applied to. Similar to the DefaultValueAttribute.

MyDescriptionAttribute(Type,String)

Hope this helps
Jay

"Merrion" <Du**********@bigfoot.com> wrote in message
news:d5**************************@posting.google.c om...
Thatnks - inheriting from DescriptionAttribute worked. Ironic that
the word Localizable should itself need Locali(s/z)ing.

Have done the same for CategoryAttribute and overriden
"GetLocalizedString" as per the documentation...but is it possible for
an attribute to get the type name of the thing it is applied to? The
reason being that the resourcemanager that returns the description and
category attribute needs to know which component type it is being
called to return the localised string for.

Thanks in advance,
Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in

message news:<eU**************@TK2MSFTNGP12.phx.gbl>...
Merrion,
I wish I had the link handy, I remember an example someplace. :-(

You need to define your own DescriptionAttribute (inheriting from
DescriptionAttribute) and override the Description property. In your
overridden property you would localize the DescriptionValue field.

The only thing I am finding right now is the description of the
DescriptionValue property:
http://msdn.microsoft.com/library/de...ValueTopic.asp
Something along the lines of the DescriptionLocalizableAttribute found in the Microsoft Content Management Server 2002.
http://msdn.microsoft.com/library/de...classtopic.asp
Hope this helps
Jay
"Merrion" <Du**********@bigfoot.com> wrote in message
news:d5**************************@posting.google.c om...
I have an attribute Description applied to the public interface items
of my usercontrol so that the developer knows what each property is
for e.g.:

'------------------------------------------------------------------------ <Description("Sets the spooler pooling interval"> _
Public Property Timeslice As Integer
'...
End Property

'------------------------------------------------------------------------
How do I make it so that the description will appear in French on a
French developer's machine etc.?

Thanks in advance,
Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.