本文整理汇总了C#中dnlib.DotNet.TypeRef.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# TypeRef.Resolve方法的具体用法?C# TypeRef.Resolve怎么用?C# TypeRef.Resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dnlib.DotNet.TypeRef
的用法示例。
在下文中一共展示了TypeRef.Resolve方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetColor
/// <summary>
/// Gets a type color
/// </summary>
/// <param name="type">Type</param>
/// <returns></returns>
public virtual object GetColor(TypeRef type) {
if (type == null)
return BoxedTextColor.Text;
var td = type.Resolve();
if (td != null)
return GetColor(td);
return BoxedTextColor.Type;
}
示例2: CanAccess
/// <summary>
/// Checks whether it can access a <see cref="TypeRef"/>
/// </summary>
/// <param name="tr">The type</param>
/// <returns><c>true</c> if it has access to it, <c>false</c> if not, and <c>null</c>
/// if we can't determine it (eg. we couldn't resolve a type or input was <c>null</c>)</returns>
public bool? CanAccess(TypeRef tr) {
if (tr == null)
return null;
return CanAccess(tr.Resolve());
}
示例3: Resolve
TypeDef Resolve(AssemblyRef asmRef, TypeRef typeRef) {
var asm = ownerModule.Assembly;
if (asm == null)
return null;
if (asmRef.FullName != asm.GetFullNameWithPublicKey() && asmRef.FullName != asm.GetFullNameWithPublicKeyToken())
return null;
var td = typeRef.Resolve();
return td != null && td.Module == ownerModule ? td : null;
}
示例4: GetTextTokenType
public static TextTokenKind GetTextTokenType(TypeRef tr)
{
if (tr == null)
return TextTokenKind.Text;
var td = tr.Resolve();
if (td != null)
return GetTextTokenType(td);
return TextTokenKind.Type;
}
示例5: Find
void Find(TypeRef typeRef)
{
if (typeRef == null)
return;
// The type might've been moved, so always resolve it instead of using DefinitionAssembly
var td = typeRef.Resolve(assembly.ModuleDefinition);
if (td == null)
Find(typeRef.DefinitionAssembly);
else
Find(td.DefinitionAssembly ?? typeRef.DefinitionAssembly);
}