예제 #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);
        }
예제 #2
0
파일: Album.cs 프로젝트: ffdd270/vocadb
        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);
        }