Detailed Description

Provides a way of interrupting a timer event. Returned by PowerUI.UICode.setTimeout and PowerUI.UICode.setInterval. This object can be passed to PowerUI.UICode.clearInterval to prevent any further timing events.

Public Member Functions

 UITimer (bool oneOff, int interval, DynamicMethod< Nitro.Void > callback)
 Creates a new timer defining how long to wait, the callback to run and if its an interval or not. More...
 
 UITimer (bool oneOff, int interval, OnUITimer callback)
 Creates a new timer defining how long to wait, the callback to run and if its an interval or not. More...
 
void Stop ()
 Stops this timer from running anymore. More...
 

Static Public Member Functions

static void OnUnload (Document document)
 Called before the game/scene is unloaded to remove any timers. More...
 

Public Attributes

bool OneOff
 True if this is a one off timer event and not an interval. More...
 
System.Timers.Timer InternalTimer
 The system timer that will time the callback. More...
 
int Interval
 The interval in MS. More...
 
UITimer Next
 The linked list of active timers. More...
 
UITimer Previous
 The linked list of active timers. More...
 
Document Document
 The document that this timer was created from. More...
 
DynamicMethod< Nitro.VoidCallback
 The callback (A nitro method) to run when the time is up. More...
 

Events

OnUITimer OnComplete
 An alternative to the callback. A delegate called when the time is up. More...
 

Private Member Functions

void Setup (bool oneOff, int interval)
 
void Elapsed (object sender, System.Timers.ElapsedEventArgs e)
 The method called when the system timer has waited for the specified interval. More...
 

Static Private Attributes

static UITimer FirstActive
 A linked list of active UI timers (interval ones only). More...
 
static UITimer LastActive
 A linked list of active UI timers (interval ones only). More...
 

Constructor & Destructor Documentation

PowerUI.UITimer.UITimer ( bool  oneOff,
int  interval,
DynamicMethod< Nitro.Void callback 
)
inline

Creates a new timer defining how long to wait, the callback to run and if its an interval or not.

Parameters
oneOffTrue if this timer is a single event. False will result in the callback being run until it's stopped.
intervalThe time in milliseconds between callbacks.
callbackThe callback (A nitro method) to run when the time is up.
PowerUI.UITimer.UITimer ( bool  oneOff,
int  interval,
OnUITimer  callback 
)
inline

Creates a new timer defining how long to wait, the callback to run and if its an interval or not.

Parameters
oneOffTrue if this timer is a single event. False will result in the callback being run until it's stopped.
intervalThe time in milliseconds between callbacks.
callbackThe callback (A delegate) to run when the time is up.

Member Function Documentation

void PowerUI.UITimer.Elapsed ( object  sender,
System.Timers.ElapsedEventArgs  e 
)
inlineprivate

The method called when the system timer has waited for the specified interval.

static void PowerUI.UITimer.OnUnload ( Document  document)
inlinestatic

Called before the game/scene is unloaded to remove any timers.

void PowerUI.UITimer.Setup ( bool  oneOff,
int  interval 
)
inlineprivate
void PowerUI.UITimer.Stop ( )
inline

Stops this timer from running anymore.

Member Data Documentation

DynamicMethod<Nitro.Void> PowerUI.UITimer.Callback

The callback (A nitro method) to run when the time is up.

Document PowerUI.UITimer.Document

The document that this timer was created from.

UITimer PowerUI.UITimer.FirstActive
staticprivate

A linked list of active UI timers (interval ones only).

System.Timers.Timer PowerUI.UITimer.InternalTimer

The system timer that will time the callback.

int PowerUI.UITimer.Interval

The interval in MS.

UITimer PowerUI.UITimer.LastActive
staticprivate

A linked list of active UI timers (interval ones only).

UITimer PowerUI.UITimer.Next

The linked list of active timers.

bool PowerUI.UITimer.OneOff

True if this is a one off timer event and not an interval.

UITimer PowerUI.UITimer.Previous

The linked list of active timers.

Event Documentation

OnUITimer PowerUI.UITimer.OnComplete

An alternative to the callback. A delegate called when the time is up.