I just realized I can add an event handler in two ways:
Consider an event handler like so:
private void MyEventHandler()
{}
Method 1: Instantiate a new delegate
MyObject.MyEvent += new Action(MyEventHandler);
Method 2: Add event handler without instantiating a new delegate
MyObject.MyEvent += MyEventHandler;
Is there any difference in between these two implementations that should be considered?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…