May 3, 2009 20:12
Do you think enums are simple? Well, they are not. Look at the following code
public enum Price
{
None,
Cheap,
Inexpensive = Cheap
}
public static void Main()
{
Console.WriteLine(Price.Inexpensive);
}
Ok so I hear you saying, "It will print Cheap". Cool stuff. You're right! If multiple enum members share the same value, the "main" member acts as a source for ToString. Now we move on - I will just add a few more members.
More...