This is the online documentation for PostSharp 5.0.
Download PDF or CHM. Go to v4.3 or v5.0

MethodInterceptionArgs Class

Arguments of advices of aspect type MethodInterceptionAspect.
Inheritance Hierarchy
System.Object
  PostSharp.Aspects.AdviceArgs
    PostSharp.Aspects.MethodInterceptionArgs

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 5.0.31.0 (5.0.31.0)
Syntax
C#
public abstract class MethodInterceptionArgs : AdviceArgs

The MethodInterceptionArgs type exposes the following members.

Properties
  NameDescription
Public propertyArguments
Gets the list of arguments with which the method has been invoked.
Public propertyAsyncBinding
Gets an interface that allows to invoke asynchronously the next node in the chain of invocation of the intercepted method.
Public propertyBinding
Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.
Public propertyDeclarationIdentifier
Gets the DeclarationIdentifier of the declaration to which the advice has been applied.
(Inherited from AdviceArgs.)
Public propertyInstance
Gets or sets the object instance on which the method is being executed.
(Inherited from AdviceArgs.)
Public propertyIsAsync
Determines whether the intercepted method is async, and therefore whether the AsyncBinding property and ProceedAsync() method are available.
Public propertyMethod
Gets the method being executed.
Public propertyReturnValue
Gets or sets the return value of the method.
Top
Methods
  NameDescription
Public methodInvoke
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.
Public methodInvokeAsync
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.
Public methodProceed
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.
Public methodProceedAsync
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.
Top
Extension Methods
  NameDescription
Public Extension MethodQueryInterface<T>
Gets the implementation of a specified interface for the specified object.
(Defined by QueryInterfaceExtensions.)
Top
Remarks
Note 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 aspect bindings if you need such deferred execution.
Note 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.
See Also