ShowDialog() public method

public ShowDialog ( IWin32Window owner, BaseWrapper component ) : DialogResult
owner IWin32Window
component BaseWrapper
return DialogResult
Example #1
0
        private void MainFormNew_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (mEditorsController.CheckModified())
            {
                using (PKStudio.Dialogs.SaveChangesDialog SCDlg = new Dialogs.SaveChangesDialog())
                {
                    DialogResult res = SCDlg.ShowDialog(this, mEditorsController.ModifiedComponents);

                    switch (res)
                    {
                    case DialogResult.Cancel:
                        e.Cancel = true;
                        break;

                    case DialogResult.No:
                        SaveState();
                        break;

                    case DialogResult.Yes:
                        mEditorsController.SaveAllModifiedEditors();
                        SaveState();
                        break;

                    default:
                        SaveState();
                        break;
                    }
                }
            }
            else
            {
                SaveState();
            }
        }
Example #2
0
        private void MainFormNew_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (mEditorsController.CheckModified())
            {
                using (PKStudio.Dialogs.SaveChangesDialog SCDlg = new Dialogs.SaveChangesDialog())
                {
                    DialogResult res = SCDlg.ShowDialog(this, mEditorsController.ModifiedComponents);

                    switch (res)
                    {
                        case DialogResult.Cancel:
                            e.Cancel = true;
                            break;
                        case DialogResult.No:
                            SaveState();
                            break;
                        case DialogResult.Yes:
                            mEditorsController.SaveAllModifiedEditors();
                            SaveState();
                            break;
                        default:
                            SaveState();
                            break;
                    }
                }
            }
            else
                SaveState();
        }