private void RemoveExistingInfoBar() { if (currentInfoBar != null) { currentInfoBar.ButtonClick -= ShowOutputWindow; currentInfoBar.Closed -= CurrentInfoBar_Closed; infoBarManager.DetachInfoBar(currentInfoBar); currentInfoBar = null; } }
private void ClearCurrentInfoBar() { this.CancelQualityProfileProcessing(); this.infoBarBinding = null; this.currentErrorWindowInfoBarHandlingClick = false; if (this.currentErrorWindowInfoBar == null) { return; } this.currentErrorWindowInfoBar.Closed -= this.CurrentErrorWindowInfoBar_Closed; this.currentErrorWindowInfoBar.ButtonClick -= this.CurrentErrorWindowInfoBar_ButtonClick; IInfoBarManager manager = this.host.GetMefService <IInfoBarManager>(); if (manager == null) // Could be null during shut down { return; } manager.DetachInfoBar(this.currentErrorWindowInfoBar); this.currentErrorWindowInfoBar = null; }