Class Timer
Inheritance
System.Object
Timer
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Experior.Core
Assembly: Experior.Core.dll
Syntax
public class Timer : ITimer
Constructors
Timer(Single)
Declaration
public Timer(float timeoutInSeconds)
Parameters
Type | Name | Description |
---|---|---|
System.Single | timeoutInSeconds |
Timer(Single, Int32)
Declaration
protected Timer(float timeoutInSeconds, int timerId)
Parameters
Type | Name | Description |
---|---|---|
System.Single | timeoutInSeconds | |
System.Int32 | timerId |
Fields
UserData
Declaration
public object UserData
Field Value
Type | Description |
---|---|
System.Object |
Properties
AutoReset
if AutoReset is true the timer will start again once it has elapsed.
Declaration
public virtual bool AutoReset { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Id
Unique timer ID.
Declaration
public int Id { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
PercentageRemaining
Percentage time remaining.
Declaration
public double PercentageRemaining { get; }
Property Value
Type | Description |
---|---|
System.Double | The percentage remaining. |
Running
If true, then the timer is running.
Declaration
public bool Running { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Timeout
Set a new time in seconds. Only possible when the timer is not running.
Declaration
public virtual float Timeout { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The timeout |
Exceptions
Type | Condition |
---|---|
System.Exception | Timer is running! Timeout can not be set when the timer is running. |
TimeRemaining
Time remaining
Declaration
public double TimeRemaining { get; }
Property Value
Type | Description |
---|---|
System.Double | The time remaining. |
Methods
Action(Action, Single)
Method that executes an anonymous method after a delay period.
Declaration
public static int Action(Action action, float delayInSeconds)
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The anonymous method that needs to be executed. |
System.Single | delayInSeconds |
Returns
Type | Description |
---|---|
System.Int32 |
Action(Single)
Method that executes an anonymous method after a delay period.
Declaration
public static int Action(float delay)
Parameters
Type | Name | Description |
---|---|---|
System.Single | delay | The due time (in seconds) when the method is executed. |
Returns
Type | Description |
---|---|
System.Int32 |
Dispose()
Declaration
public virtual bool Dispose()
Returns
Type | Description |
---|---|
System.Boolean |
GetNextId()
Declaration
protected static int GetNextId()
Returns
Type | Description |
---|---|
System.Int32 |
Reset()
Reset the timer.
Declaration
public virtual void Reset()
Start()
Start the timer.
Declaration
public virtual void Start()
Stop()
Stop the timer and remember how much time is left.
Declaration
public virtual void Stop()
Events
Disposed
Declaration
public event EventHandler Disposed
Event Type
Type | Description |
---|---|
System.EventHandler |
OnElapsed
Declaration
public event Timer.ElapsedEvent OnElapsed
Event Type
Type | Description |
---|---|
Timer.ElapsedEvent |