string to enum
How do you convert a string into an enumeration?
object Enum.Parse(System.Type enumType, string value, bool ignoreCase);
example:
enum Colour{
Red,
Green,
Blue
}
Colour c = (Colour) Enum.Parse(typeof(Colour), "Red", true); Console.WriteLine("Colour Value: {0}", c.ToString());
source: http://blogs.msdn.com/tims/archive/2004/04/02/106310.aspx