Table of Contents

Interface IClockTimer

Namespace
KZDev.SystemClock.PrimeTime
Assembly
KZDev.SystemClock.PrimeTime.dll

Registration for a timer created from a clock's timer registration API (BCL "now" subset or full NodaTime-capable clock).

public interface IClockTimer : IDisposable, IAsyncDisposable
Inherited Members

Properties

CallbacksProcessing

Returns whether there are currently callbacks being processed for this timer registration.

Enabled

Gets or sets the enabled state of this timer registration. When this is set to false, the State will be set to Disabled and no further callbacks will be made. Changing this to true will cause the timer registration to be re-enabled which has the effect of resetting and restarting the timer.

Id

A unique identifier for this timer registration instance.

IsActive

Returns whether this timer registration is currently active. This will return false if the registration has been cancelled, if all the callbacks have completed, or if the timer registration has been disposed. Otherwise, this will return true, even if State is Disabled.

IsCancelled

Indicates whether the timer has been cancelled.

IsLocalTimeRepresentation

Returns whether the properties on this registration are based on local time or UTC time. Timers by default are based on UTC time, but can be configured to use local time instead using the LocalTimeRepresentation timer option during registration.

IsRepeating

Returns whether this is a repeating timer registration or not.

IsTimeOfDay

Returns whether this is a time-of-day clock registration or a time-interval clock registration.

RegisteredTime

Gets the time (UTC or local per registration options) at which this timer was registered.

State

Returns the current state of this timer registration.

Methods

Cancel()

Cancels this timer registration. When this is called, the State will be set to Cancelled and IsActive will be set to false. No further callbacks will be made, and the timer can not be restarted.

Start()

Calling this method will restart the timer if it is not already running. This has the exact same effect as setting Enabled to true.

Stop()

Calling this method will stop the timer registration from signalling any further callbacks. This has the exact same effect as setting Enabled to false.