Open sandboxFocus

Enum InterceptorReceiverMapping

Kinds of mapping of the receiver of an intercepted call to the parameters of a generated interceptor method.

Namespace: Metalama.Extensions.Interceptors
Assembly: Metalama.Extensions.Interceptors.dll
Syntax
[CompileTime]
public enum InterceptorReceiverMapping

Fields

Name Description
None

The intercepted method has no receiver, because it is static.

Parameter

The receiver of the call is passed as the first parameter of the generated method. In a call that can modify a struct receiver, the parameter is passed by reference.

This

The receiver of the call is the this instance of the generated method, which is an instance method without a receiver parameter. The call site calls the generated method on its receiver, and meta.Proceed() calls the intercepted method on this. This makes it possible to intercept a call to a protected method of a base type.