private bool checkSave() { bool result = false; if (Global.GlobalFormMain._contentPanel.Controls[0] is FormTRConfig) { DialogResult dialogResult = MessageBox.Show(LocRM.GetString("savePending", currentCulture), LocRM.GetString("savePendingTitle", currentCulture), MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { FormTRConfig programToSave = (FormTRConfig)(Global.GlobalFormMain._contentPanel.Controls[0]); result = programToSave.save(); } else { Global.GlobalFormMain._contentPanel.Controls.Clear(); return(true); } } if (result == false) { Global.GlobalFormMain._contentPanel.Controls.Clear(); return(true); } else { return(false); } }
private void checkSave() { if (Global.GlobalFormMain.contentPanel.Controls[0] is FormTRConfig) { DialogResult dialogResult = MessageBox.Show(LocRM.GetString("savePending", currentCulture), LocRM.GetString("savePendingTitle", currentCulture), MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { FormTRConfig toSave = (FormTRConfig)(Global.GlobalFormMain.contentPanel.Controls[0]); toSave.save(); } else { /*do nothing*/ } } else if (Global.GlobalFormMain.contentPanel.Controls[0] is ExperimentConfig) { DialogResult dialogResult = MessageBox.Show(LocRM.GetString("savePending", currentCulture), LocRM.GetString("savePendingTitle", currentCulture), MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { ExperimentConfig toSave = (ExperimentConfig)(Global.GlobalFormMain.contentPanel.Controls[0]); toSave.save(); } else { /*do nothing*/ } } else if (Global.GlobalFormMain.contentPanel.Controls[0] is FormPrgConfig) { DialogResult dialogResult = MessageBox.Show(LocRM.GetString("savePending", currentCulture), LocRM.GetString("savePendingTitle", currentCulture), MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { FormPrgConfig toSave = (FormPrgConfig)(Global.GlobalFormMain.contentPanel.Controls[0]); toSave.save(); } else { /*do nothing*/ } } }