public static ApplicationInfo FromStoreApp(ManagedShell.UWPInterop.StoreApp storeApp) { ApplicationInfo ai = new ApplicationInfo(); ai.Name = storeApp.DisplayName; ai.Path = "appx:" + storeApp.AppUserModelId; ai.Target = storeApp.AppUserModelId; ai.IconColor = storeApp.IconColor; return(ai); }
public static ApplicationInfo FromStoreApp(ManagedShell.UWPInterop.StoreApp storeApp) { ApplicationInfo ai = new ApplicationInfo(); ai.Name = storeApp.DisplayName; ai.Path = "appx:" + storeApp.AppUserModelId; ai.Target = storeApp.AppUserModelId; ai.IconColor = storeApp.IconColor; ai.AllowRunAsAdmin = storeApp.EntryPoint == "Windows.FullTrustApplication"; return(ai); }
public static CategoryList Deserialize(string ConfigFile) { XmlDocument doc = new XmlDocument(); doc.Load(ConfigFile); XmlElement root = doc.ChildNodes[0] as XmlElement; CategoryList catList = new CategoryList(); foreach (XmlElement catElement in root.ChildNodes) { // get category Category cat = new Category(); cat.Name = catElement.Attributes["Name"].Value; if (catElement.Attributes["Type"] != null) { cat.Type = (AppCategoryType)Convert.ToInt32(catElement.Attributes["Type"].Value); } else { // migration if (cat.Name == "Uncategorized") { cat.Type = AppCategoryType.Uncategorized; } else if (cat.Name == "Quick Launch") { cat.Type = AppCategoryType.QuickLaunch; } } if (catElement.Attributes["ShowInMenu"] != null) { cat.ShowInMenu = Convert.ToBoolean(catElement.Attributes["ShowInMenu"].Value); } else { // force hide quick launch and uncategorized if (cat.Type == AppCategoryType.Uncategorized || cat.Type == AppCategoryType.QuickLaunch) { cat.ShowInMenu = false; } } catList.Add(cat); foreach (XmlElement appElement in catElement.ChildNodes) { // get application ApplicationInfo app = new ApplicationInfo { Name = appElement.ChildNodes[0].InnerText, Path = appElement.ChildNodes[1].InnerText }; if (appElement.Attributes["AskAlwaysAdmin"] != null) { app.AskAlwaysAdmin = Convert.ToBoolean(appElement.Attributes["AskAlwaysAdmin"].Value); } if (appElement.Attributes["AlwaysAdmin"] != null) { app.AlwaysAdmin = Convert.ToBoolean(appElement.Attributes["AlwaysAdmin"].Value); } if (appElement.ChildNodes.Count > 2) { app.Target = appElement.ChildNodes[2].InnerText; } if (!app.IsStoreApp && !ShellHelper.Exists(app.Path)) { ShellLogger.Debug(app.Path + " does not exist"); continue; } if (appElement.Attributes["AllowRunAsAdmin"] != null) { app.AllowRunAsAdmin = Convert.ToBoolean(appElement.Attributes["AllowRunAsAdmin"].Value); } else { // migration if (app.IsStoreApp && EnvironmentHelper.IsWindows8OrBetter) { ManagedShell.UWPInterop.StoreApp storeApp = ManagedShell.UWPInterop.StoreAppHelper.AppList.GetAppByAumid(app.Target); if (storeApp != null) { app.AllowRunAsAdmin = storeApp.EntryPoint == "Windows.FullTrustApplication"; } else { app.AllowRunAsAdmin = false; } } else { app.AllowRunAsAdmin = true; } } cat.Add(app); } } return(catList); }