Class OneShotService
Definition
- Assembly:
- Tizen.NUI.Gadget.dll
OneShotService performs tasks that the NUIGadget processes in parallel during the PreCreate state.
public abstract class OneShotService : IDisposable
- Inheritance
-
objectOneShotService
Constructors
View SourceOneShotService(string, bool)
Initializes the OneShotService.
Declaration
public OneShotService(string name, bool autoClose)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Unique identifier for the service instance |
| bool | autoClose | Whether to automatically close the service after execution |
Properties
View SourceAutoClose
Gets the AutoClose
Declaration
public bool AutoClose { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
This property is a variable as to whether to automatically make OneShotService Destroy after execution
Name
Gets the OneShotService's name
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
This property is the name(identifier)
of the worker thread on which
OneShotService operates.
State
Gets the current lifecycle state of OneShotService
Declaration
public OneShotServiceLifecycleState State { get; }
Property Value
| Type | Description |
|---|---|
| OneShotServiceLifecycleState |
Methods
View SourceDispose()
Releases all resources used by the OneShotService class.
Declaration
public void Dispose()
Dispose(bool)
Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | if true, dispose any disposable objets. If false, does not dispose disposable objects |
~OneShotService()
Finalizer of the OneShotService class.
Declaration
protected ~OneShotService()
OnCreate()
Override this method to define the behavior when the OneShotService is created. Calling 'base.OnCreate()' is necessary in order to emit the 'OneShotServiceLifecycleState.Created` state
Declaration
protected virtual void OnCreate()
OnDestroy()
Override this method to define the behavior when the OneShotService is destroyed. Calling 'base.OnDestroyed()' is necessary in order to emit the 'OneShotServiceLifecycleState.Destroyed` state
Declaration
protected virtual void OnDestroy()
Quit(bool)
Stops the OneShotService execution and releases resources.
Declaration
public void Quit(bool waitForJoin)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | waitForJoin | Whether to wait for complete service termination |
Run()
Starts the OneShotService execution on a worker thread. Initializes the service task and triggers the OnCreate event. If AutoClose is enabled, automatically destroys the service after execution.
Declaration
public void Run()