Changeset 5003
- Timestamp:
- 11/30/10 16:33:41 (14 years ago)
- Location:
- branches/HeuristicLab.DebugEngine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DebugEngine/OperationContentView.Designer.cs
r4998 r5003 48 48 this.groupBox = new System.Windows.Forms.GroupBox(); 49 49 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 50 this.splitContainer2 = new System.Windows.Forms.SplitContainer();51 50 this.executionContextGroupBox = new System.Windows.Forms.GroupBox(); 52 51 this.executionContextTreeView = new System.Windows.Forms.TreeView(); 53 52 this.executionContextImageList = new System.Windows.Forms.ImageList(this.components); 54 this.parametersGroupBox = new System.Windows.Forms.GroupBox();55 this.parameterListView = new System.Windows.Forms.ListView();56 this.parameterColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));57 this.parametersImageList = new System.Windows.Forms.ImageList(this.components);58 53 this.scopeGroupBox = new System.Windows.Forms.GroupBox(); 59 54 this.scopeTreeView = new System.Windows.Forms.TreeView(); … … 63 58 this.atomicLabel = new System.Windows.Forms.Label(); 64 59 this.collectionLabel = new System.Windows.Forms.Label(); 60 this.parametersImageList = new System.Windows.Forms.ImageList(this.components); 61 this.executionContextConextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 62 this.showValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 65 63 this.groupBox.SuspendLayout(); 66 64 this.splitContainer1.Panel1.SuspendLayout(); 67 65 this.splitContainer1.Panel2.SuspendLayout(); 68 66 this.splitContainer1.SuspendLayout(); 69 this.splitContainer2.Panel1.SuspendLayout();70 this.splitContainer2.Panel2.SuspendLayout();71 this.splitContainer2.SuspendLayout();72 67 this.executionContextGroupBox.SuspendLayout(); 73 this.parametersGroupBox.SuspendLayout();74 68 this.scopeGroupBox.SuspendLayout(); 69 this.executionContextConextMenu.SuspendLayout(); 75 70 this.SuspendLayout(); 76 71 // … … 92 87 // splitContainer1 93 88 // 94 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 95 | System.Windows.Forms.AnchorStyles.Left)96 89 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 90 | System.Windows.Forms.AnchorStyles.Left) 91 | System.Windows.Forms.AnchorStyles.Right))); 97 92 this.splitContainer1.Location = new System.Drawing.Point(6, 45); 98 93 this.splitContainer1.Name = "splitContainer1"; … … 100 95 // splitContainer1.Panel1 101 96 // 102 this.splitContainer1.Panel1.Controls.Add(this. splitContainer2);97 this.splitContainer1.Panel1.Controls.Add(this.executionContextGroupBox); 103 98 // 104 99 // splitContainer1.Panel2 … … 109 104 this.splitContainer1.TabIndex = 4; 110 105 // 111 // splitContainer2112 //113 this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;114 this.splitContainer2.Location = new System.Drawing.Point(0, 0);115 this.splitContainer2.Name = "splitContainer2";116 this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;117 //118 // splitContainer2.Panel1119 //120 this.splitContainer2.Panel1.Controls.Add(this.executionContextGroupBox);121 //122 // splitContainer2.Panel2123 //124 this.splitContainer2.Panel2.Controls.Add(this.parametersGroupBox);125 this.splitContainer2.Size = new System.Drawing.Size(242, 361);126 this.splitContainer2.SplitterDistance = 180;127 this.splitContainer2.TabIndex = 1;128 //129 106 // executionContextGroupBox 130 107 // … … 133 110 this.executionContextGroupBox.Location = new System.Drawing.Point(0, 0); 134 111 this.executionContextGroupBox.Name = "executionContextGroupBox"; 135 this.executionContextGroupBox.Size = new System.Drawing.Size(242, 180);112 this.executionContextGroupBox.Size = new System.Drawing.Size(242, 361); 136 113 this.executionContextGroupBox.TabIndex = 0; 137 114 this.executionContextGroupBox.TabStop = false; … … 140 117 // executionContextTreeView 141 118 // 119 this.executionContextTreeView.ContextMenuStrip = this.executionContextConextMenu; 142 120 this.executionContextTreeView.Dock = System.Windows.Forms.DockStyle.Fill; 143 121 this.executionContextTreeView.ImageIndex = 0; … … 147 125 this.executionContextTreeView.SelectedImageIndex = 0; 148 126 this.executionContextTreeView.ShowNodeToolTips = true; 149 this.executionContextTreeView.Size = new System.Drawing.Size(236, 161);127 this.executionContextTreeView.Size = new System.Drawing.Size(236, 342); 150 128 this.executionContextTreeView.TabIndex = 0; 151 129 this.executionContextTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.executionContextTreeView_NodeMouseClick); … … 157 135 this.executionContextImageList.ImageSize = new System.Drawing.Size(16, 16); 158 136 this.executionContextImageList.TransparentColor = System.Drawing.Color.Transparent; 159 //160 // parametersGroupBox161 //162 this.parametersGroupBox.Controls.Add(this.parameterListView);163 this.parametersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;164 this.parametersGroupBox.Location = new System.Drawing.Point(0, 0);165 this.parametersGroupBox.Name = "parametersGroupBox";166 this.parametersGroupBox.Size = new System.Drawing.Size(242, 177);167 this.parametersGroupBox.TabIndex = 0;168 this.parametersGroupBox.TabStop = false;169 this.parametersGroupBox.Text = "Parameters";170 //171 // parameterListView172 //173 this.parameterListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {174 this.parameterColumn});175 this.parameterListView.Dock = System.Windows.Forms.DockStyle.Fill;176 this.parameterListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;177 this.parameterListView.HideSelection = false;178 this.parameterListView.Location = new System.Drawing.Point(3, 16);179 this.parameterListView.Name = "parameterListView";180 this.parameterListView.ShowItemToolTips = true;181 this.parameterListView.Size = new System.Drawing.Size(236, 158);182 this.parameterListView.SmallImageList = this.parametersImageList;183 this.parameterListView.TabIndex = 0;184 this.parameterListView.UseCompatibleStateImageBehavior = false;185 this.parameterListView.View = System.Windows.Forms.View.Details;186 this.parameterListView.ItemActivate += new System.EventHandler(this.parameterListView_ItemActivate);187 //188 // parametersImageList189 //190 this.parametersImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;191 this.parametersImageList.ImageSize = new System.Drawing.Size(16, 16);192 this.parametersImageList.TransparentColor = System.Drawing.Color.Transparent;193 137 // 194 138 // scopeGroupBox … … 224 168 // nameTextBox 225 169 // 226 this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 227 170 this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 171 | System.Windows.Forms.AnchorStyles.Right))); 228 172 this.nameTextBox.Cursor = System.Windows.Forms.Cursors.Default; 229 173 this.nameTextBox.Location = new System.Drawing.Point(6, 19); … … 266 210 this.collectionLabel.TabIndex = 0; 267 211 this.collectionLabel.Text = "Collection"; 212 // 213 // parametersImageList 214 // 215 this.parametersImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; 216 this.parametersImageList.ImageSize = new System.Drawing.Size(16, 16); 217 this.parametersImageList.TransparentColor = System.Drawing.Color.Transparent; 218 // 219 // executionContextConextMenu 220 // 221 this.executionContextConextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 222 this.showValueToolStripMenuItem}); 223 this.executionContextConextMenu.Name = "executionContextConextMenu"; 224 this.executionContextConextMenu.Size = new System.Drawing.Size(169, 48); 225 this.executionContextConextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.executionContextConextMenu_Opening); 226 // 227 // showValueToolStripMenuItem 228 // 229 this.showValueToolStripMenuItem.Name = "showValueToolStripMenuItem"; 230 this.showValueToolStripMenuItem.Size = new System.Drawing.Size(168, 22); 231 this.showValueToolStripMenuItem.Text = "show actual value"; 232 this.showValueToolStripMenuItem.ToolTipText = "Try to obtain the parameter\'s actual value in the current execution context and o" + 233 "pen it in a new view."; 234 this.showValueToolStripMenuItem.Click += new System.EventHandler(this.ShowValue_Click); 268 235 // 269 236 // OperationContentView … … 279 246 this.splitContainer1.Panel2.ResumeLayout(false); 280 247 this.splitContainer1.ResumeLayout(false); 281 this.splitContainer2.Panel1.ResumeLayout(false);282 this.splitContainer2.Panel2.ResumeLayout(false);283 this.splitContainer2.ResumeLayout(false);284 248 this.executionContextGroupBox.ResumeLayout(false); 285 this.parametersGroupBox.ResumeLayout(false);286 249 this.scopeGroupBox.ResumeLayout(false); 250 this.executionContextConextMenu.ResumeLayout(false); 287 251 this.ResumeLayout(false); 288 252 … … 297 261 private System.Windows.Forms.Label collectionLabel; 298 262 private System.Windows.Forms.SplitContainer splitContainer1; 299 private System.Windows.Forms.ListView parameterListView;300 263 private System.Windows.Forms.TreeView scopeTreeView; 301 private System.Windows.Forms.SplitContainer splitContainer2;302 private System.Windows.Forms.GroupBox executionContextGroupBox;303 private System.Windows.Forms.TreeView executionContextTreeView;304 private System.Windows.Forms.GroupBox parametersGroupBox;305 264 private System.Windows.Forms.GroupBox scopeGroupBox; 306 265 private System.Windows.Forms.ImageList executionContextImageList; 307 266 private System.Windows.Forms.ImageList parametersImageList; 308 267 private System.Windows.Forms.ImageList scopeImageList; 309 private System.Windows.Forms.ColumnHeader parameterColumn; 268 private System.Windows.Forms.GroupBox executionContextGroupBox; 269 private System.Windows.Forms.TreeView executionContextTreeView; 270 private System.Windows.Forms.ContextMenuStrip executionContextConextMenu; 271 private System.Windows.Forms.ToolStripMenuItem showValueToolStripMenuItem; 310 272 } 311 273 } -
branches/HeuristicLab.DebugEngine/OperationContentView.cs
r4998 r5003 34 34 [View("Operation Content View")] 35 35 [Content(typeof(OperationContent), IsDefaultView = true)] 36 public sealedpartial class OperationContentView : AsynchronousContentView {36 public partial class OperationContentView : AsynchronousContentView { 37 37 public new OperationContent Content { 38 38 get { return (OperationContent)base.Content; } … … 51 51 atomicLabel.ForeColor = SystemColors.ControlDark; 52 52 collectionLabel.ForeColor = SystemColors.ControlDark; 53 parameterListView.Items.Clear();54 53 scopeTreeView.Nodes.Clear(); 55 54 executionContextTreeView.Nodes.Clear(); … … 59 58 collectionLabel.ForeColor = Content.IsCollection ? Color.Black : SystemColors.ControlDark; 60 59 nameTextBox.Text = Content.Name; 61 UpdateParameters();62 60 UpdateScopeTree(); 63 61 UpdateExecutionContext(); 64 62 } 65 }66 67 private void UpdateParameters() {68 parameterListView.BeginUpdate();69 parameterListView.Items.Clear();70 parameterListView.SmallImageList.Images.Clear();71 if (Content.IsAtomic) {72 foreach (var param in Content.AtomicOperation.Operator.Parameters) {73 ListViewItem item = parameterListView.Items.Add(74 string.Format("{0} = {1}", param.Name, GetParameterValue(param, Content.ExecutionContext)));75 item.Tag = param;76 parameterListView.SmallImageList.Images.Add(param.ItemImage ?? VS2008ImageLibrary.Nothing);77 item.ImageIndex = parameterListView.SmallImageList.Images.Count - 1;78 item.ToolTipText = string.Format("{0}{1}{1}{2}",79 Utils.TypeName(param), Environment.NewLine,80 Utils.Wrap(param.Description ?? param.ItemDescription, 60));81 }82 }83 if (parameterListView.Items.Count > 0) {84 for (int i = 0; i < parameterListView.Columns.Count; i++)85 parameterListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);86 }87 parameterListView.EndUpdate();88 63 } 89 64 … … 187 162 #region Event Handlers (child controls) 188 163 189 private void parameterListView_ItemActivate(object sender, EventArgs e) {190 if (parameterListView.SelectedItems.Count > 0) {191 IParameter param = parameterListView.SelectedItems[0].Tag as IParameter;192 if (param != null) {193 MainFormManager.MainForm.ShowContent((IContent)GetParameterValue(param, Content.ExecutionContext));194 }195 }196 }197 198 164 private void executionContextTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { 199 165 if (e.Node != null) { … … 264 230 } 265 231 232 private void ShowValue_Click(object sender, EventArgs e) { 233 if (executionContextTreeView.SelectedNode == null) 234 return; 235 IParameter param = executionContextTreeView.SelectedNode.Tag as IParameter; 236 if (param != null) 237 MainFormManager.MainForm.ShowContent(GetParameterValue(param, Content.ExecutionContext) as IContent); 238 } 239 266 240 #endregion 241 242 private void executionContextConextMenu_Opening(object sender, System.ComponentModel.CancelEventArgs e) { 243 bool isParameter = executionContextTreeView.SelectedNode.Tag as IParameter != null; 244 showValueToolStripMenuItem.Enabled = isParameter; 245 e.Cancel = !isParameter; 246 } 247 248 249 267 250 } 268 251 }
Note: See TracChangeset
for help on using the changeset viewer.