From 98531782b240c55a0a83fb1d83dcef5b78ca56fb Mon Sep 17 00:00:00 2001 From: Kyuho Jo Date: Thu, 2 Mar 2017 17:39:46 +0900 Subject: [PATCH] Simplify codes for assigning of apps icon Change-Id: I818e9b90ae9041e8dcd502e042e59d090c625307 Signed-off-by: Kyuho Jo --- TVHome/TVHome/Models/AppShortcutController.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/TVHome/TVHome/Models/AppShortcutController.cs b/TVHome/TVHome/Models/AppShortcutController.cs index ce9d0f4..a705a71 100644 --- a/TVHome/TVHome/Models/AppShortcutController.cs +++ b/TVHome/TVHome/Models/AppShortcutController.cs @@ -53,22 +53,17 @@ namespace TVHome.Models appInfo.TryGetValue("IconPath", out appIconPath); DebuggingUtils.Dbg("AppID: " + appShortcutInfo.AppID + ", Label : " + appLabel + " IconPath : " + appIconPath); + Random random = new Random(); var defaultStateDescription = new StateDescription() { Label = appLabel, - IconPath = appIconPath, + IconPath = appIconPath??icons[random.Next(0, 6)], //IconPath = (resul5t[2] == null) ? "AppIcon.png" : result[2], Action = new AppControlAction { AppID = appShortcutInfo.AppID, } }; - if (defaultStateDescription.IconPath == null || defaultStateDescription.IconPath.Length == 0) - { - Random random = new Random(); - defaultStateDescription.IconPath = icons[random.Next(0, 6)]; //IconPath = (resul5t[2] == null) ? "AppIcon.png" : result[2], - } - appShortcutInfo.StateDescriptions.Add("default", defaultStateDescription); appShortcutInfo.CurrentStateDescription = defaultStateDescription; } -- 2.34.1