Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/23/17 15:20:31 (8 years ago)
Author:
abeham
Message:

#2634: implemented reviewer's comments

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

Legend:

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

    r14185 r15048  
    3030
    3131namespace HeuristicLab.Analysis {
    32   [Item("IndexedDataRow", "A data row that contains time series.")]
     32  [Item("IndexedDataRow", "A data row that contains a series of points.")]
    3333  [StorableClass]
    3434  public class IndexedDataRow<T> : NamedItem {
     
    105105      OnVisualPropertiesChanged();
    106106    }
     107    protected override void OnNameChanged() {
     108      base.OnNameChanged();
     109      VisualProperties.DisplayName = Name;
     110    }
    107111  }
    108112}
  • trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/IndexedDataTable.cs

    r14185 r15048  
    107107    public event EventHandler VisualPropertiesChanged;
    108108    protected virtual void OnVisualPropertiesChanged() {
    109       EventHandler handler = VisualPropertiesChanged;
     109      var handler = VisualPropertiesChanged;
    110110      if (handler != null) handler(this, EventArgs.Empty);
    111111    }
     
    115115    }
    116116
    117     protected virtual void RegisterRowsEvents() {
    118       rows.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(rows_ItemsAdded);
    119       rows.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(rows_ItemsRemoved);
    120       rows.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(rows_ItemsReplaced);
    121       rows.CollectionReset += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(rows_CollectionReset);
    122     }
    123     private void rows_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
     117    private void RegisterRowsEvents() {
     118      rows.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(RowsOnItemsAdded);
     119      rows.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(RowsOnItemsRemoved);
     120      rows.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(RowsOnItemsReplaced);
     121      rows.CollectionReset += new CollectionItemsChangedEventHandler<IndexedDataRow<T>>(RowsOnCollectionReset);
     122      foreach (var row in Rows) RegisterRowEvents(row);
     123    }
     124    protected virtual void RowsOnItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
    124125      foreach (var row in e.Items)
    125126        this.RegisterRowEvents(row);
     
    129130      this.OnReset();
    130131    }
    131     private void rows_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
     132    protected virtual void RowsOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
    132133      foreach (var row in e.Items)
    133134        this.DeregisterRowEvents(row);
     
    137138      this.OnReset();
    138139    }
    139     private void rows_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
     140    protected virtual void RowsOnItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
    140141      foreach (var row in e.OldItems)
    141142        this.DeregisterRowEvents(row);
     
    147148      this.OnReset();
    148149    }
    149     private void rows_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
     150    protected virtual void RowsOnCollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedDataRow<T>> e) {
    150151      foreach (var row in e.OldItems)
    151152        this.DeregisterRowEvents(row);
     
    159160    }
    160161
    161     protected virtual void RegisterRowEvents(IndexedDataRow<T> row) {
    162       row.Values.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsAdded);
    163       row.Values.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsMoved);
    164       row.Values.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsRemoved);
    165       row.Values.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsReplaced);
    166       row.Values.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_CollectionReset);
    167     }
    168     protected virtual void DeregisterRowEvents(IndexedDataRow<T> row) {
    169       row.Values.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsAdded);
    170       row.Values.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsMoved);
    171       row.Values.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsRemoved);
    172       row.Values.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_ItemsReplaced);
    173       row.Values.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(Values_CollectionReset);
    174     }
    175 
    176     private void Values_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    177       this.OnReset();
    178     }
    179     private void Values_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    180       this.OnReset();
    181     }
    182     private void Values_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    183       this.OnReset();
    184     }
    185     private void Values_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    186       this.OnReset();
    187     }
    188     private void Values_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     162    private void RegisterRowEvents(IndexedDataRow<T> row) {
     163      row.Values.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsAdded);
     164      row.Values.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsMoved);
     165      row.Values.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsRemoved);
     166      row.Values.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsReplaced);
     167      row.Values.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnCollectionReset);
     168    }
     169    private void DeregisterRowEvents(IndexedDataRow<T> row) {
     170      row.Values.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsAdded);
     171      row.Values.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsMoved);
     172      row.Values.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsRemoved);
     173      row.Values.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnItemsReplaced);
     174      row.Values.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<Tuple<T, double>>>(ValuesOnCollectionReset);
     175    }
     176
     177    protected virtual void ValuesOnItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     178      this.OnReset();
     179    }
     180    protected virtual void ValuesOnItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     181      this.OnReset();
     182    }
     183    protected virtual void ValuesOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     184      this.OnReset();
     185    }
     186    protected virtual void ValuesOnItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
     187      this.OnReset();
     188    }
     189    protected virtual void ValuesOnCollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<Tuple<T, double>>> e) {
    189190      this.OnReset();
    190191    }
Note: See TracChangeset for help on using the changeset viewer.