assign string to enum member

  • Thread starter Thread starter Cody Manix
  • Start date Start date
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]
 
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.
 
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]
 
Back
Top