public override void EnsureTagStorage()
        {
            var systemObject = _referenceFinder.GetTypeReference(typeof(object));

            _tagField = _module.ImportReference(_stateMachine.AddPublicInstanceField(systemObject));

            TagPersistable = new FieldPersistable(new VariablePersistable(_stateMachineLocal), _tagField);
        }
Ejemplo n.º 2
0
        protected override void WeaveMethodExecutionArgs(NamedInstructionBlockChain arguments)
        {
            var executionArgs = _creator.CreateMethodExecutionArgsInstance(
                arguments,
                _aspects[0].Info.AspectAttribute.AttributeType);

            _executionArgsField = _module.ImportReference(_stateMachine.AddPublicInstanceField(executionArgs.Variable.VariableType));
            executionArgs.Add(new InstructionBlock("", Instruction.Create(OpCodes.Ldloc, executionArgs.Variable)));

            var field        = new FieldPersistable(new VariablePersistable(_stateMachineLocal), _executionArgsField);
            var instructions = field.Store(executionArgs.Flatten(), _module.ImportReference(typeof(void)));

            var chain = new InstructionBlockChain();

            chain.Add(instructions);
            AddToSetup(chain);
            ExecutionArgs = field;
        }