Example #1
0
File: Tag.cs Project: G-IT-ED/vk
        internal static Tag FromJson(VkResponse tag)
        {
            var result = new Tag();

            result.Id = tag["tag_id"];
            result.Name = tag["tagged_name"];
            result.UserId = tag["uid"];
            result.PlacerId = tag["placer_id"];
            result.Date = tag["tag_created"] ?? tag["date"];
            result.IsViewed = tag["viewed"];

            return result;
        }
Example #2
0
File: Tag.cs Project: ProESM/vk
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="tag">Ответ сервера.</param>
        /// <returns></returns>
        internal static Tag FromJson(VkResponse tag)
        {
            var result = new Tag
            {
                Id = tag["tag_id"],
                TaggedName = tag["tagged_name"],
                UserId = tag["uid"],
                PlacerId = tag["placer_id"],
                Date = tag["tag_created"] ?? tag["date"],
                IsViewed = tag["viewed"],
                X = tag["x"],
                Y = tag["y"],
                X2 = tag["x2"],
                Y2 = tag["y2"]
            };

            return result;
        }
Example #3
0
File: Tag.cs Project: vknet/vk
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        public static Tag FromJson(VkResponse response)
        {
            var result = new Tag
            {
                Id = response["tag_id"],
                TaggedName = response["tagged_name"],
                UserId = response["user_id"] ?? response["uid"],
                PlacerId = response["placer_id"],
                Date = response["tag_created"] ?? response["date"],
                IsViewed = response["viewed"],
                X = response["x"],
                Y = response["y"],
                X2 = response["x2"],
                Y2 = response["y2"]
            };

            return result;
        }