Ejemplo n.º 1
0
        private static ChocolateyPackageVersion ConvertToPackageVersion(FeedPackage package)
        {
            var convertedPackage = new ChocolateyPackageVersion
            {
                Author = package.Authors,
                ChocolateyLink = new Uri(package.GalleryDetailsUrl),
                Id = package.Id,
                Title = package.Title,
                Description = package.Description,
                Version = package.Version,
                ReleaseNotes = package.ReleaseNotes,
                DownloadCount = package.DownloadCount,
                IconLink = string.IsNullOrEmpty(package.IconUrl)
                        ? null
                        : new Uri(package.IconUrl),
                ProjectLink =
                    string.IsNullOrEmpty(package.ProjectUrl)
                        ? null
                        : new Uri(package.ProjectUrl)
            };

            return convertedPackage;
        }
Ejemplo n.º 2
0
        private ChocolateyPackage ConvertToPackage(FeedPackage package, IEnumerable<ChocolateyPackageVersion> installedPackages)
        {
            var convertedPackage = new ChocolateyPackage
            {
                Id = package.Id,
                IconLink = string.IsNullOrEmpty(package.IconUrl) ? null : new Uri(package.IconUrl),
                Title = package.Title,
                IsInstalled = installedPackages.Any(p => p.Id == package.Id)
            };

            return convertedPackage;
        }