Альбом для фотографий
Example #1
0
        internal static PhotoAlbum FromJson(VkResponse response)
        {
            var album = new PhotoAlbum();

            album.Id = response["id"];
            album.ThumbId = Utilities.GetNullableLongId(response["thumb_id"]);
            album.OwnerId = Utilities.GetNullableLongId(response["owner_id"]);
            album.Title = response["title"];
            album.Description = response["description"];
            album.Created = response["created"];
            album.Updated = response["updated"];
            album.Size = response["size"];
            album.Privacy = Utilities.GetNullableLongId(response["privacy"]);
            album.CommentPrivacy = Utilities.GetNullableLongId(response["comment_privacy"]);
            album.CanUpload = response["can_upload"];
            album.PrivacyView = response["privacy_view"];
            album.ThumbSrc = response["thumb_src"];

            return album;
        }
Example #2
0
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        internal static PhotoAlbum FromJson(VkResponse response)
        {
            var album = new PhotoAlbum
            {
                Id = response["aid"] ?? response["id"],
                ThumbId = Utilities.GetNullableLongId(response["thumb_id"]),
                OwnerId = Utilities.GetNullableLongId(response["owner_id"]),
                Title = response["title"],
                Description = response["description"],
                Created = response["created"],
                Updated = response["updated"],
                Size = response["size"],
                Privacy = Utilities.GetNullableLongId(response["privacy"]),
                CommentPrivacy = Utilities.GetNullableLongId(response["comment_privacy"]),
                CanUpload = response["can_upload"],
                PrivacyView = response["privacy_view"],
                ThumbSrc = response["thumb_src"],
                Sizes = response["sizes"].ToReadOnlyCollectionOf<PhotoSize>(x => x)
            };

            return album;
        }
Example #3
0
        /// <summary>
        /// Разобрать из json.
        /// </summary>
        /// <param name="response">Ответ сервера.</param>
        /// <returns></returns>
        internal static PhotoAlbum FromJson(VkResponse response)
        {
            VkResponseArray privacy = response["privacy_view"];
            VkResponseArray privacyComment = response["privacy_comment"];
            var album = new PhotoAlbum
            {
                Id = response["aid"] ?? response["id"],
                ThumbId = Utilities.GetNullableLongId(response["thumb_id"]),
                OwnerId = Utilities.GetNullableLongId(response["owner_id"]),
                Title = response["title"],
                Description = response["description"],
                Created = response["created"],
                Updated = response["updated"],
                Size = response["size"],
                PrivacyView = privacy.ToReadOnlyCollectionOf<Privacy>(x => x),
                PrivacyComment = privacyComment.ToReadOnlyCollectionOf<Privacy>(x => x),
                CanUpload = response["can_upload"],
                ThumbSrc = response["thumb_src"],
                Sizes = response["sizes"].ToReadOnlyCollectionOf<PhotoSize>(x => x),
                CommentsDisabled = response["comments_disabled"],
                UploadByAdminsOnly = response["upload_by_admins_only"],
                ThumbIsLast = response["thumb_is_last"]
            };

            return album;
        }