캘린더 예외 검색
Contents
[
Hide
Show
]달력 검색 예외
캘린더 클래스는 캘린더 렉스 컨셉 객체 목록을 나타내는 예외 속성을 노출시킵니다. Calendarexception에 의해 노출 된 Fromdate 및 Todate 속성은 달력 예외에 대한 날짜를 검색하는 데 사용됩니다. 이 두 속성 모두 DateTime Datatype을 지원합니다.
다음 코드 예제는 달력 예외를 검색하는 방법을 보여줍니다.
1System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName());
2
3// Create project instance
4System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"project_RetrieveExceptions_test.mpp");
5
6// Access calendars
7
8{
9 auto cal_enumerator = (project1->get_Calendars())->GetEnumerator();
10 decltype(cal_enumerator->get_Current()) cal;
11 while (cal_enumerator->MoveNext() && (cal = cal_enumerator->get_Current(), true))
12 {
13 // Access calendar exceptions
14 auto calExc_enumerator = (cal->get_Exceptions())->GetEnumerator();
15 decltype(calExc_enumerator->get_Current()) calExc;
16 while (calExc_enumerator->MoveNext() && (calExc = calExc_enumerator->get_Current(), true))
17 {
18 System::Console::WriteLine(System::String(u"From: ") + calExc->get_FromDate().ToShortDateString());
19 System::Console::WriteLine(System::String(u"To: ") + calExc->get_ToDate().ToShortDateString());
20 }
21 }
22}