本文整理汇总了C#中ITypeDefOrRef.ResolveTypeDef方法的典型用法代码示例。如果您正苦于以下问题:C# ITypeDefOrRef.ResolveTypeDef方法的具体用法?C# ITypeDefOrRef.ResolveTypeDef怎么用?C# ITypeDefOrRef.ResolveTypeDef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeDefOrRef
的用法示例。
在下文中一共展示了ITypeDefOrRef.ResolveTypeDef方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BaseTypesEntryNode
public BaseTypesEntryNode(ITypeDefOrRef tr, bool isInterface) {
if (tr == null)
throw new ArgumentNullException("tr");
this.tr = tr;
this.def = tr.ResolveTypeDef();
this.isInterface = isInterface;
this.LazyLoading = true;
}
示例2: FindMethodCheckBaseType
/// <summary>
/// Find a MethodDef from a declaring type and some MethodData. Will generate
/// a list of possible MethodSigs and check against each of them, returning the
/// first-found MethodDef that matches the method name and signature.
/// </summary>
/// <param name="declaringType">Declaring type</param>
/// <param name="data">MethodData</param>
/// <param name="detectedSig">The detected MethodSig</param>
/// <returns>MethodDef if found, null if none found</returns>
MethodDef FindMethodCheckBaseType(ITypeDefOrRef declaringType, MethodData data, out MethodSig detectedSig)
{
detectedSig = null;
TypeDef declaringDef = declaringType.ResolveTypeDef();
if (declaringDef == null)
return null;
MethodDef method = null;
MethodSig methodSig = GetMethodSig(data);
var possibleSigs = PossibleMethodSigs(declaringType, methodSig, data);
detectedSig = possibleSigs.FirstOrDefault(sig => {
return (method = declaringDef.FindMethodCheckBaseType(data.Name, sig)) != null;
});
return method;
}
示例3: WriteToolTipWithClassInfo
void WriteToolTipWithClassInfo(ITextOutput output, ITypeDefOrRef type)
{
var td = type.ResolveTypeDef();
MethodDef invoke;
if (IsDelegate(td) && (invoke = td.FindMethod("Invoke")) != null && invoke.MethodSig != null) {
output.Write("delegate", TextTokenType.Keyword);
output.WriteSpace();
var writer = new MethodWriter(this, output, invoke);
writer.WriteReturnType();
// Always print the namespace here because that's what VS does. I.e., ignore
// TOOLTIP_USE_NAMESPACES.
WriteToolTipType(output, td, true);
writer.WriteGenericArguments();
writer.WriteMethodParameterList('(', ')');
return;
}
if (td == null) {
base.WriteToolTip(output, type, null);
return;
}
string keyword;
if (td.IsEnum)
keyword = "enum";
else if (td.IsValueType)
keyword = "struct";
else if (td.IsInterface)
keyword = "interface";
else
keyword = "class";
output.Write(keyword, TextTokenType.Keyword);
output.WriteSpace();
// Always print the namespace here because that's what VS does. I.e., ignore
// TOOLTIP_USE_NAMESPACES.
WriteToolTipType(output, type, true, false);
}
示例4: DerivedTypesAnalysis
public DerivedTypesAnalysis(ITypeDefOrRef type) {
this.type = type;
typeDef = type.ResolveTypeDef();
}
示例5: ResolveWithinSameModule
static TypeDef ResolveWithinSameModule(ITypeDefOrRef type) {
if (type != null && type.Scope == type.Module)
return type.ResolveTypeDef();
return null;
}
示例6: WriteToolTip
void WriteToolTip(ITypeDefOrRef type) {
var td = type.ResolveTypeDef();
MethodDef invoke;
if (IsDelegate(td) && (invoke = td.FindMethod("Invoke")) != null && invoke.MethodSig != null) {
OutputWrite("delegate", TextTokenKind.Keyword);
WriteSpace();
var info = new MethodInfo(invoke);
WriteModuleName(info);
WriteReturnType(info);
// Always print the namespace here because that's what VS does
WriteType(td, true, ShowTypeKeywords);
WriteGenericArguments(info);
WriteMethodParameterList(info, "(", ")");
return;
}
if (td == null) {
Write(type);
return;
}
string keyword;
if (td.IsEnum)
keyword = "enum";
else if (td.IsValueType)
keyword = "struct";
else if (td.IsInterface)
keyword = "interface";
else
keyword = "class";
OutputWrite(keyword, TextTokenKind.Keyword);
WriteSpace();
// Always print the namespace here because that's what VS does
WriteType(type, true, false);
}