Browse Source

Debugger tooltips work if they are hidden and then shown again

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1412 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
b19d776a51
  1. 28
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs

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

@ -55,16 +55,19 @@ namespace ICSharpCode.SharpDevelop.Services @@ -55,16 +55,19 @@ namespace ICSharpCode.SharpDevelop.Services
if (variable == null) throw new ArgumentNullException("variable");
this.variable = variable;
this.Shown += delegate {
this.variable.ValueChanged += Update;
this.Hidden += delegate { this.variable.ValueChanged -= Update; };
DoInPausedState( delegate { Update(); } );
};
this.Hidden += delegate {
this.variable.ValueChanged -= Update;
};
DebuggerGridControl.AddColumns(this.ChildColumns);
this[1].Paint += OnIconPaint;
this[3].FinishLabelEdit += OnLabelEdited;
this[3].MouseDown += OnMouseDown;
Update();
}
void Update(object sender, DebuggerEventArgs e)
@ -146,16 +149,21 @@ namespace ICSharpCode.SharpDevelop.Services @@ -146,16 +149,21 @@ namespace ICSharpCode.SharpDevelop.Services
protected override void OnExpanding(DynamicListEventArgs e)
{
if (!populated) {
DoInPausedState(delegate { Populate(); });
}
}
void DoInPausedState(MethodInvoker action)
{
if (Variable.Debugger.IsPaused) {
Populate();
action();
} else {
EventHandler<DebuggingPausedEventArgs> populate = null;
populate = delegate {
Populate();
Variable.Debugger.DebuggingPaused -= populate;
EventHandler<DebuggingPausedEventArgs> onDebuggingPaused = null;
onDebuggingPaused = delegate {
action();
Variable.Debugger.DebuggingPaused -= onDebuggingPaused;
};
Variable.Debugger.DebuggingPaused += populate;
}
Variable.Debugger.DebuggingPaused += onDebuggingPaused;
}
}

Loading…
Cancel
Save