Beispiel #1
0
        protected void OnSuspending(object sender, SuspendingEventArgs @event)
        {
            // Validate.
            if (@event is null)
            {
                throw new ArgumentNullException(nameof(@event));
            }

            // Delay
            var deferral = @event.SuspendingOperation.GetDeferral();

            try
            {
                // Save state
                SaveState();
            }
            catch (Exception error)
            {
                // Log error saving state then continue
                LocalErrorStore.Add(error);
            }
            finally
            {
                // End delay
                deferral.Complete();
            }
        }
Beispiel #2
0
        protected static void OnError(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs @event)
        {
            // Validate.
            if (@event is null)
            {
                throw new ArgumentNullException(nameof(@event));
            }

            // Store error to send later
            LocalErrorStore.Add(@event.Exception);
        }
Beispiel #3
0
 protected void OnResuming(object sender, object @event)
 {
     try
     {
         // Load state
         LoadState();
     }
     catch (Exception error)
     {
         // Log error restoring state then create new model
         LocalErrorStore.Add(error);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Logs unhandled errors.
 /// </summary>
 protected static void OnError(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs @event)
 {
     // Store error to send later
     LocalErrorStore.Add(@event.Exception);
 }