Пример #1
0
        public void LogExceptionEventArgsTest()
        {
            var ex  = new Exception("foo");
            var arg = new LogExceptionEventArgs(ex, false, "bar");

            Assert.AreEqual(ex, arg.Ex);
            Assert.False(arg.LocalOnly);
            Assert.AreEqual("bar", arg.ErrorMessage);
        }
Пример #2
0
 private void ExceptionLogged(object aObj, [NotNull] LogExceptionEventArgs aEvent)
 {
     if (aEvent.ErrorMessage != null)
     {
         Dispatcher.InvokeAsync(() =>
         {
             // Show the error message in the app
             SetLastError(aEvent.ErrorMessage);
         });
         _toastTimer.Enabled = true;
     }
 }
Пример #3
0
 void LogHelper_OnError(object sender, LogExceptionEventArgs e)
 {
     _lastException = e.Exception;
 }
Пример #4
0
 private static void EventSink_LogException(LogExceptionEventArgs e)
 {                                                                                               // exception passed up from the server core
     try { LogException(e.Exception); }
     catch { Console.WriteLine("Nested exception while processing: {0}", e.Exception.Message); } // do not call LogException
 }
Пример #5
0
 void LogHelper_OnError(object sender, LogExceptionEventArgs e)
 {
     Console.WriteLine(e.Exception.ToString());
 }