title: How can I get the class name from a function pointer in C#?
body: <p>I have a base class "TestBase"</p>
  
  <p>Several test classes inherit from it and override the "Test" function of the base class.</p>
  
  <p>The TestBase class uses a 'TestRunner' class and passes it a pointer to it's 'Test' function (which is overridden).</p>
  
  <p>Inside 'TestRunner' a timeout may occur.  If this happens, I need to know the name of the derived class that the 'Test' pointer belongs to.</p>
  
  <p>All I have is the function pointer.  So basically, I want to know the name of the derived class that the 'Test' function pointer came from.</p>
  
  <p>I'm guessing Reflection can do this, but I'm having trouble finding out how..</p>
  
  <p>To clarify, the function pointer 'test' is defined as:</p>
  
  <pre><code>Func&lt;bool&gt; test
  </code></pre>
  
  <p>Passed in as follows:</p>
  
  <pre><code>public void RunTest(Func&lt;bool&gt; test, int timeoutInSeconds=30)
  {
     ...
     //Use 'test' to find out what class it came from...
  }
  </code></pre>