Table of Contents

Interface ICalendarTimer

Namespace
SkyrimForge
Assembly
SkyrimForge.dll

A timer on the game's calendar that ICalendarTimerFactory creates.

public interface ICalendarTimer

Remarks

Call members on the game's thread with a game loaded, which subscribing to an event does not need.

Properties

IsRunning

Whether the timer runs in the loaded game.

bool IsRunning { get; }

Property Value

bool

OnElapsed

Raised on the game's thread on the first frame at which the timer is due.

IGameEvent<CalendarTimerElapsedEventArgs> OnElapsed { get; }

Property Value

IGameEvent<CalendarTimerElapsedEventArgs>

Remarks

A timer that does not repeat is stopped before the event is raised, so a handler can start it again. A repeating timer raises it once on that frame, with the number of its periods that have ended.

Methods

Start(TimeSpan, TimeSpan?)

Starts or restarts the timer, which is due once duration has passed on the game's calendar.

void Start(TimeSpan duration, TimeSpan? repeatInterval = null)

Parameters

duration TimeSpan

The calendar time until the timer is first due.

repeatInterval TimeSpan?

The calendar time from one due time to the next. A null value stops the timer once it is due.

Exceptions

ArgumentOutOfRangeException

duration or repeatInterval is zero or negative.

Stop()

Stops the timer. A timer not running is unaffected.

void Stop()