Difference between events with an event with SomeEvent (arg) and SomeEvent.Invoke (arg)

Is there any difference in use

SomeEvent(arg);

and

SomeEvent.Invoke(arg);

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

+3
source share
3 answers

The first form is C # syntactic sugar for the second. I have not seen anyone use the second form, but I can imagine that some code generators could β€œprovide the future” with code.

0
source

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

+1
source

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

+1
source

Source: https://habr.com/ru/post/1750685/


All Articles