Ejemplo n.º 1
0
        private async Task ExecuteShowDetailCommand(ExamRealm exam)
        {
            ExamsViewModel examsViewModel = this;

            examsViewModel._singleNavigation.DisableNavigation();
            int num = await examsViewModel._navigationService.Navigate <ExamsDetailViewModel, ExamRealm>((M1)exam, (IMvxBundle)null, new CancellationToken()) ? 1 : 0;
        }
Ejemplo n.º 2
0
        private async Task FillList()
        {
            ExamsViewModel examsViewModel1 = this;

            examsViewModel1.IsLoading = true;
            if (examsViewModel1._items != null)
            {
                examsViewModel1.IsLoading = false;
            }
            try
            {
                ExamsViewModel examsViewModel = examsViewModel1;
                examsViewModel1.IsOffline = false;
                if (!examsViewModel1._connectivity.get_IsConnected())
                {
                    throw new NoInternetConnectionException().SetErrorCode <NoInternetConnectionException>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/ViewModels/ExamsViewModel.cs", 104);
                }
                IEnumerable <ExamRealm> source = await examsViewModel1._examDataService.FetchExamsAsync(examsViewModel1.ActiveProfileRealm, false);

                List <ExamRealm>        storedExams = examsViewModel1._examDataService.GetExams(examsViewModel1.ActiveProfileRealm.Id).ToList <ExamRealm>();
                IEnumerable <ExamRealm> exams1      = source != null ? (IEnumerable <ExamRealm>)source.Select <ExamRealm, ExamRealm>((Func <ExamRealm, ExamRealm>)(x =>
                {
                    ExamRealm examRealm = storedExams.FirstOrDefault <ExamRealm>((Func <ExamRealm, bool>)(y => y.Uid == x.Uid && y.ProfileId == examsViewModel.ActiveProfileRealm.Id));
                    x.SeenByUser        = false;
                    if (examRealm != null)
                    {
                        x.SeenByUser = examRealm.SeenByUser;
                    }
                    else if (examsViewModel.ActiveProfile.IsFirstLogin)
                    {
                        x.SeenByUser = true;
                    }
                    return(x);
                })).ToList <ExamRealm>() : (IEnumerable <ExamRealm>)null;
                examsViewModel1._examDataService.Delete(examsViewModel1.ActiveProfileRealm.Id);
                // ISSUE: reference to a compiler-generated method
                examsViewModel1._examDataService.AddOrUpdate(exams1, new Action <ExamRealm>(examsViewModel1.\u003CFillList\u003Eb__28_1));
                IEnumerable <ExamRealm> exams2 = examsViewModel1._examDataService.GetExams(examsViewModel1.ActiveProfileRealm.Id);
                examsViewModel1.ComposeExams(exams2);
                examsViewModel1._messenger.Publish <ActiveProfileChangedMessage>((M0) new ActiveProfileChangedMessage((object)examsViewModel1, examsViewModel1.ActiveProfile));
            }
            catch (Exception ex)
            {
                ex.SetErrorCode <Exception>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/ViewModels/ExamsViewModel.cs", 135);
                switch (ex)
                {
                case NoInternetConnectionException _:
                case ServerUnreachableException _:
                    examsViewModel1.IsOffline = true;
                    IEnumerable <ExamRealm> exams = examsViewModel1._examDataService.GetExams(examsViewModel1.ActiveProfileRealm.Id);
                    examsViewModel1.ComposeExams(exams);
                    break;
                }
            }
            finally
            {
                examsViewModel1.IsLoading = false;
            }
            examsViewModel1.IsLoading = false;
        }
Ejemplo n.º 3
0
        private async Task ExecutRefreshCommand()
        {
            ExamsViewModel examsViewModel = this;

            try
            {
                if (!examsViewModel.HasInternetConnection)
                {
                    throw new NoInternetConnectionException().SetErrorCode <NoInternetConnectionException>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/ViewModels/ExamsViewModel.cs", 191);
                }
                await examsViewModel.FillList();
            }
            catch (Exception ex)
            {
                CrossMobileAnalytics.Current.TrackException(ex, (IDictionary <string, string>)null, "ExamsViewModel:RefreshCommand", "/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/ViewModels/ExamsViewModel.cs", 198);
                ErrorHandler.Current.HandleError(ex);
            }
            finally
            {
                // ISSUE: reference to a compiler-generated method
                ((MvxMainThreadDispatchingObject)examsViewModel).InvokeOnMainThread(new Action(examsViewModel.\u003CExecutRefreshCommand\u003Eb__31_0), true);
            }
        }