Free cookie consent management tool by TermsFeed Policy Generator

Changeset 860


Ignore:
Timestamp:
11/29/08 11:06:32 (15 years ago)
Author:
gkragl
Message:

#320 implemented AddValue and Count methods and the index-operator for DataRow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/DataRow.cs

    r761 r860  
    11using System;
    22using System.Drawing;
     3using System.Collections.Generic;
    34
    45namespace HeuristicLab.Visualization {
     
    1213    private int thickness = 2;
    1314    private DrawingStyle style = DrawingStyle.Solid;
     15    private List<double> dataRow = new List<double>();
    1416
    1517    /// <summary>
     
    7375
    7476    public void AddValue(double value) {
    75       throw new NotImplementedException();
    76       // TODO ValueChangedEvent auslösen
     77      dataRow.Add(value);
     78      OnValueChanged(value, dataRow.Count - 1);
    7779    }
    7880
    7981    public void AddValue(double value, int index) {
    80       throw new NotImplementedException();
    81       // TODO ValueChangedEvent auslösen
     82      dataRow.Add(value);
     83      OnValueChanged(value, index);
    8284    }
    8385
    8486    public void AddValues(double[] values) {
    85       throw new NotImplementedException();
    86       // TODO ValuesChangedEvent auslösen
     87      int startInd = dataRow.Count;
     88
     89      foreach (double d in values) {
     90        dataRow.Add(d);
     91      }
     92
     93      OnValuesChanged(values, startInd);
    8794    }
    8895
    8996    public void AddValues(double[] values, int index) {
    90       throw new NotImplementedException();
    91       // TODO ValuesChangedEvent auslösen
     97      //check if index to start changes is valid
     98      if (index + values.Length < dataRow.Count) {
     99        foreach (double d in values) {
     100          dataRow.Add(d);
     101        }
     102        OnValuesChanged(values, index);
     103      } else {
     104        throw new System.IndexOutOfRangeException();
     105      }
    92106    }
    93107
     
    113127
    114128    public int Count {
    115       get { throw new NotImplementedException(); }
     129      get { return dataRow.Count; }
    116130    }
    117131
    118132    public double this[int index] {
    119       get { throw new NotImplementedException(); }
     133      get { return dataRow[index]; }
    120134      set {
    121         throw new NotImplementedException();
    122         // TODO ValueChangedEvent auslösen
     135        dataRow[index] = value;
     136        OnValueChanged(value, index);
    123137      }
    124138    }
Note: See TracChangeset for help on using the changeset viewer.