Example #1
0
 public SubjectAverageDbDataService()
 {
     this._dbMobileApi = (IDbMobileApi)Mvx.get_IoCProvider().Resolve <IDbMobileApi>();
     this._subjectAverageRepository = (ISubjectAverageDbRepository)Mvx.get_IoCProvider().Resolve <ISubjectAverageDbRepository>();
 }
 public NoteDetailViewModel()
 {
     this._messenger       = (IMvxMessenger)Mvx.get_IoCProvider().Resolve <IMvxMessenger>();
     this._noteDataService = (INoteDbDataService)Mvx.get_IoCProvider().Resolve <INoteDbDataService>();
 }
 public CredentialsDataService()
 {
     this._credentialsRepository = (ICredentialRealmRepository)Mvx.get_IoCProvider().Resolve <ICredentialRealmRepository>();
 }
Example #4
0
        internal override void Migrate(ISettings appSettings, ISecureStore secureStore = null)
        {
            Mvx.get_IoCProvider().Resolve <IRefreshDataService>();
            string valueOrDefault1         = appSettings.GetValueOrDefault("settings_profiles_key", (string)null, (string)null);
            IEnumerable <Profile> profiles = string.IsNullOrEmpty(valueOrDefault1) ? (IEnumerable <Profile>) new List <Profile>() : (IEnumerable <Profile>)JsonConvert.DeserializeObject <IEnumerable <Profile> >(valueOrDefault1);
            string valueOrDefault2         = appSettings.GetValueOrDefault("settings_active_profile_guid", (string)null, (string)null);

            foreach (Profile profile1 in profiles)
            {
                string id = profile1.Id;
                if (valueOrDefault2 != null && id == valueOrDefault2)
                {
                    profile1.IsActive = true;
                }
                Institute    institute            = profile1.Institute;
                TokenInfo    tokenInfo            = profile1.TokenInfo;
                PushSettings pushSettings         = profile1.PushSettings;
                int          role                 = (int)tokenInfo.Role;
                string       newProfileRolelessId = string.Format("{0}-{1}", (object)institute.InstituteCode, (object)tokenInfo.InstituteUserId);
                string       newProfileId         = string.Format("{0}-{1}_{2}", (object)institute.InstituteCode, (object)tokenInfo.InstituteUserId, (object)role);
                if (profile1.Student != null)
                {
                    Student student1 = profile1.Student;
                    IEnumerable <Absence> absences1 = profile1.Student.Absences;
                    IEnumerable <Absence> absences2 = absences1 != null?absences1.Select <Absence, Absence>((Func <Absence, Absence>)(x =>
                    {
                        x.ProfileId  = newProfileRolelessId;
                        x.SeenByUser = true;
                        return(x);
                    })) : (IEnumerable <Absence>)null;

                    student1.Absences = absences2;
                    Student student2 = profile1.Student;
                    IEnumerable <Evaluation> evaluations1 = profile1.Student.Evaluations;
                    IEnumerable <Evaluation> evaluations2 = evaluations1 != null?evaluations1.Select <Evaluation, Evaluation>((Func <Evaluation, Evaluation>)(x =>
                    {
                        x.ProfileId  = newProfileRolelessId;
                        x.SeenByUser = true;
                        return(x);
                    })) : (IEnumerable <Evaluation>)null;

                    student2.Evaluations = evaluations2;
                    Student            student3 = profile1.Student;
                    IEnumerable <Note> notes1   = profile1.Student.Notes;
                    IEnumerable <Note> notes2   = notes1 != null?notes1.Select <Note, Note>((Func <Note, Note>)(x =>
                    {
                        x.ProfileId  = newProfileRolelessId;
                        x.SeenByUser = true;
                        return(x);
                    })) : (IEnumerable <Note>)null;

                    student3.Notes = notes2;
                    Profile             profile2 = profile1;
                    IEnumerable <Event> events1  = profile1.Events;
                    IEnumerable <Event> events2  = events1 != null?events1.Select <Event, Event>((Func <Event, Event>)(x =>
                    {
                        x.ProfileId  = newProfileRolelessId;
                        x.SeenByUser = true;
                        return(x);
                    })) : (IEnumerable <Event>)null;

                    profile2.Events            = events2;
                    profile1.Student.ProfileId = newProfileRolelessId;
                    secureStore.MigrateProfileId(profile1.Id, newProfileId);
                    profile1.Id = newProfileId;
                }
            }
        }
