Is it safe to add delegates to events with keyword new?

后端 未结 4 445
时光取名叫无心
时光取名叫无心 2021-01-12 20:02

One thing I am concerned with is that I discovered two ways of registering delegates to events.

  1. OnStuff += this.Handle;
  2. OnStuff += new StuffEventHand
4条回答
  •  野的像风
    2021-01-12 21:02

    I was under the impression that 2 is just syntax sugar. They should be exactly the same thing.

提交回复
热议问题