Beispiel #1
0
        public void DeleteSong(int songId)
        {
            if (songLookupDictionary.ContainsKey(songId))
            {
                SongModel songToRemove = songLookupDictionary[songId];
                AllSongs.Remove(songToRemove);
                songLookupDictionary.Remove(songId);
            }

            DatabaseManager.Current.DeleteSong(songId);
        }
Beispiel #2
0
        public virtual void OnSongDeleting(SongInAlbum songInAlbum)
        {
            ParamIs.NotNull(() => songInAlbum);

            if (!songInAlbum.Album.Equals(this))
            {
                throw new ArgumentException("Song is not in album");
            }

            foreach (var song in Songs.Where(song => song.TrackNumber > songInAlbum.TrackNumber))
            {
                song.TrackNumber--;
            }

            AllSongs.Remove(songInAlbum);
        }