TaskUtils class

Helper class which provides useful operations with tasks.

public static class TaskUtils


static Apply(Task, ITreeAlgorithm<Task>, int)Applies specified algorithm to each task of a tree.
static Filter(Task, ICondition<Task>)Builds new tree of tasks which satisfy the condition.
static Find(Task, ICondition<Task>)Finds a task which satisfy the condition in a tree of tasks.
static TaskChildrenCount(Task)Recursively calculates a number of task’s children tasks through all levels.


Shows how to work with a tree algorithm.

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

// gather all project tasks
var coll = new ChildTasksCollector();
TaskUtils.Apply(project.RootTask, coll, 0);

// work with tasks as with a plain list
foreach (var task in coll.Tasks)
    Console.WriteLine("Task Name: " + task.Get(Tsk.Name));

See Also