public void Remove(int offset, int length) { //if (readOnly) { // return; //} OnDocumentAboutToBeChanged(new DocumentEventArgs(this, offset, length)); undoStack.Push(new UndoableDelete(this, offset, GetText(offset, length))); textBufferStrategy.Remove(offset, length); lineTrackingStrategy.Remove(offset, length); OnDocumentChanged(new DocumentEventArgs(this, offset, length)); }
public void Remove(int offset, int length) { if (!ReadOnly) { DocumentAboutToBeChanged?.Invoke(this, new DocumentEventArgs() { Document = this, Offset = offset, Length = length }); UndoStack.Push(new UndoableDelete(this, offset, GetText(offset, length))); TextBuffer.Remove(offset, length); LineManager.Remove(offset, length); DocumentChanged?.Invoke(this, new DocumentEventArgs() { Document = this, Offset = offset, Length = length }); } }