Example #5
0
        public static void ShowToast(string messageKey)
        {
            WeakReference weakReference = new WeakReference((object)((IMvxTextProvider)Mvx.get_IoCProvider().Resolve <IMvxTextProvider>()).GetText((string)null, (string)null, messageKey));

            if (!weakReference.IsAlive)
            {
                return;
            }
            ((IUserDialogs)Mvx.get_IoCProvider().Resolve <IUserDialogs>()).Toast(weakReference.Target as string, new TimeSpan?(TimeSpan.FromSeconds(10.0)));
        }
 public AbsenceDataService()
 {
     this._absenceRepository   = (IAbsenceRepository)Mvx.get_IoCProvider().Resolve <IAbsenceRepository>();
     this._settingsDataService = (ISettingsDataService)Mvx.get_IoCProvider().Resolve <ISettingsDataService>();
 }
Example #7
0
 public TeacherHomeWorkDbDataService()
 {
     this._teacherHomeWorkRepository = (ITeacherHomeWorkDbRepository)Mvx.get_IoCProvider().Resolve <ITeacherHomeWorkDbRepository>();
     this._secureStore = (ISecureStore)Mvx.get_IoCProvider().Resolve <ISecureStore>();
     this._mobileApi   = (IDbMobileApi)Mvx.get_IoCProvider().Resolve <IDbMobileApi>();
 }
 protected IStudentDataService GetStudentDataService()
 {
     return((IStudentDataService)Mvx.get_IoCProvider().Resolve <IStudentDataService>());
 }
 protected IProfileDataService GetProfileDataService()
 {
     return((IProfileDataService)Mvx.get_IoCProvider().Resolve <IProfileDataService>());
 }
Example #10
0
 public FormTeacherDataService()
 {
     this._formTeacherRepository = (IFormTeacherRepository)Mvx.get_IoCProvider().Resolve <IFormTeacherRepository>();
 }
