Method Change
Change(Duration, Duration)
Changes the next callback time and, for repeating interval timers, the repeat interval (NodaTime NodaTime.Duration overload).
bool Change(Duration nextInterval, Duration repeatInterval)
Parameters
nextIntervalDurationThe duration until the next callback.
repeatIntervalDurationThe interval for subsequent callbacks. Use a non-positive duration mapped from InfiniteTimeSpan for one-shot (no repeat).
Returns
- bool
trueif the change was applied;falseif the registration was cancelled, disposed, or otherwise invalid.
Remarks
For a currently non-repeating timer, passing a positive
repeatInterval may be disallowed by the implementation.
Exceptions
- InvalidOperationException
This registration is one-shot (not repeating) and
repeatIntervalis a positive duration, which would convert it to a repeating timer.
Change(Duration)
Changes the interval of this registration (NodaTime NodaTime.Duration overload).
bool Change(Duration interval)
Parameters
intervalDurationThe duration until the next callback. For a repeating timer, this also becomes the repeat interval.
Returns
- bool
trueif the change was applied;falseif the registration was cancelled, disposed, or otherwise invalid.
Remarks
Does not change whether the timer is repeating or one-shot. For a repeating
timer, interval is used for both the next and subsequent
intervals. Use Change(Duration, Duration) to set next and repeat
intervals separately.
Change(TimeSpan)
Changes the interval of this registration.
bool Change(TimeSpan interval)
Parameters
intervalTimeSpanThe time to delay before the next callback. For a repeating timer, this also becomes the repeat interval.
Returns
- bool
trueif the change was applied;falseif the registration was cancelled, disposed, or otherwise invalid.
Remarks
Does not change whether the timer is repeating or one-shot. For a repeating
timer, interval is used for both the next and subsequent
intervals. To set the next due time and repeat interval independently, use
Change(TimeSpan, TimeSpan).