示例#1
0
文件: Library.cs 项目: yongjan/Espera
        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();
            }
        }
示例#2
0
        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);
            }
        }