Tsk.PercentComplete

Tsk.PercentComplete field

The current status of a task, expressed as the percentage of the task’s duration that has been completed.

public static readonly Key<int, TaskKey> PercentComplete;

Examples

Shows how to change a task progress by updating of task percent complete.

var project = new Project();
Console.WriteLine("Project Calculation mode is Automatic: {0}", project.CalculationMode.Equals(CalculationMode.Automatic));

var task = project.RootTask.Children.Add("Task");
task.Set(Tsk.Duration, project.GetDuration(2));
task.Set(Tsk.PercentComplete, 50);

// Access tasks and display percentage completion
foreach (var tsk in project.RootTask.Children)
{
    Console.WriteLine(tsk.Get(Tsk.PercentComplete));
    Console.WriteLine(tsk.Get(Tsk.PercentWorkComplete));
    Console.WriteLine(tsk.Get(Tsk.PhysicalPercentComplete));
}

See Also