Example #1
0
        /// <summary>
        /// Gets the application page.
        /// </summary>
        public void GetToApplication()
        {
            if (DeviceIsShared)
            {
                CredentialsManager.DeleteSystemCredentials();
                CredentialsManager.DeleteCredentials();
            }
            if (GeofenceManager == null)
            {
                GeofenceManager = new GeofenceManager();
            }
            if (ImageHelper != null)
            {
                ImageHelper.CheckForImageToUpload();
                NetworkManager.AddNetworkStateListener(ImageHelper);
            }
            ActionManager.GetActionList();
            LocationManager = new LocationManager();
            NavBar          = new PheidiTabbedPage();
            if (LocalisationEnabled)
            {
                LocationManager.StartLocalisation();
            }
            if (MainPage == null)
            {
                MainPage = new NavigationPage(new SystemLoginPage());
            }

            MainPage.Navigation.PushAsync(NavBar);
        }
Example #2
0
        /// <summary>
        /// Logout the user.
        /// </summary>
        public void Logout()
        {
            if (DeviceIsShared)
            {
                CredentialsManager.DeleteSystemCredentials();
                CredentialsManager.DeleteCredentials();
            }
            ActionManager.CleanActionList();
            Credentials = CredentialsManager.GetAllCredentials();
            IsInLogin   = true;
            LocationManager.StopLocalisation();
            LocationService.RemoveLocationListener(GeofenceManager);
            GeofenceManager = null;
            LocationService.RemoveLocationListener(LocationManager);
            NotificationManager.RemoveAllNotificationListener();
            NetworkManager.RemoveNetworkStateListener(ImageHelper);

            MainPage.Navigation.PopToRootAsync();
        }