TaskChildrenCount

TaskUtils.TaskChildrenCount method

Recursively calculates a number of task’s children tasks through all levels.

public static int TaskChildrenCount(Task task)
ParameterTypeDescription
taskTaskThe task which children calculate.

Return Value

The number of children.

Examples

Shows how to use <see cref=“Aspose.Tasks.Util.TaskUtils.TaskChildrenCount” /> method.

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

// recursively calculates a number of task's children tasks through all levels
var count = TaskUtils.TaskChildrenCount(project.RootTask);

Console.WriteLine("Number of tasks: " + count);

See Also