Browse Source

Updated DynamicTreeDebuggerRow adapter to the new model.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2795 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
701390db65
  1. 38
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/Adapters/DynamicTreeDebuggerRow.cs

38
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/Adapters/DynamicTreeDebuggerRow.cs

@ -28,8 +28,7 @@ namespace Debugger.AddIn.TreeModel @@ -28,8 +28,7 @@ namespace Debugger.AddIn.TreeModel
AbstractNode content;
bool populated = false;
bool visible = true;
bool loadChildsWhenExpanding;
public AbstractNode Content {
get { return content; }
@ -37,35 +36,25 @@ namespace Debugger.AddIn.TreeModel @@ -37,35 +36,25 @@ namespace Debugger.AddIn.TreeModel
public DynamicTreeDebuggerRow(AbstractNode content)
{
this.content = content;
this.Shown += delegate {
visible = true;
WindowsDebugger.DoInPausedState( delegate { Update(); } );
};
this.Hidden += delegate {
visible = false;
};
DebuggerGridControl.AddColumns(this.ChildColumns);
this[1].Paint += OnIconPaint;
this[3].FinishLabelEdit += OnLabelEdited;
this[3].MouseDown += OnMouseDown;
Update();
SetContent(content);
}
void Update()
public void SetContent(AbstractNode content)
{
if (!visible) return;
this.content = content;
this[1].Text = ""; // Icon
this[2].Text = content.Name;
this[3].Text = content.Text;
this[3].AllowLabelEdit = content is ISetText;
this.ShowPlus = content.ChildNodes != null;
this.ShowPlus = (content.ChildNodes != null);
this.ShowMinusWhileExpanded = true;
}
@ -97,18 +86,13 @@ namespace Debugger.AddIn.TreeModel @@ -97,18 +86,13 @@ namespace Debugger.AddIn.TreeModel
/// </summary>
protected override void OnExpanding(DynamicListEventArgs e)
{
if (!populated) {
WindowsDebugger.DoInPausedState(delegate { Populate(); });
}
}
void Populate()
{
this.ChildRows.Clear();
foreach(AbstractNode childNode in content.ChildNodes) {
this.ChildRows.Add(new DynamicTreeDebuggerRow(childNode));
if (loadChildsWhenExpanding) {
loadChildsWhenExpanding = false;
this.ChildRows.Clear();
foreach(AbstractNode childNode in content.ChildNodes) {
this.ChildRows.Add(new DynamicTreeDebuggerRow(childNode));
}
}
populated = true;
}
}
}

Loading…
Cancel
Save