Class ServiceManager
Definition
- Namespace:
- Tizen.Applications
- Assembly:
- Tizen.Applications.UnitedService.dll
The ServiceManager provides methods and events related to managing services in the application.
public static class ServiceManager
- Inheritance
-
objectServiceManager
Methods
View SourceGetServiceInfos()
Retrieves the information about available Services.
Declaration
public static IEnumerable<ServiceInfo> GetServiceInfos()
Returns
| Type | Description |
|---|---|
| IEnumerable<><ServiceInfo> | An enumerable list of ServiceInfo objects. |
Remarks
This method provides details on services that are currently accessible rather than listing all installed services. A Service's resource package may specify which applications have access through the "allowed-packages" setting. During execution, the platform mounts the resource package in the application's resources directory.
GetServices()
Retrieves the instance of currently running Services.
Declaration
public static IEnumerable<Service> GetServices()
Returns
| Type | Description |
|---|---|
| IEnumerable<><Service> | An enumarable list containing all the active Services. |
Initialize()
Initializes the Service Manager.
Declaration
public static void Initialize()
Load(string)
Loads an assembly of the Service.
Declaration
public static void Load(string resourceType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the Service package. |
Remarks
This method loads an assembly of the Service based on the specified resource type. It throws an ArgumentException if the argument is invalid, or an InvalidOperationException if the operation fails due to any reason.
Quit(string)
Quits the main loop of the service.
Declaration
public static void Quit(string resourceType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the Service package. |
QuitAll()
Quits the main loop of all running services.
Declaration
public static void QuitAll()
Run(string, AppControlReceivedEventArgs)
Runs the main loop of the service.
Declaration
public static void Run(string resourceType, AppControlReceivedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the Service package. |
| AppControlReceivedEventArgs | args | The arguments passed in the appcontrol message. |
Remarks
If the service is already running, this method sends the args to the running service.
RunAll()
Runs the main loop of all services.
Declaration
public static void RunAll()
Shutdown()
Shuts down the Service Manager.
Declaration
public static void Shutdown()
Unload(string)
Unloads the specified Service assembly from memory.
Declaration
public static void Unload(string resourceType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the Service package to unload. |
Remarks
To use this method properly, the assembly of the gadget must be loaded using Load() with the custom context.
Events
View SourceServiceLifecycleChanged
Occurs when the lifecycle of the Service is changed.
Declaration
public static event EventHandler<ServiceLifecycleChangedEventArgs> ServiceLifecycleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<><ServiceLifecycleChangedEventArgs> |
Remarks
This event is raised when the state of the Service changes. It provides information about the current state through the ServiceLifecycleChangedEventArgs argument.