private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { if (e.Exception is Exception ex) { LogStatic.Exception(ex); } else { LogStatic.Message("an empty DispatcherUnhandledException was thrown"); } }
public static int Main() { App app = new App(); int exitCode = app.Run(); if (exitCode != 0) { string message = string.Format(CultureInfo.CurrentCulture, "exited with code {0}", exitCode); LogStatic.Message(message); } return(exitCode); }