Example #1
0
        private void GetSeasonsCallback(XRequestState requestState)
        {
            var seasons = new List <Season>();

            var query  = JObject.Parse(requestState.ResponseData);
            var result = (JObject)query["result"];

            if (result["seasons"] != null)
            {
                foreach (JObject item in (JArray)result["seasons"])
                {
                    seasons.Add(Season.FromJsonObject(item));
                }
            }

            if (requestState.UserCallback != null)
            {
                requestState.UserCallback(seasons);
            }
        }