Class Calendar
Work calendar
Inheritance
↳ object
↳ Calendar
Implements
ICalendar
Inherited Members
Equals(object, object)
GetType()
MemberwiseClone()
ReferenceEquals(object, object)
ToString()
Namespace: OptimaJet.Workflow.Core.Runtime.Calendars
Assembly: OptimaJet.Workflow.Core.dll
Syntaxpublic class Calendar : ICalendar
Properties
Name
Name of the calendar
Declarationpublic string Name { get; set; }
Type | Description |
---|---|
string |
WorkingHours
Working hours. Default 8 hours.
Declarationpublic TimeSpan WorkingHours { get; set; }
Type | Description |
---|---|
TimeSpan |
StartOfWork
The beginning of the work day
Declarationpublic TimeSpan StartOfWork { get; set; }
Type | Description |
---|---|
TimeSpan |
Weekends
Days of the week for weekends
Declarationpublic List<DayOfWeek> Weekends { get; set; }
Type | Description |
---|---|
List<DayOfWeek> |
Years
Settings for years Year
Declarationpublic Dictionary<int, Year> Years { get; set; }
Type | Description |
---|---|
Dictionary<int, Year> |
Methods
IsWorkday(DateTime)
Checking whether the day is a working day
Declarationpublic bool IsWorkday(DateTime day)
Type | Name | Description |
---|---|---|
DateTime | day | DateTime instance |
Type | Description |
---|---|
bool | true if day is workday, false otherwise |
GetRestOfWorkday(DateTime)
Get the rest of the workday
Declarationpublic TimeSpan GetRestOfWorkday(DateTime day)
Type | Name | Description |
---|---|---|
DateTime | day | DateTime instance |
Type | Description |
---|---|
TimeSpan | TimeSpan with the rest of the work day |
GetStartOfWorkday(DateTime)
Get the start of the workday
Declarationpublic TimeSpan GetStartOfWorkday(DateTime day)
Type | Name | Description |
---|---|---|
DateTime | day | DateTime instance |
Type | Description |
---|---|
TimeSpan | Start of the workday |
Create(string)
Create instance of the calendar
Declarationpublic static Calendar Create(string name)
Type | Name | Description |
---|---|---|
string | name | Name of the calendar |
Type | Description |
---|---|
Calendar |
Equals(object)
Declarationpublic override bool Equals(object obj)
Type | Name | Description |
---|---|---|
object | obj |
Type | Description |
---|---|
bool |
GetHashCode()
Declarationpublic override int GetHashCode()
Type | Description |
---|---|
int |
Extension Methods
- CalendarExtensions.SetStartOfWork(Calendar, TimeSpan)
- CalendarExtensions.SetWeekends(Calendar, params DayOfWeek[])
- CalendarExtensions.SetWorkingHours(Calendar, TimeSpan)
- CalendarExtensions.SetYears(Calendar, params Year[])
- CalendarExtensions.GetInterval(ICalendar, string, DateTime)
- Extensions.CastAs<T>(object)
- Extensions.ExtendedEquals(object, object)
- Extensions.TryCast<T>(object, out T)