Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/21/10 16:08:55 (13 years ago)
Author:
mkommend
Message:

Added ColumnsChanged and RowsChanged event in IStringConvertibleMatrix and all implementing classes (ticket #1269).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/3.3/StringMatrix.cs

    r4722 r5150  
    5353        else
    5454          columnNames = new List<string>(value);
     55        OnColumnNamesChanged();
    5556      }
    5657    }
     
    6768        else
    6869          rowNames = new List<string>(value);
     70        OnRowNamesChanged();
    6971      }
    7072    }
     
    9496          while (rowNames.Count < value)
    9597            rowNames.Add("Row " + rowNames.Count);
     98          OnRowsChanged();
     99          OnRowNamesChanged();
    96100          OnReset();
    97101        }
     
    111115          while (columnNames.Count < value)
    112116            columnNames.Add("Column " + columnNames.Count);
     117          OnColumnsChanged();
     118          OnColumnNamesChanged();
    113119          OnReset();
    114120        }
     
    167173    }
    168174    protected StringMatrix(int rows, int columns, IEnumerable<string> columnNames, IEnumerable<string> rowNames)
    169       : this(rows, columns,columnNames) {
     175      : this(rows, columns, columnNames) {
    170176      RowNames = rowNames;
    171177    }
     
    186192      ColumnNames = columnNames;
    187193    }
    188     protected StringMatrix(string[,] elements, IEnumerable<string> columnNames,IEnumerable<string> rowNames)
    189       : this(elements,columnNames) {
     194    protected StringMatrix(string[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames)
     195      : this(elements, columnNames) {
    190196      RowNames = rowNames;
    191197    }
     
    245251    }
    246252
     253    #region events
     254    public event EventHandler ColumnsChanged;
     255    protected virtual void OnColumnsChanged() {
     256      EventHandler handler = ColumnsChanged;
     257      if (handler != null)
     258        handler(this, EventArgs.Empty);
     259    }
     260    public event EventHandler RowsChanged;
     261    protected virtual void OnRowsChanged() {
     262      EventHandler handler = RowsChanged;
     263      if (handler != null)
     264        handler(this, EventArgs.Empty);
     265    }
    247266    public event EventHandler ColumnNamesChanged;
    248267    protected virtual void OnColumnNamesChanged() {
     
    275294      OnToStringChanged();
    276295    }
     296    #endregion
    277297
    278298    #region IStringConvertibleMatrix Members
Note: See TracChangeset for help on using the changeset viewer.