本文整理汇总了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();
}
示例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;
}
示例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; });
}
}
示例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;
}