Changeset 4903
- Timestamp:
- 11/22/10 14:08:18 (14 years ago)
- Location:
- branches/HeuristicLab.DebugEngine
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DebugEngine/DebugEngine.cs
r4871 r4903 22 22 using System; 23 23 using System.Linq; 24 using System. Collections.Generic;24 using System.Threading; 25 25 using HeuristicLab.Common; 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Collections;29 using System.Threading;30 28 31 29 namespace HeuristicLab.DebugEngine { … … 35 33 public class DebugEngine : Executable, IEngine { 36 34 37 38 35 #region Construction and Cloning 39 36 40 37 [StorableConstructor] 41 protected DebugEngine(bool deserializing) : base(deserializing) { 38 protected DebugEngine(bool deserializing) 39 : base(deserializing) { 42 40 pausePending = stopPending = false; 43 41 timer = new System.Timers.Timer(100); … … 45 43 timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); 46 44 } 47 protected DebugEngine(DebugEngine original, Cloner cloner) : base(original, cloner) { 45 protected DebugEngine(DebugEngine original, Cloner cloner) 46 : base(original, cloner) { 48 47 if (original.ExecutionState == ExecutionState.Started) throw new InvalidOperationException(string.Format("Clone not allowed in execution state \"{0}\".", ExecutionState)); 49 48 Log = cloner.Clone(original.Log); … … 84 83 private DateTime lastUpdateTime; 85 84 private System.Timers.Timer timer; 86 85 87 86 [Storable] 88 87 private IOperator currentOperator; … … 108 107 109 108 public virtual IExecutionContext CurrentExecutionContext { 110 get { return CurrentOperation as IExecutionContext; 109 get { return CurrentOperation as IExecutionContext; } 111 110 } 112 111 … … 153 152 ignoreNextBreakpoint = true; 154 153 timer.Start(); 155 ProcessNextOperation(); 154 ProcessNextOperation(); 156 155 timer.Stop(); 157 156 ExecutionTime += DateTime.Now - lastUpdateTime; … … 165 164 ThreadPool.QueueUserWorkItem(new WaitCallback(Run), null); 166 165 } 167 166 168 167 protected override void OnStarted() { 169 168 Log.LogMessage("Engine started"); … … 190 189 if (ExecutionState == ExecutionState.Paused) OnStopped(); 191 190 } 192 191 193 192 protected override void OnStopped() { 194 193 Log.LogMessage("Engine stopped"); -
branches/HeuristicLab.DebugEngine/DebugEngineView.Designer.cs
r4876 r4903 56 56 this.stepButton = new System.Windows.Forms.Button(); 57 57 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 58 this.refreshButton = new System.Windows.Forms.Button(); 59 this.skipStackOpsCheckBox = new System.Windows.Forms.CheckBox(); 58 60 this.splitContainer1.Panel1.SuspendLayout(); 59 61 this.splitContainer1.Panel2.SuspendLayout(); … … 80 82 this.executionTimeTextBox.Name = "executionTimeTextBox"; 81 83 this.executionTimeTextBox.ReadOnly = true; 82 this.executionTimeTextBox.Size = new System.Drawing.Size( 747, 20);84 this.executionTimeTextBox.Size = new System.Drawing.Size(611, 20); 83 85 this.executionTimeTextBox.TabIndex = 1; 84 86 // … … 157 159 this.stepButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 158 160 this.stepButton.Image = ((System.Drawing.Image)(resources.GetObject("stepButton.Image"))); 159 this.stepButton.Location = new System.Drawing.Point(8 45, 3);161 this.stepButton.Location = new System.Drawing.Point(815, 3); 160 162 this.stepButton.Name = "stepButton"; 161 163 this.stepButton.Size = new System.Drawing.Size(24, 24); … … 165 167 this.stepButton.Click += new System.EventHandler(this.stepButton_Click); 166 168 // 169 // refreshButton 170 // 171 this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 172 this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image"))); 173 this.refreshButton.Location = new System.Drawing.Point(845, 3); 174 this.refreshButton.Name = "refreshButton"; 175 this.refreshButton.Size = new System.Drawing.Size(24, 24); 176 this.refreshButton.TabIndex = 5; 177 this.refreshButton.UseVisualStyleBackColor = true; 178 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 179 // 180 // skipStackOpsCheckBox 181 // 182 this.skipStackOpsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 183 this.skipStackOpsCheckBox.AutoSize = true; 184 this.skipStackOpsCheckBox.Location = new System.Drawing.Point(709, 8); 185 this.skipStackOpsCheckBox.Name = "skipStackOpsCheckBox"; 186 this.skipStackOpsCheckBox.Size = new System.Drawing.Size(100, 17); 187 this.skipStackOpsCheckBox.TabIndex = 6; 188 this.skipStackOpsCheckBox.Text = "Skip Stack Ops"; 189 this.skipStackOpsCheckBox.UseVisualStyleBackColor = true; 190 // 167 191 // DebugEngineView 168 192 // 169 193 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 194 this.Controls.Add(this.skipStackOpsCheckBox); 195 this.Controls.Add(this.refreshButton); 170 196 this.Controls.Add(this.splitContainer2); 171 197 this.Controls.Add(this.stepButton); … … 196 222 private HeuristicLab.DebugEngine.ExecutionStackView executionStackView; 197 223 private HeuristicLab.DebugEngine.OperationContentView operationContentView; 224 private System.Windows.Forms.Button refreshButton; 225 private System.Windows.Forms.CheckBox skipStackOpsCheckBox; 198 226 199 227 } -
branches/HeuristicLab.DebugEngine/DebugEngineView.cs
r4876 r4903 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Drawing;25 23 using System.Windows.Forms; 26 using HeuristicLab.Common.Resources;27 24 using HeuristicLab.Core; 28 25 using HeuristicLab.Core.Views; 29 26 using HeuristicLab.MainForm; 30 using HeuristicLab.Persistence.Auxiliary;31 27 namespace HeuristicLab.DebugEngine { 32 28 … … 124 120 else { 125 121 switch (Content.ExecutionState) { 126 case ExecutionState.Started: executionStackView.SuspendUpdate(); break; 122 case ExecutionState.Started: 123 executionStackView.SuspendUpdate(); 124 logView.Content = null; 125 break; 127 126 default: 127 logView.Content = Content.Log; 128 128 executionStackView.ResumeUpdate(); 129 129 operationContentView.Content = new OperationContent(Content.CurrentOperation); … … 145 145 private void stepButton_Click(object sender, EventArgs e) { 146 146 Content.Step(); 147 while (skipStackOpsCheckBox.Checked && !(Content.CurrentOperation is IAtomicOperation) && Content.CanContinue) 148 Content.Step(); 149 } 150 151 private void refreshButton_Click(object sender, EventArgs e) { 152 var content = Content; 153 Content = null; 154 Content = content; 147 155 } 148 156 -
branches/HeuristicLab.DebugEngine/DebugEngineView.resx
r4876 r4903 122 122 <value> 123 123 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 124 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAL DAAA125 Cw wBP0AiyAAAARBJREFUOE9j+P//PwM6Tuh5woxNHJsYhmaQIqABMkDMRIwhWA0onPX8f/zkt0rEGILV124 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALCwAA 125 CwsBbQSEtwAAARBJREFUOE9j+P//PwM6Tuh5woxNHJsYhmaQIqABMkDMRIwhWA0onPX8f/zkt0rEGILV 126 126 gNyZz/4ndN/7HzfhtQYh72A1IGPK0//z9v/+H9Rw8zXQAFt8huAKg/+z9/3637n173+30sv/gQbY4zIE 127 127 qwGRXY/+T9n263/J0r//E6b//W+TexanIVgNCGx++L917XuwZuOSL/+lo6/9N45c9t+h6Gw8ukuwGuBR … … 134 134 <value>17, 17</value> 135 135 </metadata> 136 <data name="refreshButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> 137 <value> 138 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 139 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALEQAA 140 CxEBf2RfkQAAAmFJREFUOE+dk21IU1EYx3cVVzkhaLCy+UaY0xwlZkYRmiGR7oMEUlAGfRGKvkRFVOQ0 141 DddsVmtbvpQWhCFBSvaCUcRAk0gGm8SGM7JtrU1nzYFvu3P33znDRcLpSxceDvdefr/zv+d5Lidaufjg 142 QKKIWwNSUo4Tz4u4RAl5xYsgJIuEcADCYlS8oQKLvvvKdam1n+PcqjUyN5ox7PyIVrMB1U9PoKxThZI7 143 h3C1vwk2l2OWD40c15nbwITD/h5p/9hrVL2sgXpSA43bgGsOHeodLTj16QJK71XCOmlH3u1dbIHDOxGk 144 8PXJW1D1HYWsfgs2NW3FSfOZmKjBcTMmydLmswWXnjegZvg0dusPoHXQiDH3OJw+F9IaFbFU8UptymYL 145 DncdQ0lHBfosrxBZFvL5ZUEyFfgFm2d8lURal8kWFHeU4eIzNYULSHF8ROB6LQPI1CiRrskF3ZnC6y/L 146 2YIdxr0Y/WqDf/pnEj1lry+Q5vkxlfTdN73W6w+IyX2Cy+PfOP7FxRaQHbFSB8maGOaFfR7vFLcYjiYs 147 LEW5eVJzC1GJekjLFhR2lWJ72x7k3i0KZrUoQ/JmBdpHHmOJj0ppIiIpbx96iDzjP9q4s6sEWrcp1rJs 148 XQEsLjv9HJAE6TSF1eVE5ZNqbK7LYSfYZir+I6AShb4Ilm92MoET6BzuiU0lbWXto7NsAYmNnBuFq3pO 149 oThIYblagQfve9mCjOZ8vLC+hZwMzt9QfIAorHljQGA2sp/5L7S96wY5KHxwWHCltxEq0xGknJch5ZwM 150 5foqGAe7MROKJHtn+ASm4H8f/gZt6J11yfCrBQAAAABJRU5ErkJggg== 151 </value> 152 </data> 136 153 </root> -
branches/HeuristicLab.DebugEngine/ExecutionStackView.cs
r4871 r4903 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.ComponentModel;4 3 using System.Drawing; 5 using System.Data;6 4 using System.Linq; 7 using System.Text;8 5 using System.Windows.Forms; 9 6 using HeuristicLab.Collections; 10 7 using HeuristicLab.Core; 8 using HeuristicLab.MainForm; 11 9 using HeuristicLab.MainForm.WindowsForms; 12 using HeuristicLab.MainForm;13 10 14 11 namespace HeuristicLab.DebugEngine { … … 51 48 UpdateExecutionStack(); 52 49 } 53 50 54 51 55 52 private void UpdateExecutionStack() { … … 60 57 if (treeView.Nodes.Count > 0) 61 58 treeView.TopNode = treeView.Nodes[0]; 59 treeView.ExpandAll(); 62 60 treeView.EndUpdate(); 63 61 groupBox.Text = string.Format("Execution Stack ({0})", totalNodes); … … 118 116 } 119 117 120 118 121 119 122 120 #region Event Handlers (child controls) -
branches/HeuristicLab.DebugEngine/OperationContentView.Designer.cs
r4876 r4903 27 27 this.groupBox = new System.Windows.Forms.GroupBox(); 28 28 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 29 this.splitContainer2 = new System.Windows.Forms.SplitContainer(); 30 this.executionContextGroupBox = new System.Windows.Forms.GroupBox(); 31 this.executionContextTreeView = new System.Windows.Forms.TreeView(); 32 this.parametersGroupBox = new System.Windows.Forms.GroupBox(); 29 33 this.parameterListView = new System.Windows.Forms.ListView(); 34 this.scopeGroupBox = new System.Windows.Forms.GroupBox(); 30 35 this.scopeTreeView = new System.Windows.Forms.TreeView(); 31 36 this.nameTextBox = new System.Windows.Forms.TextBox(); … … 33 38 this.atomicLabel = new System.Windows.Forms.Label(); 34 39 this.collectionLabel = new System.Windows.Forms.Label(); 35 this.splitContainer2 = new System.Windows.Forms.SplitContainer();36 this.parametersGroupBox = new System.Windows.Forms.GroupBox();37 this.executionContextGroupBox = new System.Windows.Forms.GroupBox();38 this.scopeGroupBox = new System.Windows.Forms.GroupBox();39 this.executionContextTreeView = new System.Windows.Forms.TreeView();40 40 this.timer = new System.Windows.Forms.Timer(this.components); 41 41 this.groupBox.SuspendLayout(); … … 46 46 this.splitContainer2.Panel2.SuspendLayout(); 47 47 this.splitContainer2.SuspendLayout(); 48 this.executionContextGroupBox.SuspendLayout(); 48 49 this.parametersGroupBox.SuspendLayout(); 49 this.executionContextGroupBox.SuspendLayout();50 50 this.scopeGroupBox.SuspendLayout(); 51 51 this.SuspendLayout(); … … 85 85 this.splitContainer1.TabIndex = 4; 86 86 // 87 // splitContainer2 88 // 89 this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; 90 this.splitContainer2.Location = new System.Drawing.Point(0, 0); 91 this.splitContainer2.Name = "splitContainer2"; 92 this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; 93 // 94 // splitContainer2.Panel1 95 // 96 this.splitContainer2.Panel1.Controls.Add(this.executionContextGroupBox); 97 // 98 // splitContainer2.Panel2 99 // 100 this.splitContainer2.Panel2.Controls.Add(this.parametersGroupBox); 101 this.splitContainer2.Size = new System.Drawing.Size(242, 361); 102 this.splitContainer2.SplitterDistance = 180; 103 this.splitContainer2.TabIndex = 1; 104 // 105 // executionContextGroupBox 106 // 107 this.executionContextGroupBox.Controls.Add(this.executionContextTreeView); 108 this.executionContextGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 109 this.executionContextGroupBox.Location = new System.Drawing.Point(0, 0); 110 this.executionContextGroupBox.Name = "executionContextGroupBox"; 111 this.executionContextGroupBox.Size = new System.Drawing.Size(242, 180); 112 this.executionContextGroupBox.TabIndex = 0; 113 this.executionContextGroupBox.TabStop = false; 114 this.executionContextGroupBox.Text = "Execution Context"; 115 // 116 // executionContextTreeView 117 // 118 this.executionContextTreeView.Dock = System.Windows.Forms.DockStyle.Fill; 119 this.executionContextTreeView.Location = new System.Drawing.Point(3, 16); 120 this.executionContextTreeView.Name = "executionContextTreeView"; 121 this.executionContextTreeView.Size = new System.Drawing.Size(236, 161); 122 this.executionContextTreeView.TabIndex = 0; 123 this.executionContextTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseClick); 124 this.executionContextTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseDoubleClick); 125 // 126 // parametersGroupBox 127 // 128 this.parametersGroupBox.Controls.Add(this.parameterListView); 129 this.parametersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 130 this.parametersGroupBox.Location = new System.Drawing.Point(0, 0); 131 this.parametersGroupBox.Name = "parametersGroupBox"; 132 this.parametersGroupBox.Size = new System.Drawing.Size(242, 177); 133 this.parametersGroupBox.TabIndex = 0; 134 this.parametersGroupBox.TabStop = false; 135 this.parametersGroupBox.Text = "Parameters"; 136 // 87 137 // parameterListView 88 138 // … … 97 147 this.parameterListView.ItemActivate += new System.EventHandler(this.parameterListView_ItemActivate); 98 148 // 149 // scopeGroupBox 150 // 151 this.scopeGroupBox.Controls.Add(this.scopeTreeView); 152 this.scopeGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 153 this.scopeGroupBox.Location = new System.Drawing.Point(0, 0); 154 this.scopeGroupBox.Name = "scopeGroupBox"; 155 this.scopeGroupBox.Size = new System.Drawing.Size(305, 361); 156 this.scopeGroupBox.TabIndex = 1; 157 this.scopeGroupBox.TabStop = false; 158 this.scopeGroupBox.Text = "Scope"; 159 // 99 160 // scopeTreeView 100 161 // … … 109 170 this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 110 171 | System.Windows.Forms.AnchorStyles.Right))); 172 this.nameTextBox.Cursor = System.Windows.Forms.Cursors.Default; 111 173 this.nameTextBox.Location = new System.Drawing.Point(6, 19); 112 174 this.nameTextBox.Name = "nameTextBox"; … … 114 176 this.nameTextBox.Size = new System.Drawing.Size(395, 20); 115 177 this.nameTextBox.TabIndex = 3; 178 this.nameTextBox.DoubleClick += new System.EventHandler(this.nameTextBox_DoubleClick); 116 179 // 117 180 // contextLabel … … 147 210 this.collectionLabel.TabIndex = 0; 148 211 this.collectionLabel.Text = "Collection"; 149 //150 // splitContainer2151 //152 this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;153 this.splitContainer2.Location = new System.Drawing.Point(0, 0);154 this.splitContainer2.Name = "splitContainer2";155 this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;156 //157 // splitContainer2.Panel1158 //159 this.splitContainer2.Panel1.Controls.Add(this.executionContextGroupBox);160 //161 // splitContainer2.Panel2162 //163 this.splitContainer2.Panel2.Controls.Add(this.parametersGroupBox);164 this.splitContainer2.Size = new System.Drawing.Size(242, 361);165 this.splitContainer2.SplitterDistance = 180;166 this.splitContainer2.TabIndex = 1;167 //168 // parametersGroupBox169 //170 this.parametersGroupBox.Controls.Add(this.parameterListView);171 this.parametersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;172 this.parametersGroupBox.Location = new System.Drawing.Point(0, 0);173 this.parametersGroupBox.Name = "parametersGroupBox";174 this.parametersGroupBox.Size = new System.Drawing.Size(242, 177);175 this.parametersGroupBox.TabIndex = 0;176 this.parametersGroupBox.TabStop = false;177 this.parametersGroupBox.Text = "Parameters";178 //179 // executionContextGroupBox180 //181 this.executionContextGroupBox.Controls.Add(this.executionContextTreeView);182 this.executionContextGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;183 this.executionContextGroupBox.Location = new System.Drawing.Point(0, 0);184 this.executionContextGroupBox.Name = "executionContextGroupBox";185 this.executionContextGroupBox.Size = new System.Drawing.Size(242, 180);186 this.executionContextGroupBox.TabIndex = 0;187 this.executionContextGroupBox.TabStop = false;188 this.executionContextGroupBox.Text = "Execution Context";189 //190 // scopeGroupBox191 //192 this.scopeGroupBox.Controls.Add(this.scopeTreeView);193 this.scopeGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;194 this.scopeGroupBox.Location = new System.Drawing.Point(0, 0);195 this.scopeGroupBox.Name = "scopeGroupBox";196 this.scopeGroupBox.Size = new System.Drawing.Size(305, 361);197 this.scopeGroupBox.TabIndex = 1;198 this.scopeGroupBox.TabStop = false;199 this.scopeGroupBox.Text = "Scope";200 //201 // executionContextTreeView202 //203 this.executionContextTreeView.Dock = System.Windows.Forms.DockStyle.Fill;204 this.executionContextTreeView.Location = new System.Drawing.Point(3, 16);205 this.executionContextTreeView.Name = "executionContextTreeView";206 this.executionContextTreeView.Size = new System.Drawing.Size(236, 161);207 this.executionContextTreeView.TabIndex = 0;208 this.executionContextTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseClick);209 this.executionContextTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseDoubleClick);210 212 // 211 213 // timer … … 229 231 this.splitContainer2.Panel2.ResumeLayout(false); 230 232 this.splitContainer2.ResumeLayout(false); 233 this.executionContextGroupBox.ResumeLayout(false); 231 234 this.parametersGroupBox.ResumeLayout(false); 232 this.executionContextGroupBox.ResumeLayout(false);233 235 this.scopeGroupBox.ResumeLayout(false); 234 236 this.ResumeLayout(false); -
branches/HeuristicLab.DebugEngine/OperationContentView.cs
r4876 r4903 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.ComponentModel;4 3 using System.Drawing; 5 using System.Data;6 using System.Linq;7 4 using System.Text; 8 5 using System.Windows.Forms; 6 using HeuristicLab.Common; 7 using HeuristicLab.Core; 8 using HeuristicLab.MainForm; 9 9 using HeuristicLab.MainForm.WindowsForms; 10 using HeuristicLab.MainForm;11 using HeuristicLab.Core;12 using HeuristicLab.Common;13 10 14 11 namespace HeuristicLab.DebugEngine { … … 61 58 62 59 private object GetParameterValue(IParameter param, IExecutionContext context) { 63 var originalContext = param.ExecutionContext;60 param = (IParameter)param.Clone(); 64 61 param.ExecutionContext = context; 65 62 object value = null; 66 63 try { 67 try { 68 value = param.ActualValue; 69 } catch (Exception x) { 70 value = x; 71 } 72 } finally { 73 param.ExecutionContext = originalContext; 64 value = param.ActualValue; 65 } catch (Exception x) { 66 value = x.Message; 74 67 } 75 68 return value; … … 83 76 while (scope != null && scope.Parent != null) 84 77 scope = scope.Parent; 85 UpdateScope(scope); 86 } 87 scopeTreeView.EndUpdate(); 88 } 89 90 private void UpdateScope(IScope scope) { 91 if (scope != null) { 92 AddScope(scopeTreeView.Nodes, scope); 78 if (scope != null) 79 AddScope(scopeTreeView.Nodes, scope); 80 if (scopeTreeView.Nodes.Count > 0) 81 scopeTreeView.TopNode = scopeTreeView.Nodes[0]; 93 82 } 94 83 scopeTreeView.ExpandAll(); … … 99 88 100 89 private void AddScope(TreeNodeCollection nodes, IScope scope) { 101 TreeNode node = nodes.Add(s cope.Name);90 TreeNode node = nodes.Add(string.Format("{0} ({1}+{2})", scope.Name, scope.Variables.Count, scope.SubScopes.Count)); 102 91 node.Tag = scope; 103 92 if (Content.IsAtomic && Content.AtomicOperation.Scope == scope) { … … 121 110 AddExecutionContext(Content.ExecutionContext, executionContextTreeView.Nodes); 122 111 } 112 executionContextTreeView.ExpandAll(); 113 if (executionContextTreeView.Nodes.Count > 0) 114 executionContextTreeView.TopNode = executionContextTreeView.Nodes[0]; 123 115 executionContextTreeView.EndUpdate(); 124 116 } … … 206 198 207 199 #endregion 200 201 private void nameTextBox_DoubleClick(object sender, EventArgs e) { 202 if (Content != null && Content.IsAtomic && Content.AtomicOperation.Operator != null) 203 MainFormManager.MainForm.ShowContent(Content.AtomicOperation.Operator); 204 } 205 208 206 } 209 207 }
Note: See TracChangeset
for help on using the changeset viewer.