[ComponentBased.ComponentManager] Enhance API descriptions
authorupple <uppletaste@gmail.com>
Thu, 26 Sep 2024 15:54:36 +0000 (00:54 +0900)
committerChangGyu Choi <uppletaste@gmail.com>
Fri, 27 Sep 2024 02:01:11 +0000 (11:01 +0900)
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentInfo.cs
src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentManager.cs
src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentRunningContext.cs

index 16805c4b0135b820d9efc4bbe735557e347ec875..f0b6ebfb90ad011aee63388c6c0cd975dbba49f8 100755 (executable)
@@ -20,7 +20,8 @@ using System.Collections.Generic;
 namespace Tizen.Applications.ComponentBased
 {
     /// <summary>
-    /// This class provides methods and properties to get information of the component.
+    /// Provides methods and properties to retrieve information about a component in a Tizen application.
+    /// This class encapsulates details such as component ID, application ID, and other attributes.
     /// </summary>
     /// <since_tizen> 6 </since_tizen>
     public class ComponentInfo : IDisposable
@@ -41,13 +42,13 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// A constructor of ComponentInfo that takes the component ID.
+        /// Initializes a new instance of the <see cref="ComponentInfo"/> class with the specified component ID.
         /// </summary>
-        /// <param name="componentId">Component ID.</param>
-        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of the system error.</exception>
-        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
-        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>>
+        /// <param name="componentId">The ID of the component.</param>
+        /// <exception cref="ArgumentException">Thrown when the component ID is invalid.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when a system error occurs.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when memory allocation fails.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
         /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
         /// <since_tizen> 6 </since_tizen>
         public ComponentInfo(string componentId)
@@ -63,7 +64,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Destructor of the class.
+        /// Finalizes an instance of the <see cref="ComponentInfo"/> class.
         /// </summary>
         ~ComponentInfo()
         {
@@ -71,7 +72,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Gets the component ID.
+        /// Gets the ID of the component.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public string ComponentId
@@ -94,7 +95,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Gets the application ID of the component.
+        /// Gets the application ID associated with the component.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public string ApplicationId
@@ -132,7 +133,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Checks whether the icon of the component should be displayed or not.
+        /// Checks whether the icon of the component should be displayed.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public bool IsIconDisplayed
@@ -151,7 +152,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Checks whether the component should be managed by task-manager or not.
+        /// Checks whether the component is managed by the task manager.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public bool IsManagedByTaskManager
@@ -170,7 +171,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Gets the absolute path of the icon image.
+        /// Gets the absolute path of the component's icon image.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public string IconPath
@@ -207,11 +208,11 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Gets the localized label of the component for the given locale.
+        /// Gets the localized label of the component for a specified locale.
         /// </summary>
-        /// <param name="locale">Locale.</param>
-        /// <remarks>The format of locale is language and country code. (available value: "[2-letter lowercase language code (ISO 639-1)]-[2-letter lowercase country code (ISO 3166-alpha-2)]")</remarks>
-        /// <returns>The localized label.</returns>
+        /// <param name="locale">The locale in the format of language and country code (e.g., "en-US").</param>
+        /// <remarks>Available values are in the format "[2-letter lowercase language code (ISO 639-1)]-[2-letter lowercase country code (ISO 3166-alpha-2)]".</remarks>
+        /// <returns>The localized label corresponding to the specified locale.</returns>
         /// <since_tizen> 6 </since_tizen>
         public string GetLocalizedLabel(string locale)
         {
@@ -226,7 +227,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Releases all resources used by the ComponentInfo class.
+        /// Releases all resources used by the <see cref="ComponentInfo"/> class.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public void Dispose()
@@ -236,7 +237,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Releases all resources used by the ComponentInfo class.
+        /// Releases resources used by the <see cref="ComponentInfo"/> class.
         /// </summary>
         /// <param name="disposing">Disposing</param>
         /// <since_tizen> 6 </since_tizen>
index 4824e6f4e4b3f2b9856c0c7eeed0ff509dfdf535..890c8080fc0f3eb923b625a3b73b23e4c01a0142 100755 (executable)
@@ -29,15 +29,18 @@ namespace Tizen.Applications.ComponentBased
     public static class ComponentManager
     {
         private const string LogTag = "Tizen.Applications";
-        
+
         /// <summary>
-        /// Gets the information of the installed components asynchronously.
+        /// Asynchronously retrieves a list of installed components.
         /// </summary>
-        /// <returns>The installed component info list.</returns>
-        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of the "component not exist" error or the system error.</exception>
-        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
-        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+        /// <returns>
+        /// A task that represents the asynchronous operation.
+        /// The task result contains an <see cref="IEnumerable{ComponentInfo}"/> of the installed component information.
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is provided.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the component does not exist or if a system error occurs.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when the system runs out of memory.</exception>
+        /// <exception cref="UnauthorizedAccessException"> Thrown when permission is denied to access the component information.</exception>
         /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
         /// <since_tizen> 6 </since_tizen>
         public static async Task<IEnumerable<ComponentInfo>> GetInstalledComponentsAsync()
@@ -74,13 +77,16 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Gets the information of the running components asynchronously.
+        /// Asynchronously retrieves a list of currently running components.
         /// </summary>
-        /// <returns>The component running context list.</returns>
-        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of the "component not exist" error or the system error.</exception>
-        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
-        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+        /// <returns>
+        /// A task that represents the asynchronous operation.
+        /// The task result contains an <see cref="IEnumerable{ComponentRunningContext}"/> of the running components.
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is provided.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the component does not exist or if a system error occurs.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when the system runs out of memory.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to access the running components.</exception>
         /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
         /// <since_tizen> 6 </since_tizen>
         public static async Task<IEnumerable<ComponentRunningContext>> GetRunningComponentsAsync()
@@ -117,14 +123,16 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Checks whether the component is running or not.
+        /// Checks if a specified component is currently running.
         /// </summary>
-        /// <param name="componentId">Component ID.</param>
-        /// <returns>Returns true if the component is running, otherwise false.</returns>
-        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of the "component not exist" error or the system error.</exception>
-        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
-        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+        /// <param name="componentId">The unique identifier of the component.</param>
+        /// <returns>
+        /// True if the component is running; otherwise, false.
+        /// </returns>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is provided.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the component does not exist or if a system error occurs.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when the system runs out of memory.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to access the component status.</exception>
         /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
         /// <since_tizen> 6 </since_tizen>
         public static bool IsRunning(string componentId)
@@ -139,17 +147,17 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Terminates the component if it is running in the background.
+        /// Requests to terminate a specified component that is running in the background.
         /// </summary>
-        /// <param name="context">Component ID</param>
-        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of the "component not exist" error or the system error.</exception>
-        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
-        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+        /// <param name="context">The context of the running component to terminate.</param>
+        /// <exception cref="ArgumentException">Thrown when an invalid argument is provided.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the component does not exist or if a system error occurs.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when the system runs out of memory.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to terminate the component.</exception>
         /// <privilege>http://tizen.org/privilege/appmanager.kill.bgapp</privilege>
         /// <remarks>
-        /// This function returns after it just sends a request for terminating a background component.
-        /// Platform will decide if the target component could be terminated or not according to the state of the target component.
+        /// This method sends a request to terminate a background component.
+        /// The platform determines if the target component can be terminated based on its current state.
         /// </remarks>
         /// <since_tizen> 6 </since_tizen>
         public static void TerminateBackgroundComponent(ComponentRunningContext context)
index 4932922087c79191e6db4e9141bd4997797bc82a..0c366ec1c6e53e937c38c43d7e252b574a4441ab 100755 (executable)
@@ -23,7 +23,8 @@ using System.Threading.Tasks;
 namespace Tizen.Applications.ComponentBased
 {
     /// <summary>
-    /// This class provides methods and properties to get information of the running component.
+    /// Represents the context of a running component, providing methods and properties
+    /// to retrieve information about the component's state and behavior.
     /// </summary>
     /// <since_tizen> 6 </since_tizen>
     public class ComponentRunningContext : IDisposable
@@ -39,13 +40,14 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// A constructor of ComponentRunningContext that takes the component ID.
+        /// Initializes a new instance of the <see cref="ComponentRunningContext"/> class
+        /// with a specified component ID, retrieving the context handle associated with it.
         /// </summary>
-        /// <param name="componentId">Component ID.</param>
-        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of the "component not exist" error or the system error.</exception>
-        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
-        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+        /// <param name="componentId">The ID of the component.</param>
+        /// <exception cref="ArgumentException">Thrown when the component ID is invalid.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when the component does not exist or a system error occurs.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when memory allocation fails.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to access the component.</exception>
         /// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
         /// <since_tizen> 6 </since_tizen>
         public ComponentRunningContext(string componentId)
@@ -61,7 +63,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Destructor of the class.
+        /// Finalizes an instance of the <see cref="ComponentRunningContext"/> class.
         /// </summary>
         ~ComponentRunningContext()
         {
@@ -69,7 +71,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Enumeration for the component state.
+        /// Represents the possible states of a component.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public enum ComponentState
@@ -108,6 +110,7 @@ namespace Tizen.Applications.ComponentBased
         /// <summary>
         /// Gets the ID of the component.
         /// </summary>
+        /// <returns>The component ID as a string.</returns>
         /// <since_tizen> 6 </since_tizen>
         public string ComponentId
         {
@@ -129,7 +132,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Gets the application ID of the component.
+        /// Gets the application ID associated with the component.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public string ApplicationId
@@ -146,7 +149,7 @@ namespace Tizen.Applications.ComponentBased
                 return appId;
             }
         }
-        
+
         /// <summary>
         /// Gets the instance ID of the component.
         /// </summary>
@@ -167,7 +170,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Gets the state of the component.
+        /// Gets the current state of the component.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public ComponentState State
@@ -186,8 +189,9 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Checks whether the component is terminated or not.
+        /// Checks whether the component has been terminated.
         /// </summary>
+        /// <returns><c>true</c> if the component is terminated; otherwise, <c>false</c>.</returns>
         /// <since_tizen> 6 </since_tizen>
         public bool IsTerminated
         {
@@ -205,8 +209,9 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Checks whether the component is running as sub component of the group.
+        /// Checks whether the component is running as a sub-component of a group.
         /// </summary>
+        /// <returns><c>true</c> if the component is a sub-component; otherwise, <c>false</c>.</returns>
         /// <since_tizen> 6 </since_tizen>
         public bool IsSubComponent
         {
@@ -224,12 +229,12 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Resumes the running component.
+        /// Resumes the execution of the running component.
         /// </summary>
-        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of the system error.</exception>
-        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
-        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+        /// <exception cref="ArgumentException">Thrown when the argument is invalid.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when a system error occurs.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when memory allocation fails.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to resume the component.</exception>
         /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
         /// <since_tizen> 6 </since_tizen>
         public void Resume()
@@ -237,17 +242,17 @@ namespace Tizen.Applications.ComponentBased
             Interop.ComponentManager.ErrorCode err = Interop.ComponentManager.ComponentManagerResumeComponent(_contextHandle);
             if (err != Interop.ComponentManager.ErrorCode.None)
             {
-                throw ComponentManager.ComponentManagerErrorFactory.GetException(err, "Failed to Send the resume request.");
+                throw ComponentManager.ComponentManagerErrorFactory.GetException(err, "Failed to send the resume request.");
             }
         }
 
         /// <summary>
-        /// Pauses the running component.
+        /// Pauses the execution of the running component.
         /// </summary>
-        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of the system error.</exception>
-        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
-        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+        /// <exception cref="ArgumentException">Thrown when the argument is invalid.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when a system error occurs.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when memory allocation fails.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to pause the component.</exception>
         /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
         /// <since_tizen> 6 </since_tizen>
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -261,12 +266,12 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Terminates the running component.
+        /// Terminates the execution of the running component.
         /// </summary>
-        /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
-        /// <exception cref="InvalidOperationException">Thrown when failed because of the system error.</exception>
-        /// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
-        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+        /// <exception cref="ArgumentException">Thrown when the argument is invalid.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when a system error occurs.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when memory allocation fails.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to terminate the component.</exception>
         /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
         /// <since_tizen> 6 </since_tizen>
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -280,7 +285,7 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Releases all resources used by the ComponentInfo class.
+        /// Releases all resources used by the <see cref="ComponentRunningContext"/> class.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public void Dispose()
@@ -290,9 +295,9 @@ namespace Tizen.Applications.ComponentBased
         }
 
         /// <summary>
-        /// Releases all resources used by the ComponentInfo class.
+        /// Releases all resources used by the <see cref="ComponentRunningContext"/> class.
         /// </summary>
-        /// <param name="disposing">Disposing</param>
+        /// <param name="disposing"><c>true</c> to release managed resources; otherwise, <c>false</c>.</param>
         /// <since_tizen> 6 </since_tizen>
         private void Dispose(bool disposing)
         {