Changeset 4930
- Timestamp:
- 11/25/10 10:38:08 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DebugEngine/OperationContentView.cs
r4909 r4930 90 90 while (scope != null && scope.Parent != null) 91 91 scope = scope.Parent; 92 if (scope != null) 92 if (scope != null) { 93 93 AddScope(scopeTreeView.Nodes, scope); 94 if (scopeTreeView.Nodes.Count > 0) 95 scopeTreeView.TopNode = scopeTreeView.Nodes[0]; 96 } 97 scopeTreeView.ExpandAll(); 98 if (scopeTreeView.Nodes.Count > 0) 99 scopeTreeView.TopNode = scopeTreeView.Nodes[0]; 94 95 } 96 } 100 97 scopeTreeView.EndUpdate(); 101 98 } … … 107 104 node.ImageIndex = 0; 108 105 node.SelectedImageIndex = 0; 109 if (Content.IsAtomic && Content.AtomicOperation.Scope == scope) {110 node.ForeColor = Color.Red;111 node.BackColor = Color.LightGray;112 }113 106 foreach (var var in scope.Variables) { 114 107 TreeNode varNode = node.Nodes.Add(string.Format("{0}={1}", var.Name, var.Value)); … … 120 113 varNode.SelectedImageIndex = 1; 121 114 } 122 foreach (var subScope in scope.SubScopes) {115 foreach (var subScope in scope.SubScopes) 123 116 AddScope(node.Nodes, subScope); 124 } 125 } 117 if (Content.IsAtomic && Content.AtomicOperation.Scope == scope) { 118 node.NodeFont = new Font(DefaultFont, FontStyle.Bold); 119 node.ForeColor = Color.White; 120 node.BackColor = Color.Crimson; 121 node.Expand(); 122 scopeTreeView.TopNode = node; 123 } 124 } 125 126 126 127 127 private void UpdateExecutionContext() { … … 202 202 timer_Tick(this, EventArgs.Empty); 203 203 } 204 timer.Tag = new KeyValuePair<TreeNode, Color>(scopeNode, scopeNode.BackColor); 204 timer.Tag = new KeyValuePair<TreeNode, TreeNode>(scopeNode, new TreeNode() { 205 BackColor = scopeNode.BackColor, 206 ForeColor = scopeNode.ForeColor, 207 NodeFont = scopeNode.NodeFont, 208 }); 205 209 scopeNode.BackColor = Color.Blue; 210 scopeNode.ForeColor = Color.White; 211 scopeNode.NodeFont = new Font(DefaultFont, FontStyle.Bold); 206 212 scopeTreeView.TopNode = scopeNode; 207 213 timer.Start(); … … 211 217 } 212 218 213 private void ResetNode(TreeNode node, Color color) {219 private void ResetNode(TreeNode node, TreeNode template) { 214 220 if (InvokeRequired) 215 Invoke(new Action<TreeNode, Color>(ResetNode), node, color); 216 else 217 node.BackColor = color; 221 Invoke(new Action<TreeNode, TreeNode>(ResetNode), node, template); 222 else { 223 node.ForeColor = template.ForeColor; 224 node.BackColor = template.BackColor; 225 node.NodeFont = template.NodeFont; 226 } 218 227 } 219 228 … … 232 241 233 242 private void timer_Tick(object sender, EventArgs e) { 234 KeyValuePair<TreeNode, Color> kvp = (KeyValuePair<TreeNode, Color>)timer.Tag;243 KeyValuePair<TreeNode, TreeNode> kvp = (KeyValuePair<TreeNode, TreeNode>)timer.Tag; 235 244 ResetNode(kvp.Key, kvp.Value); 236 245 timer.Stop(); … … 243 252 244 253 #endregion 245 246 247 248 254 } 249 255 }
Note: See TracChangeset
for help on using the changeset viewer.