Ejemplo n.º 1
0
 private void ApiListener_Success(object sender, object CovidResult)
 {
     DebugHelper.Method(MethodBase.GetCurrentMethod());
     if (CovidResult is CovidReport)
     {
         this.GlobalReport = (CovidReport)CovidResult;
         SharedPreferencesHandler.SaveGlobalReport(this, this.GlobalReport);
     }
     else if (CovidResult is IEnumerable <CovidCountryReport> )
     {
         this.CountriesReport = ((IEnumerable <CovidCountryReport>)CovidResult).ToList();
         if (this.HasCachedReport)
         {
             this.CountriesReport.LoadFavouritesFromPreferences(this);
         }
         SharedPreferencesHandler.SaveCountriesReport(this, this.CountriesReport);
     }
     else if (CovidResult is CountryTimeseriesContainer)
     {
         //@ToDo cache the timeseries. It's too big for SharedPreferences. Probably SQLite.
         //SharedPreferencesHandler.SaveCountryTimeseriesContainer(this, (CountryTimeseriesContainer)CovidResult);
     }
     if (this.AllDone)
     {
         GoToMain();
     }
 }
 protected override void OnPause()
 {
     DebugHelper.Method(MethodBase.GetCurrentMethod());
     base.OnPause();
     SharedPreferencesHandler.SaveCountriesReport(this, this.CountriesReport);
 }