private void openImgList() { try { FormDefine defineFilePath = defineFilePath = new FormDefine("Lista de Imagens: ", path, "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(path + "/" + dir + ".lst"); readImagesIntoDGV(filePaths, imgPathDataGridView); if (firstOpenFlag) { WindowState = FormWindowState.Maximized; firstOpenFlag = false; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void editProgramToolStripMenuItem_Click(object sender, EventArgs e) { FormDefine defineProgram; DialogResult result; string editProgramName = "error"; try { defineProgram = new FormDefine("Editar Programa: ", testFilesPath + "/prg/", "prg", "program", false); result = defineProgram.ShowDialog(); if (result == DialogResult.OK) { editProgramName = defineProgram.ReturnValue; FormPrgConfig configureProgram = new FormPrgConfig(testFilesPath, editProgramName); if (!configureProgram.IsDisposed) { configureProgram.ShowDialog(); } else { configureProgram.Close(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void defineUser() { try { FormDefine defineUser = new FormDefine("Definir Participante: ", testFilesPath, "usr", "user", false); var result = defineUser.ShowDialog(); if (result == DialogResult.OK) { string userName = defineUser.ReturnValue; usrNameSL.Text = userName; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
//AUX FUNCTIONS private string openListFile(string itemType) { string progName = "abrir"; FormDefine defineProgram = new FormDefine("Lista: ", path + "/lst/", "lst", itemType, false); var result = defineProgram.ShowDialog(); if (result == DialogResult.OK) { progName = defineProgram.ReturnValue + itemType + ".lst"; } return(progName); }
private void defineProgram() { FormDefine defineProgram = new FormDefine("Definir Programa: ", testFilesPath + "/prg/", "prg", "program", false); try { var result = defineProgram.ShowDialog(); if (result == DialogResult.OK) { string progName = defineProgram.ReturnValue; prgNameSL.Text = progName; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void openFilesForEdition(string filePath) { try { FormDefine defineFilePath = new FormDefine("Listas de Palavras: ", filePath, "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 = filePath + "/" + fileName + "_words.lst"; string cFile = filePath + "/" + 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 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); } }
private void openFilesForEdition() { try { FormDefine defineFilePath = new FormDefine("Listas de Audio: ", path, "lst", "_audio", true); var result = defineFilePath.ShowDialog(); if (result == DialogResult.OK) { string dir = defineFilePath.ReturnValue; audioListNameTextBox.Text = dir.Remove(dir.Length - 6); // removes the _audio identification from file while editing (when its saved it is always added again) string[] filePaths = StroopProgram.readDirListFile(path + "/" + dir + ".lst"); DGVManipulation.readStringListIntoDGV(filePaths, audioPathDataGridView); numberFiles.Text = audioPathDataGridView.RowCount.ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }