Beispiel #1
0
        public async Task SyncAsync()
        {
            await MobileService.SyncContext.PushAsync();

            await couponTable.PushFileChangesAsync();

            await couponTable.PullAsync("allcoupons", couponTable.CreateQuery());
        }
Beispiel #2
0
        public async Task SyncAsync()
        {
            await imageTableSync.PushFileChangesAsync();

            await MobileService.SyncContext.PushAsync();

            await albumTableSync.PullAsync("allAlbums", albumTableSync.CreateQuery());

            await imageTableSync.PullAsync("allImages", imageTableSync.CreateQuery());
        }
        public async Task SyncAsync()
        {
            await _mobileService.SyncContext.PushAsync();

            await _imageReferenceTable.PushFileChangesAsync();

            await _categoryTable.PullAsync("categories", _categoryTable.CreateQuery());

            await _imageReferenceTable.PullAsync("imagerefs", _imageReferenceTable.CreateQuery());
        }
Beispiel #4
0
        public async Task SyncAsync()
        {
            await MobileService.SyncContext.PushAsync();

            await couponTable.PushFileChangesAsync();

            await couponTable.PullAsync("allcoupons", couponTable.CreateQuery());

            await fileSyncHandler.DownloadsComplete();
        }
Beispiel #5
0
        public async Task SynchronizeServiceAsync()
        {
            await InitializeAsync();

            await MobileService.SyncContext.PushAsync();

            await itemTable.PushFileChangesAsync();

            await itemTable.PullAsync("allitems", itemTable.CreateQuery());

            await imageTable.PullAsync("allimages", imageTable.CreateQuery());
        }
Beispiel #6
0
        public async Task SyncAsync(bool notify = false)
        {
            await imageTableSync.PushFileChangesAsync();

            await MobileService.SyncContext.PushAsync();

            await albumTableSync.PullAsync(AllAlbumsQueryString, albumTableSync.CreateQuery());

            await imageTableSync.PullAsync(AllImagesQueryString, imageTableSync.CreateQuery());

            if (notify)
            {
                await MobileService.EventManager.PublishAsync(SyncCompletedEvent.Instance);
            }
        }
Beispiel #7
0
        public async Task SyncSaleItems()
        {
            try
            {
                await MobileService.SyncContext.PushAsync();

                await saleItemsTable.PushFileChangesAsync();

                await saleItemsTable.PullAsync("allSaleItems", this.saleItemsTable.CreateQuery());
            }

            catch (Exception e)
            {
                Debug.WriteLine(@"Sync Failed: {0}", e.Message);
            }
        }
        private async Task SyncAsync()
        {
            string errorString = null;

            try
            {
                await client.SyncContext.PushAsync();

                await sightTable.PushFileChangesAsync();

                await sightFileTable.PushFileChangesAsync();

                await tripTable.PullAsync("tripItems", tripTable.CreateQuery());

                foreach (var trip in await tripTable.ToCollectionAsync())
                {
                    await sightTable.PullAsync("attractionItems", sightTable.CreateQuery().Where(s => s.TripId == trip.Id));
                }
                foreach (var sight in await sightTable.ToCollectionAsync())
                {
                    await sightFileTable.PullAsync("attractionFileItems", sightFileTable.CreateQuery().Where(sf => sf.SightId == sight.Id));
                }
            }

            catch (MobileServicePushFailedException ex)
            {
                errorString = "Push failed because of sync errors. You may be offline.\nMessage: " +
                              ex.Message + "\nPushResult.Status: " + ex.PushResult.Status;
            }
            catch (Exception ex)
            {
                errorString = "Pull failed: " + ex.Message +
                              "\n\nIf you are still in an offline scenario, " +
                              "you can try your Pull again when connected with your Mobile Service.";
            }

            if (errorString != null)
            {
                await ShowError(errorString);
            }
        }