Exemplo n.º 1
0
        private void OnProgressiveChunkSearchingFailed(ProgressivePhotoSearch sender, Exception exception)
        {
            App.Diagnostics.Error.Log("MapContext.SearchAsync", exception);
            IsSearchButtonEnabled = true;

            HideProgress((ProgressNotificationId)sender.Tag, Strings.ProgressIndicator_SearchingPhotosResult_Error);
            if (ActiveProgressiveSearchId == sender.Id)
            {
                IsSearchButtonEnabled = true;
            }
        }
Exemplo n.º 2
0
        public Task StartProgressiveSearchAsync(MapViewSettings viewSettings, PhotoTag tag) => Task.Run(() =>
        {
            if (ProgressiveSearch != null)
            {
                ProgressiveSearch.Cancel = true;
            }

            ProgressiveSearch         = App.Model.Photos.CreateProgressiveSearch(tag, viewSettings.Location, viewSettings.FromDate, viewSettings.ToDate);
            ActiveProgressiveSearchId = ProgressiveSearch.Id;
            ProgressiveSearch.ChunkSearchingStarted   += OnProgressiveChunkSearchingStarted;
            ProgressiveSearch.ChunkSearchingCompleted += OnProgressiveChunkSearchingCompleted;
            ProgressiveSearch.ChunkSearchingFailed    += OnProgressiveChunkSearchingFailed;
            ProgressiveSearch.SearchingFinished       += OnProgressiveSearchingFinished;
            return(ProgressiveSearch.PerformAsync());
        });
Exemplo n.º 3
0
        private void OnProgressiveChunkSearchingCompleted(ProgressivePhotoSearch sender, IEnumerable <Photo> items)
        {
            var newPhotos = MergePhotos(items);

            if (newPhotos.Count > 0)
            {
                PhotosAdded(this, newPhotos);
            }

            HideProgress((ProgressNotificationId)sender.Tag, Strings.GetProgressIndicatorSearchingPhotosResult(newPhotos.Count));
            if (ActiveProgressiveSearchId == sender.Id)
            {
                IsSearchButtonEnabled = true;
            }
        }