Esempio n. 1
0
        /// <summary>
        /// <see cref="IRdioManager.GetNewReleases"/>
        /// </summary>
        public IEnumerable <RdioAlbum> GetNewReleases(RdioTimeframe timeframe = RdioTimeframe.None, int start = 0,
                                                      int count = 0, IEnumerable <string> extras = null)
        {
            var postData = new NameValueCollection
            {
                { "method", "getNewReleases" }
            };

            if (timeframe != RdioTimeframe.None)
            {
                postData.Add("timeframe", timeframe.ToString());
            }
            if (start > 0)
            {
                postData.Add("start", start.ToString());
            }
            if (count > 0)
            {
                postData.Add("count", count.ToString());
            }
            if (extras != null && extras.Count() > 0)
            {
                postData.Add("extras", string.Join(",", extras));
            }

            var result       = MakeWebRequest(postData);
            var deserialized = Deserialize(result, typeof(RdioResult <IList <RdioAlbum> >));

            return(((RdioResult <IList <RdioAlbum> >)deserialized).Result);
        }
Esempio n. 2
0
        /// <summary>
        /// <see cref="IRdioManager.GetNewReleases"/>
        /// </summary>
        public IEnumerable<RdioAlbum> GetNewReleases(RdioTimeframe timeframe = RdioTimeframe.None, int start = 0,
            int count = 0, IEnumerable<string> extras = null)
        {
            var postData = new NameValueCollection
                               {
                                   {"method", "getNewReleases"}
                               };
            if (timeframe != RdioTimeframe.None) postData.Add("timeframe", timeframe.ToString());
            if (start > 0) postData.Add("start", start.ToString());
            if (count > 0) postData.Add("count", count.ToString());
            if (extras != null && extras.Count() > 0) postData.Add("extras", string.Join(",", extras));

            var result = MakeWebRequest(postData);
            var deserialized = Deserialize(result, typeof(RdioResult<IList<RdioAlbum>>));
            return ((RdioResult<IList<RdioAlbum>>)deserialized).Result;
        }