Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/04/14 19:40:22 (10 years ago)
Author:
abeham
Message:

#2120:

  • Parameters and Results are now ObservableDictionaries
  • PropertyChanged event handler replaces the Changed event handler
  • RunCollection listens to changed events to each run's parameters and results (8 additional event handlers per run)
File:
1 edited

Legend:

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

    r11171 r11344  
    2222using System;
    2323using System.Collections.Generic;
     24using System.ComponentModel;
    2425using System.Drawing;
    2526using System.Linq;
     
    116117    protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) {
    117118      foreach (IRun run in runs)
    118         run.Changed += new EventHandler(run_Changed);
     119        run.PropertyChanged += run_PropertyChanged;
    119120    }
    120121    protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) {
    121122      foreach (IRun run in runs)
    122         run.Changed -= new EventHandler(run_Changed);
     123        run.PropertyChanged -= run_PropertyChanged;
    123124    }
    124125
     
    133134      RegisterRunEvents(e.Items);
    134135    }
    135     private void run_Changed(object sender, EventArgs e) {
     136    private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    136137      if (suppressUpdates) return;
    137138      if (InvokeRequired)
    138         this.Invoke(new EventHandler(run_Changed), sender, e);
     139        this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e);
    139140      else {
    140         IRun run = (IRun)sender;
    141         UpdateRun(run);
    142         UpdateCursorInterval();
    143         chart.ChartAreas[0].RecalculateAxesScale();
    144         UpdateAxisLabels();
     141        if (e.PropertyName == "Color" || e.PropertyName == "Visible") {
     142          IRun run = (IRun)sender;
     143          UpdateRun(run);
     144          UpdateCursorInterval();
     145          chart.ChartAreas[0].RecalculateAxesScale();
     146          UpdateAxisLabels();
     147        }
    145148      }
    146149    }
     
    670673      if (xAxisValue != null)
    671674        xAxis.Title = xAxisValue;
    672       if(yAxisValue != null)
    673       yAxis.Title = yAxisValue;
     675      if (yAxisValue != null)
     676        yAxis.Title = yAxisValue;
    674677    }
    675678
Note: See TracChangeset for help on using the changeset viewer.