Ignore:
Timestamp:
07/06/15 13:52:12 (4 years ago)
Author:
abeham
Message:

#2270: Fixed several of the runcollection views

  • Added InvokeRequired checks where missing
  • Added suppressUpdates check where missing
  • Fixed some bugs, added some null checks
File:
1 edited

Legend:

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

    r12012 r12599  
    168168
    169169    private void UpdateRuns(IEnumerable<IRun> runs) {
    170       if (suppressUpdates) return;
    171170      foreach (var run in runs) {
    172171        //update color
    173         foreach (var dataRow in runMapping[run]) {
    174           dataRow.VisualProperties.Color = run.Color;
     172        if (!runMapping.ContainsKey(run)) {
     173          runMapping[run] = ExtractDataRowsFromRun(run).ToList();
     174          RegisterRunEvents(run);
     175        } else {
     176          foreach (var dataRow in runMapping[run]) {
     177            dataRow.VisualProperties.Color = run.Color;
     178          }
    175179        }
    176         //update visibility - remove and add all rows to keep the same order as before
    177         combinedDataTable.Rows.Clear();
    178         combinedDataTable.Rows.AddRange(runMapping.Where(mapping => mapping.Key.Visible).SelectMany(mapping => mapping.Value));
    179       }
     180      }
     181      //update visibility - remove and add all rows to keep the same order as before
     182      combinedDataTable.Rows.Clear();
     183      combinedDataTable.Rows.AddRange(runMapping.Where(mapping => mapping.Key.Visible).SelectMany(mapping => mapping.Value));
    180184    }
    181185
    182186    private IEnumerable<DataRow> ExtractDataRowsFromRun(IRun run) {
    183187      var resultName = (string)dataTableComboBox.SelectedItem;
     188      if (string.IsNullOrEmpty(resultName)) yield break;
     189
    184190      var rowName = (string)dataRowComboBox.SelectedItem;
    185191      if (!run.Results.ContainsKey(resultName)) yield break;
Note: See TracChangeset for help on using the changeset viewer.