For newcomers, I try to simply demystify how both usages are two sides of the same coin. When we look at its declaration we get the following by hovering our mouse pointer to +
or =+
operators of EventHandler
.
EventHandler EventHandler.operator +(EventHandler left, EventHandler right)
We are pretty sure from now on that it is a sort of operator overloading, which is +
, along with not knowing its implementation detail. At this point, we can make use of ILSpy showing that the overloaded operator corresponds to the following method somehow.
(EventHandler)Delegate.Combine(< The EventHandler reference >, < The
signature matched method implementation of the reference in question >);
For example,
myEventHandlerDelegateRef = (EventHandler) Delegate.Combine(
myEventHandlerDelegateRef,
new EventHandler(myEventHandlerRefDefinition)
);
As it can be clearly observed, the instantiation operator, new
, is used internally.