Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/29/13 11:36:00 (12 years ago)
Author:
sforsten
Message:

#2018: renamed "column" to "element" in array types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ImprovingStringConvertibleMatrix/HeuristicLab.Data/3.3/ValueTypeArray.cs

    r9308 r9401  
    4242
    4343    [Storable]
    44     protected List<string> columnNames;
    45     public virtual IEnumerable<string> ColumnNames {
    46       get { return this.columnNames; }
     44    protected List<string> elementNames;
     45    public virtual IEnumerable<string> ElementNames {
     46      get { return this.elementNames; }
    4747      set {
    48         if (ReadOnly) throw new NotSupportedException("ColumnNames cannot be set. ValueTypeArray is read-only.");
     48        if (ReadOnly) throw new NotSupportedException("ElementNames cannot be set. ValueTypeArray is read-only.");
    4949        if (value == null || value.Count() == 0)
    50           columnNames = new List<string>();
     50          elementNames = new List<string>();
    5151        else if (value.Count() != Length)
    52           throw new ArgumentException("A column name must be specified for each column.");
     52          throw new ArgumentException("An element name must be specified for each element.");
    5353        else
    54           columnNames = new List<string>(value);
    55         OnColumnNamesChanged();
     54          elementNames = new List<string>(value);
     55        OnElementNamesChanged();
    5656      }
    5757    }
     
    6565        if (value != Length) {
    6666          Array.Resize<T>(ref array, value);
    67           while (columnNames.Count > value)
    68             columnNames.RemoveAt(columnNames.Count - 1);
    69           while (columnNames.Count < value)
    70             columnNames.Add("Column " + columnNames.Count);
    71           OnColumnNamesChanged();
     67          while (elementNames.Count > value)
     68            elementNames.RemoveAt(elementNames.Count - 1);
     69          while (elementNames.Count < value)
     70            elementNames.Add("Element " + elementNames.Count);
     71          OnElementNamesChanged();
    7272          OnReset();
    7373        }
     
    106106    [StorableHook(HookType.AfterDeserialization)]
    107107    private void AfterDeserialization() {
    108       if (columnNames == null) {
    109         columnNames = new List<string>(array.Length);
    110         while (columnNames.Count < array.Length)
    111           columnNames.Add("Column " + columnNames.Count);
     108      if (elementNames == null) {
     109        elementNames = new List<string>(array.Length);
     110        while (elementNames.Count < array.Length)
     111          elementNames.Add("Element " + elementNames.Count);
    112112      }
    113113    }
     
    118118      : base(original, cloner) {
    119119      this.array = (T[])original.array.Clone();
    120       this.columnNames = new List<string>(original.columnNames);
     120      this.elementNames = new List<string>(original.elementNames);
    121121      this.readOnly = original.readOnly;
    122122    }
    123123    protected ValueTypeArray() {
    124124      array = new T[0];
    125       columnNames = new List<string>();
     125      elementNames = new List<string>();
    126126      readOnly = false;
    127127    }
    128128    protected ValueTypeArray(int length) {
    129129      array = new T[length];
    130       columnNames = new List<string>(length);
     130      elementNames = new List<string>(length);
    131131      readOnly = false;
    132132    }
     
    134134      if (elements == null) throw new ArgumentNullException();
    135135      array = (T[])elements.Clone();
    136       columnNames = new List<string>(elements.Length);
     136      elementNames = new List<string>(elements.Length);
    137137      readOnly = false;
    138138    }
     
    164164    }
    165165
    166     public event EventHandler ColumnNamesChanged;
    167     protected virtual void OnColumnNamesChanged() {
    168       EventHandler handler = ColumnNamesChanged;
     166    public event EventHandler ElementNamesChanged;
     167    protected virtual void OnElementNamesChanged() {
     168      EventHandler handler = ElementNamesChanged;
    169169      if (handler != null)
    170170        handler(this, EventArgs.Empty);
Note: See TracChangeset for help on using the changeset viewer.