public OutliningController(ITextView view, IVsOutliningManager manager) { this.theView = view; this.outliningManager = manager; this.currentDispatcher = Dispatcher.CurrentDispatcher; this.timer = new DispatcherTimer(DispatcherPriority.Background, this.currentDispatcher); this.timer.Tick += OnTimerTick; this.timer.Interval = TimeSpan.FromMilliseconds(50); this.theView.Closed += OnViewClosed; }
private void OnViewClosed(Object sender, EventArgs e) { if (this.theView != null) { this.theView.Closed -= OnViewClosed; this.theView.LayoutChanged -= OnTextViewLayoutChanged; this.theView = null; } if (this.timer != null) { this.timer.Stop(); this.timer = null; } this.outliningManager = null; this.currentDispatcher = null; }
private void OnViewClosed(Object sender, EventArgs e) { if ( this.theView != null ) { this.theView.Closed -= OnViewClosed; this.theView.LayoutChanged -= OnTextViewLayoutChanged; this.theView = null; } if ( this.timer != null ) { this.timer.Stop(); this.timer = null; } this.outliningManager = null; this.currentDispatcher = null; }