2015-01-11 21:52:30 +08:00
|
|
|
|
using System;
|
2015-01-16 23:42:12 +08:00
|
|
|
|
using System.Threading;
|
2015-01-11 21:52:30 +08:00
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Documents;
|
2015-02-08 16:27:41 +08:00
|
|
|
|
using Exceptionless;
|
2016-01-08 04:04:37 +08:00
|
|
|
|
using Wox.Core.Resource;
|
2015-01-27 21:51:29 +08:00
|
|
|
|
using Wox.Core.Updater;
|
2015-01-11 21:52:30 +08:00
|
|
|
|
|
|
|
|
|
namespace Wox.CrashReporter
|
|
|
|
|
{
|
2015-01-12 22:46:36 +08:00
|
|
|
|
internal partial class ReportWindow
|
2015-01-11 21:52:30 +08:00
|
|
|
|
{
|
|
|
|
|
private Exception exception;
|
|
|
|
|
|
|
|
|
|
public ReportWindow(Exception exception)
|
|
|
|
|
{
|
|
|
|
|
this.exception = exception;
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
SetException(exception);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetException(Exception exception)
|
|
|
|
|
{
|
|
|
|
|
tbSummary.AppendText(exception.Message);
|
2015-01-27 21:51:29 +08:00
|
|
|
|
tbVersion.Text = UpdaterManager.Instance.CurrentVersion.ToString();
|
2015-01-11 21:52:30 +08:00
|
|
|
|
tbDatetime.Text = DateTime.Now.ToString();
|
|
|
|
|
tbStackTrace.AppendText(exception.StackTrace);
|
|
|
|
|
tbSource.Text = exception.Source;
|
|
|
|
|
tbType.Text = exception.GetType().ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnSend_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
string sendingMsg = InternationalizationManager.Instance.GetTranslation("reportWindow_sending");
|
2015-01-12 22:46:36 +08:00
|
|
|
|
tbSendReport.Content = sendingMsg;
|
2015-01-11 21:52:30 +08:00
|
|
|
|
btnSend.IsEnabled = false;
|
2015-02-08 16:27:41 +08:00
|
|
|
|
SendReport();
|
2015-01-16 23:42:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SendReport()
|
|
|
|
|
{
|
2015-02-10 23:48:09 +08:00
|
|
|
|
Hide();
|
2015-02-09 19:16:13 +08:00
|
|
|
|
ThreadPool.QueueUserWorkItem(o =>
|
|
|
|
|
{
|
|
|
|
|
string reproduceSteps = new TextRange(tbReproduceSteps.Document.ContentStart, tbReproduceSteps.Document.ContentEnd).Text;
|
|
|
|
|
exception.ToExceptionless()
|
|
|
|
|
.SetUserDescription(reproduceSteps)
|
|
|
|
|
.Submit();
|
|
|
|
|
ExceptionlessClient.Current.ProcessQueue();
|
2016-01-07 05:34:42 +08:00
|
|
|
|
Dispatcher.Invoke(() =>
|
2015-02-09 19:16:13 +08:00
|
|
|
|
{
|
|
|
|
|
Close();
|
2016-01-07 05:34:42 +08:00
|
|
|
|
});
|
2015-02-09 19:16:13 +08:00
|
|
|
|
});
|
2015-01-11 21:52:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|