Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/16/15 16:48:32 (9 years ago)
Author:
abeham
Message:

#2441: Fixed bug with aggregation view open while runs are being added

This also fixes a bug I noticed in that after every add to a RunCollection the batch update event was triggered. I had put that in FilterRuns which was called from multiple places.

Location:
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs

    r12692 r13181  
    8080        return;
    8181      }
     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);
    8291      UpdateDataTableComboBox();
    8392      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);
    92102      UpdateDataTableComboBox();
    93103      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();
    106105    }
    107106    private void Content_AlgorithmNameChanged(object sender, EventArgs e) {
     
    117116      suppressUpdates = Content.UpdateOfRunsInProgress;
    118117      if (!suppressUpdates) {
     118        foreach (var run in runMapping)
     119          DeregisterRunEvents(run.Key);
     120        runMapping.Clear();
     121        combinedDataTable.Rows.Clear();
    119122        UpdateDataTableComboBox();
    120         UpdateDataRowComboBox();
    121         UpdateRuns(Content);
    122123      }
    123124    }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs

    r12692 r13181  
    389389        return;
    390390      ReadOnly = true;
     391
    391392      try {
     393        RunCollection.UpdateOfRunsInProgress = true;
    392394        RunCollection.Modify();
    393395      } finally {
    394396        ReadOnly = false;
     397        RunCollection.UpdateOfRunsInProgress = false;
    395398      }
    396399    }
Note: See TracChangeset for help on using the changeset viewer.