EventInterceptionAspect.OnInvokeHandler Method |
Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
public virtual void OnInvokeHandler( EventInterceptionArgs args )
Parameters
- args
- Type: PostSharp.Aspects.EventInterceptionArgs
Handler arguments.
Implements
IEventInterceptionAspect.OnInvokeHandler(EventInterceptionArgs)Because of the way how the C# compiler implements field-like events (i.e. events where you don't implement the Add and Remove semantics manually), the Invoke Event Handler semantic ( OnInvokeHandler(EventInterceptionArgs) or equivalent) shall not be invoked for delegates that have been added from inside the class that declares this event. |
The Invoke Event Handler semantic is different from normal event firing. Indeed, when you fire an event, all handlers that were added to this event are fired. However, the current method invokes only a single handler: the one passed to the handler parameter. |