Элемент пользовательского списка новостей
示例#1
0
		/// <summary>
		/// Разобрать из json.
		/// </summary>
		/// <param name="response">Ответ сервера.</param>
		/// <returns></returns>
		internal static NewsUserListItem FromJson(VkResponse response)
		{
			var newsUserListItem = new NewsUserListItem
			{
				Id = response["id"],
				Title = response["title"],
				NoReposts = response["no_reposts"]
			};
			VkResponseArray sourceIds = response["source_ids"];
			if (sourceIds.Count == 0)
			{
				newsUserListItem.SourceIds = new List<long>();
			}
			else
			{
				newsUserListItem.SourceIds = sourceIds.ToReadOnlyCollectionOf<long>(x => x);
			}
			return newsUserListItem;
		}
示例#2
0
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        public static NewsUserListItem FromJson(VkResponse response)
        {
            var newsUserListItem = new NewsUserListItem
            {
                Id        = response["id"],
                Title     = response["title"],
                NoReposts = response["no_reposts"]
            };
            VkResponseArray sourceIds = response["source_ids"];

            if (sourceIds.Count == 0)
            {
                newsUserListItem.SourceIds = new List <long>();
            }
            else
            {
                newsUserListItem.SourceIds = sourceIds.ToReadOnlyCollectionOf <long>(x => x);
            }
            return(newsUserListItem);
        }