Add comments for AppControlPort.cs
authorGeunsun, Lee <gs86.lee@samsung.com>
Tue, 28 Mar 2017 08:55:38 +0000 (17:55 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:51 +0000 (18:34 +0900)
Change-Id: Ide881a58fc589f709aaf72f177ffc4c4ca6f9afe

LibTVRefCommonTizen/Ports/AppControlPort.cs

index 72fca7e..b946580 100644 (file)
@@ -21,33 +21,63 @@ using Tizen.Applications;
 
 namespace LibTVRefCommonTizen.Ports
 {
+    /// <summary>
+    /// This class is for AppControl API
+    /// </summary>
     public class AppControlPort : IAppControl
     {
+        /// <summary>
+        /// The app ID of TV reference home application
+        /// </summary>
         // TODO : change application later
         public static string TVHomeAppID = "org.tizen.example.TVHome.TizenTV";
+
+        /// <summary>
+        /// The app ID of TV reference apps-tray application
+        /// </summary>
         public static string TVAppsAppID = "org.tizen.example.TVApps.TizenTV";
 
+        /// <summary>
+        /// This operation is sended from TVHomes to TVApps
+        /// </summary>
         public static string AddAppOperation = "http://xahome.tizen.org/appcontrol/operation/add_app";
+
+        /// <summary>
+        /// This operation is sended from TVApps to TVHome
+        /// </summary>
         public static string AppAddedNotifyOperation = "http://xahome.tizen.org/appcontrol/operation/app_added";
 
         public static string KeyAddedAppID = "AddedAppID";
 
-        public void SendLaunchRequest(string PkgID)
+        /// <summary>
+        /// Sends the launch request
+        /// </summary>
+        /// <param name="AppId"> The app ID to explicitly launch</param>
+        public void SendLaunchRequest(string AppId)
         {
-            AppControl appControl = new AppControl();
-
-            if (PkgID != null)
+            try
             {
-                appControl.ApplicationId = PkgID;
+                AppControl appControl = new AppControl();
+
+                if (AppId == null || AppId.Length <= 0)
+                {
+                    DebuggingUtils.Err("The AppID is null or black");
+                    return;
+                }
+
+                appControl.ApplicationId = AppId;
+
+                AppControl.SendLaunchRequest(appControl);
             }
-            else
+            catch (InvalidOperationException)
             {
-                appControl.ApplicationId = "org.tizen.settings";
+                DebuggingUtils.Err("Failed to create AppControl");
             }
-
-            AppControl.SendLaunchRequest(appControl);
         }
 
+        /// <summary>
+        /// Sends the 'Add PIN apps' operation to TV Apps
+        /// </summary>
         public void SendAddAppRequestToApps()
         {
             AppControl appControl = new AppControl()
@@ -58,6 +88,10 @@ namespace LibTVRefCommonTizen.Ports
             AppControl.SendLaunchRequest(appControl);
         }
 
+        /// <summary>
+        /// Sends the pinned app ID to TV Home
+        /// </summary>
+        /// <param name="addedAddID">The app ID to add PIN list int the TV Home</param>
         public void SendAppAddedNotificationToHome(string addedAddID)
         {
             AppControl appControl = new AppControl()