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); }
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"); } } }