{\r
result = new string[3];\r
\r
- result[0] = appInfo.Label != null ? appInfo.Label : null;\r
- result[1] = appInfo.ApplicationId != null ? appInfo.ApplicationId : null;\r
- result[2] = appInfo.IconPath != null ? appInfo.IconPath : "AppIcon.png";\r
+ result[0] = (appInfo.Label != null) ? appInfo.Label : null;\r
+ result[1] = (appInfo.ApplicationId != null) ? appInfo.ApplicationId : null;\r
+ result[2] = (System.IO.File.Exists(appInfo.IconPath)) ? appInfo.IconPath : "AppIcon.png";\r
resultList.Add(appInfo.ApplicationId, result);\r
}\r
\r
{\r
Dictionary<string, string> result = null;\r
ApplicationInfo appInfo = null;\r
+ string[] icons = { "ic_black.png", "ic_blue.png", "ic_green.png", "ic_red.png", "ic_yellow.png", "AppIcon.png" };\r
+ Random random = new Random();\r
+\r
try\r
{\r
appInfo = ApplicationManager.GetInstalledApplication(applicationId);\r
result = new Dictionary<string, string>();\r
result.Add("Label", appInfo.Label);\r
result.Add("ApplicationId", appInfo.ApplicationId);\r
- result.Add("IconPath", appInfo.IconPath);\r
+ result.Add("IconPath", (System.IO.File.Exists(appInfo.IconPath)) ? appInfo.IconPath : icons[random.Next(0, 6)]);\r
}\r
catch(Exception exception)\r
{\r
{\r
result = new string[3];\r
\r
- if (item.Label != null)\r
- {\r
- result[0] = item.Label;\r
- }\r
- else\r
- {\r
- result[0] = null;\r
- }\r
-\r
- if (item.Id != null)\r
- {\r
- result[1] = item.Id;\r
- }\r
- else\r
- {\r
- result[1] = null;\r
- }\r
-\r
- if (item.IconPath != null)\r
- {\r
- result[2] = item.IconPath;\r
- }\r
- else\r
- {\r
- result[2] = null;\r
- }\r
+ result[0] = (item.Label != null) ? item.Label : null;\r
+ result[1] = (item.Id != null) ? item.Id : null;\r
+ result[2] = (System.IO.File.Exists(item.IconPath)) ? item.IconPath : "AppIcon.png";\r
\r
pkgList.Add(item.Label, result);\r
}\r
{\r
Package tempItem = PackageManager.GetPackage(PkgID);\r
\r
- if (tempItem != null)\r
- {\r
- return tempItem.Label;\r
- }\r
- else\r
- {\r
- return null;\r
- }\r
+ return (tempItem != null) ? tempItem.Label : null;\r
}\r
}\r
}
\ No newline at end of file