Base class for OnMethodEntryAdvice, OnMethodSuccessAdvice, OnMethodExceptionAdvice, OnMethodExitAdvice, OnMethodYieldAdvice and OnMethodResumeAdvice.
Inheritance
Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp.dll
Syntax
public abstract class OnMethodBoundaryAdvice : GroupingAdviceRemarks
The derived advices are the counterparts of the methods of OnMethodBoundaryAspect for aspects composed of
advices and pointcuts. The advices of a group are woven as a single try/catch/finally construct, consistent with
OnMethodBoundaryAspect, and they can share variables through parameters bound by StateAttribute, or through
MethodExecutionTag when they receive MethodExecutionArgs. The group is inferred when it is
unambiguous, for instance for the advices without pointcut of a MethodLevelAspect; otherwise, set the
Master property.
The parameters of the advice methods receive the values of the target method, such as its arguments or its return value, through custom attributes derived from AdviceParameterAttribute.
When applied to iterator or async methods, these advices are applied semantically by default. Use SemanticallyAdvisedMethodKinds and UnsupportedTargetAction to change this behavior.
Properties
| Name | Description |
|---|---|
| SemanticallyAdvisedMethodKinds | Gets or sets which target methods are advised semantically. This affects the behavior of the advice when it is applied to iterator or async methods, which are compiled into state machines. |
| UnsupportedTargetAction | Gets or sets the action to take when the advice is applied to an unsupported target method. |