Hi, I simply do not understand why both works:
this.timer.Tick += new EventHandler(timer_Tick);
this.timer.Tick += classA.Tick;
Thanks
Hi, I simply do not understand why both works:
this.timer.Tick += new EventHandler(timer_Tick);
this.timer.Tick += classA.Tick;
Thanks
Starting from v2.0 (AFAIR) of C#, EventHandler
(and other delegates too) is instantiated implicitly. If you'll decompile your code you'll see that.
Check the specification:
Any method from any accessible class or struct that matches the delegate's signature, which consists of the return type and parameters, can be assigned to the delegate.