[NUI.Gadget] Enhance API descriptions (#6375)
authorhjhun <36876573+hjhun@users.noreply.github.com>
Mon, 30 Sep 2024 06:02:45 +0000 (15:02 +0900)
committerGitHub <noreply@github.com>
Mon, 30 Sep 2024 06:02:45 +0000 (15:02 +0900)
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadget.cs
src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs
src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetLifecycleChangedEventArgs.cs
src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs
src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetResourceManager.cs

index 6a766047b513a84763732a2ff41b37291b835dfc..2f48cca2ee290ce5254b3cfc1e163716f5a6666a 100755 (executable)
@@ -22,8 +22,13 @@ using Tizen.NUI.BaseComponents;
 namespace Tizen.NUI
 {
     /// <summary>
-    /// This class represents a NUIGadget controlled lifecycles.
+    /// Represents a NUIGadget controlled lifecycle.
     /// </summary>
+    /// <remarks>
+    /// This class provides functionality related to managing the lifecycle of a NUIGadget.
+    /// It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget.
+    /// By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly.
+    /// </remarks>
     /// <since_tizen> 10 </since_tizen>
     [EditorBrowsable(EditorBrowsableState.Never)]
     public abstract class NUIGadget
@@ -31,7 +36,11 @@ namespace Tizen.NUI
         /// <summary>
         /// Initializes the gadget.
         /// </summary>
-        /// /// <param name="type">The type of the NUIGadget.</param>
+        /// <param name="type">The type of the NUIGadget.</param>
+        /// <remarks>
+        /// This constructor initializes a new instance of the NUIGadget class based on the specified type.
+        /// It is important to provide the correct type argument in order to ensure proper functionality and compatibility with other components.
+        /// </remarks>
         /// <since_tizen> 10 </since_tizen>
         public NUIGadget(NUIGadgetType type)
         {
@@ -44,7 +53,11 @@ namespace Tizen.NUI
         /// <summary>
         /// Gets the class representing information of the current gadget.
         /// </summary>
-        /// <remarks> This property is set before the OnCreate() is called, after the instance has been created. </remarks>
+        /// <remarks>
+        /// This property is set before the OnCreate() is called, after the instance has been created.
+        /// It provides details about the current gadget such as its ID, name, version, and other relevant information.
+        /// By accessing this property, developers can retrieve the necessary information about the gadget they are working on.
+        /// </remarks>
         /// <since_tizen> 10 </since_tizen>
         public NUIGadgetInfo NUIGadgetInfo
         {
@@ -53,7 +66,7 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Gets the type.
+        /// Gets the type of the NUI gadget.
         /// </summary>
         /// <since_tizen> 10 </since_tizen>
         public NUIGadgetType Type
@@ -65,7 +78,10 @@ namespace Tizen.NUI
         /// <summary>
         /// Gets the class name.
         /// </summary>
-        /// <remarks> This property is set before the OnCreate() is called, after the instance has been created. </remarks>
+        /// <remarks>
+        /// This property is set before the OnCreate() is called, after the instance has been created.
+        /// It provides access to the name of the class that was used to create the current instance.
+        /// </remarks>
         /// <since_tizen> 10 </since_tizen>
         public string ClassName
         {
@@ -74,7 +90,7 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Gets the main view.
+        /// Gets the main view of the NUI gadget..
         /// </summary>
         /// <since_tizen> 10 </since_tizen>
         public View MainView
@@ -84,7 +100,7 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Gets the lifecycle state.
+        /// Gets the current lifecycle state of the gadget.
         /// </summary>
         /// <since_tizen> 10 </since_tizen>
         public NUIGadgetLifecycleState State
@@ -96,7 +112,11 @@ namespace Tizen.NUI
         /// <summary>
         /// Gets the resource manager.
         /// </summary>
-        /// <remarks> This property is set before the OnCreate() is called, after the instance has been created. </remarks>
+        /// <remarks> This property is set before the OnCreate() is called, after the instance has been created.
+        /// It provides access to various resources such as images, sounds, and fonts that can be used in your application.
+        /// By utilizing the resource manager, you can easily manage and retrieve these resources without having to manually handle their loading and unloading.
+        /// Additionally, the resource manager ensures efficient memory management by automatically handling the caching and recycling of resources.
+        /// </remarks>
         /// <since_tizen> 10 </since_tizen>
         public NUIGadgetResourceManager NUIGadgetResourceManager
         {
@@ -172,8 +192,8 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Overrides this method if want to handle behavior when the gedget is started.
-        /// If 'base.OnCreate()' is not called, the event 'NUIGadgetLifecycleChanged' with  the 'NUIGadgetLifecycleState.Created' state will not be emitted.
+        /// Override this method to define the behavior when the gadget is created.
+        /// Calling 'base.OnCreate()' is necessary in order to emit the 'NUIGadgetLifecycleChanged' event with the 'NUIGadgetLifecycleState.Created' state.
         /// </summary>
         /// <returns>The main view object.</returns>
         /// <since_tizen> 10 </since_tizen>
@@ -187,15 +207,19 @@ namespace Tizen.NUI
         /// <summary>
         /// Overrides this method if want to handle behavior when the gadget receives the appcontrol message.
         /// </summary>
-        /// <param name="e">The appcontrol received event argument.</param>
+        /// <remarks>
+        /// This method provides a way to customize the response when the gadget receives an appcontrol message.
+        /// By overriding this method in your derived class, you can define specific actions based on the incoming arguments.
+        /// </remarks>
+        /// <param name="e">The appcontrol received event argument containing details about the received message.</param>
         /// <since_tizen> 10 </since_tizen>
         protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e)
         {
         }
 
         /// <summary>
-        /// Overrides this method if want to handle behavior when the gadget is destroyed.
-        /// If 'base.OnDestroy()' is not called. the event 'NUIGadgetLifecycleChanged' with the 'NUIGadgetLifecycleState.Destroyed' state will not be emitted.
+        /// Override this method to handle the behavior when the gadget is destroyed.
+        /// If 'base.OnDestroy()' is not called, the 'NUIGadgetLifecycleChanged' event with the 'NUIGadgetLifecycleState.Destroyed' state will not be emitted.
         /// </summary>
         /// <since_tizen> 10 </since_tizen>
         protected virtual void OnDestroy()
index dcd551f43d3b511886a48e24ff6aa6baa41d3a83..c28aaa88a19e4be6839d9bd4671f3e37158df4d3 100755 (executable)
@@ -26,7 +26,7 @@ using SystemIO = System.IO;
 namespace Tizen.NUI
 {
     /// <summary>
-    /// This class provides properties to get information the gadget.
+    /// This class provides properties to retrieve information the gadget.
     /// </summary>
     /// <since_tizen> 10 </since_tizen>
     [EditorBrowsable(EditorBrowsableState.Never)]
index 2db245cd12116b96a8927bbc0fee835a6cc58ae0..9c9e063f7577feb966c07fd9c656323332e7cd11 100755 (executable)
@@ -20,20 +20,20 @@ using System.ComponentModel;
 namespace Tizen.NUI
 {
     /// <summary>
-    /// Arguments for the event raised when the NUIGadget lifecycle is changed.
+    /// Event arguments for the NUIGadget lifecycle change event.
     /// </summary>
     /// <since_tizen> 10 </since_tizen>
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class NUIGadgetLifecycleChangedEventArgs : EventArgs
     {
         /// <summary>
-        /// The NUIGadget object.
+        /// Gets the NUIGadget object that triggered the event.
         /// </summary>
         /// <since_tizen> 10 </since_tizen>
         public NUIGadget Gadget { get; internal set; }
 
         /// <summary>
-        /// The state of the NUIGadget lifecycle.
+        /// Gets the current state of the NUIGadget lifecycle.
         /// </summary>
         /// <since_tizen> 10 </since_tizen>
         public NUIGadgetLifecycleState State { get; internal set; }
index c0289ea0bb40cc97e2d641f97c20d91393559503..e7e277d33df57e8fe2bcaf6f2f42ab25b0f9b45b 100755 (executable)
@@ -31,7 +31,7 @@ using SystemIO = System.IO;
 namespace Tizen.NUI
 {
     /// <summary>
-    /// This class has the methods and events of the NUIGadgetManager.
+    /// The NUIGadgetManager provides methods and events related to managing gadgets in the NUI.
     /// </summary>
     /// <since_tizen> 10 </since_tizen>
     [EditorBrowsable(EditorBrowsableState.Never)]
@@ -109,6 +109,10 @@ namespace Tizen.NUI
         /// <summary>
         /// Occurs when the lifecycle of the NUIGadget is changed.
         /// </summary>
+        /// <remarks>
+        /// This event is raised when the state of the NUIGadget changes.
+        /// It provides information about the current state through the NUIGadgetLifecycleChangedEventArgs argument.
+        /// </remarks>
         /// <since_tizen> 10 </since_tizen>
         public static event EventHandler<NUIGadgetLifecycleChangedEventArgs> NUIGadgetLifecycleChanged;
 
@@ -137,6 +141,10 @@ namespace Tizen.NUI
         /// Loads an assembly of the NUIGadget.
         /// </summary>
         /// <param name="resourceType">The resource type of the NUIGadget package.</param>
+        /// <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.
+        /// </remarks>
         /// <exception cref="ArgumentException">Thrown when failed because of a invalid argument.</exception>
         /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation.</exception>
         /// <since_tizen> 10 </since_tizen>
@@ -149,9 +157,9 @@ namespace Tizen.NUI
         /// Loads an assembly of the NUIGadget.
         /// </summary>
         /// <param name="resourceType">The resource type of the NUIGadget package.</param>
-        /// <param name="useDefaultContext">The flag if ture, use a default load context. Otherwise, use a new load context.</param>
-        /// <exception cref="ArgumentException">Thrown when failed because of a invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation.</exception>
+        /// <param name="useDefaultContext">Indicates whether to use a default load context or not.</param>
+        /// <exception cref="ArgumentException">Thrown when failed due to an invalid argument.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed due to an invalid operation.</exception>
         /// <since_tizen> 10 </since_tizen>
         public static void Load(string resourceType, bool useDefaultContext)
         {
@@ -165,10 +173,23 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Unloads the loaded assembly of the NUIGadget.
+        /// Unloads the specified NUIGadget assembly from memory.
         /// </summary>
-        /// <param name="resourceType">The resource type of the NUIGadget package.</param>
-        /// <exception cref="ArgumentException">Thrown when failed because of a invalid argument.</exception>
+        /// <remarks>
+        /// To use this method properly, the assembly of the gadget must be loaded using Load() with the custom context.
+        /// </remarks>
+        /// <param name="resourceType">The resource type of the NUIGadget package to unload.</param>
+        /// <exception cref="ArgumentException">Thrown when the argument passed is not valid.</exception>
+        /// <example>
+        /// <code>
+        /// /// 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");
+        /// </code>
+        /// </example>
         /// <since_tizen> 10 </since_tizen>
         public static void Unload(string resourceType)
         {
@@ -257,6 +278,9 @@ namespace Tizen.NUI
         /// <summary>
         /// Adds a NUIGadget to the NUIGadgetManager.
         /// </summary>
+        /// <remarks>
+        /// To use Unload() method, the useDefaultContext must be'false'.
+        /// </remarks>
         /// <param name="resourceType">The resource type of the NUIGadget package.</param>
         /// <param name="className">The class name of the NUIGadget.</param>
         /// <param name="useDefaultContext">The flag it true, use a default context. Otherwise, use a new load context.</param>
@@ -294,9 +318,9 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Gets the instance of the running NUIGadgets.
+        /// Retrieves the instances of currently running NUIGadgets.
         /// </summary>
-        /// <returns>The NUIGadget list.</returns>
+        /// <returns>An enumerable list containing all the active NUIGadgets.</returns>
         /// <since_tizen> 10 </since_tizen>
         public static IEnumerable<NUIGadget> GetGadgets()
         {
@@ -304,14 +328,14 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Gets the information of the available NUIGadgets.
+        /// Retrieves information about available NUIGadgets.
         /// </summary>
         /// <remarks>
-        /// This method only returns the available gadget informations, not all installed gadget informations.
-        /// The resource package of the NUIGadget can set the allowed packages using "allowed-package".
-        /// When executing an application, the platform mounts the resource package into the resource path of the application.
+        /// 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.
         /// </remarks>
-        /// <returns>The NUIGadgetInfo list.</returns>
+        /// <returns>An enumerable list of NUIGadgetInfo objects.</returns>
         /// <since_tizen> 10 </since_tizen>
         public static IEnumerable<NUIGadgetInfo> GetGadgetInfos()
         {
@@ -319,9 +343,15 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Removes the NUIGadget from the NUIGadgetManager.
+        /// Removes the specified NUIGadget from the NUIGadgetManager.
         /// </summary>
-        /// <param name="gadget">The NUIGadget object.</param>
+        /// <param name="gadget">The NUIGadget object that needs to be removed.</param>
+        /// <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.
+        /// </remarks>
         /// <since_tizen> 10 </since_tizen>
         public static void Remove(NUIGadget gadget)
         {
@@ -345,6 +375,10 @@ namespace Tizen.NUI
         /// <summary>
         /// Removes all NUIGadgets from the NUIGadgetManager.
         /// </summary>
+        /// <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.
+        /// </remarks>
         /// <since_tizen> 10 </since_tizen>
         public static void RemoveAll()
         {
@@ -355,12 +389,33 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Resumes the running NUIGadget.
+        /// Resumes the execution of the specified NUIGadget.
         /// </summary>
-        /// <param name="gadget">The NUIGadget object.</param>
+        /// <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.
+        /// </remarks>
+        /// <param name="gadget">The NUIGadget object whose execution needs to be resumed.</param>
+        /// <exception cref="ArgumentNullException">Thrown if the 'gadget' argument is null.</exception>
+        /// <example>
+        /// To resume the execution of a specific NUIGadget named 'MyGadget', you can call the following code snippet:
+        ///
+        /// <code>
+        /// // Get the reference to the NUIGadget object
+        /// NUIGadget MyGadget = ...;
+        ///
+        /// // Resume its execution
+        /// GadgetResume(MyGadget);
+        /// </code>
+        /// </example>
         /// <since_tizen> 10 </since_tizen>
         public static void Resume(NUIGadget gadget)
         {
+            if (gadget == null)
+            {
+                throw new ArgumentNullException(nameof(gadget));
+            }
+
             if (!_gadgets.Contains(gadget))
             {
                 return;
@@ -374,12 +429,21 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Pauses the running NUIGadget.
+        /// Pauses the execution of the specified NUIGadget.
         /// </summary>
-        /// <param name="gadget">The NUIGadget object.</param>
+        /// <remarks>
+        /// Calling this method pauses the currently executing NUIGadget. It does not affect any other gadgets that may be running simultaneously.
+        /// </remarks>
+        /// <param name="gadget">The NUIGadget object whose execution needs to be paused.</param>
+        /// <exception cref="ArgumentNullException">Thrown if the argument 'gadget' is null.</exception>
         /// <since_tizen> 10 </since_tizen>
         public static void Pause(NUIGadget gadget)
         {
+            if (gadget == null)
+            {
+                throw new ArgumentNullException(nameof(gadget));
+            }
+
             if (!_gadgets.Contains(gadget))
             {
                 return;
@@ -393,12 +457,12 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Sends the appcontrol to the running NUIGadget.
+        /// Sends the specified application control to the currently running NUIGadget.
         /// </summary>
-        /// <param name="gadget">The NUIGadget object.</param>
-        /// <param name="appControl">The appcontrol object.</param>
-        /// <exception cref="ArgumentException">Thrown when failed because of a invalid argument.</exception>
-        /// <exception cref="ArgumentNullException">Thrown when failed because the argument is null.</exception>
+        /// <param name="gadget">The NUIGadget object that will receive the app control.</param>
+        /// <param name="appControl">The app control object containing the desired arguments and actions.</param>
+        /// <exception cref="ArgumentException">Thrown if any of the arguments are invalid or missing.</exception>
+        /// <exception cref="ArgumentNullException">Thrown if either 'gadget' or 'appControl' is null.</exception>
         /// <since_tizen> 10 </since_tizen>
         public static void SendAppControl(NUIGadget gadget, AppControl appControl)
         {
index d99a2c382e8856273a074a1001a1233e40398926..6f20fba2bfcfb9284b27fae710f3943298e56ab8 100755 (executable)
@@ -25,7 +25,7 @@ using System.Resources;
 namespace Tizen.NUI
 {
     /// <summary>
-    /// This class has the methods of the NUIGadgetResourceManager.
+    /// Manages resources related to NUI gadgets.
     /// </summary>
     /// <since_tizen> 10 </since_tizen>
     [EditorBrowsable(EditorBrowsableState.Never)]
@@ -40,8 +40,8 @@ namespace Tizen.NUI
         /// Initializes the resource manager of the gadget.
         /// </summary>
         /// <param name="info">The information of the gadget.</param>
-        /// <exception cref="ArgumentNullException">Thrown when failed because of a invalid argument.</exception>
-        /// <since_tizen> 11 </since_tizen>
+        /// <exception cref="ArgumentNullException">Thrown when the argument is not valid.</exception>
+        /// <since_tizen> 10 </since_tizen>
         public NUIGadgetResourceManager(NUIGadgetInfo info)
         {
             if (info == null)
@@ -57,9 +57,9 @@ namespace Tizen.NUI
         /// <summary>
         /// Initializes the resource manager of the gadget.
         /// </summary>
-        /// <param name="resourcePath">The path of the resource</param>
-        /// <param name="resourceDll">The file name of the resource.</param>
-        /// <param name="resourceClassName">The class name of the resource.</param>
+        /// <param name="resourcePath">The path where the resources are located.</param>
+        /// <param name="resourceDll">The name of the DLL containing the resources.</param>
+        /// <param name="resourceClassName">The name of the class that represents the resources.</param>
         /// <since_tizen> 10 </since_tizen>
         public NUIGadgetResourceManager(string resourcePath, string resourceDll, string resourceClassName)
         {
@@ -69,10 +69,26 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Get the value of the specified string resource.
+        /// Retrieves the value of the specified string resource.
         /// </summary>
-        /// <param name="name">The name of the resource to retrieve.</param>
-        /// <returns>The value of the resource, or null if name cannot be found in a resource set.</returns>
+        /// <param name="name">The unique identifier for the string resource to retrieve.</param>
+        /// <returns>The value of the requested string resource, or null if no matching resource could be found.</returns>
+        /// <remarks>
+        /// This function allows you to access localized string resources by providing their names.
+        /// It returns the actual value of the requested resource, which can then be displayed to users or used elsewhere in your application logic.
+        /// If the specified resource does not exist or cannot be found, the function will return null instead.
+        /// </remarks>
+        /// <example>
+        /// Here's an example demonstrating how to retrieve a string resource named "greeting" from the current context:
+        ///
+        /// <code>
+        /// // Retrieve the greeting message
+        /// string greetingMessage = GetString("greeting");
+        ///
+        /// // Display the greeting message to the user
+        /// Console.WriteLine(greetingMessage);
+        /// </code>
+        /// </example>
         /// <since_tizen> 10 </since_tizen>
         public string GetString(string name)
         {
@@ -80,12 +96,16 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Gets the return value of the string resource localized for the specified culture.
+        /// Retrieves the localized string resource for the specified culture.
         /// </summary>
-        /// <param name="name">The name of the resource to retrieve.</param>
-        /// <param name="cultureInfo">An object that represents the culture for which the resource is localied.</param>
-        /// <returns>The value of the resource localied for the specified culture, or null if name cannot be found in a resource set.</returns>
-        /// <exception cref="ArgumentNullException">Thrown when failed because of a invalid argument.</exception>
+        /// <remarks>
+        /// This method enables you to obtain a localized version of a specific string resource based on the provided culture.
+        /// It returns the desired resource value or null if the requested resource cannot be found in the resource set.
+        /// </remarks>
+        /// <param name="name">The name of the resource to fetch.</param>
+        /// <param name="cultureInfo">An object representing the culture for which the resource needs to be localized.</param>
+        /// <returns>The localized string resource for the specified culture, or null if the resource cannot be found.</returns>
+        /// <exception cref="ArgumentNullException">Thrown when an invalid argument causes failure.</exception>
         /// <since_tizen> 10 </since_tizen>
         public string GetString(string name, CultureInfo cultureInfo)
         {