public void Restore(XmlEditor editor, bool restoreText, bool restoreScroll = true) { if (restoreText) { editor._highlighting = true; editor.Rtf = Text; editor._highlighting = false; } editor.Select(CursorLocation, Length); if (restoreScroll) { editor.SetScrollPos(ScrollPos); } if (restoreText) { editor.OnTextChanged(EventArgs.Empty); } }
public static UndoRedoInfo Create(XmlEditor editor) { return(new UndoRedoInfo(editor.Rtf, editor.GetScrollPos(), editor.SelectionStart, editor.SelectionLength)); }