Esempio 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);
        }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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();
        }
Esempio 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);
 }