Ejemplo n.º 1
0
        private void OnClickCreatePlaylist(object sender, RoutedEventArgs e)
        {
            LocalPlaylist playlist = new LocalPlaylist()
            {
                Name = m_playListTextBox.Text
            };

            playlist.Save(System.IO.Path.Combine(PLAYLISTS_DIRECTORY, playlist.Name + ".xml"));
            Playlists.Add(playlist.Name);
        }
Ejemplo n.º 2
0
 private void OnClickAddToPlaylist(object sender, RoutedEventArgs e)
 {
     if (CurrentTrack != null)
     {
         string        file     = System.IO.Path.Combine(PLAYLISTS_DIRECTORY, (string)m_playlistsComboBox.SelectedItem + ".xml");
         LocalPlaylist playlist = new LocalPlaylist(file);
         bool          added    = playlist.Add(CurrentTrack);
         playlist.Save(file);
         if (added)
         {
             MessageBox.Show("Track added");
         }
         else
         {
             MessageBox.Show("Track exists already");
         }
     }
 }