public void Activate() { foreach (ITextBuffer buffer in this.textView.BufferGraph.GetTextBuffers((b) => true)) { BufferBar bar = new BufferBar(buffer, this.textViewHost, this.editorOperations, this.editorFactory); this.barMap.Add(buffer, bar); } AddChildren(); this.textView.BufferGraph.GraphBuffersChanged += OnGraphBuffersChanged; }
private void OnGraphBuffersChanged(object sender, GraphBuffersChangedEventArgs e) { foreach (ITextBuffer removedBuffer in e.RemovedBuffers) { BufferBar bar = this.barMap[removedBuffer]; this.barMap.Remove(removedBuffer); bar.Close(); } foreach (ITextBuffer addedBuffer in e.AddedBuffers) { BufferBar bar = new BufferBar(addedBuffer, this.textViewHost, this.editorOperations, this.editorFactory); this.barMap.Add(addedBuffer, bar); } Children.Clear(); AddChildren(); }