MPTagThat.FileNameToTag.FileNameToTag.btApply_Click C# (CSharp) Method

btApply_Click() private method

Apply the changes to the selected files.
private btApply_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void btApply_Click(object sender, EventArgs e)
        {
            if (!Util.CheckParameterFormat(cbFormat.Text, Options.ParameterFormat.FileNameToTag))
            MessageBox.Show(localisation.ToString("TagAndRename", "InvalidParm"),
                        localisation.ToString("message", "Error_Title"), MessageBoxButtons.OK);
              else
              {
            TagFormat tagFormat = new TagFormat(cbFormat.Text);
            List<ParameterPart> parts = tagFormat.ParameterParts;

            FileName2Tag(parts);

            // Did we get a new Format in the list, then store it temporarily
            bool newFormat = true;
            foreach (string format in Options.FileNameToTagSettingsTemp)
            {
              if (format == cbFormat.Text)
              {
            newFormat = false;
            break;
              }
            }
            if (newFormat)
              Options.FileNameToTagSettingsTemp.Add(cbFormat.Text);

            Options.FileNameToTagSettings.LastUsedFormat = cbFormat.SelectedIndex;
            _main.ShowTagEditPanel(true);
            Dispose();
              }
        }