Esempio n. 1
0
File: Counters.cs Progetto: vknet/vk
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        public static Counters FromJson(VkResponse response)
        {
            var counters = new Counters
            {
                Albums = response["albums"],
                Videos = response["videos"],
                Audios = response["audios"],
                Photos = response["photos"],
                Notes = response["notes"],
                Friends = response["friends"],
                Groups = response["groups"],
                OnlineFriends = response["online_friends"],
                MutualFriends = response["mutual_friends"],
                UserVideos = response["user_videos"],
                Followers = response["followers"],
                UserPhotos = response["user_photos"],
                Subscriptions = response["subscriptions"],
                TopicsCount = response["topics"],
                DocumentsCount = response["docs"],
                Pages = response["pages"],
                Messages = response["messages"],
                Gifts = response["gifts"],
                Events = response["events"],
                Notifications = response["notifications"],
                Sdk = response["sdk"],
                AppRequests = response["app_requests"]
            };

            return counters;
        }
Esempio n. 2
0
        internal static Counters FromJson(VkResponse response)
        {
            var counters = new Counters();

            counters.Albums = response["albums"];
            counters.Videos = response["videos"];
            counters.Audios = response["audios"];
            counters.Photos = response["photos"];
            counters.Notes = response["notes"];
            counters.Friends = response["friends"];
            counters.Groups = response["groups"];
            counters.OnlineFriends = response["online_friends"];
            counters.MutualFriends = response["mutual_friends"];
            counters.UserVideos = response["user_videos"];
            counters.Followers = response["followers"];
            counters.UserPhotos = response["user_photos"];
            counters.Subscriptions = response["subscriptions"];
            counters.TopicsCount = response["topics"];
            counters.DocumentsCount = response["docs"];

            counters.Pages = response["pages"]; // установлено экcпериментальным путем

            #region Метод https://vk.com/dev/account.getCounters
            counters.Messages = response["messages"];
            counters.Gifts = response["gifts"];
            counters.Events = response["events"];
            counters.Notifications = response["notifications"];
            #endregion

            return counters;
        }