本文整理汇总了C#中LibraryRange.GetReferenceAssemblyName方法的典型用法代码示例。如果您正苦于以下问题:C# LibraryRange.GetReferenceAssemblyName方法的具体用法?C# LibraryRange.GetReferenceAssemblyName怎么用?C# LibraryRange.GetReferenceAssemblyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibraryRange
的用法示例。
在下文中一共展示了LibraryRange.GetReferenceAssemblyName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDescription
public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
{
if (!libraryRange.IsGacOrFrameworkReference)
{
return null;
}
if (!RuntimeEnvironmentHelper.IsWindows)
{
return null;
}
if (!VersionUtility.IsDesktop(targetFramework))
{
return null;
}
var name = libraryRange.Name;
var version = libraryRange.VersionRange?.MinVersion;
string path;
if (!TryResolvePartialName(libraryRange.GetReferenceAssemblyName(), version, targetFramework, out path))
{
return null;
}
return new LibraryDescription(
libraryRange,
new LibraryIdentity(name, version, isGacOrFrameworkReference: true),
path,
LibraryTypes.GlobalAssemblyCache,
Enumerable.Empty<LibraryDependency>(),
new[] { libraryRange.GetReferenceAssemblyName() },
framework: targetFramework);
}
示例2: GetDescription
public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
{
if (!libraryRange.IsGacOrFrameworkReference)
{
return null;
}
var name = libraryRange.GetReferenceAssemblyName();
var version = libraryRange.VersionRange?.MinVersion;
string path;
Version assemblyVersion;
if (!FrameworkResolver.TryGetAssembly(name, targetFramework, out path, out assemblyVersion))
{
return null;
}
if (version == null || version.Version == assemblyVersion)
{
return new LibraryDescription(
libraryRange,
new LibraryIdentity(libraryRange.Name, new SemanticVersion(assemblyVersion), isGacOrFrameworkReference: true),
path,
LibraryTypes.ReferenceAssembly,
Enumerable.Empty<LibraryDependency>(),
new[] { name },
framework: targetFramework);
}
return null;
}
示例3: GetDescription
public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
{
if (!libraryRange.IsGacOrFrameworkReference)
{
return null;
}
if (!RuntimeEnvironmentHelper.IsWindows)
{
return null;
}
if (!VersionUtility.IsDesktop(targetFramework))
{
return null;
}
var name = libraryRange.Name;
var version = libraryRange.VersionRange?.MinVersion;
string path;
if (!TryResolvePartialName(libraryRange.GetReferenceAssemblyName(), version, out path))
{
return null;
}
_resolvedPaths[name] = path;
return new LibraryDescription
{
LibraryRange = libraryRange,
Identity = new Library
{
Name = name,
Version = version,
IsGacOrFrameworkReference = true
},
LoadableAssemblies = new[] { libraryRange.GetReferenceAssemblyName() },
Dependencies = Enumerable.Empty<LibraryDependency>()
};
}
示例4: GetDescription
public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkName targetFramework)
{
if (!libraryRange.IsGacOrFrameworkReference)
{
return null;
}
var name = libraryRange.GetReferenceAssemblyName();
var version = libraryRange.VersionRange?.MinVersion;
string path;
Version assemblyVersion;
if (!FrameworkResolver.TryGetAssembly(name, targetFramework, out path, out assemblyVersion))
{
return null;
}
if (version == null || version.Version == assemblyVersion)
{
_resolvedPaths[libraryRange.Name] = path;
return new LibraryDescription
{
LibraryRange = libraryRange,
Identity = new Library
{
Name = libraryRange.Name,
Version = new SemanticVersion(assemblyVersion),
IsGacOrFrameworkReference = true
},
LoadableAssemblies = new[] { name },
Dependencies = Enumerable.Empty<LibraryDependency>()
};
}
return null;
}