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...
 

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...
 
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...
 

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.

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.

System.Timers.Timer PowerUI.UITimer.InternalTimer

The system timer that will time the callback.

bool PowerUI.UITimer.OneOff

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

Event Documentation

OnUITimer PowerUI.UITimer.OnComplete

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