当前位置: 首页>>代码示例>>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;未经允许,请勿转载。