Is there any difference in using
SomeEvent(arg);
and
SomeEvent.Invoke(arg);
If there is no significant difference, which one is the better practice?
Is there any difference in using
SomeEvent(arg);
and
SomeEvent.Invoke(arg);
If there is no significant difference, which one is the better practice?
No difference, they are equivalent. SomeEvent(arg);
is just syntactic sugar for .Invoke
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.
They are exactly the same. The convention is to use the first form though.