Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Class Year

OptimaJet.Workflow.Core.Runtime.Calendars.Year

Represents workday settings for a calendar year.

public class Year

Inheritance

  • Object

Properties

Name
Type
YearNumber #
Int32
Gets 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
day
DateTime
The day to check.
weekend
Boolean
true if the day is a weekend in the base calendar; otherwise, false.

Returns

Type
Description
Boolean
true 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
day
DateTime
The 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
year
Int32
The year number.

Returns

Type
Description
Year
A new Year for the specified year.
public Year SetHolidays(params MonthDay[] holidays) #
Adds holidays to this year.

Parameters

Name
Type
Description
holidays
MonthDay[]
The holidays to add.

Returns

Type
Description
Year
This Year to support fluent configuration.
public Year SetHoliday(Months month, int day) #
Adds a holiday to this year.

Parameters

Name
Type
Description
month
Months
The month that contains the holiday.
day
Int32
The day number in month.

Returns

Type
Description
Year
This Year to support fluent configuration.
public Year SetWorkdays(params Workday[] workdays) #
Adds individual workdays to this year.

Parameters

Name
Type
Description
workdays
Workday[]
The workday definitions to add.

Returns

Type
Description
Year
This 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
month
Months
The month that contains the workday.
day
Int32
The day number in month.
startTimeOfDay
TimeSpan
The start time of the workday.
workingHours
TimeSpan
The working duration for the day.

Returns

Type
Description
Year
This 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
obj
Object
The object to compare with this instance.

Returns

Type
Description
Boolean
true if the specified object is a Year and has the same year number, holidays, and workdays; otherwise, false.
public override int GetHashCode() #
Returns a hash code for this Year.

Returns

Type
Description
Int32
A hash code based on the year number, holidays, and workday settings.