PostSharpAPI ReferencePost­Sharp.​AspectsMethod­Interception­Args
Open sandboxFocus

MethodInterceptionArgs Class

Arguments of advices of aspect type MethodInterceptionAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
public abstract class MethodInterceptionArgs : 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 the control has been given over to the next node in the chain of invocation. Consider working with if you need such deferred execution.

note

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

Properties

Name Description
Arguments

Gets the list of arguments with which the method has been invoked.

AsyncBinding

Gets an interface that allows to invoke asynchronously the next node in the chain of invocation of the intercepted method.

Binding

Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.

IsAsync

Determines whether the intercepted method is async, and therefore whether the AsyncBinding property and ProceedAsync() method are available.

Method

Gets the method being executed.

ReturnValue

Gets or sets the return value of the method.

Methods

Name Description
Invoke(Arguments)

Invokes the method that has been intercepted by calling the next node in the chain of invocation with given arguments, without affecting the property ReturnValue.

InvokeAsync(Arguments)

Invokes asynchronously the method that has been intercepted by calling the next node in the chain of invocation with given arguments, without affecting the property ReturnValue.

Proceed()

Proceeds with invocation of the method that has been intercepted by calling the next node in the chain of invocation, passing the current Arguments to that method and storing its return value into the property ReturnValue.

ProceedAsync()

Proceeds asynchronously with invocation of the method that has been intercepted by calling the next node in the chain of invocation, passing the current Arguments to that method and storing its return value into the property ReturnValue upon the completion of the intercepted async method.

See Also