Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4043 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
9 changed files with 277 additions and 351 deletions
@ -1,155 +0,0 @@
@@ -1,155 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
#region License
|
||||
//
|
||||
// Copyright (c) 2007, ic#code
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the ic#code nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without
|
||||
// specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
#endregion
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
|
||||
namespace ICSharpCode.SharpDevelop.Services |
||||
{ |
||||
partial class DebugeeExceptionForm : DebuggerEventForm |
||||
{ |
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.exceptionDetails = new Aga.Controls.Tree.TreeViewAdv(); |
||||
this.linkExceptionDetail = new System.Windows.Forms.LinkLabel(); |
||||
this.splitContainer = new System.Windows.Forms.SplitContainer(); |
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); |
||||
this.splitContainer.Panel1.SuspendLayout(); |
||||
this.splitContainer.Panel2.SuspendLayout(); |
||||
this.splitContainer.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// buttonBreak
|
||||
//
|
||||
this.buttonBreak.Location = new System.Drawing.Point(176, 349); |
||||
//
|
||||
// buttonContinue
|
||||
//
|
||||
this.buttonContinue.Location = new System.Drawing.Point(274, 349); |
||||
//
|
||||
// buttonTerminate
|
||||
//
|
||||
this.buttonTerminate.Location = new System.Drawing.Point(372, 349); |
||||
//
|
||||
// textBox
|
||||
//
|
||||
this.textBox.Size = new System.Drawing.Size(542, 139); |
||||
//
|
||||
// exceptionDetails
|
||||
//
|
||||
this.exceptionDetails.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
||||
| System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.exceptionDetails.AutoRowHeight = true; |
||||
this.exceptionDetails.BackColor = System.Drawing.SystemColors.Window; |
||||
this.exceptionDetails.DefaultToolTipProvider = null; |
||||
this.exceptionDetails.DragDropMarkColor = System.Drawing.Color.Black; |
||||
this.exceptionDetails.LineColor = System.Drawing.SystemColors.ControlDark; |
||||
this.exceptionDetails.LoadOnDemand = true; |
||||
this.exceptionDetails.Location = new System.Drawing.Point(3, 4); |
||||
this.exceptionDetails.Model = null; |
||||
this.exceptionDetails.Name = "exceptionDetails"; |
||||
this.exceptionDetails.SelectedNode = null; |
||||
this.exceptionDetails.Size = new System.Drawing.Size(539, 153); |
||||
this.exceptionDetails.TabIndex = 4; |
||||
this.exceptionDetails.UseColumns = true; |
||||
//
|
||||
// linkExceptionDetail
|
||||
//
|
||||
this.linkExceptionDetail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); |
||||
this.linkExceptionDetail.Location = new System.Drawing.Point(3, 142); |
||||
this.linkExceptionDetail.Name = "linkExceptionDetail"; |
||||
this.linkExceptionDetail.Size = new System.Drawing.Size(543, 23); |
||||
this.linkExceptionDetail.TabIndex = 5; |
||||
this.linkExceptionDetail.TabStop = true; |
||||
this.linkExceptionDetail.Text = "${res:MainWindow.Windows.Debug.ExceptionForm.ShowExceptionDetails}"; |
||||
this.linkExceptionDetail.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkExceptionDetailLinkClicked); |
||||
//
|
||||
// splitContainer
|
||||
//
|
||||
this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
||||
| System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.splitContainer.Location = new System.Drawing.Point(76, 16); |
||||
this.splitContainer.Name = "splitContainer"; |
||||
this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; |
||||
//
|
||||
// splitContainer.Panel1
|
||||
//
|
||||
this.splitContainer.Panel1.Controls.Add(this.linkExceptionDetail); |
||||
//
|
||||
// splitContainer.Panel2
|
||||
//
|
||||
this.splitContainer.Panel2.Controls.Add(this.exceptionDetails); |
||||
this.splitContainer.Size = new System.Drawing.Size(550, 327); |
||||
this.splitContainer.SplitterDistance = 163; |
||||
this.splitContainer.TabIndex = 6; |
||||
//
|
||||
// DebugeeExceptionForm
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(638, 399); |
||||
this.Controls.Add(this.splitContainer); |
||||
this.Name = "DebugeeExceptionForm"; |
||||
this.Resize += new System.EventHandler(this.debugeeExceptionFormResize); |
||||
this.Controls.SetChildIndex(this.splitContainer, 0); |
||||
this.Controls.SetChildIndex(this.textBox, 0); |
||||
this.Controls.SetChildIndex(this.buttonBreak, 0); |
||||
this.Controls.SetChildIndex(this.buttonContinue, 0); |
||||
this.Controls.SetChildIndex(this.buttonTerminate, 0); |
||||
this.Controls.SetChildIndex(this.pictureBox, 0); |
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); |
||||
this.splitContainer.Panel1.ResumeLayout(false); |
||||
this.splitContainer.Panel2.ResumeLayout(false); |
||||
this.splitContainer.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
this.PerformLayout(); |
||||
} |
||||
private Aga.Controls.Tree.TreeViewAdv exceptionDetails; |
||||
private System.Windows.Forms.SplitContainer splitContainer; |
||||
private System.Windows.Forms.LinkLabel linkExceptionDetail; |
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,163 +0,0 @@
@@ -1,163 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
#region License
|
||||
//
|
||||
// Copyright (c) 2007, ic#code
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the ic#code nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without
|
||||
// specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
#endregion
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
using Aga.Controls.Tree; |
||||
using Aga.Controls.Tree.NodeControls; |
||||
using Debugger; |
||||
using Debugger.AddIn.TreeModel; |
||||
using Debugger.Expressions; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Services |
||||
{ |
||||
internal sealed partial class DebugeeExceptionForm |
||||
{ |
||||
private DebugeeExceptionForm() |
||||
{ |
||||
InitializeComponent(); |
||||
|
||||
// Windows form designer cannot place a component declared in a base class in a container component
|
||||
// declared in a child class. Hence we do it manually.
|
||||
Controls.Remove(textBox); |
||||
textBox.Location = new Point(0, 4); |
||||
splitContainer.Panel1.Controls.Add(textBox); |
||||
|
||||
// To make the exceptionDetails size properly, it must be rendered full size in the designer.
|
||||
// To get the text right we set the panel to the opposite of what we want and then fire linkExceptionDetail.Click().
|
||||
splitContainer.Panel2Collapsed = DebuggingOptions.Instance.ShowExceptionDetails; |
||||
DebuggingOptions.Instance.ShowExceptionDetails = ! DebuggingOptions.Instance.ShowExceptionDetails; |
||||
linkExceptionDetailLinkClicked(linkExceptionDetail, new EventArgs()); |
||||
|
||||
WindowState = DebuggingOptions.Instance.DebuggeeExceptionWindowState; |
||||
Size = DebuggingOptions.Instance.DebuggeeExceptionWindowSize; |
||||
|
||||
splitContainer.SplitterDistance = DebuggingOptions.Instance.DebugeeExceptionSplitterDistance; |
||||
// Set this here so it doesnt fire on startup replacing the saved value with a default.
|
||||
this.splitContainer.SplitterMoved += new SplitterEventHandler(this.splitContainerMoved); |
||||
|
||||
InitializeExceptionDetails(); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Setup the columns for the exceptionDetails.
|
||||
/// </summary>
|
||||
private void InitializeExceptionDetails() { |
||||
NodeIcon iconControl = new ItemIcon(); |
||||
NodeTextBox nameControl = new ItemName(); |
||||
NodeTextBox textControl = new ItemText(); |
||||
NodeTextBox typeControl = new ItemType(); |
||||
|
||||
TreeColumn nameColumn = new TreeColumn(); |
||||
TreeColumn valColumn = new TreeColumn(); |
||||
TreeColumn typeColumn = new TreeColumn(); |
||||
|
||||
exceptionDetails.Columns.Add(nameColumn); |
||||
exceptionDetails.Columns.Add(valColumn); |
||||
exceptionDetails.Columns.Add(typeColumn); |
||||
exceptionDetails.UseColumns = true; |
||||
exceptionDetails.SelectionMode = TreeSelectionMode.Single; |
||||
exceptionDetails.LoadOnDemand = true; |
||||
|
||||
iconControl.ParentColumn = nameColumn; |
||||
exceptionDetails.NodeControls.Add(iconControl); |
||||
|
||||
nameControl.ParentColumn = nameColumn; |
||||
exceptionDetails.NodeControls.Add(nameControl); |
||||
|
||||
textControl.ParentColumn = valColumn; |
||||
exceptionDetails.NodeControls.Add(textControl); |
||||
|
||||
typeControl.ParentColumn = typeColumn; |
||||
exceptionDetails.NodeControls.Add(typeControl); |
||||
|
||||
nameColumn.Header = ResourceService.GetString("Global.Name"); |
||||
nameColumn.Width = 165; |
||||
valColumn.Header = ResourceService.GetString("Dialog.HighlightingEditor.Properties.Value"); |
||||
valColumn.Width = 200; |
||||
typeColumn.Header = ResourceService.GetString("ResourceEditor.ResourceEdit.TypeColumn"); |
||||
typeColumn.Width = 170; |
||||
} |
||||
|
||||
public static Result Show(Process process, string title, string message, Bitmap icon, bool canContinue) |
||||
{ |
||||
using (DebugeeExceptionForm form = new DebugeeExceptionForm()) { |
||||
form.Text = title; |
||||
form.pictureBox.Image = icon; |
||||
form.textBox.Text = message; |
||||
|
||||
IList<AbstractNode> exceptionNodes = new List<AbstractNode>(); |
||||
exceptionNodes.Add(ValueNode.Create(new CurrentExceptionExpression())); |
||||
|
||||
form.exceptionDetails.BeginUpdate(); |
||||
TreeViewVarNode.SetContentRecursive(process, form.exceptionDetails, exceptionNodes); |
||||
form.exceptionDetails.EndUpdate(); |
||||
form.exceptionDetails.Refresh(); |
||||
|
||||
form.buttonContinue.Enabled = canContinue; |
||||
form.ShowDialog(WorkbenchSingleton.MainForm); |
||||
return form.result; |
||||
} |
||||
} |
||||
|
||||
void debugeeExceptionFormResize(object sender, EventArgs e) |
||||
{ |
||||
DebuggingOptions.Instance.DebuggeeExceptionWindowSize = Size; |
||||
DebuggingOptions.Instance.DebuggeeExceptionWindowState = WindowState; |
||||
} |
||||
|
||||
void linkExceptionDetailLinkClicked(object sender, EventArgs e) |
||||
{ |
||||
splitContainer.Panel2Collapsed = ! splitContainer.Panel2Collapsed; |
||||
DebuggingOptions.Instance.ShowExceptionDetails = ! splitContainer.Panel2Collapsed; |
||||
linkExceptionDetail.Text = splitContainer.Panel2Collapsed |
||||
? StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.ShowExceptionDetails}") |
||||
: StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.HideExceptionDetails}"); |
||||
} |
||||
|
||||
void splitContainerMoved(object sender, EventArgs e) |
||||
{ |
||||
DebuggingOptions.Instance.DebugeeExceptionSplitterDistance = splitContainer.SplitterDistance; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,110 @@
@@ -0,0 +1,110 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
#region License
|
||||
//
|
||||
// Copyright (c) 2007, ic#code
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the ic#code nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without
|
||||
// specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
#endregion
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
|
||||
namespace ICSharpCode.SharpDevelop.Services |
||||
{ |
||||
partial class DebuggeeExceptionForm : Form |
||||
{ |
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.pictureBox = new System.Windows.Forms.PictureBox(); |
||||
this.lblExceptionText = new System.Windows.Forms.Label(); |
||||
this.exceptionView = new System.Windows.Forms.RichTextBox(); |
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// pictureBox
|
||||
//
|
||||
this.pictureBox.Location = new System.Drawing.Point(12, 12); |
||||
this.pictureBox.Name = "pictureBox"; |
||||
this.pictureBox.Size = new System.Drawing.Size(48, 52); |
||||
this.pictureBox.TabIndex = 0; |
||||
this.pictureBox.TabStop = false; |
||||
//
|
||||
// lblExceptionText
|
||||
//
|
||||
this.lblExceptionText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.lblExceptionText.Location = new System.Drawing.Point(66, 12); |
||||
this.lblExceptionText.Name = "lblExceptionText"; |
||||
this.lblExceptionText.Size = new System.Drawing.Size(560, 52); |
||||
this.lblExceptionText.TabIndex = 1; |
||||
this.lblExceptionText.Text = "Exception Message Text"; |
||||
//
|
||||
// exceptionView
|
||||
//
|
||||
this.exceptionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
||||
| System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.exceptionView.BackColor = System.Drawing.SystemColors.Control; |
||||
this.exceptionView.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); |
||||
this.exceptionView.Location = new System.Drawing.Point(12, 70); |
||||
this.exceptionView.Name = "exceptionView"; |
||||
this.exceptionView.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedBoth; |
||||
this.exceptionView.Size = new System.Drawing.Size(614, 317); |
||||
this.exceptionView.TabIndex = 2; |
||||
this.exceptionView.Text = ""; |
||||
//
|
||||
// DebuggeeExceptionForm
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(638, 399); |
||||
this.Controls.Add(this.exceptionView); |
||||
this.Controls.Add(this.lblExceptionText); |
||||
this.Controls.Add(this.pictureBox); |
||||
this.Name = "DebuggeeExceptionForm"; |
||||
this.Resize += new System.EventHandler(this.debugeeExceptionFormResize); |
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); |
||||
this.ResumeLayout(false); |
||||
} |
||||
private System.Windows.Forms.RichTextBox exceptionView; |
||||
private System.Windows.Forms.Label lblExceptionText; |
||||
private System.Windows.Forms.PictureBox pictureBox; |
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -0,0 +1,151 @@
@@ -0,0 +1,151 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
#region License
|
||||
//
|
||||
// Copyright (c) 2007, ic#code
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the ic#code nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without
|
||||
// specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
#endregion
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
using Aga.Controls.Tree; |
||||
using Aga.Controls.Tree.NodeControls; |
||||
using Debugger; |
||||
using Debugger.AddIn.TreeModel; |
||||
using Debugger.Expressions; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Services |
||||
{ |
||||
internal sealed partial class DebuggeeExceptionForm |
||||
{ |
||||
Process process; |
||||
bool active; |
||||
|
||||
DebuggeeExceptionForm(Process process) |
||||
{ |
||||
InitializeComponent(); |
||||
|
||||
this.process = process; |
||||
|
||||
this.process.Exited += ProcessHandler; |
||||
this.process.Resumed += ProcessHandler; |
||||
|
||||
this.FormClosed += FormClosedHandler; |
||||
this.Activated += delegate { this.active = true; this.Opacity = 1; }; |
||||
this.Deactivate += delegate { this.active = false; this.Opacity = DebuggingOptions.Instance.DebuggeeExceptionWindowOpacity; }; |
||||
|
||||
this.WindowState = DebuggingOptions.Instance.DebuggeeExceptionWindowState; |
||||
FormLocationHelper.Apply(this, "DebuggeeExceptionForm", true); |
||||
|
||||
this.Opacity = DebuggingOptions.Instance.DebuggeeExceptionWindowOpacity; |
||||
|
||||
this.MouseLeave += FormLeave; |
||||
this.MouseEnter += FormEnter; |
||||
this.lblExceptionText.MouseEnter += FormEnter; |
||||
this.pictureBox.MouseEnter += FormEnter; |
||||
this.exceptionView.MouseEnter += FormEnter; |
||||
|
||||
this.MinimizeBox = this.MaximizeBox = this.ShowIcon = false; |
||||
|
||||
this.exceptionView.DoubleClick += ExceptionViewDoubleClick; |
||||
} |
||||
|
||||
void ProcessHandler(object sender, EventArgs e) |
||||
{ |
||||
this.Close(); |
||||
} |
||||
|
||||
void FormEnter(object sender, EventArgs e) |
||||
{ |
||||
this.Opacity = 1; |
||||
} |
||||
|
||||
void FormLeave(object sender, EventArgs e) |
||||
{ |
||||
if (!this.active) |
||||
this.Opacity = DebuggingOptions.Instance.DebuggeeExceptionWindowOpacity; |
||||
} |
||||
|
||||
void FormClosedHandler(object sender, EventArgs e) |
||||
{ |
||||
this.process.Exited -= ProcessHandler; |
||||
this.process.Resumed -= ProcessHandler; |
||||
} |
||||
|
||||
public static void Show(Process process, string title, string message, string stacktrace, Bitmap icon) |
||||
{ |
||||
DebuggeeExceptionForm form = new DebuggeeExceptionForm(process); |
||||
form.Text = title; |
||||
form.pictureBox.Image = icon; |
||||
form.lblExceptionText.Text = message; |
||||
form.exceptionView.Text = stacktrace; |
||||
|
||||
form.Show(WorkbenchSingleton.MainForm); |
||||
} |
||||
|
||||
void ExceptionViewDoubleClick(object sender, EventArgs e) |
||||
{ |
||||
string fullText = exceptionView.Text; |
||||
// Any text?
|
||||
if (fullText.Length > 0) { |
||||
//int line = textEditorControl.ActiveTextAreaControl.Caret.Line;
|
||||
//string textLine = TextUtilities.GetLineAsString(textEditorControl.Document, line);
|
||||
Point clickPos = exceptionView.PointToClient(Control.MousePosition); |
||||
int index = exceptionView.GetCharIndexFromPosition(clickPos); |
||||
int start = index; |
||||
// find start of current line
|
||||
while (--start > 0 && fullText[start - 1] != '\n'); |
||||
// find end of current line
|
||||
while (++index < fullText.Length && fullText[index] != '\n'); |
||||
|
||||
string textLine = fullText.Substring(start, index - start); |
||||
|
||||
FileLineReference lineReference = OutputTextLineParser.GetFileLineReference(textLine); |
||||
if (lineReference != null) { |
||||
// Open matching file.
|
||||
FileService.JumpToFilePosition(lineReference.FileName, lineReference.Line, lineReference.Column); |
||||
} |
||||
} |
||||
} |
||||
|
||||
void debugeeExceptionFormResize(object sender, EventArgs e) |
||||
{ |
||||
DebuggingOptions.Instance.DebuggeeExceptionWindowState = WindowState; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue