OSDN Git Service

7d18fc1a392f3b3720ce63feef7ca25983eb2405
[handbrake-jp/handbrake-jp-git.git] / win / C# / HandBrake.ApplicationServices / Views / ExceptionWindow.cs
1 /*  frmExceptionWindow.cs $\r
2     This file is part of the HandBrake source code.\r
3     Homepage: <http://handbrake.fr>.\r
4     It may be used under the terms of the GNU General Public License. */\r
5 \r
6 namespace HandBrake.ApplicationServices.Views\r
7 {\r
8     using System;\r
9     using System.Windows.Forms;\r
10 \r
11     /// <summary>\r
12     /// A window to display Exceptions in a form which can be easily copied and reported by users.\r
13     /// </summary>\r
14     public partial class ExceptionWindow : Form\r
15     {\r
16         /// <summary>\r
17         /// Initializes a new instance of the <see cref="ExceptionWindow"/> class.\r
18         /// </summary>\r
19         public ExceptionWindow()\r
20         {\r
21             InitializeComponent();\r
22         }\r
23 \r
24         /// <summary>\r
25         /// Setup the window with the error message.\r
26         /// </summary>\r
27         /// <param name="shortError">\r
28         /// The short error.\r
29         /// </param>\r
30         /// <param name="longError">\r
31         /// The long error.\r
32         /// </param>\r
33         public void Setup(string shortError, string longError)\r
34         {\r
35             lbl_shortError.Text = shortError;\r
36             rtf_exceptionFull.Text = shortError + Environment.NewLine + longError;\r
37         }\r
38 \r
39         /// <summary>\r
40         /// Copy the Exception Information to the Clipboard.\r
41         /// </summary>\r
42         /// <param name="sender">\r
43         /// The sender.\r
44         /// </param>\r
45         /// <param name="e">\r
46         /// The e.\r
47         /// </param>\r
48         private void BtnCopyClick(object sender, EventArgs e)\r
49         {\r
50             Clipboard.SetDataObject(rtf_exceptionFull.SelectedText != string.Empty ? rtf_exceptionFull.SelectedText : rtf_exceptionFull.Text, true);\r
51         }\r
52 \r
53         /// <summary>\r
54         /// Copy from the right click menu\r
55         /// </summary>\r
56         /// <param name="sender">\r
57         /// The sender.\r
58         /// </param>\r
59         /// <param name="e">\r
60         /// The e.\r
61         /// </param>\r
62         private void MnuCopyLogClick(object sender, EventArgs e)\r
63         {\r
64             Clipboard.SetDataObject(rtf_exceptionFull.SelectedText != string.Empty ? rtf_exceptionFull.SelectedText : rtf_exceptionFull.Text, true);\r
65         } \r
66 \r
67         /// <summary>\r
68         /// Close the window\r
69         /// </summary>\r
70         /// <param name="sender">\r
71         /// The sender.\r
72         /// </param>\r
73         /// <param name="e">\r
74         /// The e.\r
75         /// </param>\r
76         private void BtnCloseClick(object sender, EventArgs e)\r
77         {\r
78             this.Close();\r
79         }\r
80     }\r
81 }\r