本文整理汇总了C#中NuGet.ZipPackage.IsPrerelease方法的典型用法代码示例。如果您正苦于以下问题:C# ZipPackage.IsPrerelease方法的具体用法?C# ZipPackage.IsPrerelease怎么用?C# ZipPackage.IsPrerelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NuGet.ZipPackage
的用法示例。
在下文中一共展示了ZipPackage.IsPrerelease方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryBuild
public bool TryBuild(byte[] bytes, out Package package)
{
package = null;
try
{
using (var stream = new MemoryStream(bytes))
{
var zipPackage = new ZipPackage(stream);
if (zipPackage.Id.IsTooLargeString() || zipPackage.Version.ToString().IsTooLargeString())
{
return false;
}
var now = dateTimeService.UtcNow;
package = new Package
{
Id = zipPackage.Id,
Version = zipPackage.Version.ToString(),
DisplayTitle = zipPackage.Title.ToStringSafe(),
IsAbsoluteLatestVersion = zipPackage.IsAbsoluteLatestVersion,
IsLatestVersion = zipPackage.IsLatestVersion,
IsPrerelease = zipPackage.IsPrerelease(),
PackageHash = cryptoService.Hash(bytes),
PackageHashAlgorithm = cryptoService.HashAlgorithmId,
PackageSize = bytes.LongLength,
Created = now,
LastUpdated = now,
Published = now,
Owners = zipPackage.Owners.Flatten().ToStringSafe(),
Authors = zipPackage.Authors.Flatten().ToStringSafe(),
Listed = true,
RequireLicenseAcceptance = zipPackage.RequireLicenseAcceptance,
Language = zipPackage.Language.ToStringSafe(),
DevelopmentDependency = zipPackage.DevelopmentDependency,
Title = zipPackage.Title.ToStringSafe(),
Tags = zipPackage.Tags.ToStringSafe(),
Copyright = zipPackage.Copyright.ToStringSafe(),
Dependencies = "".ToStringSafe(),
IconUrl = zipPackage.IconUrl.ToStringSafe(),
LicenseUrl = zipPackage.LicenseUrl.ToStringSafe(),
ProjectUrl = zipPackage.ProjectUrl.ToStringSafe(),
Description = zipPackage.Description.ToStringSafe(),
ReleaseNotes = zipPackage.ReleaseNotes.ToStringSafe(),
Summary = zipPackage.Summary.ToStringSafe(),
DownloadCount = 0,
Score = 0f,
VersionDownloadCount = 0,
BlobId = guidGenerator.NewGuid()
};
return true;
}
}
catch (Exception)
{
return false;
}
}