Managing Estimated and Milestone Tasks
Contents
[
Hide
Show
]In Microsoft Project, milestones are used to monitor a project’s progress. Milestones are crucial points in the project. Typically, a milestone’s a task with no duration but any task can be marked as a milestone. Aspose.Tasks helps you manage milestones.
Working with Milestones
The Task class exposes the IsEstimated and IsMilestone properties to manage estimated and milestone tasks:
- IsEstimated: set and get whether a task is estimated (boolean).
- IsMilestone: set and get whether a task is a milestone (boolean).
Viewing Estimated and Milestone Tasks in Microsoft Project
To check whether a task is estimates of marked as a milestone in Microsoft Project one need to double-click on a task in the Task Entry form:
Finding out Whether a Task is Estimated or a Milestone
The following code examples show how to find out whether a task is estimated or a milestone using Aspose.Tasks.
1Project project = new Project("New Project.mpp");
2
3// Create a ChildTasksCollector instance
4ChildTasksCollector collector = new ChildTasksCollector();
5
6// Collect all the tasks from RootTask using TaskUtils
7TaskUtils.Apply(project.RootTask, collector, 0);
8
9// Parse through all the collected tasks
10foreach (Task task in collector.Tasks)
11{
12 string strEst = (task.Get(Tsk.IsEstimated)) ? "Estimated" : "Non-Estimated";
13 string strMileStone = (task.Get(Tsk.IsMilestone)) ? "Milestone" : "Non-Milestone";
14 Console.WriteLine(task.Get(Tsk.Name) + " : " + strEst);
15 Console.WriteLine(task.Get(Tsk.Name) + " : " + strMileStone);
16}