Пример #1
0
        public static void DeleteSong(int playlistID, int songIndex)
        {
            CPlaylistFile pl = Get(playlistID);

            if (pl != null)
            {
                pl.DeleteSong(songIndex);
            }
        }
Пример #2
0
        public static void RemoveSongFromPlaylist(int position, int playlistId, int songId)
        {
            CPlaylistFile pl = CPlaylists.Get(playlistId);

            if (pl == null)
            {
                throw new ArgumentException("invalid playlistId");
            }
            if (!PlaylistContainsSong(songId, playlistId))
            {
                throw new ArgumentException("invalid songId");
            }
            if (position < 0 || pl.Songs.Count <= position ||
                pl.Songs[position].SongID != songId)
            {
                throw new ArgumentException("invalid position");
            }
            pl.DeleteSong(position);
            pl.Save();
        }