Detente y reanude una tarea

La fecha de parada de una tarea es la fecha en que debería (o hizo) terminar. A veces, una tarea debe detenerse temporalmente y luego reanudarse más tarde. Microsoft Project puede calcular las fechas de parada o permitir que los usuarios las ingresen manualmente.

Trabajar con tareas paradas y reanudadas

La parada y currículum las propiedades expuestas por la clase TSK se utilizan para leer o escribir la fecha de detención y reanudación de una tarea:

Vista del proyecto de Microsoft de fechas de parada y currículum

To see a task’s stop and resume dates:

  1. In the Task Entry form, on the Insert menu, select Column.

  2. Add the Stop and Resume columns.

Getting Stop and Resume Dates

The stop and resume dates are NA if the task has never stopped. For date values equal to NA, Aspose.Tasks takes the value “1/1/2000” if you’re using the evaluation version. When fully licensed, Aspose.Tasks uses DateTime.MinValue for NA values. The following examples display the stop and resume dates for all the tasks in a project.

 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// Check Stop and Resume dates for all tasks
10foreach (Task task in collector.Tasks)
11{
12    if (task.Get(Tsk.Stop).ToShortDateString() == "1/1/2000")
13        Console.WriteLine("Stop: NA");
14    else
15        Console.WriteLine("Stop: " + task.Get(Tsk.Stop).ToShortDateString());
16
17    if (task.Get(Tsk.Resume).ToShortDateString() == "1/1/2000")
18        Console.WriteLine("Resume: NA");
19    else
20        Console.WriteLine("Resume: " + task.Get(Tsk.Resume).ToShortDateString());
21}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.