PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingDispatched­Attribute.​Dispatched­Method­AspectOn­Invoke
Open sandboxFocus

DispatchedAttribute.DispatchedMethodAspect.OnInvoke Method

OnInvoke(MethodInterceptionArgs)

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

Declaration
[MethodInterceptionAdviceOptimization]
[Internal(AttributeId = -9126100459348525005L)]
[DebuggerAspectMethod]
public override void OnInvoke(MethodInterceptionArgs args)
Parameters
Type Name Description
MethodInterceptionArgs args

Advice arguments.

Overrides
MethodInterceptionAspect.OnInvoke(MethodInterceptionArgs)
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