public Package(package package, string hash, long size) { if (package == null || package.metadata == null) { return; } DateCreated = DateTime.UtcNow; DateUpdated = DateCreated; Id = package.metadata.id.ToLowerInvariant() + "." + package.metadata.version.ToLowerInvariant(); Title = package.metadata.id; PackageTitle = package.metadata.title; Version = package.metadata.version; Authors = package.metadata.authors; Copyright = package.metadata.copyright; Dependencies = PackageDependency.Process(package.metadata.dependencies); FrameworkAssemblies = FrameworkAssembly.Process(package.metadata.frameworkAssemblies); Description = package.metadata.description; PackageHash = hash; PackageSize = size; IconUrl = package.metadata.iconUrl; IsPrerelease = Version == null || Version.IndexOf('-') >= 0; LicenseUrl = package.metadata.licenseUrl; Owners = package.metadata.owners; PackageId = Id; ProjectUrl = package.metadata.projectUrl; ReleaseNotes = package.metadata.releaseNotes; Language = package.metadata.language; RequireLicenseAcceptance = package.metadata.requireLicenseAcceptance; Tags = package.metadata.tags != null?package.metadata.tags.Split(' ') : new string[] { }; MinClientVersion = package.metadata.minClientVersion; }
public Package() { DateCreated = DateTime.UtcNow; DateUpdated = DateCreated; Dependencies = new PackageDependency[0]; FrameworkAssemblies = new FrameworkAssembly[0]; }