當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。