Esempio n. 1
0
        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 editReactButton_Click(object sender, EventArgs e)
        {
            if (editReactButton.Checked)
            {
                FormDefine   defineProgram;
                DialogResult result;
                string       editProgramName = "error";

                try
                {
                    defineProgram = new FormDefine("Editar Programa: ", Global.reactionTestFilesPath + Global.programFolderName, "prg", "program", false);
                    result        = defineProgram.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        editProgramName = defineProgram.ReturnValue;
                        FormTRConfig configureProgram = new FormTRConfig(editProgramName);
                        configureProgram.PrgName = editProgramName;
                        Global.GlobalFormMain._contentPanel.Controls.Add(configureProgram);
                        editReactButton.Checked = false;
                    }
                    else
                    {
                        /*do nothing, user cancelled selection of program*/
                    }
                }
                catch (Exception ex) { MessageBox.Show(ex.Message); }
            }
            else
            {
                /*do nothing*/
            }
        }
 private void newReactButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (newReactButton.Checked)
         {
             FormTRConfig configureProgram = new FormTRConfig("false");
             Global.GlobalFormMain._contentPanel.Controls.Add(configureProgram);
             newReactButton.Checked = false;
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }
Esempio n. 4
0
        private void reactionToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            FormDefine   defineProgram;
            DialogResult result;
            string       editProgramName = "error";

            defineProgram = new FormDefine(LocRM.GetString("editProgram", currentCulture), Global.reactionTestFilesPath + Global.programFolderName, "prg", "program", false, false);
            result        = defineProgram.ShowDialog();
            if (result == DialogResult.OK)
            {
                editProgramName = defineProgram.ReturnValue;
                FormTRConfig configureProgram = new FormTRConfig(editProgramName);
                configureProgram.PrgName = editProgramName;
                this.Controls.Add(configureProgram);
            }
        }
Esempio n. 5
0
 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*/
         }
     }
 }
Esempio n. 6
0
        private void editReactButton_Click(object sender, EventArgs e)
        {
            bool screenTranslationAllowed = true;

            if (editReactButton.Checked)
            {
                if (Global.GlobalFormMain._contentPanel.Controls.Count > 0)
                {
                    screenTranslationAllowed = checkSave();
                }
                if (screenTranslationAllowed)
                {
                    FormDefine   defineProgram;
                    DialogResult result;
                    string       editProgramName = "error";

                    try
                    {
                        defineProgram = new FormDefine(LocRM.GetString("editProgram", currentCulture), Global.reactionTestFilesPath + Global.programFolderName, "prg", "program", false, false);
                        result        = defineProgram.ShowDialog();
                        if (result == DialogResult.OK)
                        {
                            editProgramName = defineProgram.ReturnValue;
                            FormTRConfig configureProgram = new FormTRConfig(editProgramName);
                            configureProgram.PrgName = editProgramName;
                            Global.GlobalFormMain._contentPanel.Controls.Add(configureProgram);
                            editReactButton.Checked = false;
                        }
                        else
                        {
                            /*do nothing, user cancelled selection of program*/
                        }
                    }
                    catch (Exception ex) { MessageBox.Show(ex.Message); }
                }
            }
            else
            {
                /*do nothing*/
            }
        }
Esempio n. 7
0
        private void newReactButton_Click(object sender, EventArgs e)
        {
            bool screenTranslationAllowed = true;

            try
            {
                if (newReactButton.Checked)
                {
                    if (Global.GlobalFormMain._contentPanel.Controls.Count > 0)
                    {
                        screenTranslationAllowed = checkSave();
                    }
                    if (screenTranslationAllowed)
                    {
                        FormTRConfig configureProgram = new FormTRConfig("false");
                        Global.GlobalFormMain._contentPanel.Controls.Add(configureProgram);
                        newReactButton.Checked = false;
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Esempio n. 8
0
        private void reactionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormTRConfig configureProgram = new FormTRConfig("false");

            this.contentPanel.Controls.Add(configureProgram);
        }