Class UIGadgetManager
Definition
- Namespace:
- Tizen.Applications
- Assembly:
- Tizen.Applications.UIGadget.dll
The UIGadgetManager provides methods and events related to managing UIGadgets in the NUI.
public static class UIGadgetManager
- Inheritance
-
objectUIGadgetManager
Methods
View SourceAdd(string, string, bool)
Adds a UIGadget to the UIGadgetManager.
Declaration
public static IUIGadget Add(string resourceType, string className, bool useDefaultContext)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the UIGadget package. |
| string | className | The class name of the UIGadget. |
| bool | useDefaultContext | The flag it true, use a default context. Otherwise, use a new load context. |
Returns
| Type | Description |
|---|---|
| IUIGadget | The UIGadget object. |
Remarks
To use Unload() method, the useDefaultContext must be'false'.
Add(string, string)
Adds a UIGadget to the UIGadgetManager.
Declaration
public static IUIGadget Add(string resourceType, string className)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the UIGadget package. |
| string | className | The class name of the UIGadget. |
Returns
| Type | Description |
|---|---|
| IUIGadget | The UIGadget object. |
Create(IUIGadget, bool)
Executes the creation process of the UIGadget.
Declaration
public static void Create(IUIGadget gadget, bool useIdler = false)
Parameters
| Type | Name | Description |
|---|---|---|
| IUIGadget | gadget | The UIGadget object to perform the creation process. |
| bool | useIdler | whether to use idler |
Remarks
This method basically works with sync. If you want to operate with async, put true in the 'useIdler' parameter and use it.
CreateInstance(string, string, bool)
Creates a new UIGadget instance.
Declaration
public static IUIGadget CreateInstance(string resourceType, string className, bool useDefaultContext)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the UIGadget package. |
| string | className | The class name of the UIGadget. |
| bool | useDefaultContext | The flag it true, use a default context. Otherwise, use a new load context. |
Returns
| Type | Description |
|---|---|
| IUIGadget | The UIGadget object. |
Remarks
To use Unload() method, the useDefaultContext must be'false'.
GetUIGadgetInfos()
Retrieves information about available UIGadgets.
Declaration
public static IEnumerable<UIGadgetInfo> GetUIGadgetInfos()
Returns
| Type | Description |
|---|---|
| IEnumerable<><UIGadgetInfo> | An enumerable list of UIGadgetInfo objects. |
Remarks
This method provides details on UIGadgets that are currently accessible rather than listing all installed UIGadgets. A UIGadget'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.
GetUIGadgets()
Retrieves the instances of currently running UIGadgets.
Declaration
public static IEnumerable<IUIGadget> GetUIGadgets()
Returns
| Type | Description |
|---|---|
| IEnumerable<><IUIGadget> | An enumerable list containing all the active UIGadgets. |
Load(string, bool)
Loads an assembly of the UIGadget.
Declaration
public static void Load(string resourceType, bool useDefaultContext)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the UIGadget package. |
| bool | useDefaultContext | Indicates whether to use a default load context or not. |
Load(string)
Loads an assembly of the UIGadget.
Declaration
public static void Load(string resourceType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the UIGadget package. |
Remarks
This method loads an assembly of the UIGadget 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.
Pause(IUIGadget, bool)
Pauses the execution of the specified UIGadget.
Declaration
public static void Pause(IUIGadget gadget, bool useIdler = true)
Parameters
| Type | Name | Description |
|---|---|---|
| IUIGadget | gadget | The UIGadget object whose execution needs to be paused. |
| bool | useIdler | whether to use idler |
Remarks
Calling this method pauses the currently executing UIGadget. It does not affect any other UIGadgets that may be running simultaneously. And, this method basically works with async. If you want to operate with sync, put false in the 'useIdler' parameter and use it.
PreCreate(IUIGadget, bool)
Executes the pre-creation process of the UIGadget.
Declaration
public static void PreCreate(IUIGadget gadget, bool useIdler = false)
Parameters
| Type | Name | Description |
|---|---|---|
| IUIGadget | gadget | The UIGadget object to perform the pre-creation process. |
| bool | useIdler | whether to use idler |
Remarks
This method basically works with sync. If you want to operate with async, put true in the 'useIdler' parameter and use it.
Refresh()
Refresh gadget mount and update information in NUIGadgetManager.
Declaration
public static void Refresh()
Remarks
To use this method properly, All the gadgets should be unloaded in advance.
Remove(IUIGadget, bool)
Removes the specified UIGadget from the UIGadgetManager.
Declaration
public static void Remove(IUIGadget gadget, bool useIdler = true)
Parameters
| Type | Name | Description |
|---|---|---|
| IUIGadget | gadget | The UIGadget object that needs to be removed. |
| bool | useIdler | whether to use idler |
Remarks
This method allows you to remove a specific UIGadget from the UIGadgetManager. By passing the UIGadget object as an argument, you can ensure that only the desired UIGadget is removed. It is important to note that once a UIGadget is removed, any references to it become invalid. Therefore, it is crucial to handle the removal process carefully to avoid any potential issues. And, this method basically works with async. If you want to operate with sync, put false in the 'useIdler' parameter and use it.
RemoveAll(bool)
Removes all UIGadgets from the UIGadgetManager.
Declaration
public static void RemoveAll(bool useIdler = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | useIdler | whether to use idler |
Remarks
This method is called to remove all UIGadgets that are currently registered in the UIGadgetManager. It ensures that no more UIGadgets exist after calling this method. And, this method basically works with async. If you want to operate with sync, put false in the 'useIdler' parameter and use it.
Resume(IUIGadget, bool)
Resumes the execution of the specified UIGadget.
Declaration
public static void Resume(IUIGadget gadget, bool useIdler = true)
Parameters
| Type | Name | Description |
|---|---|---|
| IUIGadget | gadget | The UIGadget object whose execution needs to be resumed. |
| bool | useIdler | whether to use idler |
Remarks
By calling this method, you can resume the execution of the currently suspended UIGadget. It takes the UIGadget object as an argument which represents the target UIGadget that needs to be resumed. And, this method basically works with async. If you want to operate with sync, put false in the 'useIdler' parameter and use it.
SendAppControl(IUIGadget, AppControl)
Sends the specified application control to the currently running UIGadget.
Declaration
public static void SendAppControl(IUIGadget gadget, AppControl appControl)
Parameters
| Type | Name | Description |
|---|---|---|
| IUIGadget | gadget | The UIGadget object that will receive the app control. |
| AppControl | appControl | The app control object containing the desired arguments and actions. |
SendMessage(Bundle)
Sends the message to the UIGadgetManager.
Declaration
public static void SendMessage(Bundle message)
Parameters
| Type | Name | Description |
|---|---|---|
| Bundle | message | The message |
Unload(string)
Unloads the specified UIGadget assembly from memory.
Declaration
public static void Unload(string resourceType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | resourceType | The resource type of the UIGadget package to unload. |
Remarks
To use this method properly, the assembly of the UIGadget must be loaded using Load() with the custom context.
Examples
/// Load an assembly of the UIGadget.
UIGadgetManager.Load("org.tizen.appfw.UIGadget.NetworkSetting", false);
/// UIGadgetManager.Add("org.tizen.appfw.UIGadget.NetworkSetting", "NetworkSettingUIGadget", false);
/// Unload the loaded assembly
UIGadgetManager.Unload("org.tizen.appfw.UIGadget.NetworkSetting");
Events
View SourceUIGadgetLifecycleChanged
Occurs when the lifecycle of the UIGadget is changed.
Declaration
public static event EventHandler<UIGadgetLifecycleChangedEventArgs> UIGadgetLifecycleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<><UIGadgetLifecycleChangedEventArgs> |
Remarks
This event is raised when the state of the UIGadget changes. It provides information about the current state through the UIGadgetLifecycleChangedEventArgs argument.
UIGadgetMessageReceived
Occurs when the message is received.
Declaration
public static event EventHandler<UIGadgetMessageReceivedEventArgs> UIGadgetMessageReceived
Event Type
| Type | Description |
|---|---|
| EventHandler<><UIGadgetMessageReceivedEventArgs> |