using System; using System.Collections.Generic; namespace xCommons.Extensions { public static partial class EnumExtensions { public static string GetKey (this Enum source) { return Enum.GetName (source.GetType (), source); } public static T GetValue (this string source) { return (T) Enum.Parse (typeof (T), source); } public static void Iterate (this IEnumerator source, Action action) { // while (source.MoveNext ()) { // var current = source.Current; action (current); } } } }