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

How to localize Enum members?

P: n/a
Does dot net frame prevoid any support for localizing
Enum memebers? For example:
enum Alignment
{
Left,
Right
}

string left = Alignment.Left.ToString();
left is "Left", how to localize it?
Nov 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Jerry,
Does dot net frame prevoid any support for localizing
Enum memebers? For example:
enum Alignment
{
Left,
Right
}

string left = Alignment.Left.ToString();
left is "Left", how to localize it?


Do you mean: in the property grid?

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 16 '05 #2

P: n/a
Implement it by TypeConvert in PropertyGrid? I mean any place.
"Jochen Kalmbach" <no********************@holzma.de> wrote in message
news:Xn*********************************@127.0.0.1 ...
Hi Jerry,
Does dot net frame prevoid any support for localizing
Enum memebers? For example:
enum Alignment
{
Left,
Right
}

string left = Alignment.Left.ToString();
left is "Left", how to localize it?


Do you mean: in the property grid?

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 16 '05 #3

P: n/a
Hi Jerry,
Implement it by TypeConvert in PropertyGrid? I mean any place.


"Any place" ???

Do you mean you want to localize your source-code?
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 16 '05 #4

P: n/a
No. Actually, I want initialize the comboBox by the localized member string.
"Jochen Kalmbach" <no********************@holzma.de> wrote in message
news:Xn*********************************@127.0.0.1 ...
Hi Jerry,
Implement it by TypeConvert in PropertyGrid? I mean any place.


"Any place" ???

Do you mean you want to localize your source-code?
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 16 '05 #5

P: n/a
HiJerry,
No. Actually, I want initialize the comboBox by the localized member
string.


Just write a small wrapper-class, and put this class into the ComboBox
instead of the enum directly:

class EnumLocalizer {
public EnumLocalizer(ResourceManager rm, MyEnum e)
{
this.Value = e;
this.rm = rm;
}

public MyEnum Value;
private ResourceManager rm;

public override string ToString()
{
string r = rm.GetString(e.ToString());
if ( (r == null) || (r.Length <= 0) )
return "<" + e.ToString() + ">";
return r;
}
}
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.