public FeedImage(uint photoId) { var storage = Storages.GetByFileId(photoId); src = ServiceUrlPrefixes.CouldFront + storage.storage_path; size = JsonConvert.DeserializeObject <FeedImageSize>(storage.@params); }
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 }; } }
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; } }