PostSharpAPI ReferencePost­Sharp.​AspectsEvent­Interception­Aspect
Open sandboxFocus

Class EventInterceptionAspect

Aspect that, when applied on an event, intercepts invocations of its semantics Add (OnAddHandler(EventInterceptionArgs)), Remove (OnRemoveHandler(EventInterceptionArgs)) and Invoke (OnInvokeHandler(EventInterceptionArgs)).

Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
[HasInheritedAttribute]
[MulticastAttributeUsage]
[AspectConfigurationAttributeType]
[Serializer]
public abstract class EventInterceptionAspect : EventLevelAspect, IEventLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, IEventInterceptionAspect, IEventLevelAspect, IAspect

Constructors

Name Description
EventInterceptionAspect() PostSharp.Aspects.EventInterceptionAspect

Methods

Name Description
CreateAspectConfiguration()

Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

OnAddHandler(EventInterceptionArgs)

Method invoked instead of the Add semantic of the event to which the current aspect is applied, i.e. when a new delegate is added to this event.

OnInvokeHandler(EventInterceptionArgs)

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.

OnRemoveHandler(EventInterceptionArgs)

Method invoked instead of the Remove semantic of the event to which the current aspect is applied, i.e. when a delegate is removed from this event.