Ejemplo n.º 1
0
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        public static PushSettings FromJson(VkResponse response)
        {
            var result = new PushSettings
            {
                Msg            = response["msg"],
                Chat           = response["chat"],
                Friend         = response.ContainsKey("friend") && response["mutual"],
                FriendFound    = response["friend_found"],
                FriendAccepted = response["friend_accepted"],
                Reply          = response["reply"],
                Comment        = response.ContainsKey("comment") && response["fr_of_fr"],
                Mention        = response.ContainsKey("mention") && response["fr_of_fr"],
                Like           = response.ContainsKey("like") && response["fr_of_fr"],
                Repost         = response.ContainsKey("repost") && response["fr_of_fr"],
                WallPost       = response["wall_post"],
                WallPublish    = response["wall_publish"],
                GroupInvite    = response["group_invite"],
                GroupAccepted  = response["group_accepted"],
                EventSoon      = response["event_soon"],
                TagPhoto       = response.ContainsKey("tag_photo") && response["fr_of_fr"],
                AppRequest     = response["app_request"],
                SdkOpen        = response["sdk_open"],
                NewPost        = response["new_post"],
                Birthday       = response["birthday"]
            };

            return(result);
        }
Ejemplo n.º 2
0
		/// <summary>
		/// Разобрать из json.
		/// </summary>
		/// <param name="response">Ответ сервера.</param>
		/// <returns></returns>
		internal static PushSettings FromJson(VkResponse response)
		{
			var settings = new PushSettings
			{
				Sound = response.ContainsKey("sound") && response["sound"],
				DisabledUntil = response.ContainsKey("disabled_until") ? response["disabled_until"] : null
			};
			return settings;
		}
Ejemplo n.º 3
0
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        internal static PushSettings FromJson(VkResponse response)
        {
            var settings = new PushSettings
            {
                Sound         = response.ContainsKey("sound") && response["sound"],
                DisabledUntil = response.ContainsKey("disabled_until") ? response["disabled_until"] : null
            };

            return(settings);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        public static PushSettings FromJson(VkResponse response)
        {
            var result = new PushSettings
            {
                Msg = response["msg"],
                Chat = response["chat"],
                Friend = response.ContainsKey("friend") && response["mutual"],
                FriendFound = response["friend_found"],
                FriendAccepted = response["friend_accepted"],
                Reply = response["reply"],
                Comment = response.ContainsKey("comment") && response["fr_of_fr"],
                Mention = response.ContainsKey("mention") && response["fr_of_fr"],
                Like = response.ContainsKey("like") && response["fr_of_fr"],
                Repost = response.ContainsKey("repost") && response["fr_of_fr"],
                WallPost = response["wall_post"],
                WallPublish = response["wall_publish"],
                GroupInvite = response["group_invite"],
                GroupAccepted = response["group_accepted"],
                EventSoon = response["event_soon"],
                TagPhoto = response.ContainsKey("tag_photo") && response["fr_of_fr"],
                AppRequest = response["app_request"],
                SdkOpen = response["sdk_open"],
                NewPost = response["new_post"],
                Birthday = response["birthday"]
            };

            return result;
        }