Posted on 2004-04-07
I have the following enumeration:
public enum collection1
red = 32,
orange = 45
public enum collection2
red = 31,
orange = 44
i have a constructor which takes an enum for construction of the object.
public myObject(Enum collection)
// Here i need the name of the enum.
// Which i am able to get like this.
string strEnumName = collection.GetType().Name;
// I also need the value for this enumeration.
// for example the user passes in : myCollection.collection1.red
// ????? How can i get the value of red for this enumeration.
// here i should be able to get the value for red, which is: 32
// PLEASE HELP.