Ejemplo n.º 1
0
        private void HandleCameraSelect(object sender, CameraEventArgs e)
        {
            IPhotoModel photoModel = transform.GetComponent <PhotoController>().GETPhotoModel();

            model.ChangeVisibility(false);
            photoModel.ChangeVisibility(true);
        }
Ejemplo n.º 2
0
        public async Task AddPhotoToCachesAsync(IPhotoModel photo)
        {
            //Add to list of all user photos
            await RedisCache.ListLeftPushAsync <IPhotoModel>(_cache, RedisConfig.AllUsersCache, photo);

            //Add to list of user-specific photos
            await RedisCache.ListLeftPushAsync <IPhotoModel>(_cache, RedisConfig.PhotosForUserCache(photo.Owner), photo);

            //Add single item to cache
            await RedisCache.SetAsync <IPhotoModel>(_cache, RedisConfig.PhotoByIDCache(photo.ID), photo);
        }
Ejemplo n.º 3
0
        public PhotoEntity(IPhotoModel model)
        {
            this.PartitionKey = model.Owner;
            this.RowKey =model.ID;

            this.StorageAccountName = model.StorageAccountName;
            this.ServerFileName = model.ServerFileName;
            this.Owner = model.Owner;
            this.OwnerName = model.OwnerName;
            this.BlobURL = model.BlobURL;
            this.ThumbnailURL = model.ThumbnailURL;
            this.DateAdded = model.DateAdded;
            this.OriginRegion = model.OriginRegion;
        }
Ejemplo n.º 4
0
        public PhotoEntity(IPhotoModel model)
        {
            this.PartitionKey = model.Owner;
            this.RowKey       = model.ID;

            this.StorageAccountName = model.StorageAccountName;
            this.ServerFileName     = model.ServerFileName;
            this.Owner        = model.Owner;
            this.OwnerName    = model.OwnerName;
            this.BlobURL      = model.BlobURL;
            this.ThumbnailURL = model.ThumbnailURL;
            this.DateAdded    = model.DateAdded;
            this.OriginRegion = model.OriginRegion;
        }
Ejemplo n.º 5
0
        public IPhotoViewModel Build(IPhotoModel model)
        {
            var viewModel = new PhotoViewModel
            {
                Image      = model.Image,
                Camera     = _cameraViewModelBuilder.Build(model.Camera),
                Comment    = model.Comment,
                DateTaken  = model.DateTaken,
                Name       = model.Name,
                Path       = model.Path,
                Similarity = model.Similarity
            };

            return(viewModel);
        }
Ejemplo n.º 6
0
        //Initialize Model, view and Listeners

        private void Start()
        {
            model       = new PhotoModel();
            model.Photo = new Texture2D(100, 100);
            view        = transform.GetChild(3).GetComponent <PhotoView>();

            // Listen to input from the view
            view.OnReceived  += HandleInputReceived;
            view.OnTakePhoto += HandleTakePhoto;
            view.OnBack      += HandleBack;

            // Listen to changes in the model
            model.OnPictureChanged += HandlePictureChanged;
            model.VisibilityChange += MenuStatusVisibility;
        }
Ejemplo n.º 7
0
        public IPhotoViewModel Create(IPhotoModel model)
        {
            if (model is IPhotoViewModel viewModel)
            {
                return(viewModel);
            }

            var photoViewModel = new PhotoViewModel(_messenger, _navigationService)
            {
                Model = (PhotoModel)model
            };

            photoViewModel.RedundantPhotos.Cast(Create);

            return(photoViewModel);
        }
Ejemplo n.º 8
0
 public async Task AddPhotoToAllUsersCacheAsync(IPhotoModel photo)
 {
     //Add to list of user-specific photos
     await RedisCache.ListLeftPushAsync <IPhotoModel>(_cache, RedisConfig.AllUsersCache, photo);
 }
Ejemplo n.º 9
0
 public async Task AddPhotoToUserCacheAsync(IPhotoModel photo)
 {
     //Add to list of user-specific photos
     await RedisCache.ListLeftPushAsync <IPhotoModel>(_cache, RedisConfig.PhotosForUserCache(photo.Owner), photo);
 }