private async Task <PackageRowPresentationModel> CreatePresentationModelAsync(PackageInfoSourceWrapper packageInfo)
        {
            var id      = packageInfo.PackageInfo.Identity.Id;
            var version = packageInfo.PackageInfo.Identity.Version.ToString();
            var icon    = (packageInfo.PackageInfo.IconPath == null
                   ? Resources.Load <Texture2D>(Paths.DefaultIconResourceName)
                   : await ImageHelper.LoadImageAsync(packageInfo.PackageInfo.IconPath, CancellationToken.None))
                          ?? ImageHelper.LoadImageFromResource(Paths.DefaultIconResourceName);
            var sources    = packageInfo.SourceKeys;
            var assemblies = _installedPackagesConfigService.GetInstalledInAssemblies(id) ?? new List <string>(0);

            return(new PackageRowPresentationModel(id, false, version, icon, sources, assemblies));
        }
예제 #2
0
        public bool IsPackageInstalledInAssembly(string packageId, string assemblyName)
        {
            var package = _installedPackagesConfigService.GetInstalledInAssemblies(packageId);

            return(package != null && package.Any(a => a == assemblyName));
        }