title: Anonymous method as parameter to BeginInvoke?
body: <p>Why can't you pass an anonymous method as a parameter to the <code>BeginInvoke</code> method? I have the following code:
  </p>
  
  <pre class="lang-cs prettyprint-override"><code>private delegate void CfgMnMnuDlg(DIServer svr);
  private void ConfigureMainMenu(DIServer server,)
  {
      MenuStrip mnMnu = PresenterView.MainMenu;
      if (mnMnu.InvokeRequired)
      {
          mnMnu.BeginInvoke((CfgMnMnuDlg)ConfigureMainMenu, 
                              new object[] { server});
      }
      else
      {
          // Do actual work here
      }
  }
  </code></pre>
  
  <p>I'm trying to avoid declaring the delegate.  Why can't I write something like the below instead?  Or can I, and I just can't figure out the correct syntax? The below currently generates an:</p>
  
  <blockquote>
    <p>Argument type 'Anonymous method' is not assignable to parameter type 'System.Delegate'</p>
  </blockquote>
  
  <p>Ok, that's right of course, but is there some other syntax I can use to do this (avoid having to declare a separate delegate in order to use <code>BeginInvoke()</code>? </p>
  
  <p>(Being able to do this would fit in neatly with the concept of using anon methods/lamdas in place of explicit delegates which works so cleanly everywhere else.)
  </p>
  
  <pre class="lang-cs prettyprint-override"><code>private void ConfigureMainMenu(DIServer server,)
  {
      MenuStrip mnMnu = PresenterView.MainMenu;
      if (mnMnu.InvokeRequired)
      {
          mnMnu.BeginInvoke(  //  pass anonymous method instead ?
               delegate(DIServer svr) { ConfigureMainMenu(server);},     
               new object[] { server});
      }
      else
      {
          // Do actual work here
      }
  }
  </code></pre>