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
    object
    ServiceManager

    Methods

    View Source

    GetServiceInfos()

    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.

    View Source

    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.

    View Source

    Initialize()

    Initializes the Service Manager.

    Declaration
    public static void Initialize()
    View Source

    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.

    View Source

    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.

    View Source

    QuitAll()

    Quits the main loop of all running services.

    Declaration
    public static void QuitAll()
    View Source

    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.

    View Source

    RunAll()

    Runs the main loop of all services.

    Declaration
    public static void RunAll()
    View Source

    Shutdown()

    Shuts down the Service Manager.

    Declaration
    public static void Shutdown()
    View Source

    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 Source

    ServiceLifecycleChanged

    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.

    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX