ExceptionDispatchInfo GetCachedError() { try { var cache = exceptionCache; if (cache.Exception != null) { if (exceptionCache.CacheExpiryDateTime > DateTime.UtcNow) { return(cache.Exception); } } throw new Exception("Test"); } catch (Exception ex) { ExceptionDispatchInfo edi = ExceptionDispatchInfo.Capture(ex); exceptionCache = (edi, DateTime.UtcNow.AddSeconds(ExpirySeconds)); return(edi); } }
public void AdvanceSeconds(int seconds) { UtcNow = UtcNow.AddSeconds(seconds); }
private async Task ReturnEventPage_Clicked(object sender, EventArgs e) { await Task.Delay(3000); await Navigation.PushAsync(new EventsPage()); CrossLocalNotifications.Current.Show("New Event!", "A new content has posted.", 1, UtcNow.AddSeconds(8)); }