private static void ListEnum(Type _enum)
{
Console.WriteLine("enum " + _enum.Name);
Console.WriteLine("{");
string[] foo = Enum.GetNames(_enum);
Array bar = Enum.GetValues(_enum);
for(int i =0;i<foo.Length; i++)
{
Console.WriteLine(
foo[i] + " = " +
((int)bar.GetValue(i)).ToString() + ",");
}
Console.WriteLine("}");
}
Enjoy!