private void RemoveFromPlaylist(Playlist playlist, IEnumerable <int> indexes) { bool stopCurrentSong = playlist == this.CurrentPlaylist && indexes.Any(index => index == this.CurrentPlaylist.CurrentSongIndex); playlist.RemoveSongs(indexes); if (stopCurrentSong) { this.audioPlayer.StopAsync(); } }
private void RemoveFromPlaylist(Playlist playlist, IEnumerable <int> indexes) { bool stopCurrentSong = playlist == this.CurrentPlaylist && indexes.Any(index => index == this.CurrentPlaylist.CurrentSongIndex); playlist.RemoveSongs(indexes); this.PlaylistChanged.RaiseSafe(this, EventArgs.Empty); if (stopCurrentSong) { this.currentPlayer.Stop(); this.SongFinished.RaiseSafe(this, EventArgs.Empty); } }