【发布时间】:2011-05-10 13:42:54
【问题描述】:
可能重复:
Is there an actual difference in the 2 different ways of attaching event handlers in C#?
我见过很多这样的代码:
foo.Drop += new DragEventHandler(fooHandler);
但在过去,我总是这样做:
foo.Drop += fooHandler;
这两种语法有区别吗?如果是这样,长期这样做有什么好处吗?
【问题讨论】:
-
绝对是重复的。投票关闭自己。