private void System_ErrorOccured(object sender, ErrorArgs e) { OnError(e); if( e.Fatal ) Application.Current.Shutdown(); } private void System_WarningOccured(object sender, WarningArgs e) {