Exemplo n.º 1
0
 private void ItemImagePaste_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var track = SelectedTrack;
         if (track != null && copiedPicture != null)
         {
             tagController.AddPicture(track, copiedPicture);
         }
     }
     catch (Exception ex)
     {
         var message = ex.Message;
     }
 }
Exemplo n.º 2
0
 private void ChangePictureButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (track != null)
         {
             var dialog = new System.Windows.Forms.OpenFileDialog();
             dialog.Filter = "Image Files (*.jpg,*.jpeg,*.png,*.gif)|*.jpg;*.jpeg;*.png;*.gif|All Files (*.*)|*.*";
             if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 if (track.Path.EndsWith(".mp3"))
                 {
                     tagController.AddPicture(track, dialog.FileName);
                 }
                 else
                 {
                     track.ImagePath = dialog.FileName;
                     trackController.Save(track);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         log.Error("MediaPropertyView.ChangePictureButton_Click", ex);
         MessageBox.Show("There was an error trying to add a picture to this track.\n\n" + ex.Message, "Could Not Add Picture To Track");
     }
 }