Browse Source

fix http://community.sharpdevelop.net/forums/t/15745.aspx - Delete variable in watch window

pull/6/merge
Siegfried Pammer 14 years ago
parent
commit
723ed39a8a
  1. 10
      src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/TreeNodeWrapper.cs
  2. 17
      src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs

10
src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/TreeNodeWrapper.cs

@ -39,6 +39,16 @@ namespace Debugger.AddIn.Pads.Controls @@ -39,6 +39,16 @@ namespace Debugger.AddIn.Pads.Controls
get { return Node.HasChildNodes; }
}
public override bool CanDelete()
{
return Parent is WatchRootNode;
}
public override void Delete()
{
Parent.Children.Remove(this);
}
protected override void LoadChildren()
{
if (Node.HasChildNodes) {

17
src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs

@ -55,12 +55,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -55,12 +55,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
watchList = new WatchList(WatchListType.Watch);
watchList.ContextMenu = MenuService.CreateContextMenu(this, "/SharpDevelop/Pads/WatchPad/ContextMenu");
watchList.MouseDoubleClick += watchList_DoubleClick;
watchList.KeyUp += watchList_KeyUp;
watchList.MouseDoubleClick += WatchListDoubleClick;
watchList.WatchItems.CollectionChanged += OnWatchItemsCollectionChanged;
panel.Children.Add(watchList);
panel.KeyUp += new KeyEventHandler(panel_KeyUp);
panel.KeyDown += PanelKeyDown;
// wire events that influence the items
LoadSavedNodes();
@ -122,23 +121,15 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -122,23 +121,15 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
#endregion
void panel_KeyUp(object sender, KeyEventArgs e)
void PanelKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Insert) {
AddNewWatch();
e.Handled = true;
}
}
void watchList_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Delete) {
RemoveWatchCommand cmd = new RemoveWatchCommand { Owner = this };
cmd.Run();
}
}
void watchList_DoubleClick(object sender, MouseEventArgs e)
void WatchListDoubleClick(object sender, MouseEventArgs e)
{
if (watchList.SelectedNode == null)
{

Loading…
Cancel
Save