private void editExperimentButton_Click(object sender, EventArgs e)
        {
            bool screenTranslationAllowed = true;

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


                defineProgram = new FormDefine(LocRM.GetString("editProgram", currentCulture), Global.experimentTestFilesPath + Global.programFolderName, "prg", "program", false, false);
                result        = defineProgram.ShowDialog();
                if (result == DialogResult.OK)
                {
                    editProgramName = defineProgram.ReturnValue;
                    ExperimentConfig editExperiment = new ExperimentConfig(editProgramName);
                    Global.GlobalFormMain._contentPanel.Controls.Add(editExperiment);
                    editExperimentButton.Checked = false;
                }
                else
                {
                    /*do nothing, user cancelled selection of program*/
                }
            }
        }
        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*/
            }
        }
        public static void createListFile(string listTypeParam, FormDefine formDefine)
        {
            listType = listTypeParam;
            MessageBox.Show(LocRM.GetString("inFormListWarning", currentCulture));
            if (Global.GlobalFormMain._contentPanel.Controls.Count > 0)
            {
                Control listCreationControl = null;
                controlToRestore = Global.GlobalFormMain._contentPanel.Controls[0];
                Global.GlobalFormMain._contentPanel.Controls.Clear();
                switch (listType)
                {
                case "_color":
                case "_words":
                    listCreationControl = new FormWordColorConfig(false);
                    break;

                case "_audio":
                    listCreationControl = new FormAudioConfig(false);
                    break;

                case "_image":
                    listCreationControl = new FormImgConfig("false");
                    break;
                }
                Global.GlobalFormMain._contentPanel.Controls.Add(listCreationControl);
            }
            else
            {
                /*do nothing*/
            }
        }
        private void editStroopButton_CheckedChanged(object sender, EventArgs e)
        {
            bool screenTranslationAllowed = true;

            if (editStroopButton.Checked)
            {
                if (Global.GlobalFormMain._contentPanel.Controls.Count > 0)
                {
                    screenTranslationAllowed = checkSave();
                }
                if (screenTranslationAllowed)
                {
                    string       editProgramName = "error";
                    FormDefine   defineProgram   = new FormDefine(LocRM.GetString("editProgram", currentCulture), Global.stroopTestFilesPath + Global.programFolderName, "prg", "program", false, false);
                    DialogResult result          = defineProgram.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        editProgramName = defineProgram.ReturnValue;
                        if (!Validations.isEmpty(editProgramName))
                        {
                            FormPrgConfig configureProgram = new FormPrgConfig(editProgramName);
                            if (!configureProgram.IsDisposed)
                            {
                                Global.GlobalFormMain._contentPanel.Controls.Add(configureProgram);
                            }
                            editStroopButton.Checked = false;
                        }
                    }
                }
            }
        }
Exemple #5
0
        public static string OpenListFile(string itemType)
        {
            string progName = "abrir";

            FormDefine defineProgram = new FormDefine("Lista: ", Global.testFilesPath + Global.listFolderName, "lst", itemType, false);
            var        result        = defineProgram.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                progName = defineProgram.ReturnValue;
            }

            return(progName);
        }
 private void editStroopButton_CheckedChanged(object sender, EventArgs e)
 {
     if (editStroopButton.Checked)
     {
         try
         {
             string       editProgramName = "error";
             FormDefine   defineProgram   = new FormDefine("Editar Programa: ", Global.stroopTestFilesPath + Global.programFolderName, "prg", "program", false);
             DialogResult result          = defineProgram.ShowDialog();
             if (result == DialogResult.OK)
             {
                 editProgramName = defineProgram.ReturnValue;
                 FormPrgConfig configureProgram = new FormPrgConfig(editProgramName);
                 Global.GlobalFormMain._contentPanel.Controls.Add(configureProgram);
                 editStroopButton.Checked = false;
             }
         }
         catch (Exception ex) { MessageBox.Show(ex.Message); }
     }
 }
Exemple #7
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*/
            }
        }
        private void editExperimentButton_Click(object sender, EventArgs e)
        {
            FormDefine   defineProgram;
            DialogResult result;
            string       editProgramName = "error";


            defineProgram = new FormDefine("Editar Programa: ", Global.experimentTestFilesPath + Global.programFolderName, "prg", "program", false);
            result        = defineProgram.ShowDialog();
            if (result == DialogResult.OK)
            {
                editProgramName = defineProgram.ReturnValue;
                ExperimentConfig editExperiment = new ExperimentConfig(editProgramName);
                Global.GlobalFormMain._contentPanel.Controls.Add(editExperiment);
                editExperimentButton.Checked = false;
            }
            else
            {
                /*do nothing, user cancelled selection of program*/
            }
        }
Exemple #9
0
        private void editParticipantButton_Click(object sender, EventArgs e)
        {
            bool screenTranslationAllowed = true;

            if (editParticipantButton.Checked)
            {
                if (FileManipulation.GlobalFormMain._contentPanel.Controls.Count > 0)
                {
                    screenTranslationAllowed = checkSave();
                }
                if (screenTranslationAllowed)
                {
                    FormDefine   defineParticipant;
                    DialogResult result;
                    string       editParticipantName = "error";

                    try
                    {
                        defineParticipant = new FormDefine(LocRM.GetString("editParticipant", currentCulture), FileManipulation._participantDataPath, "data", "participant", false, false);
                        result            = defineParticipant.ShowDialog();
                        if (result == DialogResult.OK)
                        {
                            editParticipantName = defineParticipant.ReturnValue;
                            FormParticipantConfig configureProgram = new FormParticipantConfig(editParticipantName);
                            FileManipulation.GlobalFormMain._contentPanel.Controls.Add(configureProgram);
                            editParticipantButton.Checked = false;
                        }
                        else
                        {
                            /*do nothing, user cancelled selection of participant*/
                        }
                    }
                    catch (Exception ex) { MessageBox.Show(ex.Message); }
                }
            }
            else
            {
                /*do nothing*/
            }
        }
        public static string OpenListFile(string itemType, string current, string type)
        {
            ResourceManager LocRM          = new ResourceManager("TestPlatform.Resources.Localizations.LocalizedResources", typeof(FormMain).Assembly);
            CultureInfo     currentCulture = CultureInfo.CurrentUICulture;

            string progName = LocRM.GetString("open", currentCulture);

            FormDefine defineProgram = new FormDefine("Lista: ", Global.testFilesPath + Global.listFolderName, type, itemType, false, true);
            var        result        = defineProgram.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                if (defineProgram.ReturnValue.Length != 0)
                {
                    progName = defineProgram.ReturnValue;
                }
                else
                {
                    progName = current;
                }
            }

            return(progName);
        }