Example #1
0
        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();
        }
Example #2
0
        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;
            }
        }