Class NUIGadgetManager

    Definition

    Namespace:
    Tizen.NUI
    Assembly:
    Tizen.NUI.Gadget.dll

    The NUIGadgetManager provides methods and events related to managing gadgets in the NUI.

    public static class NUIGadgetManager
    Inheritance
    object
    NUIGadgetManager

    Methods

    View Source

    Add(string, string, bool)

    Adds a NUIGadget to the NUIGadgetManager.

    Declaration
    public static NUIGadget Add(string resourceType, string className, bool useDefaultContext)
    Parameters
    Type Name Description
    string resourceType

    The resource type of the NUIGadget package.

    string className

    The class name of the NUIGadget.

    bool useDefaultContext

    The flag it true, use a default context. Otherwise, use a new load context.

    Returns
    Type Description
    NUIGadget

    The NUIGadget object.

    Remarks

    To use Unload() method, the useDefaultContext must be'false'.

    View Source

    Add(string, string)

    Adds a NUIGadget to the NUIGadgetManager.

    Declaration
    public static NUIGadget Add(string resourceType, string className)
    Parameters
    Type Name Description
    string resourceType

    The resource type of the NUIGadget package.

    string className

    The class name of the NUIGadget.

    Returns
    Type Description
    NUIGadget

    The NUIGadget object.

    View Source

    GetGadgetInfos()

    Retrieves information about available NUIGadgets.

    Declaration
    public static IEnumerable<NUIGadgetInfo> GetGadgetInfos()
    Returns
    Type Description
    IEnumerable<><NUIGadgetInfo>

    An enumerable list of NUIGadgetInfo objects.

    Remarks

    This method provides details on gadgets that are currently accessible rather than listing all installed gadgets. A NUIGadget'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

    GetGadgets()

    Retrieves the instances of currently running NUIGadgets.

    Declaration
    public static IEnumerable<NUIGadget> GetGadgets()
    Returns
    Type Description
    IEnumerable<><NUIGadget>

    An enumerable list containing all the active NUIGadgets.

    View Source

    Load(string, bool)

    Loads an assembly of the NUIGadget.

    Declaration
    public static void Load(string resourceType, bool useDefaultContext)
    Parameters
    Type Name Description
    string resourceType

    The resource type of the NUIGadget package.

    bool useDefaultContext

    Indicates whether to use a default load context or not.

    View Source

    Load(string)

    Loads an assembly of the NUIGadget.

    Declaration
    public static void Load(string resourceType)
    Parameters
    Type Name Description
    string resourceType

    The resource type of the NUIGadget package.

    Remarks

    This method loads an assembly of the NUIGadget 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

    Pause(NUIGadget)

    Pauses the execution of the specified NUIGadget.

    Declaration
    public static void Pause(NUIGadget gadget)
    Parameters
    Type Name Description
    NUIGadget gadget

    The NUIGadget object whose execution needs to be paused.

    Remarks

    Calling this method pauses the currently executing NUIGadget. It does not affect any other gadgets that may be running simultaneously.

    View Source

    Remove(NUIGadget)

    Removes the specified NUIGadget from the NUIGadgetManager.

    Declaration
    public static void Remove(NUIGadget gadget)
    Parameters
    Type Name Description
    NUIGadget gadget

    The NUIGadget object that needs to be removed.

    Remarks

    This method allows you to remove a specific NUIGadget from the NUIGadgetManager. By passing the NUIGadget object as an argument, you can ensure that only the desired gadget is removed. It is important to note that once a gadget is removed, any references to it become invalid. Therefore, it is crucial to handle the removal process carefully to avoid any potential issues.

    View Source

    RemoveAll()

    Removes all NUIGadgets from the NUIGadgetManager.

    Declaration
    public static void RemoveAll()
    Remarks

    This method is called to remove all NUIGadgets that are currently registered in the NUIGadgetManager. It ensures that no more NUIGadgets exist after calling this method.

    View Source

    Resume(NUIGadget)

    Resumes the execution of the specified NUIGadget.

    Declaration
    public static void Resume(NUIGadget gadget)
    Parameters
    Type Name Description
    NUIGadget gadget

    The NUIGadget object whose execution needs to be resumed.

    Remarks

    By calling this method, you can resume the execution of the currently suspended NUIGadget. It takes the NUIGadget object as an argument which represents the target gadget that needs to be resumed.

    Examples

    To resume the execution of a specific NUIGadget named 'MyGadget', you can call the following code snippet:

    // Get the reference to the NUIGadget object
    NUIGadget MyGadget = ...;
    
    // Resume its execution
    GadgetResume(MyGadget);
    View Source

    SendAppControl(NUIGadget, AppControl)

    Sends the specified application control to the currently running NUIGadget.

    Declaration
    public static void SendAppControl(NUIGadget gadget, AppControl appControl)
    Parameters
    Type Name Description
    NUIGadget gadget

    The NUIGadget object that will receive the app control.

    AppControl appControl

    The app control object containing the desired arguments and actions.

    View Source

    Unload(string)

    Unloads the specified NUIGadget assembly from memory.

    Declaration
    public static void Unload(string resourceType)
    Parameters
    Type Name Description
    string resourceType

    The resource type of the NUIGadget package to unload.

    Remarks

    To use this method properly, the assembly of the gadget must be loaded using Load() with the custom context.

    Examples
    /// Load an assembly of the NUIGadget.
    NUIGadgetManager.Load("org.tizen.appfw.gadget.NetworkSetting", false);
    /// NUIGadgetManager.Add("org.tizen.appfw.gadget.NetworkSetting", "NetworkSettingGadget", false);
    
    /// Unload the loaded assembly
    NUIGadgetManager.Unload("org.tizen.appfw.gadget.NetworkSetting");

    Events

    View Source

    NUIGadgetLifecycleChanged

    Occurs when the lifecycle of the NUIGadget is changed.

    Declaration
    public static event EventHandler<NUIGadgetLifecycleChangedEventArgs> NUIGadgetLifecycleChanged
    Event Type
    Type Description
    EventHandler<><NUIGadgetLifecycleChangedEventArgs>
    Remarks

    This event is raised when the state of the NUIGadget changes. It provides information about the current state through the NUIGadgetLifecycleChangedEventArgs argument.

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