title: Extract arguments of method calls with Mono.Cecil
body: <p>I am trying to extract all arguments passed to a specific method with Mono.Cecil.<br/>
  In a post-processing script that runs right after the project being build, I am able to find all method calls, and even extract the type of the argument passed to the function. However, I am not able to get the actual value... So is this even possible with Mono.Cecil, and if yes, what value do I need to look at? </p>
  
  <p>Here is my current code :</p>
  
  <pre><code>List&lt;MethodDefinition&gt; methods = new List&lt;MethodDefinition&gt; ();
  foreach (ModuleDefinition _module in assembly.Modules) {
      foreach (TypeDefinition _type in _module.Types) {
          methods.AddRange (_type.Methods);
      }
  }
  var uiExtensionMethod = methods
        .Where(m =&gt; m.DeclaringType.Name == "SetCustomText").FirstOrDefault();
  var instructions = uiExtensionMethod.Body.Instructions;
  var count = instructions.Count;
  var instructionArray = instructions.ToArray();
  for (int i = 0; i &lt; count; i++) {
      if (instructionArray [i] != null) {
          if (instructionArray [i].Operand != null) {
              var paramType = instructionArray [i].Operand.ToString ();
              // So here I have the type of the parameter, but I cannot get the value...
          }
      }
  }
  </code></pre>