Changeset 5219
- Timestamp:
- 01/05/11 09:38:51 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DebugEngine/3.3/ExecutionStackView.cs
r5146 r5219 73 73 74 74 private void UpdateExecutionStack() { 75 if (suspended) { 76 groupBox.Text = string.Format("Execution Stack ({0})", CountOperations(Content)); 77 } else { 78 treeView.BeginUpdate(); 79 treeView.Nodes.Clear(); 80 treeView.ImageList.Images.Clear(); 81 treeView.ImageList.Images.Add(VS2008ImageLibrary.Method); 82 treeView.ImageList.Images.Add(VS2008ImageLibrary.Module); 83 treeView.ImageList.Images.Add(VS2008ImageLibrary.BreakpointActive); 84 int totalNodes = AddStackOperations(treeView.Nodes, ((IEnumerable<IOperation>)Content).Reverse()); 85 if (treeView.Nodes.Count > 0) 86 treeView.TopNode = treeView.Nodes[0]; 87 treeView.ExpandAll(); 88 treeView.EndUpdate(); 89 groupBox.Text = string.Format("Execution Stack ({0})", totalNodes); 90 } 91 } 92 93 private int CountOperations(IEnumerable<IOperation> operations) { 94 int count = 0; 95 foreach (IOperation op in operations) { 96 count++; 97 OperationCollection ops = op as OperationCollection; 98 if (ops != null) 99 count += CountOperations(ops); 100 } 101 return count; 75 treeView.BeginUpdate(); 76 treeView.Nodes.Clear(); 77 treeView.ImageList.Images.Clear(); 78 treeView.ImageList.Images.Add(VS2008ImageLibrary.Method); 79 treeView.ImageList.Images.Add(VS2008ImageLibrary.Module); 80 treeView.ImageList.Images.Add(VS2008ImageLibrary.BreakpointActive); 81 int totalNodes = AddStackOperations(treeView.Nodes, ((IEnumerable<IOperation>)Content).Reverse()); 82 if (treeView.Nodes.Count > 0) 83 treeView.TopNode = treeView.Nodes[0]; 84 treeView.ExpandAll(); 85 treeView.EndUpdate(); 86 groupBox.Text = string.Format("Execution Stack ({0})", totalNodes); 102 87 } 103 88 … … 123 108 } else if (op is OperationCollection) { 124 109 OperationCollection ops = op as OperationCollection; 125 TreeNode node = treeView.Nodes.Add( 126 string.Format("{0} Operation{1}", ops.Count, ops.Count == 1 ? string.Empty : "s")); 110 TreeNode node = nodes.Add( 111 string.Format("{0} {2}Operation{1}", 112 ops.Count, 113 ops.Count == 1 ? string.Empty : "s", 114 ops.Parallel ? "Parallel " : string.Empty 115 )); 127 116 node.Tag = op; 128 117 node.ToolTipText = Utils.TypeName(ops); … … 159 148 } 160 149 #endregion 161 162 #region Suspension163 private bool suspended = false;164 public virtual void SuspendUpdate() {165 suspended = true;166 treeView.Nodes.Clear();167 }168 169 public virtual void ResumeUpdate() {170 suspended = false;171 if (Content != null)172 UpdateExecutionStack();173 }174 #endregion175 150 } 176 151 }
Note: See TracChangeset
for help on using the changeset viewer.