Exemplo n.º 1
0
        private async Task RefreshMeetings(bool forceRefresh, CancellationToken token)
        {
            IsBusy = true;
            try
            {
                Meetings.PauseNotifications();

                //var test  = App.Instance.GetInstance<IUseFullDocumentService>();
                //var documents = await test.GetDocumentsAsync();

                var meetings = await _meetingService.GetMeetingsAsync(forceRefresh, token);

                Meetings.Clear();
                Meetings.AddRange(meetings);
                var lastUpdate = _meetingService.GetLastUpdateTime();
                UpdateLastUpdateText(lastUpdate);
            }
            catch (TaskCanceledException ex)
            {
                Debug.WriteLine(ex.Message);
            }
            catch (TokenExpiredException ex)
            {
                Debug.WriteLine(ex.Message);
                this.ShowViewModel <StartupViewModel>();
            }
            catch (System.Exception ex)
            {
                Debug.WriteLine(ex.Message);
                await App.Instance.AlertService.ShowExceptionMessageAsync(ex, "Erreur lors de la récupération des rendez-vous.");
            }
            finally
            {
                _pageTokenSource = null;
                Meetings.ResumeNotifications();
                IsBusy = false;
            }
        }