示例#1
0
        private void WeaveOnExecute(MethodDefinition targetMethod, ILProcessor ilp, VariableDefinition aspectInstance, VariableDefinition correlation, Instruction addAfter)
        {
            if (_onExecute != null)
            {
                var onExecInstructions = GetOnExecuteInstructions(targetMethod, ilp, aspectInstance, correlation);

                if (addAfter == null)
                {
                    ilp.PrependInstructions(onExecInstructions);
                }
                else
                {
                    ilp.InsertInstructionsAfter(addAfter, onExecInstructions);
                }
            }
        }