private void Unsubscribe(IEnumerable <Song> songs) { foreach (Song song in songs ?? Enumerable.Empty <Song>()) { CurrentSong.Unsubscribe(song); OtherSongs.Unsubscribe(song); AllSongs.Unsubscribe(song); } }
private void OnCurrentSongChanged(object sender, CurrentSongChangedEventArgs e) { CurrentSong.Unsubscribe(e.OldCurrentSong); CurrentSong.Subscribe(e.NewCurrentSong); OtherSongs.Unsubscribe(e.NewCurrentSong); OtherSongs.Subscribe(e.OldCurrentSong); CurrentSongChanged?.Invoke(this, new SubscriptionsEventArgs <IPlaylist, CurrentSongChangedEventArgs>(sender, e)); }