Enum MonthItemType

MonthItemType enumeration

Specifies the month item for which an exception recurrence is scheduled.

public enum MonthItemType

Values

NameValueDescription
Undefined-1Indicates Undefined month item type.
Day0Indicates Day month item type.
Weekday1Indicates Weekday month item type.
WeekendDay2Indicates WeekendDay month item type.
Sunday3Indicates Sunday month item type.
Monday4Indicates Monday month item type.
Tuesday5Indicates Tuesday month item type.
Wednesday6Indicates Wednesday month item type.
Thursday7Indicates Thursday month item type.
Friday8Indicates Friday month item type.
Saturday9Indicates Saturday month item type.

Examples

Shows how to define calendar exception by month day.

var project = new Project(DataDir + "project_test.mpp");

// create a calendar
var calendar = project.Calendars.Add("Calendar1");

// create calendar exception for every friday
var exception = new CalendarException();
exception.Type = CalendarExceptionType.MonthlyByDay;
exception.FromDate = new DateTime(2010, 1, 1);
exception.ToDate = new DateTime(2020, 12, 31);
exception.Month = Month.December;
exception.MonthDay = 1;
exception.MonthItem = MonthItemType.Undefined;
exception.MonthPosition = MonthPosition.Last;
exception.Period = 5;

// check that aa friday is exceptional
Console.WriteLine("Is date an exception date: " + exception.CheckException(new DateTime(2012, 12, 1)));

// add the exception to the calendar
calendar.Exceptions.Add(exception);

See Also