Retrieving Calendar Exceptions

Contents
[ Hide Show ]

Retrieving Calendar Exceptions

The Calendar class exposes the Exceptions property which represents a list of CalendarException objects. The FromDate and ToDate properties exposed by CalendarException are used to retrieve dates for calendar exceptions.

The following example retrieves calendar exceptions.

 1Project project = new Project("New Project.mpp");
 2
 3// Access calendars
 4foreach (Calendar cal in project.Calendars)
 5{
 6    // Access calendar exceptions
 7    foreach (CalendarException calExc in cal.Exceptions)
 8    {
 9        Console.WriteLine("From: " + calExc.FromDate.ToShortDateString());
10        Console.WriteLine("To: " + calExc.ToDate.ToShortDateString());
11    }
12}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.