ChobiQ.DoubanFMAPICodePack.PlaylistRequest.GetResponse C# (CSharp) Method

GetResponse() public method

public GetResponse ( ) : PlaylistResponse
return PlaylistResponse
        public PlaylistResponse GetResponse()
        {
            PlaylistRequestForm form = new PlaylistRequestForm(this);

            if (Operation == PlayOperation.PlaysToEnd ||
                Operation == PlayOperation.Like ||
                Operation == PlayOperation.Unlike)
            {
                ConnectionManager.GetResponseStream(
                    ConnectionManager.PlaylistUri, form);

                return null;
            }

            var jResp = ConnectionManager.GetResponse(
                ConnectionManager.PlaylistUri, form);

            return new PlaylistResponse(jResp);
        }

Usage Example

Exemplo n.º 1
0
        //Removes current playing song then adds to play history.
        private Song DequeueToHistory(PlayOperation operationType)
        {
            if (_playlist.Count > 0)
            {
                var song = _playlist.Dequeue();
                _history.AddSong(song, operationType);

                if (_playlist.Count == 1)
                {
                    PlaylistRequest request = new PlaylistRequest(
                        _status, _history, PlayOperation.PlayingLast,
                        CurrentChannel, CurrentSong);

                    var resp = request.GetResponse();

                    ExtractPlaylist(resp, false);
                }

                return(song);
            }
            else
            {
                return(null);
            }
        }
All Usage Examples Of ChobiQ.DoubanFMAPICodePack.PlaylistRequest::GetResponse