MethodMappingWriter.EmitStoreContextItemIntoLocalConditional Method (MethodMappingContextItem, ILocalStorage, ITypeSignature, InstructionWriter, Action<InstructionWriter, ILocalStorage>, Action<InstructionWriter, ILocalStorage>) |
Namespace: PostSharp.Sdk.AspectInfrastructure
Assembly: PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
public void EmitStoreContextItemIntoLocalConditional( MethodMappingContextItem methodMappingContextItem, ref ILocalStorage contextItemLocal, ITypeSignature contextItemType, InstructionWriter instructionWriter, Action<InstructionWriter, ILocalStorage> loadContextItemAction, Action<InstructionWriter, ILocalStorage> emitIfLoadedFromContextAction )
Parameters
- methodMappingContextItem
- Type: PostSharp.Sdk.AspectInfrastructure.MethodMappingContextItem
The context item. - contextItemLocal
- Type: PostSharp.Sdk.AspectInfrastructure.ILocalStorage
The local variable where the value of the context item should be stored. If the input value of this parameter is null, a local variable of type contextItemType is created. - contextItemType
- Type: PostSharp.Sdk.CodeModel.ITypeSignature
The type of the context item, used to create the local variable if contextItemLocal is null. - instructionWriter
- Type: PostSharp.Sdk.CodeModel.InstructionWriter
An InstructionWriter. - loadContextItemAction
- Type: System.Action<InstructionWriter, ILocalStorage>
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. - emitIfLoadedFromContextAction
- Type: System.Action<InstructionWriter, ILocalStorage>
A delegate that emits instructions executed in case the item has been loaded from context, or null if nothing should be executed if the item is loaded from context.