assign string to enum member

C

Cody Manix

is there a way to explicitly assign a name to an enum member?
what about internationalisation? one must be able to change the text.

i'd like to implemtent it this way:

enum Color =
{
Red="Rot",
Green="Grün",
Blue="Blau"
};

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu
[noncommercial and no ****ing ads]
 
J

Jon Skeet

Cody Manix said:
is there a way to explicitly assign a name to an enum member?
what about internationalisation? one must be able to change the text.

i'd like to implemtent it this way:

enum Color =
{
Red="Rot",
Green="Grün",
Blue="Blau"
};

Assigning a single name to it doesn't help much in terms of
internationalisation - you basically need to be able to do a resource
lookup from the enum name to the user text.

You can apply the Description attribute to enum members, I believe -
that may help you, depending on your needs.
 
C

Cody Manix

enum Color =
You can apply the Description attribute to enum members, I believe -
that may help you, depending on your needs.

i have a combobox where i want to fill the enumeration members in. the
display content of the combobox should vary dependant oo the current
culture.


--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu
[noncommercial and no ****ing ads]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top