Example #1
0
        static async Task <IReadOnlyList <StoreApp> > FindStoreAppsInPackage(Package p)
        {
            if (p.IsFramework || p.IsResourcePackage)
            {
                return(null);
            }

            var entries = await p.GetAppListEntriesAsync();

            if (entries.Count == 0)
            {
                return(null);
            }

            var apps = new List <StoreApp>();

            foreach (var entry in entries)
            {
                var app = new StoreApp(p, entry);
                app.logo = await app.GetLogo();

                apps.Add(app);
            }

            // Nameが重複する場合、最後の要素が代表することにする(今のところ、Edgeを起動できるようにするためだけ)
            return(apps.GroupBy(app => app.Name).Select(g => g.Last()).ToList().AsReadOnly());
        }
        private async Task Rescan(bool initial = false)
        {
            if (!initial)
            {
                SaveLaunchedCounts(entries);
            }

            LoadingIndicator.IsActive = true;
            InputText.IsEnabled       = false;

            entries.Clear();
            entries.AddRange(await StoreApp.FindAllStoreApps());
            entries.AddRange(DesktopApp.FindAllDesktopApps());
            entries.AddRange(UriLauncher.FindAllUriLaunchers());
            entries.AddRange(LoadAliases(entries));
            entries.Sort((x, y) => x.Name.CompareTo(y.Name));

            LoadLaunchedCounts(entries);

            LoadingIndicator.IsActive = false;
            InputText.IsEnabled       = true;
            InputText.Focus();
        }