/// <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); }
/// <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; }