//Use the Iterator Pattern.
//The Runner class creates the family tree structure and stores this in a variant variable, which will at runtime be converted to a Tree type.

Tree family = new Tree(
new Node(new Person("Tom", 1950),
new Node(new Person("Peter", 1976),
new Node(new Person("Sarah", 2000), null,
new Node(new Person("James", 2002), null, null)),
new Node(new Person("Robert", 1978), null,
new Node(new Person("Mark", 1982),
new Node(new Person("Carrie", 2005), null, null),
null))),
null)
);

Console.WriteLine("Full Family");
foreach (Person p in family.Preorder)
{
Console.Write("{0} ", p);
}
Console.WriteLine("\n");

var selection = from p in family
 where p.Birth > 1980
 orderby p.Name select p;

Console.WriteLine("Born after 1980 in alpha order");
foreach (Person p in selection)
{
Console.Write("{0} ", p);
}
Console.WriteLine("\n");