private void btnRename_Click(object sender, EventArgs e) { bool NoErrorsFound = true; ValidateRenameProcess(ref NoErrorsFound); if (NoErrorsFound) { try { switch (comboRenamingStrat.SelectedItem.ToString()) { case Vocab.Renaming.ComboLinear: { LinearRenamer linearRenamer = new LinearRenamer(txtInputDirectory.Text, getExtInclusions(), txtPrefixOption.Text, txtSuffixOption.Text); linearRenamer.Execute(); MessageBox.Show($"Success! \n{linearRenamer.FileCount} files were renamed.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } case Vocab.Renaming.ComboRandom: { RandomRenamer randomRenamer = new RandomRenamer(txtInputDirectory.Text, getExtInclusions()); randomRenamer.Execute(); MessageBox.Show($"Success! \n{randomRenamer.FileCount} files were renamed.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } case Vocab.Renaming.ComboRegEx: { MessageBox.Show("RegEx strategy is WIP and not available.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } default: break; } } catch (Exception thrownException) { MessageBox.Show($"An unhandled exception has occurred: {thrownException.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void UpdateLinearExample() { txtLinearExample.Text = LinearRenamer.ExampleFilename(txtPrefixOption.Text, txtSuffixOption.Text); }