Open sandboxFocus

Class MethodExecutionArgs

Arguments of the advices of aspects of type OnMethodBoundaryAspect and OnExceptionAspect.

Inheritance
MethodExecutionArgs
Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
public class MethodExecutionArgs : AdviceArgs
Remarks

note

As a result of weaving optimizations, instances of classes derived from AdviceArgs may be shared among different aspects. Therefore, aspect code should not attempt to access this object once control has been passed to the next node in the chain of invocation. Consider working with aspect bindings if you need such deferred execution.

note

Aspect weaving optimizations may also cause an advice parameter of this type to appear as null when inspecting it in a debugger. If you need to inspect the instance at runtime, consider disabling aspect optimizations in the debug build configuration.

Developing Simple Aspects

Properties

Name Description
Arguments

Gets the arguments with which the method has been invoked.

Exception

Gets or sets the exception thrown by the target method.

FlowBehavior

Gets or sets the control flow of the target method once the advice is exited.

Method

Gets the method being executed.

MethodExecutionTag

Gets or sets user-defined state information whose lifetime is linked to the current method execution. Aspects derived from IOnMethodBoundaryAspect should use this property to save state information between different events (OnEntry(MethodExecutionArgs), OnExit(MethodExecutionArgs) and OnException(MethodExecutionArgs)).

ReturnValue

Gets or sets the method return value.

YieldValue

Gets or sets the value yielded by the iterator method.

See Also