Trabajar con tareas estimadas y hitos

En el proyecto Microsoft, los hitos se utilizan para monitorear el progreso de un proyecto. Los hitos son puntos cruciales en el proyecto. Por lo general, un hito es una tarea sin duración, pero cualquier tarea puede marcarse como un hito. Aspose.Tasks for C ++ API te ayuda a administrar hitos.

Trabajando con hitos

La clase TSK expone las propiedades ISestimated e Ismilestone para administrar tareas estimadas e hitos:

Visualización de tareas estimadas e hitos en el proyecto Microsoft

Para ver si una tarea es estimaciones de marcada como un hito en el proyecto de Microsoft, se puede hacer doble clic en una tarea en el formulario de entrada de tarea:

Marcar una tarea estimada como un hito en el proyecto Microsoft

Descubrir si se estima una tarea o un hito

El siguiente ejemplo del código demuestra cómo averiguar si se estima una tarea o un hito usando Aspose.Tasks.

 1// Read project from file stream
 2System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName());
 3System::SharedPtr<System::IO::FileStream> fs = System::MakeObject<System::IO::FileStream>(dataDir + u"EstimatedMilestoneTasks.mpp", System::IO::FileMode::Open);
 4System::SharedPtr<Project> prj = System::MakeObject<Project>(fs);
 5fs->Close();
 6    
 7// Create a ChildTasksCollector instance
 8System::SharedPtr<ChildTasksCollector> collector = System::MakeObject<ChildTasksCollector>();
 9    
10// Collect all the tasks from RootTask using TaskUtils
11TaskUtils::Apply(prj->get_RootTask(), collector, 0);
12    
13// Parse through all the collected tasks
14    
15{
16    auto tsk1_enumerator = (collector->get_Tasks())->GetEnumerator();
17    decltype(tsk1_enumerator->get_Current()) tsk1;
18    while (tsk1_enumerator->MoveNext() && (tsk1 = tsk1_enumerator->get_Current(), true))
19    {
20        System::String strEst = tsk1->Get<NullableBool>(Tsk::IsEstimated()).get_Value() ? System::String(u"Estimated") : System::String(u"Non-Estimated");
21        System::String strMileStone = tsk1->Get<NullableBool>(Tsk::IsMilestone()).get_Value() ? System::String(u"Milestone") : System::String(u"Non-Milestone");
22        System::Console::WriteLine(tsk1->Get(Tsk::Name()) + u" : " + strEst);
23        System::Console::WriteLine(tsk1->Get(Tsk::Name()) + u" : " + strMileStone);
24    }
25}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.