예제 #1
0
        public new static ScreenshotsPhoto Create(IPhotoMetadata photoMetadata)
        {
            var instance = new ScreenshotsPhoto();

            instance.Id           = photoMetadata.Id.Value;
            instance.Owner        = photoMetadata.Owner;
            instance.Location     = new GeoPoint(photoMetadata.Latitude.Value, photoMetadata.Longitude.Value);
            instance.Preview      = new ScreenshotsPreviewPicture(photoMetadata.Photos.First());
            instance.LargePreview = new ScreenshotsPicture(photoMetadata.Photos.First());
            instance.Original     = new ScreenshotsPicture(photoMetadata.Photos.First());
            instance.Size         = photoMetadata.Photos.First().Size;
            instance.Date         = photoMetadata.Date.Value;
            instance.Text         = photoMetadata.Text;
            return(instance);
        }
예제 #2
0
        public override async Task <PhotoBatchResult> GetUsersAsync(User user)
        {
            var getResult = await Provider.GetAllAsync(user.Id, user.AccessToken, 0, 200).ConfigureAwait(false);

            var photos = new List <Photo>();

            foreach (var photoMetadata in getResult.Photos)
            {
                var photo = ScreenshotsPhoto.Create(photoMetadata);
                if (photo != null)
                {
                    photos.Add(photo);
                }
            }
            return(new PhotoBatchResult(photos, PhotoTag.Personal, (offset, count) => Provider.GetAllAsync(user.Id, user.AccessToken, offset, count), 200));
        }