private void DeleteSelectedPlaylist(object param) { if (PlayLists[SelectedPlaylist] != null) { if (File.Exists(Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\MVMPV2.d\\" + PlayLists[SelectedPlaylist].Name + ".xml")) { File.Delete(Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\MVMPV2.d\\" + PlayLists[SelectedPlaylist].Name + ".xml"); } PlayLists.Remove(PlayLists[SelectedPlaylist]); this.mediaPlayer.Playlists = PlayLists.ToList <Library.PlayList>(); } }
private void RenameSelectedPlaylist(object param) { if (PlayLists[SelectedPlaylist] != null) { string newName = InputPlaylistName(); if (File.Exists(Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\MVMPV2.d\\" + PlayLists[SelectedPlaylist].Name + ".xml")) { File.Delete(Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\MVMPV2.d\\" + PlayLists[SelectedPlaylist].Name + ".xml"); } if (newName != null) { PlayLists[SelectedPlaylist].Name = newName; } this.mediaPlayer.Playlists = PlayLists.ToList <Library.PlayList>(); this.mediaPlayer.SerializePlaylists(); } }