Invoke anoymous event handler using reflection?
<p>I have implemented my own event registration  for a client-server UI framework, much like in ASP.NET. I store an event's name (e.g. "<code>Click</code>") in a dictionary and as the value I remember </p>

<p><code>oEventHandler.Method.DeclaringType.AssemblyQualifiedName.ToString() + "." + oEventHandler.Method.Name.</code></p>

<p>Then to reinvoke the event handlers later on, I recreate the delegate:</p>

<pre><code>var oEventHandler = Delegate.CreateDelegate( typeof( BLUIEventHandler ), oPage, sEventMethod, false )
</code></pre>

<p>and invoke it on the page:</p>

<pre><code>oEventHandler.Invoke( oPage, this, oEventArgs );
</code></pre>

<p>This works fine for event handlers that are part of the ASPX page, like</p>

<pre><code>var oTheButton = new UIButton();
oTheButton.Click += this.HandleClick;
private void HandleClick() {}
</code></pre>

<p>but fails for anonymous delegates:</p>

<pre><code>var oTheButton = new UIButton();
oTheButton.Click += delegate {/* Will never be called. */};
</code></pre>

<p>The resulting string for a non-anymous delegate is:</p>

<pre><code>"MyTest.Rene.UI.Foo, BDRS, Version=8.10.1.19703, Culture=neutral, PublicKeyToken=null.HandleClick"
</code></pre>

<p>For an anoymous delegate it is:</p>

<pre><code>"MyTest.Rene.UI.Foo+&lt;&gt;c__DisplayClass1, MyTest, Version=8.10.1.17866, Culture=neutral, PublicKeyToken=null.&lt;OnInitializeLayout&gt;oTheButton__0"
</code></pre>

<p>However when I try to recreate the anonymous delegate, I get a binding error.
Is there a way to get back to the anymous delegate and invoke it?</p>
