fix: Streamlines event scheduler API. Adds months to weekly recurrence (#2178)
This commit is contained in:
parent
990e86b983
commit
f95b3a8b3b
11 changed files with 347 additions and 137 deletions
|
|
@ -7,27 +7,23 @@ public class YearlyCallbackScheduledEvent : YearlyScheduledEvent
|
|||
private readonly Action _callback;
|
||||
|
||||
protected YearlyCallbackScheduledEvent(
|
||||
DateTime startAfter,
|
||||
TimeOnly time,
|
||||
MonthDay yearlyStart,
|
||||
MonthDay yearlyEnd,
|
||||
Action callback,
|
||||
IRecurrencePattern recurrence,
|
||||
TimeZoneInfo timeZone = null
|
||||
) : this(startAfter, DateTime.MaxValue, time, yearlyStart, yearlyEnd, callback, recurrence, timeZone)
|
||||
IRecurrencePattern recurrence
|
||||
) : this(time, yearlyStart, yearlyEnd, DateTime.MaxValue, callback, recurrence)
|
||||
{
|
||||
}
|
||||
|
||||
protected YearlyCallbackScheduledEvent(
|
||||
DateTime startAfter,
|
||||
DateTime endOn,
|
||||
TimeOnly time,
|
||||
MonthDay yearlyStart,
|
||||
MonthDay yearlyEnd,
|
||||
DateTime endOn,
|
||||
Action callback,
|
||||
IRecurrencePattern recurrence,
|
||||
TimeZoneInfo timeZone = null
|
||||
) : base(startAfter, endOn, time, yearlyStart, yearlyEnd, recurrence, timeZone) => _callback = callback;
|
||||
IRecurrencePattern recurrence
|
||||
) : base(time, yearlyStart, yearlyEnd, endOn, recurrence) => _callback = callback;
|
||||
|
||||
public override void OnEvent() => _callback();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue