Table of Contents

Method Change

Namespace
KZDev.PrimeTime
Assembly
KZDev.PrimeTime.dll

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

nextInterval Duration

The duration until the next callback.

repeatInterval Duration

The interval for subsequent callbacks. Use a non-positive duration mapped from InfiniteTimeSpan for one-shot (no repeat).

Returns

bool

true if the change was applied; false if 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 repeatInterval is 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

interval Duration

The duration until the next callback. For a repeating timer, this also becomes the repeat interval.

Returns

bool

true if the change was applied; false if 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

interval TimeSpan

The time to delay before the next callback. For a repeating timer, this also becomes the repeat interval.

Returns

bool

true if the change was applied; false if 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).