begin edit #1 ...
An example of including an element of an Enum inside another Enum, and accessing the contents of the included Enum.
public enum someEnum
{
one, two, three, four, five
}
public enum someOtherEnum
{
someEnum, six, seven, eight
}
var enu = (someEnum) someOtherEnum.someEnum;
foreach (var v in Enum.GetValues(enu.GetType()))
{
Console.WriteLine(v + " value = " + Convert.ToInt32(v).ToString());
}
Note that I think using this type of code is a mistake, and that using structs, or static classes, with Constants is a better idea.
end edit #1 ...
Your code suggests to me that you are not quite clear on what Enums are, but you can iterate over the values in the Enum like this:
public enum someEnum
{
one,
two,
three,
four,
five
}
foreach(var v in Enum.GetValues(typeof(someEnum)) as someEnum[])
{
Console.WriteLine(v + " value = " + Convert.ToInt32(v).ToString());
}
You can iterate over the names of the Enum constants like this:
foreach (var v in Enum.GetNames(typeof(someEnum)))
{
Console.WriteLine(v + " value = " + Convert.ToInt32(Enum.Parse(typeof(someEnum), v)).ToString());
}
Now, what is your goal here; what are you trying to do ?