Ejemplo n.º 1
0
        private async void SyncExecute()
        {
            if (this.synchronizationManager.IsSyncConfigured)
            {
                if (!this.synchronizationManager.IsSyncRunning)
                {
                    if (ModelHelper.SoftEditPending < 1)
                    {
                        await SyncWarningChecker.CheckWarningBeforeSync(this.Workbook, this.synchronizationManager, this.messageBoxService, this.platformService);

                        // sync is configured and not currently running, we can start sync
                        await TryWarnVercorsDeprecation();

                        await this.synchronizationManager.Sync();
                    }
                }
                else
                {
                    // ask for confirmation before cancelling sync as user might have tapped the button without wanting to cancel sync
                    var result = await this.messageBoxService.ShowAsync(
                        StringResources.SyncProgress_SyncInProgress,
                        StringResources.Action_Cancel + "?",
                        DialogButton.YesNo);

                    if (result == DialogResult.Yes && this.synchronizationManager.IsSyncRunning)
                    {
                        this.synchronizationManager.Cancel();
                    }
                }
            }
            else
            {
                this.NavigationService.FlyoutTo(ViewLocator.SettingsSyncPage);
            }
        }
Ejemplo n.º 2
0
        private async void OnSyncOperationFailed(object sender, SyncFailedEventArgs e)
        {
            this.notificationService.EndAsyncOperationAsync();

            await SyncWarningChecker.HandleFailedSynced(e, this.messageBoxService, this.NavigationService);
        }