示例#1
0
        private void OnSyncFinished (SyncFinishedMessage msg)
        {
            // Protect against Java side being GCed
            if (Handle == IntPtr.Zero)
                return;

            if (subscriptionSyncFinished != null) {
                var bus = ServiceContainer.Resolve<MessageBus> ();
                bus.Unsubscribe (subscriptionSyncFinished);
                subscriptionSyncFinished = null;
            }

            StopSelf ();
        }
        private void OnSyncFinished (SyncFinishedMessage msg)
        {
            var settingsStore = ServiceContainer.Resolve<SettingsStore> ();
            if (msg.HadErrors) {
                var ignoreTime = settingsStore.IgnoreSyncErrorsUntil;
                var showError = ignoreTime == null || ignoreTime < Time.UtcNow;

                if (showError) {
                    // Make sure that error is shown
                    statusView.IsSyncing = false;
                    StatusBarShown = true;
                }
            } else {
                // Successful sync, clear ignoring flag
                settingsStore.IgnoreSyncErrorsUntil = null;
                StatusBarShown = false;
            }
        }
示例#3
0
 private void OnSyncFinishedMessage (SyncFinishedMessage msg)
 {
     SyncOrStop (checkRunning: false);
 }
 private void SyncFinished (SyncFinishedMessage msg)
 {
     syncRetryButton.Enabled = true;
     if (msg.FatalError != null) {
         syncStatus = syncFatalError;
     } else if (msg.HadErrors) {
         syncStatus = syncHadErrors;
     } else {
         syncStatus = syncSuccessful;
     }
     lastSyncInMillis = Toggl.Phoebe.Time.Now.Ticks / TimeSpan.TicksPerMillisecond;
     UpdateSyncStatus ();
 }
 private void OnSyncFinished (SyncFinishedMessage msg)
 {
     ServiceContainer.Resolve<IPlatformUtils> ().DispatchOnUIThread (() => {
         IsAppSyncing = false;
     });
 }
        private void SyncFinished (SyncFinishedMessage msg)
        {
            if (!swipeLayout.Refreshing) {
                return;
            }

            swipeLayout.Refreshing = false;

            if (msg.HadErrors) {
                int msgId = Resource.String.LastSyncHadErrors;

                if (msg.FatalError.IsNetworkFailure ()) {
                    msgId = Resource.String.LastSyncNoConnection;
                } else if (msg.FatalError is TaskCanceledException) {
                    msgId = Resource.String.LastSyncFatalError;
                }
                Snackbar.Make (coordinatorLayout, Resources.GetString (msgId), Snackbar.LengthLong).Show ();
            }
        }
 private void OnSyncFinished (SyncFinishedMessage msg)
 {
     syncRunning = false;
     ResetIndicator ();
 }
示例#8
0
        private async void OnSyncFinished (SyncFinishedMessage msg)
        {
            // Check if the user has access to any premium workspaces
            var store = ServiceContainer.Resolve<IDataStore> ();
            var numPremium = await store.Table<WorkspaceData> ()
                             .Where (r => r.IsPremium).CountAsync();

            UserPlan = numPremium > 0 ? Plan.Pro : Plan.Free;
        }
示例#9
0
 private void OnSyncFinished (SyncFinishedMessage msg)
 {
     if (backgroundFetchHandler != null) {
         backgroundFetchHandler (msg.HadErrors ? UIBackgroundFetchResult.Failed : UIBackgroundFetchResult.NewData);
     }
 }
示例#10
0
 private void OnSyncFinished (SyncFinishedMessage msg)
 {
     if (Handle == IntPtr.Zero)
         return;
     ToggleProgressBar (false);
 }
示例#11
0
文件: GcmService.cs 项目: jblj/mobile
 private void OnSyncFinishedMessage (SyncFinishedMessage msg)
 {
     if (IsCancelled || IsRunning) {
         Finish ();
     } else {
         // Previous sync finished, need to start pull sync now.
         Start ();
     }
 }