Class TizenCore
Definition
- Assembly:
- Tizen.Core.dll
The class which provides functions related to the Tizen Core.
public static class TizenCore
- Inheritance
-
objectTizenCore
Methods
View SourceFind(string)
Finds the task instance.
Declaration
public 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
TizenCore.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
public static Task FindFromCurrentThread()
Returns
Type | Description |
---|---|
Task | On success the task instance, othwerwise null. |
Examples
TizenCore.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
public static void Initialize()
Examples
TizenCore.Initialize();
var task = TizenCore.Spawn("Worker");
View Source
Shutdown()
Shuts down Tizen Core.
Declaration
public static void Shutdown()
Examples
TizenCore.Shutdown();
View Source
Spawn(string)
Creates and runs the task.
Declaration
public 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
TizenCore.Initialize();
var task = TizenCore.Spawn("Worker");
if (task != null)
{
task.AddTimer(5000, () => {
Console.WriteLine("Timer expired");
return true;
});
}