public static void ShowForm(IWin32Window owner, IExample example) { AreaForm form = new AreaForm(example.Panel); form.Text = example.Caption; form.ShowDialog(owner); form.Controls.Clear(); form.Dispose(); }
private void ExamplesView_MouseDoubleClick(object sender, MouseEventArgs e) { var example = SelectedExample; if (null == example) { return; } Label label = null; try { Cursor = Cursors.WaitCursor; Enabled = false; if (null != example.Panel) { AreaForm.ShowForm(this, example); } else { label = ShowWait(); example.RunExample(); } } catch (Exception exception) { ErrorForm.Show(this, exception); } finally { HideWait(label); Enabled = true; Cursor = Cursors.Default; } }