private string SelectFilePath()
        {
            OpenFileDialog fbd2 = new OpenFileDialog();

            fbd2.ShowDialog();
            while (!InputCheck.Mp3Format(fbd2.FileName))
            {
                System.Windows.MessageBox.Show("Please choose an mp3 file.");
                fbd2.ShowDialog();
            }
            return(fbd2.FileName);
        }
        private void btSelectMp3_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog fbd = new OpenFileDialog();

            fbd.ShowDialog();
            while (!InputCheck.Mp3Format(fbd.FileName))
            {
                System.Windows.MessageBox.Show("Please choose an mp3 file.");
                fbd.ShowDialog();
            }
            tbMp3Path.Text = fbd.FileName;
        }
 private Boolean CheckNumber()
 {
     if (!InputCheck.IsNumber(tbCutFrom.Text))
     {
         System.Windows.MessageBox.Show("Please use a number.");
         return(false);
     }
     if (!InputCheck.IsNumber(tbCutTo.Text))
     {
         System.Windows.MessageBox.Show("Please use a number.");
         return(false);
     }
     return(true);
 }
 private void btMerge_Click(object sender, RoutedEventArgs e)
 {
     if (InputCheck.Mergable(tbMp3Path.Text, tbMp3Path2.Text, tbNewFileName.Text, tbDestinationPath.Text))
     {
         string[] Mps3Paths = new string[] { tbMp3Path.Text, tbMp3Path2.Text };
         string   NewMp3    = tbDestinationPath.Text + "\\" + InputCheck.CreateMp3Format(tbNewFileName.Text);
         Mp3Editor.Mp3Concat(Mps3Paths, NewMp3);
         System.Windows.MessageBox.Show("The merging was successfull.");
         ResetWindow();
     }
     else
     {
         System.Windows.MessageBox.Show("Please fill in everything.");
     }
 }
 private void btTrimFile_Click(object sender, RoutedEventArgs e)
 {
     if (CheckNumber() && InputCheck.Trimmable(tbMp3Path.Text, tbNewFileName.Text, tbDestinationPath.Text))
     {
         try
         {
             string NewMp3 = tbDestinationPath.Text + "\\" + InputCheck.CreateMp3Format(tbNewFileName.Text);
             Mp3Editor.Mp3Trim(tbMp3Path.Text, NewMp3, TimeSpan.FromSeconds(Convert.ToInt32(tbCutFrom.Text)), TimeSpan.FromSeconds(Convert.ToInt32(tbCutTo.Text)));
             System.Windows.MessageBox.Show("The trim was successful.");
             ResetWindow();
         }
         catch (ArgumentOutOfRangeException)
         {
             System.Windows.MessageBox.Show("The end should be greater than begin.");
         }
     }
     else
     {
         System.Windows.MessageBox.Show("Please fill in everything.");
     }
 }