private void DoneExit_Click(object sender, EventArgs e)
 {
     RegexFinal = "";
     if (DefaultAndAdvancedTab.SelectedTab == DefaultAndAdvancedTab.TabPages["Default"])
     {
         foreach (var a in TagGroupList)
         {
             if (a.Item1 == 0)
             {
                 RegexFinal += "(" + Regex.Escape(a.Item2) + ")";
             }
             if (a.Item1 == 1)
             {
                 RegexFinal += "([0-9]*)";
             }
             if (a.Item1 == 2)
             {
                 RegexFinal += "([a-zA-Z]*)";
             }
             if (a.Item1 == 3)
             {
                 RegexFinal += "(.*)";
             }
             if (a.Item1 == 4)
             {
                 RegexFinal += "([^a-zA-Z]*)";
             }
             if (a.Item1 == 5)
             {
                 RegexFinal += "([^0-9]*)";
             }
         }
         if (count != 0)
         {
             NameFormatDefault NameSpecifierDefault = new NameFormatDefault(TagGroupList, RegexFinal, FileTypeForPassing);
             NameSpecifierDefault.ShowDialog();
             NameSpecifierDefault.Close();
             EnteredUserNameFormat = NameSpecifierDefault.FinalUserNameFormat;
             Close();
         }
     }
     else
     {
         if (UserRegexBox.Text != "")
         {
             RegexFinal = UserRegexBox.Text;
             NameFormatAdvanced NameSpecifierAdvanced = new NameFormatAdvanced(FileTypeForPassing);
             NameSpecifierAdvanced.ShowDialog();
             NameSpecifierAdvanced.Close();
             EnteredUserNameFormat = NameSpecifierAdvanced.FinalUserNameFormat;
             Close();
         }
     }
 }
 private void DoneExit_Click(object sender, EventArgs e) {
     RegexFinal = "";
     if (DefaultAndAdvancedTab.SelectedTab == DefaultAndAdvancedTab.TabPages["Default"]) {
         foreach (var a in TagGroupList) {
             if (a.Item1 == 0) {
                 RegexFinal += "(" + Regex.Escape(a.Item2) + ")";
             }
             if (a.Item1 == 1) {
                 RegexFinal += "([0-9]*)";
             }
             if (a.Item1 == 2) {
                 RegexFinal += "([a-zA-Z]*)";
             }
             if (a.Item1 == 3) {
                 RegexFinal += "(.*)";
             }
             if (a.Item1 == 4) {
                 RegexFinal += "([^a-zA-Z]*)";
             }
             if (a.Item1 == 5) {
                 RegexFinal += "([^0-9]*)";
             }
         }
         if (count != 0) {
             NameFormatDefault NameSpecifierDefault = new NameFormatDefault(TagGroupList, RegexFinal, FileTypeForPassing);
             NameSpecifierDefault.ShowDialog();
             NameSpecifierDefault.Close();
             EnteredUserNameFormat = NameSpecifierDefault.FinalUserNameFormat;
             Close();
         }
     } else {
         if (UserRegexBox.Text != "") {
             RegexFinal = UserRegexBox.Text;
             NameFormatAdvanced NameSpecifierAdvanced = new NameFormatAdvanced(FileTypeForPassing);
             NameSpecifierAdvanced.ShowDialog();
             NameSpecifierAdvanced.Close();
             EnteredUserNameFormat = NameSpecifierAdvanced.FinalUserNameFormat;
             Close();
         }
     }
 }