Setting the enum from it's name
I've changed this a bit due to some comments
1: enum Directions
2: { 3: Up, 4: Down, 5: Left, 6: Right 7: }8: void DoSomething()
9: { 10: 11: Directions currentState =(Directions) Enum.Parse(typeof(Directions), "Down");
12: }