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
get { return Node.HasChildNodes; } get { return Node.HasChildNodes; }
} }
public override bool CanDelete()
{
return Parent is WatchRootNode;
}
public override void Delete()
{
Parent.Children.Remove(this);
}
protected override void LoadChildren() protected override void LoadChildren()
{ {
if (Node.HasChildNodes) { if (Node.HasChildNodes) {

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

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

Loading…
Cancel
Save