Ejemplo n.º 1
0
        public void InsertBefore(Instruction target, Instruction instr)
        {
            int index = m_instrs.IndexOf(target);

            if (index == -1)
            {
                throw new ReflectionException("Target instruction not in method body");
            }

            m_instrs.Insert(index, instr);
            instr.Previous  = target.Previous;
            target.Previous = instr;
            instr.Next      = target;
        }
Ejemplo n.º 2
0
        public void InsertBefore(Instruction target, Instruction instr)
        {
            int index = m_instrs.IndexOf(target);

            if (index == -1)
            {
                throw new ArgumentOutOfRangeException("Target instruction not in method body");
            }

            m_instrs.Insert(index, instr);
            instr.Previous = target.Previous;
            if (target.Previous != null)
            {
                target.Previous.Next = instr;
            }
            target.Previous = instr;
            instr.Next      = target;
        }
Ejemplo n.º 3
0
        public void InsertBefore(Instruction target, Instruction instruction)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            if (instruction == null)
            {
                throw new ArgumentNullException("instruction");
            }

            var index = instructions.IndexOf(target);

            if (index == -1)
            {
                throw new ArgumentOutOfRangeException("target");
            }

            instructions.Insert(index, instruction);
        }