Go to content Go to navigation Go to search
C#, Programmer Dull · Feb 23, 08:34 PM

In the I don’t think that means what you think that means department…

A while back I thought it was a pretty neat trick that .NET could figure out that these anonymous functions were the same and would do the right thing:

   SomeEvent += new EventHandler((object o, EventArgs e)=>{ DoSomethingCool(); });
   ...
   SomeEvent -= new EventHandler((object o, EventArgs e)=>{ DoSomethingCool(); });

It turns out it cannot.

My bad.

commenting closed for this article

The economy must be getting better... XBox financials