Found the answer:
foreach (string volume in Enum.GetNames(typeof(Volume)))
{
Console.WriteLine("Volume Member: {0}\n Value: {1}",
volume, (byte)Enum.Parse(typeof(Volume), volume));
}
In my specific case, I used:
foreach (var test in Enum.GetNames(typeof(TableDesign))) {
testMethod(documentWord, test);
}
and in the testMethod method:
tableTest.Design = (TableDesign) Enum.Parse(typeof(TableDesign), test);
It worked without problems (even if it was slow, but I just wanted to get things fast (and the performance of onetimer doesn't matter).
Perhaps this will help someone in the future :-)
source
share