public void StartAutoSync(int interval) { if (IsRunning) { return; } IsRunning = true; Device.StartTimer(TimeSpan.FromMinutes(interval), () => { if (!IsRunning) { return(false); } syncService.SyncFromServer(method: 1, onSuccess: OnSuccess, showOverlay: false); return(IsRunning); }); Device.StartTimer(TimeSpan.FromSeconds(30), () => { if (!IsRunning) { return(false); } syncService.sendPushingAlertIntervention(); return(IsRunning); }); }
private void GetSync() { IsBusy = true; syncService.SyncFromServer(method: 1, onSuccess: OnSyncCompleted, onError: (error) => OnSyncCompleted(), showOverlay: false); }