Beispiel #1
0
        // Launches the startup task
        protected override async void OnResume()
        {
            base.OnResume();

            if (CheckInternet.HasConnexion() || CheckIsDownload())
            {
                MainThread.BeginInvokeOnMainThread(() =>
                {
                    SetContentView(Resource.Layout.splash);
                    mProgress            = FindViewById <ProgressBar>(Resource.Id.SplashProgressBar);
                    mProgress.Visibility = ViewStates.Visible;
                });
                SimulateStartup();
            }
            else
            {
                if (await CheckInternet.ShowMessageIfNotConnected(this) == Controller.ShowDialog.MessageResult.YES)
                {
                    OnResume();
                }
                else
                {
                    StopApplication();
                }
            }
        }
Beispiel #2
0
 private async void DownloadIfNecessary()
 {
     if (CheckInternet.HasConnexion() || CheckIsDownload())
     {
         ProgressBar.IsVisible = true;
         await SimulateStartup();
     }
     else
     {
         if (await DisplayAlert("Erreur",
                                "Pas de connection internet, activer le Wifi ou les données mobiles et rééssayer!",
                                "Réésayer",
                                "Quitter"))
         {
             DownloadIfNecessary();
         }
         else
         {
             StopApplication();
         }
     }
 }