Esempio n. 1
0
        /// <summary>
        /// Gets the metro applications.
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<MetroApplication> GetApplications()
        {
            var packages = new PackageManager()
                .FindPackagesForUser(WindowsIdentity.GetCurrent().User.Value);

            var metroPackages = new List<MetroPackage>();

            foreach (var package in packages)
            {
                var metroPackage = new MetroPackage(package);

                if (metroPackage.Applications.Any())
                {
                    metroPackages.Add(new MetroPackage(package));
                }
            }

            var metroApplications = metroPackages
                .SelectMany(package => package.Applications)
                .Where(
                    application =>
                        !string.IsNullOrEmpty(application.AppUserModelId) &&
                        !string.IsNullOrEmpty(application.Name));

            return metroApplications;
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the metro applications.
        /// </summary>
        /// <returns></returns>
        public static IEnumerable <MetroApplication> GetApplications()
        {
            var packages = new PackageManager()
                           .FindPackagesForUser(WindowsIdentity.GetCurrent().User.Value);

            var metroPackages = new List <MetroPackage>();

            foreach (var package in packages)
            {
                var metroPackage = new MetroPackage(package);

                if (metroPackage.Applications.Any())
                {
                    metroPackages.Add(new MetroPackage(package));
                }
            }

            var metroApplications = metroPackages
                                    .SelectMany(package => package.Applications)
                                    .Where(
                application =>
                !string.IsNullOrEmpty(application.AppUserModelId) &&
                !string.IsNullOrEmpty(application.Name));

            return(metroApplications);
        }