This is the online documentation for PostSharp 5.0.
Download PDF or CHM. Go to v4.3 or v5.0

EventInterceptionAspect.OnInvokeHandler Method

Method invoked when the event to which the current aspect is applied is fired, for each delegate of this event, and instead of invoking this delegate.

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 5.0.33.0 (5.0.33.0)
Syntax
C#
public virtual void OnInvokeHandler(
	EventInterceptionArgs args
)

Parameters

args
Type: PostSharp.Aspects.EventInterceptionArgs
Handler arguments.

Implements

IEventInterceptionAspect.OnInvokeHandler(EventInterceptionArgs)
Remarks
Note Note
Because of the way how the C# compiler implements automatic 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.

Note Note
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.
See Also