Class EcoreMainloop
Definition
- Namespace:
- ElmSharp
- Assembly:
- ElmSharp.dll
- API Level:
- preview
EcoreMainloop is a helper class, which provides the functions relative to Ecore's main loop.
C#Copypublic static class EcoreMainloop
- Inheritance
-
System.ObjectEcoreMainloop
Properties
Declaration
C#Copypublic static bool IsMainThread { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
True if the calling function is the same thread, false otherwise.
API Level: preview
Methods
View Source
AddTimer(Double, Func<Boolean>)
Creates a timer to call the given function in the given period of time.
Declaration
C#Copypublic static IntPtr AddTimer(double interval, Func<bool> handler)
Parameters
Type | Name | Description |
---|---|---|
System.Double | interval | The interval in seconds. |
System.Func<Boolean> | handler | The given function. |
Returns
Type | Description |
---|---|
System.IntPtr | A timer object handler on success, or null on failure. |
API Level: preview
Declaration
C#Copypublic static void Begin()
API Level: preview
Declaration
C#Copypublic static void Post(Action task)
Parameters
Type | Name | Description |
---|---|---|
System.Action | task | The action to call when idle. |
API Level: preview
Declaration
C#Copypublic static void PostAndWakeUp(Action task)
Parameters
Type | Name | Description |
---|---|---|
System.Action | task | The action wanted to be called. |
API Level: preview
View Source
Quit()
Quits the main loop, once all the events currently on the queue have been processed.
Declaration
C#Copypublic static void Quit()
API Level: preview
Declaration
C#Copypublic static void RemoveTimer(IntPtr id)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | id | The specified timer handler |
API Level: preview
Declaration
C#Copypublic static void Send(Action task)
Parameters
Type | Name | Description |
---|---|---|
System.Action | task | The action wanted to be called. |