本文整理汇总了C#中NuGet.Versioning.NuGetVersion.ToNormalizedString方法的典型用法代码示例。如果您正苦于以下问题:C# NuGetVersion.ToNormalizedString方法的具体用法?C# NuGetVersion.ToNormalizedString怎么用?C# NuGetVersion.ToNormalizedString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NuGet.Versioning.NuGetVersion
的用法示例。
在下文中一共展示了NuGetVersion.ToNormalizedString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VersionForDisplay
public VersionForDisplay(
NuGetVersion version,
string additionalInfo)
{
Version = version;
_additionalInfo = additionalInfo;
_toString = string.IsNullOrEmpty(_additionalInfo) ?
Version.ToNormalizedString() :
_additionalInfo + " " + Version.ToNormalizedString();
}
示例2: VersionLength
public void VersionLength(string version)
{
// Arrange & Act
var semVer = new NuGetVersion(version);
Assert.Equal("2.0.0", semVer.ToNormalizedString());
}
示例3: IsInstalled
public override bool IsInstalled(string packageId, NuGetVersion packageVersion)
{
NuGetTraceSources.CoreInteropInstalledPackagesList.Verbose("isinstalled", "IsInstalled? {0} {1}", packageId, packageVersion.ToNormalizedString());
return _localRepository.Exists(
packageId,
new SemanticVersion(packageVersion.Version, packageVersion.Release));
}
示例4: GetLockFilePath
public string GetLockFilePath(string packageId, NuGetVersion version, NuGetFramework framework)
{
return Path.Combine(
GetBaseToolPath(packageId),
version.ToNormalizedString(),
framework.GetShortFolderName(),
"project.lock.json");
}
示例5: GetLockFilePath
public string GetLockFilePath(string packageId, NuGetVersion version, NuGetFramework framework)
{
if (version == null)
{
throw new ArgumentNullException(nameof(version));
}
if (framework == null)
{
throw new ArgumentNullException(nameof(framework));
}
return Path.Combine(
GetBaseToolPath(packageId),
version.ToNormalizedString(),
framework.GetShortFolderName(),
"project.lock.json");
}
示例6: GetPackageMetadataForVisualStudioUI
public Task<VisualStudioUIPackageMetadata> GetPackageMetadataForVisualStudioUI(string packageId, NuGetVersion version)
{
return Task.Factory.StartNew(() =>
{
var semver = new SemanticVersion(version.ToNormalizedString());
var package = V2Client.FindPackage(packageId, semver);
// Sometimes, V2 APIs seem to fail to return a value for Packages(Id=,Version=) requests...
if (package == null)
{
var packages = V2Client.FindPackagesById(packageId);
package = packages.FirstOrDefault(p => Equals(p.Version, semver));
}
// If still null, fail
if (package == null)
{
return null;
}
return GetVisualStudioUIPackageMetadata(package);
});
}
示例7: GetPackageMetadata
public override async Task<JObject> GetPackageMetadata(string id, NuGetVersion version)
{
var data = await GetPackageMetadataById(id);
return data.FirstOrDefault(p => StringComparer.OrdinalIgnoreCase.Equals(
p["version"].ToString(),
version.ToNormalizedString()));
}
示例8: NormalizesStringOutputForDisplayAndUniqueness
public void NormalizesStringOutputForDisplayAndUniqueness(NuGetVersion version, string expected)
{
Assert.Equal(expected, version.ToNormalizedString(), StringComparer.Ordinal);
}
示例9: GetReportAbuseUrl
//public ReportAbuseResourceV3(IEnumerable<Uri> reportAbuseTemplates)
//{
// if (reportAbuseTemplates == null || !reportAbuseTemplates.Any())
// {
// throw new ArgumentNullException("reportAbuseTemplates");
// }
// _reportAbuseTemplates = reportAbuseTemplates;
//}
/// <summary>
/// Gets a URL for reporting package abuse. The URL will not be verified to exist.
/// </summary>
/// <param name="id">The package id (natural casing)</param>
/// <param name="version">The package version</param>
/// <returns>The first URL from the resource, with the URI template applied.</returns>
public Uri GetReportAbuseUrl(string id, NuGetVersion version)
{
//return Utility.ApplyPackageIdVersionToUriTemplate(_reportAbuseTemplates.First(), id, version);
return new Uri(String.Format(CultureInfo.InvariantCulture, "https://www.nuget.org/packages/{0}/{1}/ReportAbuse", id, version.ToNormalizedString()));
}