Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/ChartDataRowsModel.cs @ 715

Last change on this file since 715 was 697, checked in by mstoeger, 16 years ago

changed interface between model and view to support full and partial updates as decided in the last meeting (#316)

  • model.Columns property provides access to all values contained within the model for full updates
  • model.DataChanged event notifies the view of partial updates
File size: 1.0 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Collections.Specialized;
6
7
8namespace HeuristicLab.Visualization{
9  public class ChartDataRowsModel : ChartDataModelBase, IChartDataRowsModel {
10
11    private readonly ListDictionary dataRows;
12   
13    public ChartDataRowsModel(){
14
15      dataRows = new ListDictionary();
16    }
17
18    public void AddDataRow(int id){
19      List<double> row = new List<double>();
20
21      dataRows.Add(id, row);
22    }
23
24    public void PushData(int dataRowId, double value){
25        ((List<double>)dataRows[dataRowId]).Add(value);
26
27    }
28
29    public event ChartDataRowsModelColumnChangedHandler ColumnChanged;
30
31    private void RaiseColumnChanged(ChangeType type, long columnId, double[] values) {
32      if (ColumnChanged != null) {
33        ColumnChanged(type, columnId, values);
34      }
35    }
36
37    public List<ChartDataRowsModelColumn> Columns {
38      get { throw new NotImplementedException(); }
39    }
40  }
41}
Note: See TracBrowser for help on using the repository browser.