Changeset 13181
- Timestamp:
- 11/16/15 16:48:32 (9 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs
r12692 r13181 80 80 return; 81 81 } 82 UpdateDataTableComboBox(); // will trigger AddRuns 83 } 84 private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) { 85 if (suppressUpdates) return; 86 if (InvokeRequired) { 87 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e); 88 return; 89 } 90 RemoveRuns(e.Items); 82 91 UpdateDataTableComboBox(); 83 92 UpdateDataRowComboBox(); 84 AddRuns(e.Items); 85 } 86 private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) { 87 if (suppressUpdates) return; 88 if (InvokeRequired) { 89 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e); 90 return; 91 } 93 RebuildCombinedDataTable(); 94 } 95 private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 96 if (suppressUpdates) return; 97 if (InvokeRequired) { 98 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e); 99 return; 100 } 101 RemoveRuns(e.OldItems); 92 102 UpdateDataTableComboBox(); 93 103 UpdateDataRowComboBox(); 94 RemoveRuns(e.Items); 95 } 96 private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 97 if (suppressUpdates) return; 98 if (InvokeRequired) { 99 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e); 100 return; 101 } 102 UpdateDataTableComboBox(); 103 UpdateDataRowComboBox(); 104 RemoveRuns(e.OldItems); 105 AddRuns(e.Items); 104 RebuildCombinedDataTable(); 106 105 } 107 106 private void Content_AlgorithmNameChanged(object sender, EventArgs e) { … … 117 116 suppressUpdates = Content.UpdateOfRunsInProgress; 118 117 if (!suppressUpdates) { 118 foreach (var run in runMapping) 119 DeregisterRunEvents(run.Key); 120 runMapping.Clear(); 121 combinedDataTable.Rows.Clear(); 119 122 UpdateDataTableComboBox(); 120 UpdateDataRowComboBox();121 UpdateRuns(Content);122 123 } 123 124 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r12692 r13181 389 389 return; 390 390 ReadOnly = true; 391 391 392 try { 393 RunCollection.UpdateOfRunsInProgress = true; 392 394 RunCollection.Modify(); 393 395 } finally { 394 396 ReadOnly = false; 397 RunCollection.UpdateOfRunsInProgress = false; 395 398 } 396 399 } -
trunk/sources/HeuristicLab.Optimization/3.3/RunCollection.cs
r12692 r13181 483 483 #region Filtering 484 484 private void UpdateFiltering(bool reset) { 485 var oldUpateRuns = UpdateOfRunsInProgress;486 UpdateOfRunsInProgress = true;487 485 if (reset) 488 486 list.ForEach(r => r.Visible = true); 489 487 foreach (IRunCollectionConstraint constraint in this.constraints) 490 488 constraint.Check(); 491 UpdateOfRunsInProgress = oldUpateRuns;492 489 } 493 490 … … 539 536 protected virtual void Constraint_ConstraintOperationChanged(object sender, EventArgs e) { 540 537 IRunCollectionConstraint constraint = (IRunCollectionConstraint)sender; 541 if (constraint.Active) 542 this.UpdateFiltering(true); 538 if (constraint.Active) { 539 var oldUpateRuns = UpdateOfRunsInProgress; 540 try { 541 UpdateOfRunsInProgress = true; 542 UpdateFiltering(true); 543 } finally { UpdateOfRunsInProgress = oldUpateRuns; } 544 } 543 545 } 544 546 protected virtual void Constraint_ConstraintDataChanged(object sender, EventArgs e) { 545 547 IRunCollectionConstraint constraint = (IRunCollectionConstraint)sender; 546 if (constraint.Active) 547 this.UpdateFiltering(true); 548 if (constraint.Active) { 549 var oldUpateRuns = UpdateOfRunsInProgress; 550 try { 551 UpdateOfRunsInProgress = true; 552 UpdateFiltering(true); 553 } finally { UpdateOfRunsInProgress = oldUpateRuns; } 554 } 548 555 } 549 556 #endregion … … 551 558 #region Modification 552 559 public void Modify() { 553 var oldUpateRuns = UpdateOfRunsInProgress;554 UpdateOfRunsInProgress = true;555 560 var runs = this.ToList(); 556 561 var selectedRuns = runs.Where(r => r.Visible).ToList(); … … 566 571 } 567 572 } 568 UpdateOfRunsInProgress = oldUpateRuns;569 573 } 570 574
Note: See TracChangeset
for help on using the changeset viewer.