System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName()); System::SharedPtr project1 = System::MakeObject(dataDir + u"Project2.mpp"); // Create a ChildTasksCollector instance System::SharedPtr collector = System::MakeObject(); // Collect all the tasks from RootTask using TaskUtils TaskUtils::Apply(project1->get_RootTask(), collector, 0); // Parse through all the collected tasks { auto tsk1_enumerator = (collector->get_Tasks())->GetEnumerator(); decltype(tsk1_enumerator->get_Current()) tsk1; while (tsk1_enumerator->MoveNext() && (tsk1 = tsk1_enumerator->get_Current(), true)) { if (tsk1->Get(Tsk::ConstraintDate()).ToShortDateString() == u"1/1/2000") { System::Console::WriteLine(u"NA"); } else { System::Console::WriteLine(tsk1->Get(Tsk::ConstraintDate()).ToShortDateString()); } System::Console::WriteLine(System::ObjectExt::ToString(tsk1->Get(Tsk::ConstraintType()))); } }