Enum DayType

DayType enumeration

Specifies the day of a week.

public enum DayType

Values

NameValueDescription
Exception0Indicates Exception day type.
Sunday1Indicates Sunday day type.
Monday2Indicates Monday day type.
Tuesday3Indicates Tuesday day type.
Wednesday4Indicates Wednesday day type.
Thursday5Indicates Thursday day type.
Friday6Indicates Friday day type.
Saturday7Indicates Saturday day type.

Examples

Shows how to define a new calendar, add week days to it and define working times for days.

var project = new Project();

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

// Add working days monday through thursday with default timings
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Monday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Tuesday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Wednesday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Thursday));
calendar.WeekDays.Add(new WeekDay(DayType.Saturday));
calendar.WeekDays.Add(new WeekDay(DayType.Sunday));

// Set friday as short working day
var weekDay = new WeekDay(DayType.Friday);

// Sets working time. Only time part of DateTime is important
var workingTime = new WorkingTime(9, 12);
var workingTime2 = new WorkingTime(13, 16);
weekDay.WorkingTimes.Add(workingTime);
weekDay.WorkingTimes.Add(workingTime2);
weekDay.DayWorking = true;
calendar.WeekDays.Add(weekDay);

// working with the project...

See Also