Class ScheduleTime
Basic ITimePlan implementation to setup a time schedule on simple time pattern syntax.
public sealed class ScheduleTime : ITimePlan
- Inheritance
-
ScheduleTime
- Implements
- Inherited Members
- Extension Methods
Examples
2017-10-25 10:35:27 | exact not repeating time as given |
2017-10-* 10:35:27 | Monday | every Monday of October, 2017 at 10:35:27 |
*-*-* 10:35:27 | Sunday, Saturday | every weekend at 10:35:27 |
Remarks
The schedule time pattern is based on this time format:
yyyy-mm-dd hh:mm:ss { | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday }
where the part in { } braces specifying day-of-week constrains is optional.
Each integer component in the date-time part could be replaced with a '*' to denote a wildcard.
Constructors
ScheduleTime(string)
Ctor from scheduleTimePattern
public ScheduleTime(string scheduleTimePattern)
Parameters
scheduleTimePattern
string
Remarks
(See class for schedule-time pattern.)
ScheduleTime(string, IList<DayOfWeek>)
Ctor from timePattern
and weekDays
.
public ScheduleTime(string timePattern, IList<DayOfWeek> weekDays)
Parameters
Remarks
(See class for time pattern.)
Methods
DueDate(DateTime)
Returns the next due-date fromNow
.
public DateTime DueDate(DateTime fromNow)
Parameters
fromNow
DateTime
Returns
Remarks
NOTE: Implementation must return due-dates which are in the future from fromNow
.
i.e. when a ITimePlan implementation returnde a due-date,
the next call to the DueDate()
method with a new fromNow
argument which is the last due-date
plus a small milli.sec. amount (RESOLUTION_MSEC)
MUST return a new due-date > fromNow!!!
NextFrom(DateTime, string)
Next time schedule fromNow
defined by scheduleTimePattern
public static DateTime NextFrom(DateTime fromNow, string scheduleTimePattern)
Parameters
Returns
Remarks
(See class for schedule-time pattern.)