tags:

views:

36

answers:

3

Is there any difference in using

SomeEvent(arg);

and

SomeEvent.Invoke(arg);

If there is no significant difference, which one is the better practice?

+1  A: 

No difference, they are equivalent. SomeEvent(arg); is just syntactic sugar for .Invoke

Brian R. Bondy
A: 

The first form is C# syntactic sugar for the second. I've not seen anyone use the second form, but I can imagine that some code-generators might in order to "future-proof" the code.

Jesse C. Slicer
+1  A: 

They are exactly the same. The convention is to use the first form though.

Paolo