PostSharp6.2/API Reference/Post­Sharp.​Aspects Namespace/IMethod­Interception­Aspect Interface/IMethod­Interception­Aspect Methods/IMethod­Interception­Aspect.​On­Invoke Method

IMethodInterceptionAspect.OnInvoke Method

Method invoked instead of the method to which the aspect has been applied.

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 6.2.13.0 (6.2.13.0)
Syntax
C#
void OnInvoke(
	MethodInterceptionArgs args
)

Parameters

args
Type: PostSharp.Aspects.MethodInterceptionArgs
Advice arguments.
Remarks

The implementation of OnInvoke(MethodInterceptionArgs) may invoke Proceed(), may schedule it for invocation from another thread, or may completely skip its invocation. Alternatively, it may use Binding. Before returning to the caller, the OnInvoke(MethodInterceptionArgs) method must set the return value (property ReturnValue) and all output arguments (property Arguments), otherwise the target method may fail with a NullReferenceException. These are normally set by calling Proceed().

See Also