本文整理汇总了C#中Mono.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# Mono.Resolve方法的具体用法?C# Mono.Resolve怎么用?C# Mono.Resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono
的用法示例。
在下文中一共展示了Mono.Resolve方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsEqualOrSubclass
protected static bool IsEqualOrSubclass (Mono.Linker.AssemblyResolver resolver, MC.TypeReference inspect, MC.TypeReference baseClass)
{
MC.TypeDefinition currentType = resolver.Resolve (inspect);
while (true) {
if (baseClass.FullName == currentType.FullName)
return true;
if (currentType.BaseType.FullName == "System.Object")
return false;
currentType = resolver.Resolve (currentType.BaseType);
}
}
示例2: ImplementsInterface
protected static bool ImplementsInterface (Mono.Linker.AssemblyResolver resolver, MC.TypeReference inspect, MC.TypeReference interf)
{
MC.TypeDefinition currentType = resolver.Resolve (inspect);
foreach (MC.TypeReference child in currentType.Interfaces) {
if (child.FullName == interf.FullName)
return true;
if (ImplementsInterface (resolver, child, interf))
return true;
}
if (ImplementsInterface (resolver, currentType.BaseType, interf))
return true;
return false;
}
示例3: AllCustomAttributes
protected static IEnumerable<MC.CustomAttribute> AllCustomAttributes (Mono.Linker.AssemblyResolver resolver, MC.TypeDefinition typedef)
{
MC.TypeDefinition currentType = typedef;
while (true) {
foreach (MC.CustomAttribute attr in currentType.CustomAttributes)
yield return attr;
if (currentType.BaseType.FullName == "System.Object")
yield break;
currentType = resolver.Resolve (currentType.BaseType);
}
}