Ejemplo n.º 1
0
        static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            string expMsg = NNTPServer.Traces.ExceptionToString(e.ExceptionObject as Exception);

            if (string.IsNullOrEmpty(expMsg))
            {
                expMsg = "<Unknown Exception>";
            }
            Traces.Main_TraceEvent(System.Diagnostics.TraceEventType.Critical, 1, "UnhandledException: {0}",
                                   expMsg);

            var    exp = e.ExceptionObject as Exception;
            string msg = "<Unknown>";

            if (exp != null)
            {
                msg = exp.Message;
            }

            var dlg = new SendDebugDataWindow();

            dlg.UnhandledExceptionMessage = msg;
            if (dlg.ShowDialog() == true)
            {
                try
                {
                    var app = (App)Current;
                    app.SendLogs(expMsg, dlg.UsersEMail, dlg.UsersDescription, dlg.UserSendEmail);
                }
                catch { }
                Environment.Exit(-1);
            }
        }
Ejemplo n.º 2
0
        private void OnSendDebugFilesExecute(object sender, ExecutedRoutedEventArgs e)
        {
            var app = (App)Application.Current;
            var dlg = new SendDebugDataWindow();

            dlg.Owner = this;
            if (dlg.ShowDialog() == true)
            {
                app.SendLogs(null, dlg.UsersEMail, dlg.UsersDescription, dlg.UserSendEmail);
            }
        }