PostSharp.ILAPI ReferencePost­Sharp.​AspectsMethod­Interception­Aspect
Open sandboxFocus

MethodInterceptionAspect Class

Aspect that, when applied on a method, intercepts invocations of this method.

Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
[MulticastAttributeUsage]
[HasInheritedAttribute]
[AspectConfigurationAttributeType]
[Serializer]
public abstract class MethodInterceptionAspect : MethodLevelAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, IAsyncMethodInterceptionAspect, IMethodInterceptionAspect, IMethodLevelAspect, IAspect

Constructors

Name Description
MethodInterceptionAspect() PostSharp.Aspects.MethodInterceptionAspect

Properties

Name Description
SemanticallyAdvisedMethodKinds

Determines which target methods will be advised semantically. This affects the behavior of the aspect when it's applied to iterator or async methods, which are compiled into state machines.

UnsupportedTargetAction

Specifies the action to take when the aspect is applied to an async method with unsupported return value type.

Methods

Name Description
CreateAspectConfiguration()

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

OnInvoke(MethodInterceptionArgs)

Method invoked instead of the method to which the aspect has been applied.

OnInvokeAsync(MethodInterceptionArgs)

Method invoked instead of the method to which the aspect has been applied.

SetAspectConfiguration(AspectConfiguration, MethodBase)

Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect.