public async void FillUpMap(bool forceRefresh) { if (loading) { return; } loading = true; if (pane != null && pane.Opened) { pane.SetState(InfoPane.State.Closed, animated: false); } flashBar.ShowLoading(); try { var stations = await hubway.GetStations(forceRefresh); if (stations.Length == 0) { Toast.MakeText(Activity, Resource.String.load_error, ToastLength.Long).Show(); } else { await SetMapStationPins(stations); } lastUpdateText.Text = "Last refreshed: " + DateTime.Now.ToShortTimeString(); } catch (Exception e) { e.Data ["method"] = "FillUpMaps"; Xamarin.Insights.Report(e); Android.Util.Log.Debug("DataFetcher", e.ToString()); } flashBar.ShowLoaded(); showedStale = false; loading = false; }
public async void FillUpMap(bool forceRefresh) { if (loading) { return; } loading = true; if (pane != null && pane.Opened) { pane.SetState(InfoPane.State.Closed, animated: false); } flashBar.ShowLoading(); try { var stations = await hubway.GetStations(forceRefresh); await SetMapStationPins(stations); lastUpdateText.Text = "Last refreshed: " + DateTime.Now.ToShortTimeString(); } catch (Exception e) { AnalyticsHelper.LogException("DataFetcher", e); Android.Util.Log.Debug("DataFetcher", e.ToString()); } flashBar.ShowLoaded(); showedStale = false; if (pendingSearchTerm != null) { OpenStationWithTerm(pendingSearchTerm); pendingSearchTerm = null; } loading = false; }
public async void FillUpMap(bool forceRefresh) { if (loading) { return; } loading = true; if (pane != null && pane.Opened) { pane.SetState(InfoPane.State.Closed, animated: false); } flashBar.ShowLoading(); using (var scope = ActivityScope.Of(Activity)) await DoFillUpMap(scope, forceRefresh); flashBar.ShowLoaded(); showedStale = false; if (pendingSearchTerm != null) { OpenStationWithTerm(pendingSearchTerm); pendingSearchTerm = null; } loading = false; }