From b4e1e342024f0c751a58a8e2db32338f1c251fb8 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 25 Feb 2012 11:15:07 +0100 Subject: [PATCH] add Continue button to DebuggeeExceptionForm --- .../Service/DebuggeeExceptionForm.Designer.cs | 20 +++++++++++++++++-- .../Service/DebuggeeExceptionForm.cs | 11 +++++++++- .../Service/DebuggeeExceptionForm.resx | 4 ++-- .../Debugger.AddIn/Service/WindowsDebugger.cs | 2 +- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.Designer.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.Designer.cs index d54478bc11..109aada6f7 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.Designer.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.Designer.cs @@ -21,6 +21,7 @@ namespace ICSharpCode.SharpDevelop.Services this.exceptionView = new System.Windows.Forms.RichTextBox(); this.btnStop = new System.Windows.Forms.Button(); this.btnBreak = new System.Windows.Forms.Button(); + this.btnContinue = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); this.SuspendLayout(); // @@ -60,7 +61,7 @@ namespace ICSharpCode.SharpDevelop.Services // this.btnStop.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.btnStop.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnStop.Location = new System.Drawing.Point(340, 366); + this.btnStop.Location = new System.Drawing.Point(385, 366); this.btnStop.Name = "btnStop"; this.btnStop.Size = new System.Drawing.Size(115, 30); this.btnStop.TabIndex = 3; @@ -73,7 +74,7 @@ namespace ICSharpCode.SharpDevelop.Services // this.btnBreak.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.btnBreak.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnBreak.Location = new System.Drawing.Point(219, 366); + this.btnBreak.Location = new System.Drawing.Point(143, 366); this.btnBreak.Name = "btnBreak"; this.btnBreak.Size = new System.Drawing.Size(115, 30); this.btnBreak.TabIndex = 4; @@ -82,9 +83,23 @@ namespace ICSharpCode.SharpDevelop.Services this.btnBreak.UseVisualStyleBackColor = true; this.btnBreak.Click += new System.EventHandler(this.BtnBreakClick); // + // btnContinue + // + this.btnContinue.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.btnContinue.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnContinue.Location = new System.Drawing.Point(264, 366); + this.btnContinue.Name = "btnContinue"; + this.btnContinue.Size = new System.Drawing.Size(115, 30); + this.btnContinue.TabIndex = 5; + this.btnContinue.Text = "Continue"; + this.btnContinue.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.btnContinue.UseVisualStyleBackColor = true; + this.btnContinue.Click += new System.EventHandler(this.BtnContinueClick); + // // DebuggeeExceptionForm // this.ClientSize = new System.Drawing.Size(642, 399); + this.Controls.Add(this.btnContinue); this.Controls.Add(this.btnBreak); this.Controls.Add(this.btnStop); this.Controls.Add(this.exceptionView); @@ -96,6 +111,7 @@ namespace ICSharpCode.SharpDevelop.Services ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.ResumeLayout(false); } + private System.Windows.Forms.Button btnContinue; private System.Windows.Forms.Button btnBreak; private System.Windows.Forms.Button btnStop; private System.Windows.Forms.RichTextBox exceptionView; diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs index eca5787f6a..bf6a5db7f4 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.cs @@ -38,9 +38,11 @@ namespace ICSharpCode.SharpDevelop.Services this.btnBreak.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Break}"); this.btnStop.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Terminate}"); + this.btnContinue.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Continue}"); this.btnBreak.Image = WinFormsResourceService.GetBitmap("Icons.16x16.Debug.Break"); this.btnStop.Image = WinFormsResourceService.GetBitmap("Icons.16x16.StopProcess"); + this.btnContinue.Image = WinFormsResourceService.GetBitmap("Icons.16x16.Debug.Continue"); } void ProcessHandler(object sender, EventArgs e) @@ -54,13 +56,14 @@ namespace ICSharpCode.SharpDevelop.Services this.process.Resumed -= ProcessHandler; } - public static void Show(Process process, string title, string message, string stacktrace, Bitmap icon) + public static void Show(Process process, string title, string message, string stacktrace, Bitmap icon, bool canContinue) { DebuggeeExceptionForm form = new DebuggeeExceptionForm(process); form.Text = title; form.pictureBox.Image = icon; form.lblExceptionText.Text = message; form.exceptionView.Text = stacktrace; + form.btnContinue.Enabled = canContinue; form.Show(WorkbenchSingleton.MainWin32Window); } @@ -105,5 +108,11 @@ namespace ICSharpCode.SharpDevelop.Services this.process.Terminate(); Close(); } + + void BtnContinueClick(object sender, EventArgs e) + { + this.process.Continue(); + Close(); + } } } diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.resx b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.resx index 7080a7d118..1af7de150c 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.resx +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/DebuggeeExceptionForm.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs b/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs index 4866d12fed..36aec4378d 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs @@ -878,7 +878,7 @@ namespace ICSharpCode.SharpDevelop.Services string message = string.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Message}"), e.Exception.Type); Bitmap icon = WinFormsResourceService.GetBitmap(e.IsUnhandled ? "Icons.32x32.Error" : "Icons.32x32.Warning"); - DebuggeeExceptionForm.Show(debuggedProcess, title, message, stacktraceBuilder.ToString(), icon); + DebuggeeExceptionForm.Show(debuggedProcess, title, message, stacktraceBuilder.ToString(), icon, !e.IsUnhandled); } public void JumpToCurrentLine()