Simple question on anonymous method signatures and event handlers
<p>So, probably a simple question with a simple answer, but I don't know what it is and I am curious :).  Why does the compiler allow me to do something like this?</p>

<pre><code>button1.Click += delegate { someFlag = true; };
</code></pre>

<p>(I can only use .NET 2.0, so no lamdas, but the same concept)</p>

<p>I cannot however do this:</p>

<pre><code>button1.Click += MyDelegateMethod

// snip

// compile error, signature does not match the signature of System.EventHandler.
private void MyDelegateMethod( )
{ 

}
</code></pre>

<p>I would expect that I would have to declare my anonymous method as:</p>

<pre><code>delegate(object sender, EventArgs e) { someFlag = true; };
</code></pre>

<p>I don't understand why it is ok for an anonymous method, but not ok when I write the full method itself.  Anyone?</p>
