rename, part 1

This commit is contained in:
bao-qian
2016-05-20 19:38:38 +01:00
parent 7490cb81b8
commit e4c7842f34
3 changed files with 0 additions and 0 deletions

63
Wox/ReportWindow.xaml.cs Normal file
View File

@@ -0,0 +1,63 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
using Exceptionless;
using Wox.Core.Resource;
using Wox.Infrastructure;
namespace Wox.CrashReporter
{
internal partial class ReportWindow
{
private Exception exception;
public ReportWindow(Exception exception)
{
this.exception = exception;
InitializeComponent();
SetException(exception);
}
private void SetException(Exception exception)
{
tbSummary.AppendText(exception.Message);
tbVersion.Text = Infrastructure.Constant.Version;
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)
{
string sendingMsg = InternationalizationManager.Instance.GetTranslation("reportWindow_sending");
tbSendReport.Content = sendingMsg;
btnSend.IsEnabled = false;
SendReport();
}
private void SendReport()
{
Hide();
Task.Run(() =>
{
string reproduceSteps = new TextRange(tbReproduceSteps.Document.ContentStart, tbReproduceSteps.Document.ContentEnd).Text;
exception.ToExceptionless()
.SetUserDescription(reproduceSteps)
.Submit();
ExceptionlessClient.Current.ProcessQueue();
Dispatcher.Invoke(() =>
{
Close();
});
});
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}