本文整理匯總了C#中Mono.Cecil.ModuleDefinition.GetTypeReferences方法的典型用法代碼示例。如果您正苦於以下問題:C# ModuleDefinition.GetTypeReferences方法的具體用法?C# ModuleDefinition.GetTypeReferences怎麽用?C# ModuleDefinition.GetTypeReferences使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.Cecil.ModuleDefinition
的用法示例。
在下文中一共展示了ModuleDefinition.GetTypeReferences方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetExpandedTypeDependanceList
private ICollection<TypeReference> GetExpandedTypeDependanceList(ModuleDefinition module)
{
Mono.Collections.Generic.Collection<TypeDefinition> moduleTypes;
if (!UserDefinedTypes.TryGetValue(module, out moduleTypes))
{
throw new Exception("Module types not found.");
}
HashSet<TypeReference> firstLevelDependanceTypes = new HashSet<TypeReference>();
foreach (TypeReference type in moduleTypes)
{
if (!firstLevelDependanceTypes.Contains(type))
{
firstLevelDependanceTypes.Add(type);
}
}
foreach (TypeReference type in module.GetTypeReferences())
{
if (!firstLevelDependanceTypes.Contains(type))
{
firstLevelDependanceTypes.Add(type);
}
}
return Telerik.JustDecompiler.Decompiler.Utilities.GetExpandedTypeDependanceList(firstLevelDependanceTypes);
}
示例2: findTypeReference
public static TypeReference findTypeReference(ModuleDefinition module, string asmSimpleName, string fullName)
{
foreach (var type in module.GetTypeReferences()) {
if (type.FullName != fullName)
continue;
var asmRef = type.Scope as AssemblyNameReference;
if (asmRef == null || asmRef.Name != asmSimpleName)
continue;
return type;
}
return null;
}
示例3: GetModuleDependsOnAnalysis
private ICollection<AssemblyNameReference> GetModuleDependsOnAnalysis(ModuleDefinition module)
{
Mono.Collections.Generic.Collection<TypeDefinition> assemblyModuleTypes = module.Types;
HashSet<TypeReference> firstLevelDependanceTypes = new HashSet<TypeReference>();
foreach (TypeReference type in assemblyModuleTypes)
{
if (!firstLevelDependanceTypes.Contains(type))
{
firstLevelDependanceTypes.Add(type);
}
}
foreach (TypeReference type in module.GetTypeReferences())
{
if (!firstLevelDependanceTypes.Contains(type))
{
firstLevelDependanceTypes.Add(type);
}
}
ICollection<TypeReference> expadendTypeDependanceList = Utilities.GetExpandedTypeDependanceList(firstLevelDependanceTypes);
ICollection<AssemblyNameReference> dependingOnAssemblies = Utilities.GetAssembliesDependingOn(module, expadendTypeDependanceList);
foreach (AssemblyNameReference assemblyReference in module.AssemblyReferences)
{
if (!dependingOnAssemblies.Contains(assemblyReference))
{
dependingOnAssemblies.Add(assemblyReference);
}
}
return dependingOnAssemblies;
}