Is there an actual difference in the 2 different ways of attaching event handlers in C#?

半世苍凉 提交于 2019-11-28 01:54:33
Alexander Kojevnikov

The second method is a shortcut to the first one, it was introduced in C# 2.0

See also this thread.

They are exactly the same, its called syntax sugar.

There are a lot of things that arent needed, to get a better idea of them while programming you should try something like Resharper. It will color the unnecessary code in Grey. Not to mention a whole myriad of incredible tools and refactorings.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!