1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
7
using System.Windows.Forms;
9
namespace ICSharpCode.Core.WinForms
12
/// Add summary description for SaveErrorInformDialog
14
sealed class SaveErrorInformDialog : System.Windows.Forms.Form
16
System.Windows.Forms.Label descriptionLabel;
17
System.Windows.Forms.TextBox descriptionTextBox;
18
System.Windows.Forms.Button exceptionButton;
19
System.Windows.Forms.Button okButton;
21
string displayMessage;
22
Exception exceptionGot;
24
public SaveErrorInformDialog(string fileName, string message, string dialogName, Exception exceptionGot)
26
this.Text = StringParser.Parse(dialogName);
27
// Must be called for initialization
28
this.InitializeComponent2();
29
RightToLeftConverter.ConvertRecursive(this);
31
displayMessage = StringParser.Parse(
33
new StringTagPair("FileName", fileName),
34
new StringTagPair("Path", Path.GetDirectoryName(fileName)),
35
new StringTagPair("FileNameWithoutPath", Path.GetFileName(fileName)),
36
new StringTagPair("Exception", exceptionGot.GetType().FullName)
38
descriptionTextBox.Lines = this.displayMessage.Split('\n');
40
this.exceptionGot = exceptionGot;
43
void ShowException(object sender, EventArgs e)
45
MessageService.ShowMessage(exceptionGot.ToString(), "Exception got");
49
/// This method was autogenerated - do not change the contents manually
51
private void InitializeComponent2()
54
// Set up generated class SaveErrorInformDialog
56
this.ClientSize = new Size(508, 320);
59
// Set up member descriptionLabel
61
this.descriptionLabel = new System.Windows.Forms.Label();
62
this.descriptionLabel.Location = new System.Drawing.Point(8, 8);
63
this.descriptionLabel.Size = new System.Drawing.Size(584, 24);
64
this.descriptionLabel.TabIndex = 3;
65
this.descriptionLabel.Anchor = (System.Windows.Forms.AnchorStyles.Top
66
| (System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right));
67
this.descriptionLabel.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
68
this.descriptionLabel.Text = StringParser.Parse("${res:ICSharpCode.Core.Services.ErrorDialogs.DescriptionLabel}");
69
this.descriptionLabel.Name = "descriptionLabel";
70
this.Controls.Add(descriptionLabel);
73
// Set up member descriptionTextBox
75
this.descriptionTextBox = new System.Windows.Forms.TextBox();
76
this.descriptionTextBox.Name = "descriptionTextBox";
77
this.descriptionTextBox.Multiline = true;
78
this.descriptionTextBox.Size = new System.Drawing.Size(584, 237);
79
this.descriptionTextBox.Location = new System.Drawing.Point(8, 40);
80
this.descriptionTextBox.TabIndex = 2;
81
this.descriptionTextBox.Anchor = (System.Windows.Forms.AnchorStyles.Top
82
| (System.Windows.Forms.AnchorStyles.Bottom
83
| (System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
84
this.descriptionTextBox.ReadOnly = true;
85
this.Controls.Add(descriptionTextBox);
88
// Set up member exceptionButton
90
this.exceptionButton = new System.Windows.Forms.Button();
91
this.exceptionButton.TabIndex = 1;
92
this.exceptionButton.Name = "exceptionButton";
93
this.exceptionButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
94
this.exceptionButton.Text = StringParser.Parse("${res:ICSharpCode.Core.Services.ErrorDialogs.ShowExceptionButton}");
95
this.exceptionButton.Size = new System.Drawing.Size(120, 27);
96
this.exceptionButton.Location = new System.Drawing.Point(372, 285);
97
this.exceptionButton.Click += new EventHandler(ShowException);
98
this.Controls.Add(exceptionButton);
101
// Set up member chooseLocationButton
103
this.okButton = new System.Windows.Forms.Button();
104
this.okButton.Name = "okButton";
105
this.okButton.TabIndex = 0;
106
this.okButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
107
this.okButton.Text = StringParser.Parse("${res:Global.OKButtonText}");
108
this.okButton.Size = new System.Drawing.Size(120, 27);
109
this.okButton.Location = new System.Drawing.Point(244, 285);
110
this.okButton.DialogResult = DialogResult.OK;
111
this.Controls.Add(okButton);
114
this.MaximizeBox = false;
115
this.Name = "SaveErrorInformDialog";
116
this.MinimizeBox = false;
117
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
118
this.ShowInTaskbar = false;
119
this.StartPosition = FormStartPosition.CenterScreen;
121
this.ResumeLayout(false);
122
this.Size = new System.Drawing.Size(526, 262);