PostSharpAPI ReferencePost­Sharp.​AspectsOn­Method­Boundary­Aspect
Open sandboxFocus

OnMethodBoundaryAspect Class

Aspect that, when applied to a method defined in the current assembly, inserts a piece of code before and after the body of these methods.

Inheritance
OnMethodBoundaryAspect
Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
[MulticastAttributeUsage]
[HasInheritedAttribute]
[AspectConfigurationAttributeType]
[Serializer]
public abstract class OnMethodBoundaryAspect : MethodLevelAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, IOnStateMachineBoundaryAspect, IOnMethodBoundaryAspect, IMethodLevelAspect, IAspect

Constructors

Name Description
OnMethodBoundaryAspect() PostSharp.Aspects.OnMethodBoundaryAspect

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 unsupported target method.

Methods

Name Description
CreateAspectConfiguration()

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

OnEntry(MethodExecutionArgs)

Method executed before the body of methods to which this aspect is applied.

OnException(MethodExecutionArgs)

Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception.

OnExit(MethodExecutionArgs)

Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block).

OnResume(MethodExecutionArgs)

Method executed when a state machine resumes execution after a yield return or await statement.

OnSuccess(MethodExecutionArgs)

Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.).

OnYield(MethodExecutionArgs)

Method executed when a state machine yields, as the result of a yield return or await statement.

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.