public Package(FeedPackage feed)
		{
			this.Id = feed.Id;
			this.Copyright = feed.Copyright;
			this.IconUrl = feed.IconUrl;
			this.Summary = feed.Summary;
			this.DownloadCount = feed.DownloadCount;
			this.Authors = feed.Authors.Split('|').Select(author => new PackageAuthor { Name = author }).ToList();
			this.Versions = new List<PackageVersion> { new PackageVersion(feed) };
		}
Beispiel #2
0
 public Package(FeedPackage feed)
 {
     this.Id            = feed.Id;
     this.Copyright     = feed.Copyright;
     this.IconUrl       = feed.IconUrl;
     this.Summary       = feed.Summary;
     this.DownloadCount = feed.DownloadCount;
     this.Authors       = feed.Authors.Split('|').Select(author => new PackageAuthor {
         Name = author
     }).ToList();
     this.Versions = new List <PackageVersion> {
         new PackageVersion(feed)
     };
 }
        public PackageVersion(FeedPackage feed)
        {
            this.Version                  = feed.Version;
            this.Created                  = feed.Created;
            this.Description              = feed.Description;
            this.GalleryDetailsUrl        = feed.GalleryDetailsUrl;
            this.IsLatestVersion          = feed.IsLatestVersion;
            this.IsPreRelease             = feed.IsPreRelease;
            this.Language                 = feed.Language;
            this.LastUpdated              = feed.LastUpdated;
            this.Published                = feed.Published;
            this.PackageHash              = feed.PackageHash;
            this.PackageHashAlgorithm     = feed.PackageHashAlgorithm;
            this.PackageSize              = feed.PackageSize;
            this.PackageUrl               = feed.PackageUrl;
            this.ReportAbuseUrl           = feed.ReportAbuseUrl;
            this.ReleaseNotes             = feed.ReleaseNotes;
            this.RequireLicenseAcceptance = feed.RequireLicenseAcceptance;
            this.Tags             = feed.Tags;
            this.Title            = feed.Title;
            this.DownloadCount    = feed.VersionDownloadCount;
            this.MinClientVersion = feed.MinClientVersion;
            this.LastEdited       = feed.LastEdited;
            this.LicenseUrl       = feed.LicenseUrl;
            this.LicenseNames     = feed.LicenseNames;
            this.LicenseReportUrl = feed.LicenseReportUrl;

            if (!string.IsNullOrEmpty(feed.Dependencies))
            {
                this.Dependencies = feed.Dependencies.Split('|').Select(d =>
                {
                    var parts = d.Split(':');
                    switch (parts.Length)
                    {
                    case 1:
                        return(new PackageDependency(parts[0]));

                    case 2:
                        return(new PackageDependency(parts[0], parts[1]));

                    case 3:
                        return(new PackageDependency(parts[0], parts[1], parts[2]));

                    default:
                        return(new PackageDependency(d));
                    }
                }).ToList();
            }
        }
		public PackageVersion(FeedPackage feed)
		{
			this.Version = feed.Version;
			this.Created = feed.Created;
			this.Description = feed.Description;
			this.GalleryDetailsUrl = feed.GalleryDetailsUrl;
			this.IsLatestVersion = feed.IsLatestVersion;
			this.IsPreRelease = feed.IsPreRelease;
			this.Language = feed.Language;
			this.LastUpdated = feed.LastUpdated;
			this.Published = feed.Published;
			this.PackageHash = feed.PackageHash;
			this.PackageHashAlgorithm = feed.PackageHashAlgorithm;
			this.PackageSize = feed.PackageSize;
			this.PackageUrl = feed.PackageUrl;
			this.ReportAbuseUrl = feed.ReportAbuseUrl;
			this.ReleaseNotes = feed.ReleaseNotes;
			this.RequireLicenseAcceptance = feed.RequireLicenseAcceptance;
			this.Tags = feed.Tags;
			this.Title = feed.Title;
			this.DownloadCount = feed.VersionDownloadCount;
			this.MinClientVersion = feed.MinClientVersion;
			this.LastEdited = feed.LastEdited;
			this.LicenseUrl = feed.LicenseUrl;
			this.LicenseNames = feed.LicenseNames;
			this.LicenseReportUrl = feed.LicenseReportUrl;

			if (!string.IsNullOrEmpty(feed.Dependencies))
			{
				this.Dependencies = feed.Dependencies.Split('|').Select(d =>
				{
					var parts = d.Split(':');
					switch(parts.Length)
					{
						case 1:
							return new PackageDependency(parts[0]);
						case 2:
							return new PackageDependency(parts[0], parts[1]);
						case 3:
							return new PackageDependency(parts[0], parts[1], parts[2]);
						default:
							return new PackageDependency(d);
					}
				}).ToList();
			}
		}