473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Regionalisation of attributes?

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
3 1547
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

50
by: Dan Perl | last post by:
There is something with initializing mutable class attributes that I am struggling with. I'll use an example to explain: class Father: attr1=None # this is OK attr2= # this is wrong...
1
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
9
by: Soren Kuula | last post by:
Hi, I just can't find namespaces of attributes stated clearly enough in the XML namespace spec. But .. I hear rumors that attributes, unless qualified otherwise, default to the namespace of the...
7
by: Info 3000 | last post by:
Hello, I'm beginner in XML. I have just a little question : I understand that I can write : <Book> <Title> A nice day </Title> <Author> James Nicepen </Author> </Book>
7
by: John R. | last post by:
How do you set the following file attributes: Compressed Encrypted Normal ReparsePoint SparsePoint You CAN'T set these using FileInfo.Attributes or File.SetAttributes. It doesn't work for...
7
by: localhost | last post by:
What is the best and/or fastest way to enumerate attributes of an HTML control? In my page template, I have: <body id="myBody" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0"...
3
by: Janaka | last post by:
I've seen and used some samples where you can set the onclick attrubute to a Button control to get it to do some javascript a la : btnUse.Attributes = "DoSomeJS()"; However when i try and get...
2
by: prabhupr | last post by:
Hi Folks I was reading this article (http://www.dotnetbips.com/articles/displayarticle.aspx?id=32) on "Custom Attribute", written by Bipin. The only thing I did not understand in this article...
2
by: james_027 | last post by:
hi everyone, I am now in chapter 5 of Dive Into Python and I have some question about it. From what I understand in the book is you define class attributes & data attributes like this in python...
2
by: cloftis | last post by:
Using VS2003, VB and MSHTML, Using an HTMLSpanElement I want to enumerate the attributes of a SPAN tag. 1 'For testing sake 2 Dim strMarkup as String = "<span attr1='somevalue'...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.