|
using System;
namespace TreeStructuredEnumerations
{
class Program
{
private static void DumpTree(AnimalKind parent, Int32 level)
{
foreach (AnimalKind animalKind in EnumUtility.CreateList(parent))
{
string caption = animalKind.ToString();
int width = caption.Length;
string output = caption.PadLeft(width + level, ' ');
Console.WriteLine(output);
DumpTree(animalKind, level + 1);
}
}
static void Main()
{
DumpTree(AnimalKind.Unknown, 0);
Console.ReadKey();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.