private void openFilesForEdition() { FormDefine defineFilePath = new FormDefine(LocRM.GetString("audioList", currentCulture), FileManipulation._listFolderName, "dir", "_audio", true, false); var result = defineFilePath.ShowDialog(); if (result == DialogResult.OK) { isListNameValid = true; string choosenList = defineFilePath.ReturnValue; if (choosenList == "") { isListNameValid = false; return; } // removes the _audio identification from file while editing (when its saved it is always added again) audioListNameTextBox.Text = choosenList; audioList = new StrList(choosenList, AUDIO); string[] filePaths = audioList.ListContent.ToArray(); DGVManipulation.ReadStringListIntoDGV(filePaths, audioPathDataGridView); numberFiles.Text = audioPathDataGridView.RowCount.ToString(); } }
private void openFilesForEdition() { try { FormDefine defineFilePath = new FormDefine(LocRM.GetString("wordList", currentCulture), FileManipulation._listFolderName, "lst", "_words_color", true, false); var result = defineFilePath.ShowDialog(); if (result == DialogResult.OK) { isListNameValid = true; string fileName = defineFilePath.ReturnValue; if (fileName == "") { isListNameValid = false; return; } fileName = fileName.Remove(fileName.Length - 6); listNameTextBox.Text = fileName; string wFile = FileManipulation._listFolderName + "/" + fileName + "_words.lst"; string cFile = FileManipulation._listFolderName + "/" + fileName + "_color.lst"; if (!File.Exists(wFile) && !File.Exists(cFile)) { return; } if (File.Exists(wFile)) { string[] wordsArray = StrList.readListFile(wFile); foreach (string word in wordsArray) { wordsList.Add(word); } wordsListCheckBox.Checked = true; } if (File.Exists(cFile)) { string[] colorsArray = StrList.readListFile(cFile); foreach (string color in colorsArray) { colorsList.Add(color); } colorsListCheckBox.Checked = true; } addItems(); } else { wordsListCheckBox.Checked = true; colorsListCheckBox.Checked = true; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void openFilesForEdition() { try { FormDefine defineFilePath = new FormDefine("Listas de Palavras: ", Global.testFilesPath + Global.listFolderName, "lst", "_words_color", true); var result = defineFilePath.ShowDialog(); if (result == DialogResult.OK) { string fileName = defineFilePath.ReturnValue; fileName = fileName.Remove(fileName.Length - 6); listNameTextBox.Text = fileName; string wFile = Global.testFilesPath + Global.listFolderName + "/" + fileName + "_words.lst"; string cFile = Global.testFilesPath + Global.listFolderName + "/" + fileName + "_color.lst"; if (File.Exists(wFile)) { string[] wordsArray = StrList.readListFile(wFile); foreach (string word in wordsArray) { wordsList.Add(word); } wordsListCheckBox.Checked = true; } if (File.Exists(cFile)) { string[] colorsArray = StrList.readListFile(cFile); foreach (string color in colorsArray) { colorsList.Add(color); } colorsListCheckBox.Checked = true; } checkTypeOfList(); numberItens.Text = wordsDataGridView.RowCount.ToString(); } else { wordsListCheckBox.Checked = true; colorsListCheckBox.Checked = true; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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); } }
private void stroopToolStripMenuItem1_Click(object sender, EventArgs e) { FormDefine defineProgram; DialogResult result; string editProgramName = "error"; try { defineProgram = new FormDefine(LocRM.GetString("editProgram", currentCulture), Global.stroopTestFilesPath + Global.programFolderName, "prg", "program", false, false); result = defineProgram.ShowDialog(); if (result == DialogResult.OK) { editProgramName = defineProgram.ReturnValue; FormPrgConfig configureProgram = new FormPrgConfig(editProgramName); this.Controls.Add(configureProgram); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void openImgList() { FormDefine defineFilePath = defineFilePath = new FormDefine(LocRM.GetString("imageList", currentCulture), Global.testFilesPath + Global.listFolderName, "dir", "_image", true, false); var result = defineFilePath.ShowDialog(); if (result == DialogResult.OK) { string listName = defineFilePath.ReturnValue; isListNameValid = true; if (listName == "") { isListNameValid = false; return; } imgListNameTextBox.Text = listName; // removes the _img identification from file while editing (when its saved it is always added again) imageList = new StrList(listName, IMAGE); string[] filePaths = imageList.ListContent.ToArray(); readImagesIntoDGV(filePaths, imgPathDataGridView); } }
private void openImgList() { try { FormDefine defineFilePath = defineFilePath = new FormDefine("Lista de Imagens: ", Global.testFilesPath + Global.listFolderName, "lst", "_image", true); var result = defineFilePath.ShowDialog(); if (result == DialogResult.OK) { string dir = defineFilePath.ReturnValue; imgListNameTextBox.Text = dir.Remove(dir.Length - 6); // removes the _img identification from file while editing (when its saved it is always added again) string[] filePaths = StroopProgram.readDirListFile(Global.testFilesPath + Global.listFolderName + "/" + dir + ".lst"); readImagesIntoDGV(filePaths, imgPathDataGridView); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void openFilesForEdition() { try { FormDefine defineFilePath = new FormDefine("Listas de Audio: ", Global.testFilesPath + Global.listFolderName, "lst", "_audio", true); var result = defineFilePath.ShowDialog(); if (result == DialogResult.OK) { string choosenList = defineFilePath.ReturnValue; audioListNameTextBox.Text = choosenList.Remove(choosenList.Length - 6); // removes the _audio identification from file while editing (when its saved it is always added again) string[] filePaths = StroopProgram.readDirListFile(Global.testFilesPath + Global.listFolderName + "/" + choosenList + ".lst"); DGVManipulation.ReadStringListIntoDGV(filePaths, audioPathDataGridView); numberFiles.Text = audioPathDataGridView.RowCount.ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void moveFileToBackup(string originPath, string backupPath, string fileType) { try { FormDefine defineFilePath = new FormDefine("Excluir: ", originPath, fileType, "_image_words_color_audio", true); var result = defineFilePath.ShowDialog(); if (result == DialogResult.OK) { DialogResult dialogResult = MessageBox.Show("Deseja realmente excluir " + defineFilePath.ReturnValue + "?", "", MessageBoxButtons.YesNo); // pergunta se deseja repetir o programa if (dialogResult == DialogResult.Yes) { File.Move(originPath + defineFilePath.ReturnValue + "." + fileType, backupPath + "backup_" + defineFilePath.ReturnValue + "." + fileType); MessageBox.Show(defineFilePath.ReturnValue + ".lst excluída com sucesso!"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }