本文整理汇总了C#中System.Reflection.Metadata.MetadataReader.FormatAssemblyInfo方法的典型用法代码示例。如果您正苦于以下问题:C# MetadataReader.FormatAssemblyInfo方法的具体用法?C# MetadataReader.FormatAssemblyInfo怎么用?C# MetadataReader.FormatAssemblyInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Metadata.MetadataReader
的用法示例。
在下文中一共展示了MetadataReader.FormatAssemblyInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DependencyFinderEngineHelper
public DependencyFinderEngineHelper(MetadataReader metadataReader, string assemblyPath)
{
_reader = metadataReader;
_assemblyLocation = assemblyPath;
MemberDependency = new List<MemberDependency>();
CallingAssembly = _reader.GetAssemblyInfo(assemblyPath);
// Get assembly info
var assemblyDefinition = _reader.GetAssemblyDefinition();
_currentAssemblyInfo = _reader.FormatAssemblyInfo(assemblyDefinition);
_currentAssemblyName = _reader.GetString(assemblyDefinition.Name);
}
示例2: DependencyFinderEngineHelper
public DependencyFinderEngineHelper(IDependencyFilter assemblyFilter, MetadataReader metadataReader, IAssemblyFile file)
{
_assemblyFilter = assemblyFilter;
_reader = metadataReader;
_assemblyLocation = file.Name;
MemberDependency = new List<MemberDependency>();
CallingAssembly = new AssemblyInfo
{
AssemblyIdentity = metadataReader.FormatAssemblyInfo().ToString(),
FileVersion = file.Version ?? string.Empty,
TargetFrameworkMoniker = metadataReader.GetTargetFrameworkMoniker() ?? string.Empty
};
// Get assembly info
var assemblyDefinition = _reader.GetAssemblyDefinition();
_currentAssemblyInfo = _reader.FormatAssemblyInfo(assemblyDefinition);
_currentAssemblyName = _reader.GetString(assemblyDefinition.Name);
}
示例3: AddReferencedAssemblies
/// <summary>
/// Add all assemblies that were referenced to the referenced assembly dictionary. By default,
/// we add every referenced assembly and will remove the ones that are actually referenced when
/// all submitted assemblies are processed.
/// </summary>
/// <param name="metadataReader"></param>
private void AddReferencedAssemblies(MetadataReader metadataReader)
{
var assemblyReferences = metadataReader.AssemblyReferences
.Select(metadataReader.GetAssemblyReference)
.Select(metadataReader.FormatAssemblyInfo);
var assemblyName = metadataReader.FormatAssemblyInfo();
foreach (var reference in assemblyReferences)
{
_unresolvedAssemblies.AddOrUpdate(
reference.ToString(),
new HashSet<string>(StringComparer.Ordinal) { assemblyName.ToString() },
(key, existing) =>
{
lock (existing)
{
existing.Add(assemblyName.ToString());
}
return existing;
});
}
}