Exemple #1
0
 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);
     }
 }
Exemple #2
0
 public void AdvanceSeconds(int seconds)
 {
     UtcNow = UtcNow.AddSeconds(seconds);
 }
Exemple #3
0
        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));
        }