src/sys/dotnet/perwapi/PERWAPI.cs
/// <summary>
/// Replace a number of IL instructions beginning at position pos in the buffer
/// with some new instruction(s).  This removes the instructions and puts
/// the instruction buffer into "insert" mode at the position of the removed
/// instructions.  EndInsert must be called to insert the new instructions.
/// The instructions from index "from" up to and including index "to" will
/// be replaced by the new instructions entered.
/// This method cannot be called when in "insert" mode.
/// </summary>
/// <param name="from">the index to start replacing instruction from</param>
/// <param name="to">the last index of the instructions to be replaced</param>
Replace a number of IL instructions beginning at position pos in the buffer
with some new instruction(s).  This removes the instructions and puts
the instruction buffer into "insert" mode at the position of the removed
instructions.  EndInsert must be called to insert the new instructions.
The instructions from index "from" up to and including index "to" will
be replaced by the new instructions entered.
This method cannot be called when in "insert" mode.
Replace a number of IL instructions beginning at position pos in the buffer with some new instruction ( s ) . This removes the instructions and puts the instruction buffer into " insert " mode at the position of the removed instructions . EndInsert must be called to insert the new instructions . The instructions from index " from " up to and including index " to " will be replaced by the new instructions entered . This method cannot be called when in " insert " mode .
public void ReplaceInstruction(int from, int to) {
            if (inserting) throw new Exception("Cannot replace instructions during insert.");
            currI = from;
            if ((from < 0) || (from >= tide) || (to < 0))
                throw new Exception("replace index is out of range");
            if (to >=tide) to = tide-1;
            numReplace = to - from + 1;
            StartInsert();
        }
public void ReplaceInstruction ( int from , int to ) { if ( inserting ) throw new Exception ( " " ) ; currI = from ; if ( ( from < 0 ) || ( from >= tide ) || ( to < 0 ) ) throw new Exception ( " " ) ; if ( to >= tide ) to = tide - 1 ; numReplace = to - from + 1 ; StartInsert ( ) ; }
Replace a number of IL instructions beginning at position pos in the buffer
with some new instruction(s).
Replace a number of IL instructions beginning at position pos in the buffer with some new instruction ( s ) .
from
int
the index to start replacing instruction from
the index to start replacing instruction from
to
int
the last index of the instructions to be replaced
the last index of the instructions to be replaced