/// <summary> /// Creates DocumentChangeEventArgs for the reverse change. /// </summary> public DocumentChangeEventArgs Invert() { OffsetChangeMap map = this.OffsetChangeMapOrNull; if (map != null) { map = map.Invert(); map.Freeze(); } return(new DocumentChangeEventArgs(this.Offset, this.InsertedText, this.RemovedText, map)); }
public void Undo() { OffsetChangeMap map = change.OffsetChangeMapOrNull; document.Replace(change.Offset, change.InsertionLength, change.RemovedText, map != null ? map.Invert() : null); }