Class TizenCore
Definition
- Assembly:
- Tizen.Core.dll
The class which provides functions related to the Tizen Core.
C#Copypublic static class TizenCore
- Inheritance
-
objectTizenCore
Methods
Declaration
C#Copypublic static Task Find(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | The ID of the task. |
Returns
| Type | Description |
|---|---|
| Task | On success the task instance, othwerwise null. |
Examples
CopyTizenCore.Initialize(); var task = TizenCore.Find("Test") ?? TizenCore.Spawn("Test");
View Source
FindFromCurrentThread()
Finds the task instance running in the thread of the caller or the "main" task.
Declaration
C#Copypublic static Task FindFromCurrentThread()
Returns
| Type | Description |
|---|---|
| Task | On success the task instance, othwerwise null. |
Examples
CopyTizenCore.Initialize(); var coreTask = TizenCore.FindFromThisThread(); if (coreTask != null) { coreTask.Post(() => { Console.WriteLine("Idler invoked"); }); }
View Source
Initialize()
Initializes Tizen Core. This method should be called once per application before creating any Tasks. Calling this method more than one time will increase internal reference counts which need to be matched by calling Shutdown(). Failing to call Shutdown() in corresponding number of calls may cause resource leakages.
Declaration
C#Copypublic static void Initialize()
Examples
CopyTizenCore.Initialize(); var task = TizenCore.Spawn("Worker");
Declaration
C#Copypublic static void Shutdown()
Examples
CopyTizenCore.Shutdown();
Declaration
C#Copypublic static Task Spawn(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | The ID of the task. |
Returns
| Type | Description |
|---|---|
| Task | On succes the created task instance, othwerwise null. |
Examples
CopyTizenCore.Initialize(); var task = TizenCore.Spawn("Worker"); if (task != null) { task.AddTimer(5000, () => { Console.WriteLine("Timer expired"); return true; }); }