From: cskim Date: Wed, 29 Mar 2017 02:48:02 +0000 (+0900) Subject: Add comments for Models X-Git-Tag: submit/tizen/20170808.015446~142 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c387307d5c3e1044df8147e9212d651e80cf024c;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Add comments for Models Change-Id: Ic1c9e44fce641a87f3421f7210b9006346cf2628 --- diff --git a/LibTVRefCommonPortable/DataModels/HomeMenuAppShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/HomeMenuAppShortcutInfo.cs index 0b20cd4..8ede65d 100644 --- a/LibTVRefCommonPortable/DataModels/HomeMenuAppShortcutInfo.cs +++ b/LibTVRefCommonPortable/DataModels/HomeMenuAppShortcutInfo.cs @@ -29,7 +29,7 @@ namespace LibTVRefCommonPortable.DataModels public string Status { get; set; } /// - /// A methods initialize a status of a Shortcut. + /// A method initializes a status of a Shortcut. /// public override void UpdateState() { @@ -37,7 +37,7 @@ namespace LibTVRefCommonPortable.DataModels } /// - /// A methods changes current status of a Shortcut. + /// A method changes current status of a Shortcut. /// /// A new status public void ChangeStatus(string status) diff --git a/LibTVRefCommonPortable/DataModels/WiFiSettingShortcutInfo.cs b/LibTVRefCommonPortable/DataModels/WiFiSettingShortcutInfo.cs index b4c86d8..3a38e7f 100644 --- a/LibTVRefCommonPortable/DataModels/WiFiSettingShortcutInfo.cs +++ b/LibTVRefCommonPortable/DataModels/WiFiSettingShortcutInfo.cs @@ -24,7 +24,7 @@ namespace LibTVRefCommonPortable.DataModels public class WiFiSettingShortcutInfo : ShortcutInfo { /// - /// A methods initailizes the status of a Shortcut. + /// A method initailizes the status of a Shortcut. /// public override void UpdateState() { diff --git a/LibTVRefCommonPortable/Models/AppShortcutController.cs b/LibTVRefCommonPortable/Models/AppShortcutController.cs index e432e4f..d75ead3 100755 --- a/LibTVRefCommonPortable/Models/AppShortcutController.cs +++ b/LibTVRefCommonPortable/Models/AppShortcutController.cs @@ -24,15 +24,25 @@ using System.Threading.Tasks; namespace LibTVRefCommonPortable.Models { + /// + /// 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. + /// public class AppShortcutController { + /// + /// A default app icon for no icon applications. + /// private static String DefaultAppIcon = "AppIcon.png"; - public AppShortcutController() - { - - } - + /// + /// A method provides installed app list. + /// The returned app list has only Tizen UI apps not the system app or no display apps. + /// + /// A installed app list. public async Task> GetInstalledApps() { IApplicationManagerAPIs applicationManagerPort = DependencyService.Get(); @@ -68,6 +78,13 @@ namespace LibTVRefCommonPortable.Models return appShortcutInfoList; } + /// + /// 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 + /// + /// + /// + /// A App Shortcut list contains the additional Shortcuts. private void AddAllAppsAndMediaHubShortcut(ref List returnPinnedAppsInfo) { var allAppsStateDescription = new StateDescription() @@ -104,6 +121,12 @@ namespace LibTVRefCommonPortable.Models returnPinnedAppsInfo.Insert(1, mediaHubShortcutInfo); } + /// + /// A method appends a Add Pin Shortcut in the given App Shortcut list. + /// + /// + /// + /// A App Shortcut list contains the additional Shortcuts. private void AppendAddPinShortcut(ref List returnPinnedAppsInfo) { var addPinStateDescription = new StateDescription() @@ -129,6 +152,12 @@ namespace LibTVRefCommonPortable.Models returnPinnedAppsInfo.Add(addPinShortcutInfo); } + /// + /// 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. + /// + /// A Pinned App Shortcut list. private async Task> GetPinnedApps() { IApplicationManagerAPIs applicationManagerPort = DependencyService.Get(); @@ -174,6 +203,11 @@ namespace LibTVRefCommonPortable.Models return returnPinnedAppsInfo; } + /// + /// A method provides a App Shortcut list which contains default App Shortcuts + /// such as the All Apps, the Media Hub, and the Add Pin. + /// + /// A default App Shortcut list. public IEnumerable GetDefaultShortcuts() { List returnPinnedAppsInfo = new List(); @@ -184,6 +218,11 @@ namespace LibTVRefCommonPortable.Models return returnPinnedAppsInfo; } + /// + /// 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. + /// + /// App Shortcut list. public async Task> GetPinnedAppsWithDefaultShortcuts() { List returnPinnedAppsInfo = await GetPinnedApps(); @@ -194,6 +233,10 @@ namespace LibTVRefCommonPortable.Models return returnPinnedAppsInfo; } + /// + /// A method provides only pinned app's app ID as a hashtable. + /// + /// A hashtable includes pinned app's app ID. public async Task> GetPinnedAppsAppIDs() { IApplicationManagerAPIs applicationManagerPort = DependencyService.Get(); @@ -209,16 +252,24 @@ namespace LibTVRefCommonPortable.Models return pinnedAppsDictionary; } + /// + /// A method updates the pinned App list by using the AppShortcutStorage. + /// + /// A pinned app list. public void UpdatePinnedApps(IEnumerable pinnedAppsInfo) { AppShortcutStorage.Write(pinnedAppsInfo); } + /// + /// A listener to get notification of the AppShortcutStorage. + /// + /// A Event Handler for the nofication of AppShortutStorage. public void AddFileSystemChangedListener(EventHandler eventListener) { if (AppShortcutStorage.Instance != null) { - AppShortcutStorage.Instance.AddFileSystemChangedListener(eventListener); + AppShortcutStorage.Instance.AddStorageChangedListener(eventListener); } else { diff --git a/LibTVRefCommonPortable/Models/RecentShortcutController.cs b/LibTVRefCommonPortable/Models/RecentShortcutController.cs index 0de468b..07f67a3 100644 --- a/LibTVRefCommonPortable/Models/RecentShortcutController.cs +++ b/LibTVRefCommonPortable/Models/RecentShortcutController.cs @@ -14,10 +14,7 @@ * 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 { + /// + /// 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. + /// public class RecentShortcutController { + /// + /// A constructor + /// public RecentShortcutController() { } + /// + /// A method removes a Recent Shortcut. + /// + /// a Recent Shortcut to be removed. public void Remove(RecentShortcutInfo history) { RecentShortcutStorage.Delete(history); } + /// + /// A method revmoes all Recent Shortcuts. + /// public void RemoveAll() { RecentShortcutStorage.DeleteAll(); } + /// + /// A method updates Recent Shortcut. + /// + /// A Recent Shortcut to be updated. + /// A Status of Update public bool Update(RecentShortcutInfo shortcut) { - RecentShortcutStorage.Update(shortcut); - return false; + return RecentShortcutStorage.Update(shortcut); } + /// + /// A method provides a Recent Shortcut list. + /// + /// A Recnet Shortcut list. public IEnumerable GetList() { IApplicationManagerAPIs applicationManagerPort = DependencyService.Get(); diff --git a/LibTVRefCommonPortable/Models/SettingShortcutController.cs b/LibTVRefCommonPortable/Models/SettingShortcutController.cs index 448dfd9..a2a80eb 100755 --- a/LibTVRefCommonPortable/Models/SettingShortcutController.cs +++ b/LibTVRefCommonPortable/Models/SettingShortcutController.cs @@ -14,17 +14,25 @@ * limitations under the License. */ -using System; -using System.Collections; using System.Collections.Generic; using LibTVRefCommonPortable.DataModels; namespace LibTVRefCommonPortable.Models { + /// + /// A class provides Settings Shortcut information. + /// public class SettingShortcutController { + /// + /// A Setting Shortcut list. + /// private List settingShortcutList = new List(); + /// + /// A Constructor + /// Set dedicated Settings to be displayed in the TVHome. + /// public SettingShortcutController() { // TODO : read from file!!! @@ -40,6 +48,10 @@ namespace LibTVRefCommonPortable.Models // TODO : Provides list of SettingShortcuts } + /// + /// A method provides Setting Shortcut list. + /// + /// A Setting Shortcut list. public IEnumerable GetList() { return new List(settingShortcutList); diff --git a/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs b/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs index 64a325f..1904a97 100755 --- a/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs +++ b/LibTVRefCommonPortable/Models/SettingShortcutFactory.cs @@ -18,6 +18,9 @@ using LibTVRefCommonPortable.DataModels; namespace LibTVRefCommonPortable.Models { + /// + /// A enumeration for Setting Shortcut making. + /// public enum SettingID { SETTINGS, @@ -25,8 +28,16 @@ namespace LibTVRefCommonPortable.Models BLUETOOTH }; + /// + /// A factory class to provide Setting Shortcuts. + /// public static class SettingShortcutFactory { + /// + /// A method provides Setting Shortcuts. + /// + /// A Setting ID + /// A Setting Shortcut. public static ShortcutInfo Get(SettingID id) { ShortcutInfo sc; diff --git a/LibTVRefCommonPortable/Utils/AppShortcutStorage.cs b/LibTVRefCommonPortable/Utils/AppShortcutStorage.cs index acc4777..7c9b13b 100644 --- a/LibTVRefCommonPortable/Utils/AppShortcutStorage.cs +++ b/LibTVRefCommonPortable/Utils/AppShortcutStorage.cs @@ -135,7 +135,7 @@ namespace LibTVRefCommonPortable.Utils return true; } - public void AddFileSystemChangedListener(EventHandler eventListener) + public void AddStorageChangedListener(EventHandler eventListener) { fileSystemWatcher.CustomChanged += eventListener; }