As mentioned above, enumerations cannot be strings (or anything else but integers) in C #. I assume you came from Java? It would be nice if .NET had this function, where enums can be of any type.
As I usually get around this, use a static class:
public static class MyValues { public static string ValueA { get { return "A"; } } public static string ValueB { get { return "B"; } } }
Using this technique you can also use any type. You can call it the same way you used enumerations:
if (value == MyValues.ValueA) {
source share