Class Efl.LoopTimer
Timers are objects that will call a given callback at some point in the future and repeat that tick at a given interval. Timers require the ecore main loop to be running and functioning properly. They do not guarantee exact timing but try to work on a "best effort" basis.
The Efl.Object.FreezeEvent() and Efl.Object.ThawEvent() calls are used to pause and unpause the timer. (Since EFL 1.22)
Syntax
public class LoopTimer : LoopConsumer, IWrapper, IDisposable
Constructors
LoopTimer(EoWrapper.ConstructingHandle)
Subclasses should override this constructor if they are expected to be instantiated from native code. Do not call this constructor directly.
Declaration
protected LoopTimer(EoWrapper.ConstructingHandle ch)
Parameters
Type | Name | Description |
---|---|---|
Efl.Eo.EoWrapper.ConstructingHandle | ch | Tag struct storing the native handle of the object being constructed. |
LoopTimer(Object, Double)
Initializes a new instance of the Efl.LoopTimer class.
Declaration
public LoopTimer(Object parent, double timerInterval)
Parameters
Type | Name | Description |
---|---|---|
Efl.Object | parent | Parent instance. |
System.Double | timerInterval | Interval the timer ticks on. See Efl.LoopTimer.SetTimerInterval(System.Double) |
LoopTimer(IntPtr, Object)
Initializes a new instance of the Efl.LoopTimer class. Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.
Declaration
protected LoopTimer(IntPtr baseKlass, Object parent)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | baseKlass | The pointer to the base native Eo class. |
Efl.Object | parent | The Efl.Object parent of this instance. |
Properties
TimePending
Pending time regarding a timer. (Since EFL 1.22)
Declaration
public double TimePending { get; }
Property Value
Type | Description |
---|---|
System.Double | Pending time |
TimerInterval
Interval the timer ticks on. (Since EFL 1.22)
Declaration
public double TimerInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The new interval in seconds |
Methods
GetTimePending()
Pending time regarding a timer. (Since EFL 1.22)
Declaration
public virtual double GetTimePending()
Returns
Type | Description |
---|---|
System.Double | Pending time |
GetTimerInterval()
Interval the timer ticks on. (Since EFL 1.22)
Declaration
public virtual double GetTimerInterval()
Returns
Type | Description |
---|---|
System.Double | The new interval in seconds |
OnTimerTickEvent(EventArgs)
Method to raise event TimerTickEvent.
Declaration
public void OnTimerTickEvent(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event to raise. |
ResetTimer()
Resets a timer to its full interval. This effectively makes the timer start ticking off from zero now. This is equal to delaying the timer by the already passed time, since the timer started ticking (Since EFL 1.22)
Declaration
public virtual void ResetTimer()
ResetTimerLoop()
This effectively resets a timer but based on the time when this iteration of the main loop started. (Since EFL 1.22)
Declaration
public virtual void ResetTimerLoop()
SetTimerInterval(Double)
If set during a timer call this will affect the next interval. (Since EFL 1.22)
Declaration
public virtual void SetTimerInterval(double kw_in)
Parameters
Type | Name | Description |
---|---|---|
System.Double | kw_in | The new interval in seconds |
TimerDelay(Double)
Adds a delay to the next occurrence of a timer. This doesn't affect the timer interval. (Since EFL 1.22)
Declaration
public virtual void TimerDelay(double add)
Parameters
Type | Name | Description |
---|---|---|
System.Double | add | The amount of time by which to delay the timer in seconds |
Events
TimerTickEvent
Event triggered when the specified time as passed. (Since EFL 1.22)
Declaration
public event EventHandler TimerTickEvent
Event Type
Type | Description |
---|---|
System.EventHandler |