Class Year
OptimaJet.Workflow.Core.Runtime.Calendars.Year
Represents workday settings for a calendar year.
Namespace: OptimaJet.Workflow.Core.Runtime.Calendars
public class YearInheritance
- Object
Properties
Name
Type
YearNumber #Int32Gets the calendar year number.
Holidays #List<MonthDay>Gets the holidays configured for the year.
Workdays #List<Workday>Gets the individual workdays configured for the year.
Methods
public bool IsWorkday(DateTime day, bool weekend) #Determines whether the specified day is a working day.
Parameters
Name
Type
Description
dayDateTimeThe day to check.
weekendBooleantrue if the day is a weekend in the base calendar; otherwise, false.Returns
Type
Description
Booleantrue if the day is a working day; otherwise, false.public TimeSpan? GetDayTime(DateTime day) #Gets the configured end time of a working day.
Parameters
Name
Type
Description
dayDateTimeThe day to query.
Returns
Type
Description
Nullable<TimeSpan>The end time for the working day on the given date, or
null if no matching workday is configured.public static Year Create(int year) #Creates a new Year instance.
Parameters
Name
Type
Description
yearInt32The year number.
Returns
Type
Description
YearA new Year for the specified year.
public Year SetHolidays(params MonthDay[] holidays) #Adds holidays to this year.
Parameters
Name
Type
Description
holidaysMonthDay[]The holidays to add.
Returns
Type
Description
YearThis Year to support fluent configuration.
public Year SetHoliday(Months month, int day) #Adds a holiday to this year.
Parameters
Name
Type
Description
monthMonthsThe month that contains the holiday.
dayInt32The day number in
month.Returns
Type
Description
YearThis Year to support fluent configuration.
public Year SetWorkdays(params Workday[] workdays) #Adds individual workdays to this year.
Parameters
Name
Type
Description
workdaysWorkday[]The workday definitions to add.
Returns
Type
Description
YearThis Year to support fluent configuration.
public Year SetWorkday(Months month, int day, TimeSpan startTimeOfDay, TimeSpan workingHours) #Adds a single workday definition to this year.
Parameters
Name
Type
Description
monthMonthsThe month that contains the workday.
dayInt32The day number in
month.startTimeOfDayTimeSpanThe start time of the workday.
workingHoursTimeSpanThe working duration for the day.
Returns
Type
Description
YearThis Year to support fluent configuration.
public override bool Equals(object obj) #Determines whether the specified object is equal to this Year.
Parameters
Name
Type
Description
objObjectThe object to compare with this instance.
Returns
Type
Description
Booleantrue if the specified object is a Year and has the same year number, holidays, and workdays; otherwise, false.