I don't understand what the difference between these 2 variations are. What is the pros/cons of each approach?
1. a.MyEvent += new MyClass.MyEventDelegate(FireEvent);
2. a.MyEvent += FireEvent;
The first one works in all versions of C# while the second only works on 2.0 and above. If you need your to compile you code with C# 1.0 compiler, go with the first one; otherwise, I'd use the more concise version. The generated code should be identical in both cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With