Exemplo n.º 1
0
        public void Remove(Instruction instruction)
        {
            if (instruction == null)
            {
                throw new ArgumentNullException("instruction");
            }

            if (!instructions.Remove(instruction))
            {
                throw new ArgumentOutOfRangeException("instruction");
            }
        }
Exemplo n.º 2
0
        public void Remove(Instruction instr)
        {
            if (!m_instrs.Contains(instr))
            {
                throw new ArgumentException("Instruction not in method body");
            }

            if (instr.Previous != null)
            {
                instr.Previous.Next = instr.Next;
            }
            if (instr.Next != null)
            {
                instr.Next.Previous = instr.Previous;
            }
            m_instrs.Remove(instr);
        }