本文整理匯總了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;
}
}