WorkingTime

Ecng.ComponentModel

Working schedule settings.

继承自: Cloneable<WorkingTime>

实现: IAsyncPersistable

构造函数

WorkingTime
public WorkingTime()
workingTime = WorkingTime()

Initializes a new instance of the WorkingTime.

属性

IsEnabled
public bool IsEnabled { get; set; }
value = workingTime.IsEnabled
workingTime.IsEnabled = value

Whether the schedule is active.

Periods
public List<WorkingTimePeriod> Periods { get; set; }
value = workingTime.Periods
workingTime.Periods = value

Schedule validity periods.

SpecialDays
public IDictionary<DateTime, Range<TimeSpan>[]> SpecialDays { get; set; }
value = workingTime.SpecialDays
workingTime.SpecialDays = value

Special working days (holidays, shortened days, etc.).

SpecialHolidays
public DateTime[] SpecialHolidays { get; set; }
value = workingTime.SpecialHolidays
workingTime.SpecialHolidays = value

Special holidays.

SpecialWorkingDays
public DateTime[] SpecialWorkingDays { get; set; }
value = workingTime.SpecialWorkingDays
workingTime.SpecialWorkingDays = value

Special working days (non-standard working days, e.g., Saturday working days).

方法

Clone
public override WorkingTime Clone()
result = workingTime.Clone()

Creates a new object that is a copy of the current instance.

返回值: A new object that is a copy of this instance.

LoadAsync
public Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = workingTime.LoadAsync(storage, cancellationToken)

Asynchronously loads the state of the object from the specified SettingsStorage.

storage
The SettingsStorage instance from which to load the data.
cancellationToken
A token to monitor for cancellation requests.

返回值: A task that represents the asynchronous load operation.

SaveAsync
public Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = workingTime.SaveAsync(storage, cancellationToken)

Asynchronously saves the state of the object to the specified SettingsStorage.

storage
The SettingsStorage instance to which to save the data.
cancellationToken
A token to monitor for cancellation requests.

返回值: A task that represents the asynchronous save operation.

ToString
public override string ToString()
result = workingTime.ToString()

Returns a string representation of the tuple, with values separated by commas.

返回值: A string representing the tuple's values.