本文整理汇总了C#中dnlib.DotNet.MethodSig.GetParameters方法的典型用法代码示例。如果您正苦于以下问题:C# MethodSig.GetParameters方法的具体用法?C# MethodSig.GetParameters怎么用?C# MethodSig.GetParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dnlib.DotNet.MethodSig
的用法示例。
在下文中一共展示了MethodSig.GetParameters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public static void Write(this ITextOutput writer, MethodSig sig, IMethod method = null)
{
if (sig == null && method != null)
sig = method.MethodSig;
if (sig == null)
return;
if (sig.ExplicitThis) {
writer.Write("instance", TextTokenType.Keyword);
writer.WriteSpace();
writer.Write("explicit", TextTokenType.Keyword);
writer.WriteSpace();
}
else if (sig.HasThis) {
writer.Write("instance", TextTokenType.Keyword);
writer.WriteSpace();
}
sig.RetType.WriteTo(writer, ILNameSyntax.SignatureNoNamedTypeParameters);
writer.WriteSpace();
if (method != null) {
if (method.DeclaringType != null) {
method.DeclaringType.WriteTo(writer, ILNameSyntax.TypeName);
writer.Write("::", TextTokenType.Operator);
}
MethodDef md = method as MethodDef;
if (md != null && md.IsCompilerControlled) {
writer.WriteReference(Escape(method.Name + "$PST" + method.MDToken.ToInt32().ToString("X8")), method, TextTokenHelper.GetTextTokenType(method));
}
else {
writer.WriteReference(Escape(method.Name), method, TextTokenHelper.GetTextTokenType(method));
}
}
MethodSpec gim = method as MethodSpec;
if (gim != null && gim.GenericInstMethodSig != null) {
writer.Write('<', TextTokenType.Operator);
for (int i = 0; i < gim.GenericInstMethodSig.GenericArguments.Count; i++) {
if (i > 0) {
writer.Write(',', TextTokenType.Operator);
writer.WriteSpace();
}
gim.GenericInstMethodSig.GenericArguments[i].WriteTo(writer);
}
writer.Write('>', TextTokenType.Operator);
}
writer.Write("(", TextTokenType.Operator);
var parameters = sig.GetParameters();
for(int i = 0; i < parameters.Count; ++i) {
if (i > 0) {
writer.Write(',', TextTokenType.Operator);
writer.WriteSpace();
}
parameters[i].WriteTo(writer, ILNameSyntax.SignatureNoNamedTypeParameters);
}
writer.Write(")", TextTokenType.Operator);
}