protected override void Dispose(bool disposing) { if (disposing) { if (this.textBuffer != null) { this.textBuffer = (ITextBuffer)null; } if (this.undoManager != null) { this.undoManager.TextBufferUndoHistory.UndoRedoHappened -= new EventHandler <UndoRedoEventArgs>(this.TextBufferUndoHistory_UndoRedoHappened); this.undoManager.TextBufferUndoHistory.UndoTransactionCompleted -= new EventHandler <UndoTransactionCompletedEventArgs>(this.TextBufferUndoHistory_UndoTransactionCompleted); this.undoManager = (ITextBufferUndoManager)null; } if (this.topMarker != null) { this.topMarker = (UndoTransactionMarker)null; } } base.Dispose(disposing); }
internal ITextBufferUndoManager CreateTextBuffer(string contents, string documentType, out UndoTransactionMarker topUndoStackMarker) { ITextBufferUndoManager textBuffer = this.CreateTextBuffer(contents, documentType); topUndoStackMarker = this.undoHistoryRegistry.GetUndoTransactionMarker("TopMarker"); return(textBuffer); }