PostSharpAPI ReferencePost­Sharp.​AspectsEvent­Interception­AspectOn­Remove­Handler
Open sandboxFocus

EventInterceptionAspect.OnRemoveHandler Method

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.

Declaration
[RequiresEventInterceptionAdviceAnalysis]
[RequiresDebuggerEnhancement]
[HasInheritedAttribute]
[EventInterceptionAdviceOptimization]
public virtual void OnRemoveHandler(EventInterceptionArgs args)
Parameters
Type Name Description
EventInterceptionArgs args

Handler arguments.

Implements
IEventInterceptionAspect.OnRemoveHandler(EventInterceptionArgs)
Remarks
note

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.