Class Service
Definition
- Namespace:
- Tizen.Applications
- Assembly:
- Tizen.Applications.UnitedService.dll
Represents a Service controlled lifecycle.
public abstract class Service : IDisposable
- Inheritance
-
objectService
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
Constructors
View SourceService()
Initializes the service.
Declaration
public Service()
Remarks
This constructor initializes a new instance of the Service class.
Properties
View SourceId
The Id.
Declaration
public string Id { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
Name
The name.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
ServiceInfo
The information of the service.
Declaration
public ServiceInfo ServiceInfo { get; }
Property Value
| Type | Description |
|---|---|
| ServiceInfo |
Remarks
This property is set before the OnCreate() is called, after the instance has been created. It provides details about the current service such as its ID, name, version, and other relevant information. By accessing this property, developers can retrieve the necessary information about the service they are working on.
State
The lifecycle state of the service.
Declaration
public ServiceLifecycleState State { get; }
Property Value
| Type | Description |
|---|---|
| ServiceLifecycleState |
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
Methods
View SourceDispose()
Releases all resources used by the service class.
Declaration
public void Dispose()
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
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, disposes any disposable objects. If false, does not dispose disposable objects. |
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
~Service()
Finalizer of the service class.
Declaration
protected ~Service()
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
OnAppControlReceived(AppControlReceivedEventArgs)
Overrides this method if want to handle behavior when the service receives the appcontrol message.
Declaration
protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| AppControlReceivedEventArgs | e | The appcontrol received event argument containing details about the received message. |
Remarks
This method provides a way to customize the response when the service receives an appcontrol message. By overriding this method in your derived class, you can define specific actions based on the incoming arguments.
OnCreate()
Override this method to define the behavior when the service is created. Calling 'base.OnCreate()' is necessary in order to emit the 'ServiceLifecycleChanged' event with the 'ServiceLifecycleState.Created' state.
Declaration
protected virtual void OnCreate()
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
OnDestroy()
Override this method to handle the behavior when the service is destroyed. If 'base.OnDestroy()' is not called, the 'ServiceLifecycleChanged' event with the 'ServiceLifecycleState.Destroyed' state will not be emitted.
Declaration
protected virtual void OnDestroy()
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
OnLocaleChanged(LocaleChangedEventArgs)
Overrides this method if want to handle behavior when the system language is changed.
Declaration
protected virtual void OnLocaleChanged(LocaleChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| LocaleChangedEventArgs | e | The locale changed event argument. |
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
OnLowBattery(LowBatteryEventArgs)
Overrides this method if want to handle behavior when the system battery is low.
Declaration
protected virtual void OnLowBattery(LowBatteryEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| LowBatteryEventArgs | e | The low batter event argument. |
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
OnLowMemory(LowMemoryEventArgs)
Overrides this method if want to handle behavior when the system memory is low.
Declaration
protected virtual void OnLowMemory(LowMemoryEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| LowMemoryEventArgs | e | The low memory event argument. |
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
OnRegionFormatChanged(RegionFormatChangedEventArgs)
Overrides this method if want to handle behavior when the region format is changed.
Declaration
protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| RegionFormatChangedEventArgs | e | The region format changed event argument. |
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
Quit()
Quits the main loop of the service.
Declaration
public void Quit()
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.
Run(AppControlReceivedEventArgs)
Runs the main loop of the service.
Declaration
public void Run(AppControlReceivedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| AppControlReceivedEventArgs | args | The argument of the app control received event. |
Remarks
This class provides functionality related to managing the lifecycle of a Service. It enables developers to handle events such as initialization, activation, deactivation, and destruction of the service. By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their services accordingly.