Class WeekDay

Class WeekDay

Namespace: Aspose.Tasks
Assembly: Aspose.Tasks.dll (25.2.0)

Represents a weekday which either defines regular days of a week or exception days in a calendar.

[ClassInterface(ClassInterfaceType.AutoDual)]
public class WeekDay

Inheritance

objectWeekDay

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

WeekDay(DayType)

Initializes a new instance of the Aspose.Tasks.WeekDay class with the specified day type.

public WeekDay(DayType dayType)

Parameters

dayType DayType

The specified day type.

WeekDay(DayType, IEnumerable<workingtime>)

Initializes a new instance of the Aspose.Tasks.WeekDay class with the specified day type and list of working time periods.

public WeekDay(DayType dayType, IEnumerable<workingtime> workingTimes)

Parameters

dayType DayType

The specified day type.

workingTimes IEnumerable<WorkingTime&gt;

List of working time periods.

WeekDay(DayType, params WorkingTime[])

Initializes a new instance of the Aspose.Tasks.WeekDay class with the specified day type and working time periods.

public WeekDay(DayType dayType, params WorkingTime[] workingTimes)

Parameters

dayType DayType

The specified day type.

workingTimes WorkingTime[]

Array of working time periods.

WeekDay()

Initializes a new instance of the Aspose.Tasks.WeekDay class.

public WeekDay()

Properties

DayType

Gets the type of a day.

public DayType DayType { get; }

Property Value

DayType

DayWorking

Gets or sets a value indicating whether the specified date or day type is working.

public bool DayWorking { get; set; }

Property Value

bool

FromDate

Gets or sets the beginning of an exception time.

public DateTime FromDate { get; set; }

Property Value

DateTime

ToDate

Gets or sets the end of an exception time.

public DateTime ToDate { get; set; }

Property Value

DateTime

WorkingTimes

Gets WorkingTimeCollection for this WeekDay instance. The collection of working times that define the time worked on the weekday.

public WorkingTimeCollection WorkingTimes { get; }

Property Value

WorkingTimeCollection

Methods

CastToDayType(DayOfWeek)

Casts .Net’s System.DayOfWeek to Aspose.Tasks.WeekDay.DayType.

public static DayType CastToDayType(DayOfWeek dw)

Parameters

dw DayOfWeek

The day of week to cast from.

Returns

DayType

A cast day type.

Clone()

Returns a deep copy of the week day.

public WeekDay Clone()

Returns

WeekDay

Returns the deep copy of the week day.

CreateDefaultWorkingDay(DayType)

Creates default working day.

public static WeekDay CreateDefaultWorkingDay(DayType dayType)

Parameters

dayType DayType

The day type to create default working day from.

Returns

WeekDay

A default working day with working times 8-12 and 13-17.

Equals(object)

Returns a value indicating whether this instance is equal to a specified object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with this instance.

Returns

bool

True if the specified object is a WeekDay that has the same FromDate, ToDate values and WorkingTimes as this instance; otherwise, false.

GetHashCode()

Returns a hash code value for the instance of the Aspose.Tasks.WeekDay class.

public override int GetHashCode()

Returns

int

returns a hash code value for this object.

GetWorkingTime()

Returns the working time for a week day.

public TimeSpan GetWorkingTime()

Returns

TimeSpan

Working time.

SetDefaultWorkingTime(WeekDay)

Sets default time periods for the specified week day.

public static void SetDefaultWorkingTime(WeekDay day)

Parameters

day WeekDay

The week day to set default working day on. </workingtime>