Class WeekDay
Namespace: Aspose.Tasks
Assembly: Aspose.Tasks.dll (25.8.0)
Represents a weekday which either defines regular days of a week or exception days in a calendar.
[ClassInterface(ClassInterfaceType.AutoDual)]
public class WeekDayInheritance
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
>
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
DayWorking
Gets or sets a value indicating whether the specified date or day type is working.
public bool DayWorking { get; set; }Property Value
FromDate
Gets or sets the beginning of an exception time.
public DateTime FromDate { get; set; }Property Value
ToDate
Gets or sets the end of an exception time.
public DateTime ToDate { get; set; }Property Value
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
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
A cast day type.
Clone()
Returns a deep copy of the week day.
public WeekDay Clone()Returns
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
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
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
returns a hash code value for this object.
GetWorkingTime()
Returns the working time for a week day.
public TimeSpan GetWorkingTime()Returns
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>