public void RemoveMedia(IMediaItem media) { // CurrentMedia relies on the underlying playlist, so we can't check after removal if (_playlist.Remove(media) == true) { _nonShuffledPlaylist.Remove(media); OnPlaylistChanged?.Invoke(); } }
public void OneItemOneCollectionRemoveTest() { var sc = new SmartCollection <TestItem, object>(new object()); var si = new TestItem(); Assert.AreEqual(null, si.Collection); sc.Add(si); Assert.AreEqual(sc, si.Collection); sc.Remove(si); Assert.AreEqual(null, si.Collection); Assert.IsFalse(sc.Contains(si)); }