public void ShowGraph() { IEnumerable <FoldChangeBarGraph> barGraphs; if (null != DockPanel) { barGraphs = DockPanel.Contents.OfType <FoldChangeBarGraph>(); } else { barGraphs = FormUtil.OpenForms.OfType <FoldChangeBarGraph>(); } foreach (var form in barGraphs) { if (SameBindingSource(form)) { form.Activate(); return; } } var graph = new FoldChangeBarGraph(); graph.SetBindingSource(FoldChangeBindingSource); if (null != Pane) { graph.Show(Pane, null); } else { graph.Show(Owner); } }
public void ShowGraph() { IEnumerable<FoldChangeBarGraph> barGraphs; if (null != DockPanel) { barGraphs = DockPanel.Contents.OfType<FoldChangeBarGraph>(); } else { barGraphs = Application.OpenForms.OfType<FoldChangeBarGraph>(); } foreach (var form in barGraphs) { if (SameBindingSource(form)) { form.Activate(); return; } } var graph = new FoldChangeBarGraph(); graph.SetBindingSource(FoldChangeBindingSource); if (null != Pane) { graph.Show(Pane, null); } else { graph.Show(Owner); } }