當前位置: 首頁>>代碼示例>>C#>>正文


C# NuGetFramework.ToString方法代碼示例

本文整理匯總了C#中NuGet.Frameworks.NuGetFramework.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# NuGetFramework.ToString方法的具體用法?C# NuGetFramework.ToString怎麽用?C# NuGetFramework.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NuGet.Frameworks.NuGetFramework的用法示例。


在下文中一共展示了NuGetFramework.ToString方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SynthesizeFrameworkFriendlyName

        private static string SynthesizeFrameworkFriendlyName(NuGetFramework targetFramework)
        {
            // Names are not present in the RedistList.xml file for older frameworks or on Mono
            // We do some custom version string rendering to match how net40 is rendered (.NET Framework 4)
            if (targetFramework.Framework.Equals(FrameworkConstants.FrameworkIdentifiers.Net))
            {
                string versionString = targetFramework.Version.Minor == 0 ?
                    targetFramework.Version.Major.ToString() :
                    GetDisplayVersion(targetFramework).ToString();

                string profileString = string.IsNullOrEmpty(targetFramework.Profile) ?
                    string.Empty :
                    $" {targetFramework.Profile} Profile";
                return ".NET Framework " + versionString + profileString;
            }
            return targetFramework.ToString();
        }
開發者ID:swgillespie,項目名稱:cli,代碼行數:17,代碼來源:FrameworkReferenceResolver.cs

示例2: ExplodePortableFramework

        /// <summary>
        /// portable-net45+win8 -> net45, win8
        /// </summary>
        private IEnumerable<NuGetFramework> ExplodePortableFramework(NuGetFramework pcl, bool includeOptional = true)
        {
            IEnumerable<NuGetFramework> frameworks = null;
            if (!_mappings.TryGetPortableFrameworks(pcl.Profile, includeOptional, out frameworks))
            {
                Debug.Fail("Unable to get portable frameworks from: " + pcl.ToString());
                frameworks = Enumerable.Empty<NuGetFramework>();
            }

            return frameworks;
        }
開發者ID:eerhardt,項目名稱:NuGet3,代碼行數:14,代碼來源:FrameworkReducer.cs

示例3: CacheResolvePackage

        private async Task<SourcePackageDependencyInfo> CacheResolvePackage(NuGetFactory factory, PackageIdentity package, NuGetFramework fx)
        {
            string key = String.Format(@"{0}-{1}", package.ToString(), fx.ToString());
            if (base.IsInCache<SourcePackageDependencyInfo>("CacheResolvePackage", key))
            {
                return Get<SourcePackageDependencyInfo>("CacheResolvePackage", key);
            }
            else
            {
                var depResource = await factory.GetDependency();
                var output = await depResource.ResolvePackage(package, fx, CancellationToken.None);
                return Get<SourcePackageDependencyInfo>("CacheResolvePackage", key, () => { return output; });
            }

        }
開發者ID:punitganshani,項目名稱:NuGetViz,代碼行數:15,代碼來源:CacheNugetRepository.cs

示例4: GetFriendlyNuGetFramework

        public string GetFriendlyNuGetFramework(NuGetFramework targetFramework)
        {
            // We don't have a friendly name for this anywhere on the machine so hard code it
            string friendlyName = targetFramework.Framework;
            if (Equals(targetFramework.Framework, FrameworkConstants.CommonFrameworks.DnxCore))
            {
                return "DNX Core " + targetFramework.Version.ToString();
            }
            else if (Equals(targetFramework.Framework, FrameworkConstants.CommonFrameworks.Dnx))
            {
                return "DNX " + targetFramework.Version.ToString();
            }

            var information = _cache.GetOrAdd(targetFramework, GetFrameworkInformation);

            if (information == null)
            {
                return targetFramework.ToString();
            }

            return information.Name;
        }
開發者ID:elanwu123,項目名稱:dnx,代碼行數:22,代碼來源:FrameworkReferenceResolver.cs


注:本文中的NuGet.Frameworks.NuGetFramework.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。