Exemplo n.º 1
0
        /// <summary>
        /// Remove the specified GenrePopulation from the collection and from storage.
        /// </summary>
        /// <param name="population"></param>
        public static void RemovePopulation(GenrePopulation population)
        {
            GenrePopulationCollection.Remove(population);

            // No need to wait for this
            DbAccess.DeleteAsync(population);
        }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
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);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Delete the specified Playlist from the collections and from the storage
        /// </summary>
        /// <param name="playlistToDelete"></param>
        public static void DeletePlaylist(Playlist playlistToDelete)
        {
            PlaylistCollection.Remove(playlistToDelete);

            playlistToDelete.Clear();

            // Now delete the playlist itself. No need to wait for this to finish
            DbAccess.DeleteAsync(playlistToDelete);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Delete a tag and its contents from storage and the local collection
        /// </summary>
        /// <param name="tagToDelete"></param>
        public static void DeleteTag(Tag tagToDelete)
        {
            // Delete all the TaggedAlbum entries from the Tag
            tagToDelete.DeleteTaggedAlbums(tagToDelete.TaggedAlbums.ToList());

            // Delete the Tag itself. No need to wait for this
            DbAccess.DeleteAsync(tagToDelete);

            // And locally
            TagsCollection.Remove(tagToDelete);

            new TagDeletedMessage()
            {
                DeletedTag = tagToDelete
            }.Send();
        }
Exemplo n.º 8
0
 /// <summary>
 /// Delete the specified TaggedAlbum from the storage and the collection
 /// </summary>
 /// <param name="taggedAlbumToDelete"></param>
 /// <returns></returns>
 public static void DeleteTaggedAlbum(TaggedAlbum taggedAlbumToDelete)
 {
     // No need to wait for the TaggedAlbum to be deleted from storage
     DbAccess.DeleteAsync(taggedAlbumToDelete);
     TaggedAlbumCollection.Remove(taggedAlbumToDelete);
 }