示例#1
0
        private async Task FetchInsitutes(bool refreshOnline)
        {
            InstitutePickerViewModel institutePickerViewModel1 = this;

            try
            {
                institutePickerViewModel1.Busy();
                if (refreshOnline)
                {
                    IEnumerable <Institute> source = await institutePickerViewModel1._instituteDataService.FetchInstitutesAsync();

                    institutePickerViewModel1._institutesList = source.ToList <Institute>();
                    institutePickerViewModel1._instituteDataService.SaveInstitutes((IEnumerable <Institute>)institutePickerViewModel1._institutesList);
                }
                else if (institutePickerViewModel1._institutesList == null)
                {
                    institutePickerViewModel1._institutesList = institutePickerViewModel1._instituteDataService.GetInstitutes().ToList <Institute>();
                    if (!institutePickerViewModel1._institutesList.Any <Institute>())
                    {
                        IEnumerable <Institute> source = await institutePickerViewModel1._instituteDataService.FetchInstitutesAsync();

                        institutePickerViewModel1._institutesList = source.ToList <Institute>();
                        institutePickerViewModel1._instituteDataService.SaveInstitutes((IEnumerable <Institute>)institutePickerViewModel1._institutesList);
                    }
                }
                if (!string.IsNullOrWhiteSpace(institutePickerViewModel1.SearchText))
                {
                    InstitutePickerViewModel._searchTextGlobal = institutePickerViewModel1.SearchText;
                    List <Institute> institutesList = institutePickerViewModel1._institutesList;
                    // ISSUE: reference to a compiler-generated method
                    IOrderedEnumerable <Institute> orderedEnumerable = institutesList != null?institutesList.Where <Institute>(new Func <Institute, bool>(institutePickerViewModel1.\u003CFetchInsitutes\u003Eb__28_1)).OrderBy <Institute, string>((Func <Institute, string>)(x => x.Name)) : (IOrderedEnumerable <Institute>)null;

                    institutePickerViewModel1.Institutes = new ObservableCollection <Institute>((IEnumerable <Institute>)orderedEnumerable);
                }
                else
                {
                    InstitutePickerViewModel._searchTextGlobal = string.Empty;
                    InstitutePickerViewModel            institutePickerViewModel2 = institutePickerViewModel1;
                    List <Institute>                    institutesList            = institutePickerViewModel1._institutesList;
                    MvxObservableCollection <Institute> observableCollection      = new MvxObservableCollection <Institute>(institutesList != null ? (IEnumerable <Institute>)institutesList.OrderBy <Institute, string>((Func <Institute, string>)(x => x.City)) : (IEnumerable <Institute>)null);
                    institutePickerViewModel2.Institutes = (ObservableCollection <Institute>)observableCollection;
                }
            }
            catch (Exception ex)
            {
                CrossMobileAnalytics.Current.TrackException(ex, (IDictionary <string, string>)null, nameof(FetchInsitutes), "/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/ViewModels/InstitutePickerViewModel.cs", 132);
            }
            finally
            {
                institutePickerViewModel1.NotBusy();
            }
        }
示例#2
0
        private async Task GetInstitutes(bool refreshOnline = false)
        {
            InstitutePickerViewModel institutePickerViewModel = this;

            if (!institutePickerViewModel.HasInternetConnection)
            {
                int num1 = await institutePickerViewModel._modalDialog.DisplayAlertAsync(institutePickerViewModel._textProvider.GetText((string)null, (string)null, "Common_NoInternet_Message"), institutePickerViewModel._textProvider.GetText((string)null, (string)null, "Common_NoInternet_Title"), "OK", (string)null) ? 1 : 0;

                int num2 = await institutePickerViewModel._navigationService.Close((IMvxViewModel)institutePickerViewModel, new CancellationToken()) ? 1 : 0;
            }
            else
            {
                institutePickerViewModel.IsLoading = true;
                await Task.Run((Func <Task>)(async() => await this.FetchInsitutes(refreshOnline)));
            }
        }
示例#3
0
 private async Task Close()
 {
     InstitutePickerViewModel institutePickerViewModel = this;
     int num = await institutePickerViewModel._navigationService.Close((IMvxViewModel)institutePickerViewModel, new CancellationToken()) ? 1 : 0;
 }