Class ChildTasksCollector

ChildTasksCollector class

Collects all child tasks.

public class ChildTasksCollector : TreeAlgorithmBase<Task>

Constructors

NameDescription
ChildTasksCollector()Initializes a new instance of the ChildTasksCollector class.

Properties

NameDescription
Tasks { get; }Gets a list collected child objects (tasks).

Methods

NameDescription
override Alg(Task, int)Processes the specified object.
virtual PostAlg(Task, int)
virtual PreAlg(Task, int)

Examples

Shows how to iterate over all tasks in a project as a plain list.

var project = new Project(DataDir + "ParentChildTasks.mpp");

var collector = new ChildTasksCollector();
TaskUtils.Apply(project.RootTask, collector, 0);

// Parse through all the collected tasks
foreach (var task in collector.Tasks)
{
    Console.WriteLine(task.Get(Tsk.Name));
}

See Also