当前位置: 首页>>代码示例>>C#>>正文


C# NuGetVersion.ToNormalizedString方法代码示例

本文整理汇总了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();
        }
开发者ID:pabomex,项目名称:NuGet.PackageManagement,代码行数:11,代码来源:VersionForDisplay.cs

示例2: VersionLength

        public void VersionLength(string version)
        {
            // Arrange & Act
            var semVer = new NuGetVersion(version);

           Assert.Equal("2.0.0", semVer.ToNormalizedString());
        }
开发者ID:cinecove,项目名称:NuGet.Versioning,代码行数:7,代码来源:VersionParsingTests.cs

示例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));
 }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:7,代码来源:CoreInteropInstalledPackagesList.cs

示例4: GetLockFilePath

 public string GetLockFilePath(string packageId, NuGetVersion version, NuGetFramework framework)
 {
     return Path.Combine(
         GetBaseToolPath(packageId),
         version.ToNormalizedString(),
         framework.GetShortFolderName(),
         "project.lock.json");
 }
开发者ID:krytarowski,项目名称:cli,代码行数:8,代码来源:ToolPathCalculator.cs

示例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");
        }
开发者ID:akrisiun,项目名称:dotnet-cli,代码行数:18,代码来源:ToolPathCalculator.cs

示例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);
            });
        }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:23,代码来源:V2VisualStudioUIMetadataResource.cs

示例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()));
 }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:7,代码来源:V3SourceRepository.cs

示例8: NormalizesStringOutputForDisplayAndUniqueness

 public void NormalizesStringOutputForDisplayAndUniqueness(NuGetVersion version, string expected)
 {
     Assert.Equal(expected, version.ToNormalizedString(), StringComparer.Ordinal);
 }
开发者ID:ZhiYuanHuang,项目名称:NuGetGallery,代码行数:4,代码来源:SemanticVersionExtensionsFacts.cs

示例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()));
        }
开发者ID:michaelstaib,项目名称:NuGet.Protocol,代码行数:21,代码来源:ReportAbuseResourceV3.cs


注:本文中的NuGet.Versioning.NuGetVersion.ToNormalizedString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。