static void UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (e.ExceptionObject is Exception) LogException((Exception)e.ExceptionObject); }