PostSharp SDK 2023.0 / / Class Reference / Post­Sharp.​Sdk.​Aspect­Infrastructure Namespace / Method­Mapping­Writer Class / Method­Mapping­Writer Methods / Method­Mapping­Writer.​Emit­Load­Context­Item Method

MethodMappingWriter.EmitLoadContextItem Method

Emits instructions that load the value of a context item on the stack. If the item is not available in the current context, it is loaded using instructions emitted by a delegate.

Namespace:  PostSharp.Sdk.AspectInfrastructure
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
Syntax
C#
public void EmitLoadContextItem(
	MethodMappingContextItem methodMappingContextItem,
	ITypeSignature type,
	InstructionWriter instructionWriter,
	Action<InstructionWriter> loadContextItemAction
)

Parameters

methodMappingContextItem
Type: PostSharp.Sdk.AspectInfrastructure.MethodMappingContextItem
The context item.
type
Type: PostSharp.Sdk.CodeModel.ITypeSignature
Type of the context item value.
instructionWriter
Type: PostSharp.Sdk.CodeModel.InstructionWriter
An InstructionWriter.
loadContextItemAction
Type: System.Action<InstructionWriter>
A delegate that emits instructions that load the context item value on the stack. This delegate is invoked in case the item is not available in the current context.
See Also