From 6e80d05d88dd8a2c4956a68c6829716b8ef94ad1 Mon Sep 17 00:00:00 2001
From: Matt Ward <ward.matt@gmail.com>
Date: Sat, 3 Jan 2009 17:25:44 +0000
Subject: [PATCH] Fixed SD2-1503. Invalid expression error message prompt
 displayed by watch window.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3740 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
---
 .../Debugger.AddIn/Project/Src/Pads/WatchPad.cs      | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs
index 2d7d91c268..4c3bb1d3b4 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs
@@ -45,6 +45,14 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
 		}
 	}
 	
+	public class ErrorInfoNode : ICorDebug.InfoNode
+	{
+		public ErrorInfoNode(string name, string text) : base(name, text)
+		{
+			Image = IconService.GetBitmap("Icons.16x16.Error");
+		}
+	}
+	
 	public sealed class WatchItemName: NodeTextBox {
 		public WatchItemName()
 		{
@@ -239,7 +247,9 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
 							
 							nodes.Add(new TreeViewVarNode(debuggedProcess, watchList, valNode));
 						} catch (GetValueException) {
-							MessageService.ShowError(string.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), nod.Content.Name));
+							string error = String.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), nod.Content.Name);
+							ErrorInfoNode infoNode = new ErrorInfoNode(nod.Content.Name, error);
+							nodes.Add(new TreeViewVarNode(debuggedProcess, watchList, infoNode));
 						}
 					}