TaskUtils.Apply
Contents
[
Hide
]TaskUtils.Apply method
Applies specified algorithm to each task of a tree.
public static void Apply(Task root, ITreeAlgorithm<Task> alg, int level)
Parameter | Type | Description |
---|---|---|
root | Task | Root of the tree |
alg | ITreeAlgorithm`1 | Applied algorithm. |
level | Int32 | Level of the root task. |
Examples
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
- class Task
- interface ITreeAlgorithm<T>
- class TaskUtils
- namespace Aspose.Tasks.Util
- assembly Aspose.Tasks