Possible Duplicate:
Is there an actual difference in the 2 different ways of attaching event handlers in C#?
I’ve been seeing a lot of code that looks like this:
foo.Drop += new DragEventHandler(fooHandler);
But in the past, I’ve always done this:
foo.Drop += fooHandler;
Is there a difference between these two syntaxes? If so, is there any advantage to doing it the long way?
The second is shorthand for the first; they will compile to indentical IL.
However, the second syntax is new to C# 2.0; C# 1 only supports the first.