Example #1
0
        public PackageInfo(AppInfoExtended appInfo)
        {
            if (appInfo == null)
            {
                throw new ArgumentNullException(nameof(appInfo));
            }

            _appName     = appInfo.AppName;
            _iconPath    = appInfo.IconPath;
            _isInstalled = appInfo.IsInstalled;
            _packageName = appInfo.PackageName;
        }
Example #2
0
        public AppInfoExtended[] MergePackageInfo(IEnumerable <AppInfo> apps, IEnumerable <PackageInfo> packages)
        {
            List <AppInfoExtended> appInfos = new List <AppInfoExtended>();

            foreach (var app in apps)
            {
                var appInfo = new AppInfoExtended(app);
                var package = packages.FirstOrDefault(x => x.PackageName == app.PackageName);
                if (package != null)
                {
                    appInfo.IsInstalled = true;
                }

                appInfos.Add(appInfo);
            }

            return(appInfos.ToArray());
        }