void OnInsightWindowClosed(object sender, EventArgs e) { if (_insightWindow != null) { _insightWindow.Closed -= OnInsightWindowClosed; _insightWindow.Dispose(); _insightWindow = null; } }
/// <summary> /// Shows the insight window. /// </summary> /// <param name="insightDataProvider">The insight data provider.</param> public void ShowInsightWindow(IInsightDataProvider insightDataProvider) { if (_insightWindow == null || _insightWindow.IsDisposed) { _insightWindow = new InsightWindow(ParentForm, this); _insightWindow.Closed += OnInsightWindowClosed; } _insightWindow.AddInsightDataProvider(insightDataProvider, FileName); _insightWindow.ShowInsightWindow(); }