public static void Run()
{
// ExStart:ReadParentChildTasks
// Create project instance
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName);
Project project1 = new Project(dataDir + "ParentChildTasks.mpp");
// Create a ChildTasksCollector instance
ChildTasksCollector collector = new ChildTasksCollector();
// Collect all the tasks from RootTask using TaskUtils
TaskUtils.Apply(project1.RootTask, collector, 0);
// Parse through all the collected tasks
foreach (Task tsk1 in collector.Tasks)
{
Console.WriteLine(tsk1.Get(Tsk.Name));
}
// ExEnd:ReadParentChildTasks
}
}