Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…riable in watch window
  • Loading branch information
siegfriedpammer committed Apr 27, 2012
1 parent c5e470b commit 723ed39
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Expand Up @@ -39,6 +39,16 @@ public TreeNodeWrapper(TreeNode node)
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) {
Expand Down
17 changes: 4 additions & 13 deletions src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs
Expand Up @@ -55,12 +55,11 @@ protected override void InitializeComponents()
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();
Expand Down Expand Up @@ -122,23 +121,15 @@ Properties GetSavedVariablesProperties()

#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)
{
Expand Down

0 comments on commit 723ed39

Please sign in to comment.