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); }
public void insertValue(string line) { string[] strs = line.Split('\t'); if(strs.Length == 47) { MSITPackage package = new MSITPackage(); package.wrap(strs); MSITLogPackages.Add(package); }else if(strs.Length == 32) { FeedPackage package = new FeedPackage(); package.wrap(strs); FeedLogPackages.Add(package); } }
public static FeedPackage CreateV2FeedPackage(string ID, string version, global::System.DateTime created, int downloadCount, bool isLatestVersion, bool isAbsoluteLatestVersion, bool isPrerelease, global::System.DateTime lastUpdated, global::System.DateTime published, long packageSize, bool requireLicenseAcceptance, int versionDownloadCount) { FeedPackage v2FeedPackage = new FeedPackage(); v2FeedPackage.Id = ID; v2FeedPackage.Version = version; v2FeedPackage.Created = created; v2FeedPackage.DownloadCount = downloadCount; v2FeedPackage.IsLatestVersion = isLatestVersion; v2FeedPackage.IsAbsoluteLatestVersion = isAbsoluteLatestVersion; v2FeedPackage.IsPrerelease = isPrerelease; v2FeedPackage.LastUpdated = lastUpdated; v2FeedPackage.Published = published; v2FeedPackage.PackageSize = packageSize; v2FeedPackage.RequireLicenseAcceptance = requireLicenseAcceptance; v2FeedPackage.VersionDownloadCount = versionDownloadCount; return(v2FeedPackage); }
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); }
public static FeedPackage CreateV2FeedPackage(string ID, string version, global::System.DateTime created, int downloadCount, bool isLatestVersion, bool isAbsoluteLatestVersion, bool isPrerelease, global::System.DateTime lastUpdated, global::System.DateTime published, long packageSize, bool requireLicenseAcceptance, int versionDownloadCount) { FeedPackage v2FeedPackage = new FeedPackage(); v2FeedPackage.Id = ID; v2FeedPackage.Version = version; v2FeedPackage.Created = created; v2FeedPackage.DownloadCount = downloadCount; v2FeedPackage.IsLatestVersion = isLatestVersion; v2FeedPackage.IsAbsoluteLatestVersion = isAbsoluteLatestVersion; v2FeedPackage.IsPrerelease = isPrerelease; v2FeedPackage.LastUpdated = lastUpdated; v2FeedPackage.Published = published; v2FeedPackage.PackageSize = packageSize; v2FeedPackage.RequireLicenseAcceptance = requireLicenseAcceptance; v2FeedPackage.VersionDownloadCount = versionDownloadCount; return v2FeedPackage; }
public void AddToPackages(FeedPackage v2FeedPackage) { base.AddObject("Packages", v2FeedPackage); }