title: Pass different methods as parameter to invoke by method name
body: <p>I have several methods in a <i>Util</i> class with different return types and different parameters, f.e:</p>
  
  <pre><code>int RealMethodToExecute(int i, string s) { ... }
  </code></pre>
  
  <p>Those methods must be invoked in the ui thread and the call would look something like that:</p>
  
  <pre><code>int x = (int)InvokeControl.Invoke("Util.RealMethodToExecute");
  </code></pre>
  
  <p>Because in my opinion using the method names as string is not really pretty, i thought at the following solution:</p>
  
  <pre><code>public int WrappedRealMethodToExecute(int i, string s)
  {
      return InvokeMethod(Util.RealMethodToExecute, i, s);
  }
  
  private static T InvokeMethod&lt;T&gt;(Func&lt;int, string, T&gt; func, params object[] p)
  {            
      return (T)InvokeControl.Invoke(func.Method.DeclaringType.FullName + "." + func.Method.Name, p);
  }
  </code></pre>
  
  <p>The problem now is that <i>InvokeMethod</i> only acceppts methods with an int and a string parameter and a return value but i have different methods which i want to execute.</p>
  
  <p>I dont want to overload <i>InvokeMethod</i>. I just need the full qualified name of the function to execute it.</p>
  
  <p>Any ideas??</p>
  
  <p>edit: extended example with parameters</p>