Browse Source

Implemented SD2-663 - you can copy values from tooltips to clipborad;

Values of properties can not be edited

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1086 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
0be82e62dd
  1. 32
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs

32
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs

@ -53,6 +53,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -53,6 +53,7 @@ namespace ICSharpCode.SharpDevelop.Services
this[1].Paint += OnIconPaint;
this[3].FinishLabelEdit += OnLabelEdited;
this[3].MouseDown += OnMouseDown;
Update();
}
@ -68,13 +69,11 @@ namespace ICSharpCode.SharpDevelop.Services @@ -68,13 +69,11 @@ namespace ICSharpCode.SharpDevelop.Services
this[1].Text = ""; // Icon
this[2].Text = variable.Name;
this[3].Text = variable.Value.AsString;
if (variable.Value is PrimitiveValue && variable.Value.ManagedType != typeof(string)) {
this[3].AllowLabelEdit = true;
}
this[3].AllowLabelEdit = variable.Value is PrimitiveValue &&
variable.Value.ManagedType != typeof(string) &&
!(variable is PropertyVariable);
if (!variable.Value.MayHaveSubVariables) {
this.ShowPlus = false;
}
this.ShowPlus = variable.Value.MayHaveSubVariables;
this.ShowMinusWhileExpanded = true;
}
@ -96,6 +95,27 @@ namespace ICSharpCode.SharpDevelop.Services @@ -96,6 +95,27 @@ namespace ICSharpCode.SharpDevelop.Services
}
}
void OnMouseDown(object sender, DynamicListMouseEventArgs e)
{
if (e.Button == MouseButtons.Right) {
ContextMenuStrip menu = new ContextMenuStrip();
ToolStripMenuItem copyItem;
copyItem = new ToolStripMenuItem();
copyItem.Text = "Copy value to clipboard";
copyItem.Checked = false;
copyItem.Click += delegate {
ClipboardWrapper.SetText(((DynamicListItem)sender).Text);
};
menu.Items.AddRange(new ToolStripItem[] {
copyItem
});
menu.Show(e.List, e.Location);
}
}
/// <summary>
/// Called when plus is pressed in debugger tooltip.
/// Sets the data to be show in the next level.

Loading…
Cancel
Save