private void editProgram() { ReactionProgram editProgram = new ReactionProgram(); try { editProgram.readProgramFile(path + Global.programFolderName + editPrgName + ".prg"); } catch (FileNotFoundException e) { MessageBox.Show(LocRM.GetString("cantEdìtProgramMissingFiles", currentCulture) + e.Message); return; } prgNameTextBox.Text = editProgram.ProgramName; numExpo.Value = editProgram.NumExpositions; expoTime.Value = editProgram.ExpositionTime; intervalTime.Value = editProgram.IntervalTime; beepingCheckbox.Checked = editProgram.IsBeeping; beepDuration.Value = editProgram.BeepDuration; stimuluSize.Value = (decimal)editProgram.StimuluSize; fontSizeUpDown.Value = editProgram.FontSize; positionsBox.SelectedIndex = editProgram.NumberPositions - 1; expandImageCheck.Checked = editProgram.ExpandImage; if (editProgram.getHasColorList()) { UniqueColorOption.Checked = false; ColorListOption.Checked = true; openColorListButton.Enabled = true; stimulusColor.Enabled = false; } if (editProgram.ExpositionRandom) { isRandomExposition.Checked = true; } if (editProgram.BeepingRandom) { randomBeepCheck.Checked = true; } if (editProgram.StimulusColor != "false") { stimulusColor.Text = editProgram.StimulusColor; stimulusColorPanel.BackColor = ColorTranslator.FromHtml(editProgram.StimulusColor); } else { stimulusColor.Enabled = false; stimulusColorPanel.BackColor = Color.White; } editProgramShapes(editProgram); if (editProgram.ResponseType == "space") { responseTypeBox.SelectedIndex = 0; } else if (editProgram.ResponseType == "arrows") { responseTypeBox.SelectedIndex = 1; } if (editProgram.getWordListFile() == null) { openWordListButton.Enabled = false; } else { openWordListButton.Enabled = true; openWordListButton.Text = editProgram.getWordListFile().ListName; } if (editProgram.getColorListFile() == null) { openColorListButton.Enabled = false; } else { openColorListButton.Enabled = true; openColorListButton.Text = editProgram.getColorListFile().ListName; } if (editProgram.getImageListFile() == null) { openImgListButton.Enabled = false; } else { openImgListButton.Enabled = true; openImgListButton.Text = editProgram.getImageListFile().ListName; } if (editProgram.getAudioListFile() == null) { openAudioListButton.Enabled = false; } else { openAudioListButton.Enabled = true; openAudioListButton.Text = editProgram.getAudioListFile().ListName; } if (editProgram.BackgroundColor.ToLower() == "false") { bgColorPanel.BackColor = Color.White; bgColorButton.Text = LocRM.GetString("choose", currentCulture); } else { if ((Validations.isHexPattern(editProgram.BackgroundColor))) { bgColorButton.Text = editProgram.BackgroundColor; bgColorPanel.BackColor = ColorTranslator.FromHtml(editProgram.BackgroundColor); } } if (editProgram.FixPoint == "+") { fixPointCross.Checked = true; fixPointCircle.Checked = false; fixPointColorButton.Text = editProgram.FixPointColor; fixPointColorPanel.BackColor = ColorTranslator.FromHtml(editProgram.FixPointColor); } else if (editProgram.FixPoint == "o") { fixPointCross.Checked = false; fixPointCircle.Checked = true; fixPointColorButton.Text = editProgram.FixPointColor; fixPointColorPanel.BackColor = ColorTranslator.FromHtml(editProgram.FixPointColor); } else { fixPointCross.Checked = false; fixPointCircle.Checked = false; } // reads program instructions to instruction box if there are any if (editProgram.InstructionText != null) { instructionsBox.ForeColor = Color.Black; instructionsBox.Text = editProgram.InstructionText[0]; for (int i = 1; i < editProgram.InstructionText.Count; i++) { instructionsBox.AppendText(Environment.NewLine + editProgram.InstructionText[i]); } } else { instructionsBox.Text = instructionBoxText; } switch (editProgram.ExpositionType) { case "shapes": chooseExpoType.SelectedIndex = 0; break; case "words": chooseExpoType.SelectedIndex = 1; break; case "images": chooseExpoType.SelectedIndex = 2; break; case "imageAndWord": chooseExpoType.SelectedIndex = 3; break; case "wordWithAudio": chooseExpoType.SelectedIndex = 4; break; case "imageWithAudio": chooseExpoType.SelectedIndex = 5; break; default: throw new Exception(LocRM.GetString("expoType", currentCulture) + editProgram.ExpositionType + LocRM.GetString("invalid", currentCulture)); } }