Browse Subversion Repository
Contents of /ErrorReportWindow.cs
Parent Directory
| Revision Log
Revision 9 -
( show annotations)
( download)
Thu Feb 24 14:12:19 2011 UTC
(13 years ago)
by aqua877
File size: 1334 byte(s)
エラー報告機能の実装
| 1 |
using System; |
| 2 |
using System.Collections.Generic; |
| 3 |
using System.ComponentModel; |
| 4 |
using System.Data; |
| 5 |
using System.Drawing; |
| 6 |
using System.Linq; |
| 7 |
using System.Text; |
| 8 |
using System.Windows.Forms; |
| 9 |
|
| 10 |
namespace Aqua877.WinApp.IronLivetube |
| 11 |
{ |
| 12 |
public partial class ErrorReportWindow : Form |
| 13 |
{ |
| 14 |
private Exception Error; |
| 15 |
public ErrorReportWindow(Exception error) |
| 16 |
{ |
| 17 |
this.Error = error; |
| 18 |
InitializeComponent(); |
| 19 |
} |
| 20 |
|
| 21 |
private void ReportErrorButton_Click(object sender, EventArgs e) |
| 22 |
{ |
| 23 |
ErrorReportHelper.ReportExceptionFinished += ret => |
| 24 |
{ |
| 25 |
if (ret) |
| 26 |
{ |
| 27 |
MessageBox.Show("エラー報告は完了しました。ご協力ありがとうございます。", "エラー報告完了", MessageBoxButtons.OK, MessageBoxIcon.Information); |
| 28 |
} |
| 29 |
else |
| 30 |
{ |
| 31 |
MessageBox.Show("エラー報告は正しく完了しませんでした。", "エラー報告失敗", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| 32 |
} |
| 33 |
this.Close(); |
| 34 |
}; |
| 35 |
|
| 36 |
ErrorReportHelper.ReportException(this.Error); |
| 37 |
} |
| 38 |
|
| 39 |
private void CloseButton_Click(object sender, EventArgs e) |
| 40 |
{ |
| 41 |
this.Close(); |
| 42 |
} |
| 43 |
|
| 44 |
private void ErrorReport_FormClosing(object sender, FormClosingEventArgs e) |
| 45 |
{ |
| 46 |
if (this.RestartIronLivetubeCheckBox.Checked) |
| 47 |
{ |
| 48 |
GlobalValues.RestartProgramTrigger = true; |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
} |
| |