Add comments for Models
authorcskim <charles0.kim@samsung.com>
Wed, 29 Mar 2017 02:48:02 +0000 (11:48 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:51 +0000 (18:34 +0900)
Change-Id: Ic1c9e44fce641a87f3421f7210b9006346cf2628

LibTVRefCommonPortable/DataModels/HomeMenuAppShortcutInfo.cs
LibTVRefCommonPortable/DataModels/WiFiSettingShortcutInfo.cs
LibTVRefCommonPortable/Models/AppShortcutController.cs
LibTVRefCommonPortable/Models/RecentShortcutController.cs
LibTVRefCommonPortable/Models/SettingShortcutController.cs
LibTVRefCommonPortable/Models/SettingShortcutFactory.cs
LibTVRefCommonPortable/Utils/AppShortcutStorage.cs

index 0b20cd4..8ede65d 100644 (file)
@@ -29,7 +29,7 @@ namespace LibTVRefCommonPortable.DataModels
         public string Status { get; set; }
 
         /// <summary>
-        /// A methods initialize a status of a Shortcut.
+        /// A method initializes a status of a Shortcut.
         /// </summary>
         public override void UpdateState()
         {
@@ -37,7 +37,7 @@ namespace LibTVRefCommonPortable.DataModels
         }
 
         /// <summary>
-        /// A methods changes current status of a Shortcut.
+        /// A method changes current status of a Shortcut.
         /// </summary>
         /// <param name="status">A new status</param>
         public void ChangeStatus(string status)
index b4c86d8..3a38e7f 100644 (file)
@@ -24,7 +24,7 @@ namespace LibTVRefCommonPortable.DataModels
     public class WiFiSettingShortcutInfo : ShortcutInfo
     {
         /// <summary>
-        /// A methods initailizes the status of a Shortcut.
+        /// A method initailizes the status of a Shortcut.
         /// </summary>
         public override void UpdateState()
         {
index e432e4f..d75ead3 100755 (executable)
@@ -24,15 +24,25 @@ using System.Threading.Tasks;
 
 namespace LibTVRefCommonPortable.Models
 {
+    /// <summary>
+    /// A class provides Application related information to ViewModel.
+    /// The TVHome shows the Pinned app list when the App Home Menu is pressed,
+    /// by invoking AppShortcutController's api to retrive the pinned app list.
+    /// The TVApps shows the installed Tizen UI apps in the main screen.
+    /// To provides the installed apps, the TVApps invokes a AppShortcutController's api.
+    /// </summary>
     public class AppShortcutController
     {
+        /// <summary>
+        /// A default app icon for no icon applications.
+        /// </summary>
         private static String DefaultAppIcon = "AppIcon.png";
 
-        public AppShortcutController()
-        {
-
-        }
-
+        /// <summary>
+        /// A method provides installed app list.
+        /// The returned app list has only Tizen UI apps not the system app or no display apps.
+        /// </summary>
+        /// <returns>A installed app list.</returns>
         public async Task<IEnumerable<AppShortcutInfo>> GetInstalledApps()
         {
             IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();
@@ -68,6 +78,13 @@ namespace LibTVRefCommonPortable.Models
             return appShortcutInfoList;
         }
 
+        /// <summary>
+        /// A method prepends a All Apps Shortcut and a MediaHub Shortcut in the given App Shortcut list.
+        /// Actually this method is used for making the Pinned App Shortcut panel of the TVHome
+        /// </summary>
+        /// <seealso cref="GetDefaultShortcuts"/>
+        /// <seealso cref="GetPinnedAppsWithDefaultShortcuts"/>
+        /// <param name="returnPinnedAppsInfo">A App Shortcut list contains the additional Shortcuts.</param>
         private void AddAllAppsAndMediaHubShortcut(ref List<ShortcutInfo> returnPinnedAppsInfo)
         {
             var allAppsStateDescription = new StateDescription()
@@ -104,6 +121,12 @@ namespace LibTVRefCommonPortable.Models
             returnPinnedAppsInfo.Insert(1, mediaHubShortcutInfo);
         }
 
+        /// <summary>
+        /// A method appends a Add Pin Shortcut in the given App Shortcut list.
+        /// </summary>
+        /// <seealso cref="GetDefaultShortcuts"/>
+        /// <seealso cref="GetPinnedAppsWithDefaultShortcuts"/>
+        /// <param name="returnPinnedAppsInfo">A App Shortcut list contains the additional Shortcuts.</param>
         private void AppendAddPinShortcut(ref List<ShortcutInfo> returnPinnedAppsInfo)
         {
             var addPinStateDescription = new StateDescription()
@@ -129,6 +152,12 @@ namespace LibTVRefCommonPortable.Models
             returnPinnedAppsInfo.Add(addPinShortcutInfo);
         }
 
+        /// <summary>
+        /// A method provides Pinned App Shrotcut list by retriving from the AppShortcutStorage.
+        /// This method provides only the Pinned App Shortcut list not including any additional Shortcuts
+        /// such as the All Apps, the Media Hub, and the Add Pin.
+        /// </summary>
+        /// <returns>A Pinned App Shortcut list.</returns>
         private async Task<List<ShortcutInfo>> GetPinnedApps()
         {
             IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();
@@ -174,6 +203,11 @@ namespace LibTVRefCommonPortable.Models
             return returnPinnedAppsInfo;
         }
 
+        /// <summary>
+        /// A method provides a App Shortcut list which contains default App Shortcuts
+        /// such as the All Apps, the Media Hub, and the Add Pin.
+        /// </summary>
+        /// <returns>A default App Shortcut list.</returns>
         public IEnumerable<ShortcutInfo> GetDefaultShortcuts()
         {
             List<ShortcutInfo> returnPinnedAppsInfo = new List<ShortcutInfo>();
@@ -184,6 +218,11 @@ namespace LibTVRefCommonPortable.Models
             return returnPinnedAppsInfo;
         }
 
+        /// <summary>
+        /// A method provides the App Shortcut list with the default App Shortcut icons.
+        /// The pinned apps, the All Apps, the MediaHub, and the Add Pin are included in the return App Shortcut list.
+        /// </summary>
+        /// <returns>App Shortcut list.</returns>
         public async Task<IEnumerable<ShortcutInfo>> GetPinnedAppsWithDefaultShortcuts()
         {
             List<ShortcutInfo> returnPinnedAppsInfo = await GetPinnedApps();
@@ -194,6 +233,10 @@ namespace LibTVRefCommonPortable.Models
             return returnPinnedAppsInfo;
         }
 
+        /// <summary>
+        /// A method provides only pinned app's app ID as a hashtable.
+        /// </summary>
+        /// <returns>A hashtable includes pinned app's app ID.</returns>
         public async Task<Dictionary<string, string>> GetPinnedAppsAppIDs()
         {
             IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();
@@ -209,16 +252,24 @@ namespace LibTVRefCommonPortable.Models
             return pinnedAppsDictionary;
         }
 
+        /// <summary>
+        /// A method updates the pinned App list by using the AppShortcutStorage.
+        /// </summary>
+        /// <param name="pinnedAppsInfo">A pinned app list.</param>
         public void UpdatePinnedApps(IEnumerable<AppShortcutInfo> pinnedAppsInfo)
         {
             AppShortcutStorage.Write(pinnedAppsInfo);
         }
 
+        /// <summary>
+        /// A listener to get notification of the AppShortcutStorage.
+        /// </summary>
+        /// <param name="eventListener">A Event Handler for the nofication of AppShortutStorage.</param>
         public void AddFileSystemChangedListener(EventHandler<EventArgs> eventListener)
         {
             if (AppShortcutStorage.Instance != null)
             {
-                AppShortcutStorage.Instance.AddFileSystemChangedListener(eventListener);
+                AppShortcutStorage.Instance.AddStorageChangedListener(eventListener);
             }
             else
             {
index 0de468b..07f67a3 100644 (file)
  * limitations under the License.
  */
 
-using System;
-using System.Collections;
 using System.Collections.Generic;
-using System.Threading.Tasks;
 using LibTVRefCommonPortable.DataModels;
 using LibTVRefCommonPortable.Utils;
 
@@ -25,28 +22,51 @@ using Xamarin.Forms;
 
 namespace LibTVRefCommonPortable.Models
 {
+    /// <summary>
+    /// A class provides Recent Shortcut information to the ViewModel
+    /// The Recent Shortcut can be a app which is recently used and
+    /// a content which is recently consumed in the TV.
+    /// </summary>
     public class RecentShortcutController
     {
+        /// <summary>
+        /// A constructor
+        /// </summary>
         public RecentShortcutController()
         {
         }
 
+        /// <summary>
+        /// A method removes a Recent Shortcut.
+        /// </summary>
+        /// <param name="history">a Recent Shortcut to be removed.</param>
         public void Remove(RecentShortcutInfo history)
         {
             RecentShortcutStorage.Delete(history);
         }
 
+        /// <summary>
+        /// A method revmoes all Recent Shortcuts.
+        /// </summary>
         public void RemoveAll()
         {
             RecentShortcutStorage.DeleteAll();
         }
 
+        /// <summary>
+        /// A method updates Recent Shortcut.
+        /// </summary>
+        /// <param name="shortcut">A Recent Shortcut to be updated.</param>
+        /// <returns>A Status of Update</returns>
         public bool Update(RecentShortcutInfo shortcut)
         {
-            RecentShortcutStorage.Update(shortcut);
-            return false;
+            return RecentShortcutStorage.Update(shortcut);
         }
 
+        /// <summary>
+        /// A method provides a Recent Shortcut list.
+        /// </summary>
+        /// <returns>A Recnet Shortcut list.</returns>
         public IEnumerable<RecentShortcutInfo> GetList()
         {
             IApplicationManagerAPIs applicationManagerPort = DependencyService.Get<IApplicationManagerAPIs>();
index 448dfd9..a2a80eb 100755 (executable)
  * limitations under the License.
  */
 
-using System;
-using System.Collections;
 using System.Collections.Generic;
 using LibTVRefCommonPortable.DataModels;
 
 namespace LibTVRefCommonPortable.Models
 {
+    /// <summary>
+    /// A class provides Settings Shortcut information.
+    /// </summary>
     public class SettingShortcutController
     {
+        /// <summary>
+        /// A Setting Shortcut list.
+        /// </summary>
         private List<ShortcutInfo> settingShortcutList = new List<ShortcutInfo>();
 
+        /// <summary>
+        /// A Constructor
+        /// Set dedicated Settings to be displayed in the TVHome.
+        /// </summary>
         public SettingShortcutController()
         {
             // TODO : read from file!!!
@@ -40,6 +48,10 @@ namespace LibTVRefCommonPortable.Models
             // TODO : Provides list of SettingShortcuts
         }
 
+        /// <summary>
+        /// A method provides Setting Shortcut list.
+        /// </summary>
+        /// <returns>A Setting Shortcut list.</returns>
         public IEnumerable<ShortcutInfo> GetList()
         {
             return new List<ShortcutInfo>(settingShortcutList);
index 64a325f..1904a97 100755 (executable)
@@ -18,6 +18,9 @@ using LibTVRefCommonPortable.DataModels;
 
 namespace LibTVRefCommonPortable.Models
 {
+    /// <summary>
+    /// A enumeration for Setting Shortcut making.
+    /// </summary>
     public enum SettingID
     {
         SETTINGS,
@@ -25,8 +28,16 @@ namespace LibTVRefCommonPortable.Models
         BLUETOOTH
     };
 
+    /// <summary>
+    /// A factory class to provide Setting Shortcuts.
+    /// </summary>
     public static class SettingShortcutFactory
     {
+        /// <summary>
+        /// A method provides Setting Shortcuts.
+        /// </summary>
+        /// <param name="id">A Setting ID</param>
+        /// <returns>A Setting Shortcut.</returns>
         public static ShortcutInfo Get(SettingID id)
         {
             ShortcutInfo sc;
index acc4777..7c9b13b 100644 (file)
@@ -135,7 +135,7 @@ namespace LibTVRefCommonPortable.Utils
             return true;
         }
 
-        public void AddFileSystemChangedListener(EventHandler<EventArgs> eventListener)
+        public void AddStorageChangedListener(EventHandler<EventArgs> eventListener)
         {
             fileSystemWatcher.CustomChanged += eventListener;
         }