Esempio n. 1
0
        public override CloseEventArgs ShowDialog()
        {
            if (CurrentMethod == null)
            {
                form = new frmSelectTest(Methods);


                if (form.ShowDialog() == DialogResult.OK)
                {
                    CurrentMethod = form.SelectedMethod;
                }
            }

            if (CurrentMethod != null)
            {
                frmTest form = new frmTest(CurrentMethod);
                form.LoadDataFromMethod();
                form.ShowDialog();
                LastResult = new TestsCloseEventArgs((double)CurrentMethod.finRes);
                OnClose(LastResult);
                return(LastResult);
            }

            return(null);
        }
Esempio n. 2
0
        /// <summary>
        /// Can't understand: what the f**k?!?
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void form_frmSelectTestClosed(object sender, FormClosedEventArgs e)
        {
            // Here was no parametr in constructor for Module.
            if (sender is frmSelectTest)
            {
                var form = sender as frmSelectTest;
                if (form.DialogResult != DialogResult.OK)
                {
                    return;
                }

                CurrentMethod = form.SelectedMethod;
            }

            if (CurrentMethod != null)
            {
                frmTest form = new frmTest(CurrentMethod);
                if (sender is frmSelectTest)
                {
                    form.MdiParent = (sender as frmSelectTest).MdiParent;
                }
                form.FormClosed += form_frmTestClosed;
                form.Show();
            }
        }