当前位置: 首页>>代码示例>>C#>>正文


C# MethodSig.GetParameters方法代码示例

本文整理汇总了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);
 }
开发者ID:gsong2014,项目名称:dnSpy,代码行数:54,代码来源:DisassemblerHelpers.cs


注:本文中的dnlib.DotNet.MethodSig.GetParameters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。