Esempio n. 1
0
 /// <summary>
 /// Adds a PlaylistSong to the list if a song with the same hash doesn't already exist.
 /// </summary>
 /// <param name="song"></param>
 /// <returns>True if the song was added.</returns>
 public bool TryAdd(PlaylistSong song)
 {
     if (!Songs.Any(s => s.Hash.Equals(song.Hash)))
     {
         Songs.Add(song);
         IsDirty = true;
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
 public bool TryRemove(PlaylistSong song)
 {
     return(TryRemove(song.Hash));
 }
Esempio n. 3
0
 /// <summary>
 /// Attempts to remove the song from all loaded playlists.
 /// </summary>
 /// <param name="song"></param>
 public static void RemoveSongFromAll(PlaylistSong song)
 {
     RemoveSongFromAll(song.Hash);
 }