Example #11
0
 public RatingDataService()
 {
     this._ratingRepository = (IRatingRepository)Mvx.get_IoCProvider().Resolve <IRatingRepository>();
 }
        public override void HandleError(ServerUnreachableException exception)
        {
            IAuthDataService    authDataService    = (IAuthDataService)Mvx.get_IoCProvider().Resolve <IAuthDataService>();
            IProfileDataService profileDataService = (IProfileDataService)Mvx.get_IoCProvider().Resolve <IProfileDataService>();
            M0 m0 = Mvx.get_IoCProvider().Resolve <IConnectivity>();
            ICredentialsDataService credentialsDataService = (ICredentialsDataService)Mvx.get_IoCProvider().Resolve <ICredentialsDataService>();

            if (((IConnectivity)m0).get_IsConnected())
            {
                Profile profile = profileDataService.GetActiveProfile();
                try
                {
                    if (profile == null)
                    {
                        this.DisplayServerUnreachableErrorMessage(exception);
                    }
                    else
                    {
                        Credentials credentials = credentialsDataService.GetCredentials(profile?.Id);
                        if (credentials != null)
                        {
                            Task.Run <Profile>((Func <Task <Profile> >)(() => authDataService.Login(profile.Institute, credentials.UserName, credentials.Password))).Wait();
                        }
                        else
                        {
                            Task.Run <TokenData>((Func <Task <TokenData> >)(() => authDataService.RefreshToken(profile))).Wait();
                        }
                    }
                }
                catch (AggregateException ex)
                {
                    foreach (Exception innerException in ex.Flatten().InnerExceptions)
                    {
                        if (innerException is ServerUnreachableException exception1)
                        {
                            this.DisplayServerUnreachableErrorMessage(exception1);
                            ErrorHandler.Current.HandleError((Exception) new RefreshTokenException("Sikertelen relogin vagy token refresh", profile).SetErrorCode <RefreshTokenException>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/Helpers/ErrorHandlers/ServerUnreachableErrorHandler.cs", 58));
                        }
                        else
                        {
                            ErrorHandler.Current.HandleError(innerException);
                        }
                    }
                }
            }
            else
            {
                ErrorHandler.Current.HandleError((Exception) new NoInternetConnectionException().SetErrorCode <NoInternetConnectionException>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/Helpers/ErrorHandlers/ServerUnreachableErrorHandler.cs", 69));
            }
        }
 public InstituteDataService()
 {
     this._instituteRepository = (IInstituteRepository)Mvx.get_IoCProvider().Resolve <IInstituteRepository>();
     this._globalMobileApi     = (IGlobalMobileApi)Mvx.get_IoCProvider().Resolve <IGlobalMobileApi>();
 }
 public ExamsDetailViewModel()
 {
     this._messenger       = (IMvxMessenger)Mvx.get_IoCProvider().Resolve <IMvxMessenger>();
     this._examDataService = (IExamDbDataService)Mvx.get_IoCProvider().Resolve <IExamDbDataService>();
 }
Example #15
0
 public UserAgentService()
 {
     this._settingsDataService = (ISettingsDataService)Mvx.get_IoCProvider().Resolve <ISettingsDataService>();
 }
Example #16
0
 public SettingsDataService()
 {
     this._settingRepository = (ISettingRepository)Mvx.get_IoCProvider().Resolve <ISettingRepository>();
 }
Example #17
0
 public RatingChooserViewModel()
 {
     this._messenger = (IMvxMessenger)Mvx.get_IoCProvider().Resolve <IMvxMessenger>();
 }
Example #18
0
 public HomeWorkStudentDetailViewModel()
 {
     this._studentHomeWorkDataService = (IStudentHomeWorkDbDataService)Mvx.get_IoCProvider().Resolve <IStudentHomeWorkDbDataService>();
 }
Example #19
0
 public Settings()
 {
     this._migration   = (ISettingsMigration)Mvx.get_IoCProvider().Resolve <ISettingsMigration>();
     this._secureStore = (ISecureStore)Mvx.get_IoCProvider().Resolve <ISecureStore>();
     this.Migrate();
 }
 public TutelaryDbDataService()
 {
     this._tutelaryRepository = (ITutelaryDbRepository)Mvx.get_IoCProvider().Resolve <ITutelaryDbRepository>();
 }
        protected override async Task <HttpResponseMessage> SendAsync(
            HttpRequestMessage request,
            CancellationToken cancellationToken)
        {
            // ISSUE: explicit reference operation
            // ISSUE: reference to a compiler-generated field
            int num = (^ this).\u003C\u003E1__state;
            HttpResponseMessage response;
            HttpResponseMessage result1;

            try
            {
                response = (HttpResponseMessage)null;
                try
                {
                    TaskAwaiter awaiter1 = this._semaphore.WaitAsync().GetAwaiter();
                    if (!awaiter1.IsCompleted)
                    {
                        // ISSUE: explicit reference operation
                        // ISSUE: reference to a compiler-generated field
                        (^ this).\u003C\u003E1__state = num = 0;
                        TaskAwaiter taskAwaiter = awaiter1;
                        // ISSUE: explicit reference operation
                        // ISSUE: reference to a compiler-generated field
                        (^ this).\u003C\u003Et__builder.AwaitUnsafeOnCompleted <TaskAwaiter, AuthDbMessageHandler.\u003CSendAsync\u003Ed__6>(ref awaiter1, this);
                        return;
                    }
                    awaiter1.GetResult();
                    TaskAwaiter <HttpRequestMessage> taskAwaiter1;
                    HttpRequestMessage result2;
                    if (this._secureStore.GetTokenData(this._profile.Id).ExpiresAt <= DateTime.Now)
                    {
                        TaskAwaiter <TokenData> awaiter2 = ((IAuthDbDataService)Mvx.get_IoCProvider().Resolve <IAuthDbDataService>()).RefreshToken(this._profile).GetAwaiter();
                        if (!awaiter2.IsCompleted)
                        {
                            // ISSUE: explicit reference operation
                            // ISSUE: reference to a compiler-generated field
                            (^ this).\u003C\u003E1__state = num = 1;
                            TaskAwaiter <TokenData> taskAwaiter2 = awaiter2;
                            // ISSUE: explicit reference operation
                            // ISSUE: reference to a compiler-generated field
                            (^ this).\u003C\u003Et__builder.AwaitUnsafeOnCompleted <TaskAwaiter <TokenData>, AuthDbMessageHandler.\u003CSendAsync\u003Ed__6>(ref awaiter2, this);
                            return;
                        }
                        TokenData result3 = awaiter2.GetResult();
                        if (result3 == null)
                        {
                            result1 = (HttpResponseMessage)null;
                            goto label_26;
                        }
                        else
                        {
                            this._tokenInfoRepository.AddOrUpdate(new TokenInfoRealmMapper().To((Ekreta.Mobile.Core.Models.TokenInfo)JsonConvert.DeserializeObject <Ekreta.Mobile.Core.Models.TokenInfo>(TokenDecoder.Decode(result3.AccessToken))), (Action <TokenInfoRealm>)null);
                            TaskAwaiter <HttpRequestMessage> awaiter3 = this.CloneRequest(request, result3).GetAwaiter();
                            if (!awaiter3.IsCompleted)
                            {
                                // ISSUE: explicit reference operation
                                // ISSUE: reference to a compiler-generated field
                                (^ this).\u003C\u003E1__state = num = 2;
                                taskAwaiter1 = awaiter3;
                                // ISSUE: explicit reference operation
                                // ISSUE: reference to a compiler-generated field
                                (^ this).\u003C\u003Et__builder.AwaitUnsafeOnCompleted <TaskAwaiter <HttpRequestMessage>, AuthDbMessageHandler.\u003CSendAsync\u003Ed__6>(ref awaiter3, this);
                                return;
                            }
                            result2 = awaiter3.GetResult();
                        }
                    }
                    else
                    {
                        TaskAwaiter <HttpRequestMessage> awaiter2 = this.CloneRequest(request, (TokenData)null).GetAwaiter();
                        if (!awaiter2.IsCompleted)
                        {
                            // ISSUE: explicit reference operation
                            // ISSUE: reference to a compiler-generated field
                            (^ this).\u003C\u003E1__state = num = 3;
                            taskAwaiter1 = awaiter2;
                            // ISSUE: explicit reference operation
                            // ISSUE: reference to a compiler-generated field
                            (^ this).\u003C\u003Et__builder.AwaitUnsafeOnCompleted <TaskAwaiter <HttpRequestMessage>, AuthDbMessageHandler.\u003CSendAsync\u003Ed__6>(ref awaiter2, this);
                            return;
                        }
                        result2 = awaiter2.GetResult();
                    }
                    TaskAwaiter <HttpResponseMessage> awaiter4 = base.SendAsync(result2, cancellationToken).GetAwaiter();
                    if (!awaiter4.IsCompleted)
                    {
                        // ISSUE: explicit reference operation
                        // ISSUE: reference to a compiler-generated field
                        (^ this).\u003C\u003E1__state = num = 4;
                        TaskAwaiter <HttpResponseMessage> taskAwaiter2 = awaiter4;
                        // ISSUE: explicit reference operation
                        // ISSUE: reference to a compiler-generated field
                        (^ this).\u003C\u003Et__builder.AwaitUnsafeOnCompleted <TaskAwaiter <HttpResponseMessage>, AuthDbMessageHandler.\u003CSendAsync\u003Ed__6>(ref awaiter4, this);
                        return;
                    }
                    response = awaiter4.GetResult();
                    result1  = response;
                }
                catch (InvalidOperationException ex)
                {
                    result1 = response;
                }
                catch (HttpRequestException ex)
                {
                    if (!((IConnectivity)Mvx.get_IoCProvider().Resolve <IConnectivity>()).get_IsConnected())
                    {
                        throw new NoInternetConnectionException().SetErrorCode <NoInternetConnectionException>("/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile.Core.Standard/Services/Handlers/AuthDbMessageHandler.cs", 99);
                    }
                    throw;
                }
                finally
                {
                    if (num < 0)
                    {
                        this._semaphore.Release();
                    }
                }
            }
            catch (Exception ex)
            {
                // ISSUE: explicit reference operation
                // ISSUE: reference to a compiler-generated field
                (^ this).\u003C\u003E1__state = -2;
                response = (HttpResponseMessage)null;
                // ISSUE: explicit reference operation
                // ISSUE: reference to a compiler-generated field
                (^ this).\u003C\u003Et__builder.SetException(ex);
                return;
            }
label_26:
            // ISSUE: explicit reference operation
            // ISSUE: reference to a compiler-generated field
            (^ this).\u003C\u003E1__state = -2;
            response = (HttpResponseMessage)null;
            // ISSUE: explicit reference operation
            // ISSUE: reference to a compiler-generated field
            (^ this).\u003C\u003Et__builder.SetResult(result1);
        }
 public EvaluationDetailViewModel()
 {
     this._showRating            = false;
     this._messenger             = (IMvxMessenger)Mvx.get_IoCProvider().Resolve <IMvxMessenger>();
     this._evaluationDataService = (IEvaluationDbDataService)Mvx.get_IoCProvider().Resolve <IEvaluationDbDataService>();
 }
Example #23
0
 public MessagesViewModel()
 {
     this._uzenetDataService = (IUzenetDataService)Mvx.get_IoCProvider().Resolve <IUzenetDataService>();
     this._messenger         = (IMvxMessenger)Mvx.get_IoCProvider().Resolve <IMvxMessenger>();
     this.SetTitle("Messages_Page_Title");
 }
 public ProfileDbDataService()
 {
     this._profileRepository      = (IProfileDbRepository)Mvx.get_IoCProvider().Resolve <IProfileDbRepository>();
     this._tokenInfoRepository    = (ITokenInfoDbRepository)Mvx.get_IoCProvider().Resolve <ITokenInfoDbRepository>();
     this._pushSettingsRepository = (IPushSettingsDbRepository)Mvx.get_IoCProvider().Resolve <IPushSettingsDbRepository>();
     this._secureStore            = (ISecureStore)Mvx.get_IoCProvider().Resolve <ISecureStore>();
     this._globalMobileApi        = (IGlobalMobileApi)Mvx.get_IoCProvider().Resolve <IGlobalMobileApi>();
     this._mobileApi = (IMobileApi)Mvx.get_IoCProvider().Resolve <IMobileApi>();
     this._pushNotificationHandler = (IPushNotificationHandler)Mvx.get_IoCProvider().Resolve <IPushNotificationHandler>();
     this._pushNotificationPlatformSpecificService = (IPushNotificationPlatformSpecificService)Mvx.get_IoCProvider().Resolve <IPushNotificationPlatformSpecificService>();
 }
 private string GetSchoolYearId()
 {
     return(((IProfileDataService)Mvx.get_IoCProvider().Resolve <IProfileDataService>()).GetActiveProfile().TokenInfo.SchoolYearId);
 }
        private async Task Init()
        {
            FirebaseMessageService firebaseMessageService = this;
            await MvvmCrossHelper.Init((Context)firebaseMessageService);

            if (!Mvx.get_IoCProvider().CanResolve <IPushNotificationService>())
            {
                return;
            }
            firebaseMessageService._pushNotificationService = (IPushNotificationService)Mvx.get_IoCProvider().Resolve <IPushNotificationService>();
        }
 public EventDataService()
 {
     this._eventRepository     = (IEventRepository)Mvx.get_IoCProvider().Resolve <IEventRepository>();
     this._settingsDataService = (ISettingsDataService)Mvx.get_IoCProvider().Resolve <ISettingsDataService>();
     this._mobileApi           = (IMobileApi)Mvx.get_IoCProvider().Resolve <IMobileApi>();
 }
 public TranslateExtension()
 {
     this._textProvider = (IMvxTextProvider)Mvx.get_IoCProvider().Resolve <IMvxTextProvider>();
 }
Example #29
0
 protected virtual void InitializeFirstChance()
 {
     ((MvxSetup)this).InitializeFirstChance();
     MvvmCrossHelper.IsRunning = true;
     Mvx.get_IoCProvider().RegisterType <IDeviceSpecification, DeviceSpecification>();
     Mvx.get_IoCProvider().RegisterType <IPushNotificationPlatformSpecificService, PushNotificationPlatformSpecificService>();
     Mvx.get_IoCProvider().RegisterSingleton <IMessaging>((Func <M0>)(() => CrossMessaging.get_Current()));
     Mvx.get_IoCProvider().RegisterSingleton <IDeviceInfo>((Func <M0>)(() => CrossDeviceInfo.get_Current()));
     Mvx.get_IoCProvider().RegisterType <IFirebaseAnalytics, eKreta.Mobile.Droid.Platform.FirebaseAnalytics.FirebaseAnalytics>();
     Mvx.get_IoCProvider().RegisterType <IFirebaseRemoteConfigurationService, FirebaseRemoteConfigurationService>();
     Mvx.get_IoCProvider().RegisterSingleton <IUserDialogs>((Func <M0>)(() => Acr.UserDialogs.UserDialogs.get_Instance()));
     Acr.UserDialogs.UserDialogs.Init((Func <Activity>)(() => ((IMvxAndroidCurrentTopActivity)Mvx.get_IoCProvider().Resolve <IMvxAndroidCurrentTopActivity>()).get_Activity()));
     ImageCircleRenderer.Init();
     ServicePointManager.ServerCertificateValidationCallback += (RemoteCertificateValidationCallback)((sender, certificate, chain, sslPolicyErrors) => true);
     AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(this.CurrentDomain_UnhandledException);
 }
 public RootedDeviceViewModel()
 {
     this._securityService = (ISecurityService)Mvx.get_IoCProvider().Resolve <ISecurityService>();
 }