Ejemplo n.º 1
0
 /// <summary>
 /// Delete the specified Album from the storage and the collections
 /// </summary>
 /// <param name="albumToDelete"></param>
 /// <returns></returns>
 public static void DeleteAlbum(Album albumToDelete)
 {
     // No need to wait for the delete
     DbAccess.DeleteAsync(albumToDelete);
     AlbumCollection.Remove(albumToDelete);
     IdLookup.Remove(albumToDelete.Id);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Delete the specified Artist from the storage and the collections
 /// </summary>
 /// <param name="artistAlbumToDelete"></param>
 /// <returns></returns>
 public static void DeleteArtist(Artist artistToDelete)
 {
     // No need to wait for the Artist to be removed from storage
     DbAccess.DeleteAsync(artistToDelete);
     ArtistCollection.Remove(artistToDelete);
     IdLookup.Remove(artistToDelete.Id);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Delete the specified ArtistAlbum from the storage and the collections
 /// </summary>
 /// <param name="artistAlbumToDelete"></param>
 /// <returns></returns>
 public static void DeleteArtistAlbum(ArtistAlbum artistAlbumToDelete)
 {
     // No need to wait for the ArtistAlbum to be deleted from storage
     DbAccess.DeleteAsync(artistAlbumToDelete);
     ArtistAlbumCollection.Remove(artistAlbumToDelete);
     IdLookup.Remove(artistAlbumToDelete.Id);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Delete the specified Albums from the storage and the collections
 /// </summary>
 /// <param name="albumToDelete"></param>
 /// <returns></returns>
 public static void DeleteAlbums(IEnumerable <Album> albumsToDelete)
 {
     // No need to wait for the delete
     DbAccess.DeleteItemsAsync(albumsToDelete);
     foreach (Album albumToDelete in albumsToDelete)
     {
         AlbumCollection.Remove(albumToDelete);
         IdLookup.Remove(albumToDelete.Id);
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Delete the specified Artists from the storage and the collections
        /// </summary>
        /// <param name="artistsToDelete"></param>
        public static void DeleteArtists(IEnumerable <Artist> artistsToDelete)
        {
            DbAccess.DeleteItemsAsync(artistsToDelete);

            foreach (Artist artistToDelete in artistsToDelete)
            {
                ArtistCollection.Remove(artistToDelete);
                IdLookup.Remove(artistToDelete.Id);
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Delete all the specified ArtistAlbum from the storage and the collections
 /// </summary>
 /// <param name="artistAlbumsToDelete"></param>
 /// <returns></returns>
 public static void DeleteArtistAlbums(IEnumerable <ArtistAlbum> artistAlbumsToDelete)
 {
     // No need to wait for the ArtistAlbums to be deleted from storage
     DbAccess.DeleteItemsAsync(artistAlbumsToDelete);
     foreach (ArtistAlbum artAlbum in artistAlbumsToDelete)
     {
         ArtistAlbumCollection.Remove(artAlbum);
         IdLookup.Remove(artAlbum.Id);
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Delete a single song from local and peristanet storage
        /// </summary>
        /// <param name="songToDelete"></param>
        public static void DeleteSong(Song songToDelete)
        {
            lock ( lockObject )
            {
                if (IdLookup.ContainsKey(songToDelete.Id) == true)
                {
                    SongCollection.Remove(songToDelete);
                    IdLookup.Remove(songToDelete.Id);
                    artistAlbumLookup[songToDelete.ArtistAlbumId].Remove(songToDelete);
                    albumLookup[songToDelete.AlbumId].Remove(songToDelete);
                }
            }

            DbAccess.DeleteAsync(songToDelete);
        }