|
|
|
@ -9,6 +9,7 @@ using System; |
|
|
|
using System.Drawing; |
|
|
|
using System.Drawing; |
|
|
|
using System.Windows.Forms; |
|
|
|
using System.Windows.Forms; |
|
|
|
using Debugger; |
|
|
|
using Debugger; |
|
|
|
|
|
|
|
using ICSharpCode.Core; |
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
using ICSharpCode.SharpDevelop.Gui.TreeGrid; |
|
|
|
using ICSharpCode.SharpDevelop.Gui.TreeGrid; |
|
|
|
|
|
|
|
|
|
|
|
@ -23,6 +24,7 @@ namespace ICSharpCode.SharpDevelop.Services |
|
|
|
// 3 = value
|
|
|
|
// 3 = value
|
|
|
|
|
|
|
|
|
|
|
|
Variable variable; |
|
|
|
Variable variable; |
|
|
|
|
|
|
|
Image image; |
|
|
|
|
|
|
|
|
|
|
|
public Variable Variable { |
|
|
|
public Variable Variable { |
|
|
|
get { |
|
|
|
get { |
|
|
|
@ -42,23 +44,35 @@ namespace ICSharpCode.SharpDevelop.Services |
|
|
|
if (variable == null) throw new ArgumentNullException("variable"); |
|
|
|
if (variable == null) throw new ArgumentNullException("variable"); |
|
|
|
|
|
|
|
|
|
|
|
this.variable = variable; |
|
|
|
this.variable = variable; |
|
|
|
|
|
|
|
this.variable.ValueChanged += delegate { Update(); }; |
|
|
|
|
|
|
|
|
|
|
|
this[1].Paint += OnIconPaint; |
|
|
|
this[1].Paint += OnIconPaint; |
|
|
|
this[2].Text = variable.Name; |
|
|
|
|
|
|
|
this[3].Text = variable.Value.AsString; |
|
|
|
|
|
|
|
this[3].FinishLabelEdit += OnLabelEdited; |
|
|
|
this[3].FinishLabelEdit += OnLabelEdited; |
|
|
|
if (variable.Value is PrimitiveValue && variable.Value.ManagedType != typeof(string)) { |
|
|
|
if (variable.Value is PrimitiveValue && variable.Value.ManagedType != typeof(string)) { |
|
|
|
this[3].AllowLabelEdit = true; |
|
|
|
this[3].AllowLabelEdit = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!variable.Value.MayHaveSubVariables) |
|
|
|
if (!variable.Value.MayHaveSubVariables) { |
|
|
|
this.ShowPlus = false; |
|
|
|
this.ShowPlus = false; |
|
|
|
|
|
|
|
} |
|
|
|
this.ShowMinusWhileExpanded = true; |
|
|
|
this.ShowMinusWhileExpanded = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Update(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Update() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
image = DebuggerIcons.GetImage(variable); |
|
|
|
|
|
|
|
this[1].Text = ""; // Icon
|
|
|
|
|
|
|
|
this[2].Text = variable.Name; |
|
|
|
|
|
|
|
this[3].Text = variable.Value.AsString; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void OnIconPaint(object sender, ItemPaintEventArgs e) |
|
|
|
void OnIconPaint(object sender, ItemPaintEventArgs e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
e.Graphics.DrawImageUnscaled(DebuggerIcons.GetImage(variable), e.ClipRectangle); |
|
|
|
if (image != null) { |
|
|
|
|
|
|
|
e.Graphics.DrawImageUnscaled(image, e.ClipRectangle); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void OnLabelEdited(object sender, DynamicListEventArgs e) |
|
|
|
void OnLabelEdited(object sender, DynamicListEventArgs e) |
|
|
|
@ -71,5 +85,19 @@ namespace ICSharpCode.SharpDevelop.Services |
|
|
|
MessageBox.Show(WorkbenchSingleton.MainForm, "Can not covert " + newValue + " to " + val.ManagedType.ToString(), "Can not set value"); |
|
|
|
MessageBox.Show(WorkbenchSingleton.MainForm, "Can not covert " + newValue + " to " + val.ManagedType.ToString(), "Can not set value"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Called when plus is pressed in debugger tooltip.
|
|
|
|
|
|
|
|
/// Sets the data to be show in the next level.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
protected override void OnExpanding(DynamicListEventArgs e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
this.ChildRows.Clear(); |
|
|
|
|
|
|
|
foreach(Variable variable in this.Variable.SubVariables) { |
|
|
|
|
|
|
|
DynamicTreeDebuggerRow newRow = new DynamicTreeDebuggerRow(variable); |
|
|
|
|
|
|
|
DebuggerGridControl.AddColumns(newRow.ChildColumns); |
|
|
|
|
|
|
|
this.ChildRows.Add(newRow); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|