internal void run(IModelEdit modelEdit) { //we're about to make several changes to the DOM //wrap them within one IEditorTransaction so that //they can undo as a single operation using (IEditorTransaction editorTransaction = modelEdit.createEditorTransaction()) { //change the DOM editDom(modelEdit.domDocument); //restore the selected range into the newly-located DOM nodes //(the renderer removed the selected range from these nodes automatically //when the editDom method temporarily removed the nodes from the document) IWindowSelection windowSelection = modelEdit.windowSelection; m_start.restore(windowSelection.collapse); m_end.restore(windowSelection.extend); } }