推定およびマイルストーンのタスクを使用します

Microsoft Projectでは、マイルストーンがプロジェクトの進捗状況を監視するために使用されます。マイルストーンは、プロジェクトの重要なポイントです。通常、マイルストーンは期間のないタスクですが、あらゆるタスクをマイルストーンとしてマークすることができます。 C ++ APIのAspose.Tasksは、マイルストーンを管理するのに役立ちます。

マイルストーンの操作

TSKクラスは、推定タスクとマイルストーンタスクを管理するために、ISESTIMATEDおよびISMILESTONE特性を公開します。

Microsoftプロジェクトの推定およびマイルストーンタスクの表示

マイクロソフトプロジェクトのマイルストーンとしてマークされたタスクであるかどうかを確認するには、タスクエントリフォームのタスクをダブルクリックすることができます。

マイクロソフトプロジェクトのマイルストーンとして推定タスクをマークする

タスクが推定されているかマイルストーンかを見つける

次のコードの例は、タスクが見積もられているかどうか、または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.