H
hufaunder
I have some enums that I want to convert to strings so they can be
shown on the GUI (using Framework 3.0). The easiest way is using
ToString() but that does not support multiple languages. I am familiar
with custom converters of class objects but how do I achieve this for
enums. For instance:
enum Vehicle { Car, Motorcycle, Train }
Vehicle myVehicle = Vehicle.Car;
1) String value = (String) myVehicle;
2) String value = Convert.ToString(myVehicle)
Both solution 1) or 2) are fine as long as I can do it in some
'standard' way.
Thanks
shown on the GUI (using Framework 3.0). The easiest way is using
ToString() but that does not support multiple languages. I am familiar
with custom converters of class objects but how do I achieve this for
enums. For instance:
enum Vehicle { Car, Motorcycle, Train }
Vehicle myVehicle = Vehicle.Car;
1) String value = (String) myVehicle;
2) String value = Convert.ToString(myVehicle)
Both solution 1) or 2) are fine as long as I can do it in some
'standard' way.
Thanks