コード例 #1
0
        public FeedImage(uint photoId)
        {
            var storage = Storages.GetByFileId(photoId);

            src  = ServiceUrlPrefixes.CouldFront + storage.storage_path;
            size = JsonConvert.DeserializeObject <FeedImageSize>(storage.@params);
        }
コード例 #2
0
        public FeedImage(Framely iframely)
        {
            var thumb = iframely.links?.thumbnail?.Where(t => (t?.media?.width ?? 1000) < 400).FirstOrDefault();

            if (thumb != null)
            {
                src = thumb.href;

                size = new FeedImageSize {
                    height = thumb.media.height, width = thumb.media.width
                };
            }
        }
コード例 #3
0
 public CommentAttachment(FeedAttachment feedAttachment)
 {
     this.feedAttachment = feedAttachment;
     if (feedAttachment is FeedAttachmentPhoto)
     {
         var photoAttachment = feedAttachment as FeedAttachmentPhoto;
         image_profile = photoAttachment.image_main.src;
         size          = photoAttachment.image_main.size;
     }
     else if (feedAttachment is FeedAttachmentSticker)
     {
         var stickerAttachment = feedAttachment as FeedAttachmentSticker;
         image_profile = stickerAttachment.image_main.src;
         size          = stickerAttachment.image_main.size;
     }
 }