Changeset 6485
- Timestamp:
- 06/27/11 16:28:33 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.Designer.cs
r6471 r6485 34 34 private void InitializeComponent() { 35 35 this.components = new System.ComponentModel.Container(); 36 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExperimentTreeView));37 36 this.optimizersGroupBox = new System.Windows.Forms.GroupBox(); 38 37 this.splitContainer = new System.Windows.Forms.SplitContainer(); … … 167 166 this.optimizerTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.optimizerTreeView_DragEnter); 168 167 this.optimizerTreeView.DragOver += new System.Windows.Forms.DragEventHandler(this.optimizerTreeView_DragOver); 168 this.optimizerTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.optimizerTreeView_KeyDown); 169 169 this.optimizerTreeView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.optimizerTreeview_MouseClick); 170 170 this.optimizerTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.optimizerTreeView_MouseDown); -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.cs
r6471 r6485 162 162 } 163 163 RebuildImageList(); 164 UpdateDetailsViewHost(); 164 165 } 165 166 … … 219 220 } 220 221 RebuildImageList(); 222 UpdateDetailsViewHost(); 221 223 } 222 224 private void Optimizers_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) { … … 242 244 } 243 245 RebuildImageList(); 246 UpdateDetailsViewHost(); 244 247 } 245 248 private void Optimizers_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) { … … 270 273 } 271 274 RebuildImageList(); 275 UpdateDetailsViewHost(); 272 276 } 273 277 private void Optimizers_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) { … … 298 302 } 299 303 RebuildImageList(); 304 UpdateDetailsViewHost(); 300 305 } 301 306 … … 382 387 else throw new NotSupportedException("Handling for specific type not implemented" + parentOptimizer.GetType()); 383 388 } 384 if (optimizerTreeView.SelectedNode != null)385 detailsViewHost.Content = (IOptimizer)optimizerTreeView.SelectedNode.Tag;386 389 SetEnabledStateOfControls(); 390 UpdateDetailsViewHost(); 387 391 RebuildImageList(); 388 392 } … … 494 498 } 495 499 500 private void optimizerTreeView_KeyDown(object sender, KeyEventArgs e) { 501 if (ReadOnly) return; 502 if (optimizerTreeView.SelectedNode == null) return; 503 if (e.KeyCode != Keys.Delete) return; 504 505 var treeNode = optimizerTreeView.SelectedNode; 506 var optimizer = (IOptimizer)treeNode.Tag; 507 508 if (treeNode.Parent == null) 509 Content.Optimizers.Remove(optimizer); 510 else { 511 var batchRun = treeNode.Parent.Tag as BatchRun; 512 var experiment = treeNode.Parent.Tag as Experiment; 513 if (batchRun != null) batchRun.Optimizer = null; 514 else if (experiment != null) experiment.Optimizers.Remove(optimizer); 515 else throw new NotSupportedException("Handling for specific type not implemented" + optimizerTreeView.SelectedNode.Tag.GetType()); 516 } 517 SetEnabledStateOfControls(); 518 UpdateDetailsViewHost(); 519 RebuildImageList(); 520 } 521 496 522 private void addButton_Click(object sender, System.EventArgs e) { 497 523 if (typeSelectorDialog == null) { … … 526 552 else experiment = (Experiment)optimizerTreeView.SelectedNode.Parent.Tag; 527 553 528 detailsViewHost.SuspendRepaint();529 554 int index = optimizerTreeView.SelectedNode.Index; 530 555 experiment.Optimizers.Reverse(index - 1, 2); 531 556 optimizerTreeView.SelectedNode = optimizerTreeViewMapping[optimizer].First(); 532 detailsViewHost.Content = (IOptimizer)optimizerTreeView.SelectedNode.Tag;533 557 SetEnabledStateOfControls(); 534 detailsViewHost.ResumeRepaint(true); 558 UpdateDetailsViewHost(); 559 RebuildImageList(); 535 560 } 536 561 private void moveDownButton_Click(object sender, EventArgs e) { … … 543 568 experiment.Optimizers.Reverse(index, 2); 544 569 optimizerTreeView.SelectedNode = optimizerTreeViewMapping[optimizer].First(); 545 detailsViewHost.Content = (IOptimizer)optimizerTreeView.SelectedNode.Tag;546 570 SetEnabledStateOfControls(); 547 } 548 549 private void removeButton_Click(object sender, System.EventArgs e) { 571 UpdateDetailsViewHost(); 572 RebuildImageList(); 573 } 574 575 private void removeButton_Click(object sender, EventArgs e) { 550 576 var treeNode = optimizerTreeView.SelectedNode; 551 577 var optimizer = (IOptimizer)treeNode.Tag; … … 561 587 } 562 588 SetEnabledStateOfControls(); 563 detailsViewHost.Content = (IOptimizer)optimizerTreeView.SelectedNode.Tag; 589 UpdateDetailsViewHost(); 590 RebuildImageList(); 564 591 } 565 592 … … 577 604 578 605 #region helpers 606 private void UpdateDetailsViewHost() { 607 if (optimizerTreeView.SelectedNode != null) 608 detailsViewHost.Content = (IOptimizer)optimizerTreeView.SelectedNode.Tag; 609 else 610 detailsViewHost.Content = null; 611 } 612 579 613 private TreeNode CreateTreeNode(IOptimizer optimizer) { 580 614 TreeNode node = new TreeNode(optimizer.ToString());
Note: See TracChangeset
for help on using the changeset viewer.