Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/14/10 11:30:55 (14 years ago)
Author:
epitzer
Message:

DataTable, DataRow and DataTableView have been unsealed. (#1338)

A possible persistence problem has also been fixed by directly persisting the visualProperties property otherwise an ArgumentException might break backwards compatibility.

Location:
trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataRow.cs

    r4887 r5097  
    3434  [Item("DataRow", "A row of data values.")]
    3535  [StorableClass]
    36   public sealed class DataRow : NamedItem {
     36  public class DataRow : NamedItem {
     37    [Storable(Name = "VisualProperties")]
    3738    private DataRowVisualProperties visualProperties;
    3839    public DataRowVisualProperties VisualProperties {
     
    5455
    5556    #region Persistence Properties
    56     [Storable(Name = "VisualProperties")]
    57     private DataRowVisualProperties StorableVisualProperties {
    58       get { return VisualProperties; }
    59       set { VisualProperties = value; }
    60     }
    6157    [Storable(Name = "values")]
    6258    private IEnumerable<double> StorableValues {
     
    6763
    6864    [StorableConstructor]
    69     private DataRow(bool deserializing) : base(deserializing) { }
    70     private DataRow(DataRow original, Cloner cloner)
     65    protected DataRow(bool deserializing) : base(deserializing) { }
     66    protected DataRow(DataRow original, Cloner cloner)
    7167      : base(original, cloner) {
    7268      this.VisualProperties = (DataRowVisualProperties)cloner.Clone(original.visualProperties);
     
    107103
    108104    public event EventHandler VisualPropertiesChanged;
    109     private void OnVisualPropertiesChanged() {
     105    protected virtual void OnVisualPropertiesChanged() {
    110106      EventHandler handler = VisualPropertiesChanged;
    111107      if (handler != null) handler(this, EventArgs.Empty);
  • trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataTable.cs

    r4887 r5097  
    3737  [Item("DataTable", "A table of data values.")]
    3838  [StorableClass]
    39   public sealed class DataTable : NamedItem, IStringConvertibleMatrix {
     39  public class DataTable : NamedItem, IStringConvertibleMatrix {
    4040    public override Image ItemImage {
    4141      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Performance; }
    4242    }
    4343
     44    [Storable(Name = "VisualProperties")]
    4445    private DataTableVisualProperties visualProperties;
    4546    public DataTableVisualProperties VisualProperties {
     
    6263
    6364    #region Persistence Properties
    64     [Storable(Name = "VisualProperties")]
    65     private DataTableVisualProperties StorableVisualProperties {
    66       get { return VisualProperties; }
    67       set { VisualProperties = value; }
    68     }
    6965    [Storable(Name = "rows")]
    7066    private IEnumerable<DataRow> StorableRows {
     
    7571
    7672    [StorableConstructor]
    77     private DataTable(bool deserializing) : base(deserializing) { }
    78     private DataTable(DataTable original, Cloner cloner)
     73    protected DataTable(bool deserializing) : base(deserializing) { }
     74    protected DataTable(DataTable original, Cloner cloner)
    7975      : base(original, cloner) {
    8076      this.VisualProperties = (DataTableVisualProperties)cloner.Clone(original.visualProperties);
     
    114110
    115111    public event EventHandler VisualPropertiesChanged;
    116     private void OnVisualPropertiesChanged() {
     112    protected virtual void OnVisualPropertiesChanged() {
    117113      EventHandler handler = VisualPropertiesChanged;
    118114      if (handler != null) handler(this, EventArgs.Empty);
     
    123119    }
    124120
    125     private void RegisterRowsEvents() {
     121    protected virtual void RegisterRowsEvents() {
    126122      rows.ItemsAdded += new CollectionItemsChangedEventHandler<DataRow>(rows_ItemsAdded);
    127123      rows.ItemsRemoved += new CollectionItemsChangedEventHandler<DataRow>(rows_ItemsRemoved);
     
    158154    }
    159155
    160     private void RegisterRowEvents(DataRow row) {
     156    protected virtual void RegisterRowEvents(DataRow row) {
    161157      row.Values.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsAdded);
    162158      row.Values.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsMoved);
     
    165161      row.Values.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_CollectionReset);
    166162    }
    167     private void DeregisterRowEvents(DataRow row) {
     163    protected virtual void DeregisterRowEvents(DataRow row) {
    168164      row.Values.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsAdded);
    169165      row.Values.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsMoved);
     
    233229
    234230    public event EventHandler<EventArgs<int, int>> ItemChanged;
    235     private void OnItemChanged(int rowIndex, int columnIndex) {
     231    protected virtual void OnItemChanged(int rowIndex, int columnIndex) {
    236232      var handler = ItemChanged;
    237233      if (handler != null) handler(this, new EventArgs<int, int>(rowIndex, columnIndex));
     
    239235    }
    240236    public event EventHandler Reset;
    241     private void OnReset() {
     237    protected virtual void OnReset() {
    242238      var handler = Reset;
    243239      if (handler != null) handler(this, EventArgs.Empty);
    244240    }
    245241    public event EventHandler ColumnNamesChanged;
    246     private void OnColumnNamesChanged() {
     242    protected virtual void OnColumnNamesChanged() {
    247243      var handler = ColumnNamesChanged;
    248244      if (handler != null) handler(this, EventArgs.Empty);
    249245    }
    250246    public event EventHandler RowNamesChanged;
    251     private void OnRowNamesChanged() {
     247    protected virtual void OnRowNamesChanged() {
    252248      var handler = RowNamesChanged;
    253249      if (handler != null) handler(this, EventArgs.Empty);
    254250    }
    255251    public event EventHandler SortableViewChanged;
    256     private void OnSortableViewChanged() {
     252    protected virtual void OnSortableViewChanged() {
    257253      var handler = SortableViewChanged;
    258254      if (handler != null) handler(this, EventArgs.Empty);
Note: See TracChangeset for help on using the changeset viewer.