Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/10/09 16:50:26 (15 years ago)
Author:
swagner
Message:

Implemented generic EventArgs (#796)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Logging/3.3/LinechartView.cs

    r1530 r2474  
    3131using HeuristicLab.Charting;
    3232using HeuristicLab.Charting.Data;
     33using HeuristicLab.Common;
    3334
    3435namespace HeuristicLab.Logging {
     
    8586    protected override void RemoveItemEvents() {
    8687      if(Linechart != null) {
    87         Linechart.Values.ItemAdded -= new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    88         Linechart.Values.ItemRemoved -= new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     88        Linechart.Values.ItemAdded -= new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     89        Linechart.Values.ItemRemoved -= new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    8990      }
    9091      base.RemoveItemEvents();
     
    9798      base.AddItemEvents();
    9899      if(Linechart != null) {
    99         Linechart.Values.ItemAdded += new EventHandler<ItemIndexEventArgs>(Values_ItemAdded);
    100         Linechart.Values.ItemRemoved += new EventHandler<ItemIndexEventArgs>(Values_ItemRemoved);
     100        Linechart.Values.ItemAdded += new EventHandler<EventArgs<IItem, int>>(Values_ItemAdded);
     101        Linechart.Values.ItemRemoved += new EventHandler<EventArgs<IItem, int>>(Values_ItemRemoved);
    101102      }
    102103    }
     
    144145
    145146    #region Values Events
    146     private delegate void ItemIndexDelegate(object sender, ItemIndexEventArgs e);
    147     private void Values_ItemRemoved(object sender, ItemIndexEventArgs e) {
     147    private delegate void ItemIndexDelegate(object sender, EventArgs<IItem, int> e);
     148    private void Values_ItemRemoved(object sender, EventArgs<IItem, int> e) {
    148149      if(InvokeRequired) {
    149150        Invoke(new ItemIndexDelegate(Values_ItemRemoved), sender, e);
     
    152153      }
    153154    }
    154     private void Values_ItemAdded(object sender, ItemIndexEventArgs e) {
     155    private void Values_ItemAdded(object sender, EventArgs<IItem, int> e) {
    155156      if(InvokeRequired) {
    156157        Invoke(new ItemIndexDelegate(Values_ItemAdded), sender, e);
    157158      } else {
    158159        Datachart datachart = dataChartControl.Chart;
    159         ItemList list = (ItemList)e.Item;
     160        ItemList list = (ItemList)e.Value;
    160161        datachart.UpdateEnabled = false;
    161162        for (int i = 0; i < list.Count; i++) {
     
    163164          if (list[i] is IntData) value = (double)((IntData)list[i]).Data;
    164165          else value = ((DoubleData)list[i]).Data;
    165           datachart.AddDataPoint(i, e.Index, value);
     166          datachart.AddDataPoint(i, e.Value2, value);
    166167          if (value < minY) minY = value;
    167168          if (value > maxY) maxY = value;
Note: See TracChangeset for help on using the changeset viewer.