Passing a random method as a parameter?
<p>Is there any way in <strong>C#</strong> to pass a <strong>random</strong> method as a parameter?</p>

<p>To explain my question:</p>

<p>I want to write a simple Logger-Tool that reports the entering and leaving of a method <strong>with</strong> the passed arguments an the class and method name:</p>

<p><strong>The log file I'm aiming at:</strong></p>

<pre><code>ENTERING: ClassOfDoom::MethodOfDoom( arg1={1} [int], arg2={true} [bool] )
LEAVING: ClassOfDoom::MethodOfDoom RETURNING 1 [int]
</code></pre>

<p><strong>The code I have in mind:</strong></p>

<pre><code>class ClassOfDoom {
  // Remeber: MethodOfDoom is a _random_ method with _random_ arguments
  public int MethodOfDoom(int arg1, bool arg2) {
    Log.Entering(this, this.MethodOfDoom, arg1, arg2);
    ...
    return Log.Returing(this, this.MethodOfDoom, 1);
  }
}
</code></pre>

<p>Is there a way to achieve this? Or isn't <strong>C#</strong> as flexible as that?</p>

<p>Thanks in advance!</p>
