Managing Estimated and Milestone Tasks

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:

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:

is the task a milestone or estimated

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}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.