Статистика сообщества или приложения.
Example #1
0
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        public static StatsPeriod FromJson(VkResponse response)
        {
            var statsPeriod = new StatsPeriod
            {
                Day              = DateTime.Parse(response["day"], DateTimeFormatInfo.InvariantInfo),
                Views            = response["views"],
                Visitors         = response["visitors"],
                Reach            = response["reach"],
                ReachSubscribers = response["reach_subscribers"],
                Subscribed       = response["subscribed"],
                Unsubscribed     = response["unsubscribed"],
                Sex              = response["sex"].ToReadOnlyCollectionOf <StatsStruct>(x => x),
                Age              = response["age"].ToReadOnlyCollectionOf <StatsStruct>(x => x),
                SexAge           = response["sex_age"].ToReadOnlyCollectionOf <StatsStruct>(x => x),
                Cities           = response["cities"].ToReadOnlyCollectionOf <StatsStruct>(x => x),
                Countries        = response["countries"].ToReadOnlyCollectionOf <StatsStruct>(x => x)
            };

            return(statsPeriod);
        }
Example #2
0
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        internal static StatsPeriod FromJson(VkResponse response)
        {
            var statsPeriod = new StatsPeriod
            {
                Day = DateTime.Parse(response["day"], DateTimeFormatInfo.InvariantInfo),
                Views = response["views"],
                Visitors = response["visitors"],
                Reach = response["reach"],
                ReachSubscribers = response["reach_subscribers"],
                Subscribed = response["subscribed"],
                Unsubscribed = response["unsubscribed"],
                Sex = response["sex"].ToReadOnlyCollectionOf<StatsStruct>(x => x),
                Age = response["age"].ToReadOnlyCollectionOf<StatsStruct>(x => x),
                SexAge = response["sex_age"].ToReadOnlyCollectionOf<StatsStruct>(x => x),
                Cities = response["cities"].ToReadOnlyCollectionOf<StatsStruct>(x => x),
                Countries = response["countries"].ToReadOnlyCollectionOf<StatsStruct>(x => x)
            };

            return statsPeriod;
        }