Пример #1
0
        /// <summary>
        /// Retrieves the 100 latest news for the an app
        /// </summary>
        /// <param name="appid">The app to retrieve news for</param>
        /// <returns>SteamNewArticle Array containing the retrived news</returns>
        public ISteamNewsArticle[] GetGameNews(int appid)
        {
            string      result   = GetDataFromUrl(Tags.steamApiUrl + "ISteamNews/GetNewsForApp/v0002/?appid=" + appid + "&count=100&format=json");
            IDictionary mainDic  = Serialization.MiniJSON.Json.Deserialize(result) as IDictionary;
            IDictionary secDic   = mainDic["appnews"] as IDictionary;
            IList       newsList = secDic["newsitems"] as IList;

            SteamNewsArticle[] retVal = new SteamNewsArticle[newsList.Count];

            for (int i = 0; i < retVal.Length; ++i)
            {
                retVal[i] = new SteamNewsArticle(newsList[i] as ICollection);
            }

            return(retVal);
        }
Пример #2
0
        /// <summary>
        /// Retrieves the 100 latest news for the an app
        /// </summary>
        /// <param name="appid">The app to retrieve news for</param>
        /// <returns>SteamNewArticle Array containing the retrived news</returns>
        public ISteamNewsArticle[] GetGameNews(int appid)
        {
            string result = GetDataFromUrl(Tags.steamApiUrl + "ISteamNews/GetNewsForApp/v0002/?appid=" + appid + "&count=100&format=json");
            IDictionary mainDic = Serialization.MiniJSON.Json.Deserialize(result) as IDictionary;
            IDictionary secDic = mainDic["appnews"] as IDictionary;
            IList newsList = secDic["newsitems"] as IList;
            SteamNewsArticle[] retVal = new SteamNewsArticle[newsList.Count];

            for(int i = 0; i < retVal.Length; ++i) {
                retVal[i] = new SteamNewsArticle(newsList[i] as ICollection);
            }

            return retVal;
        }