Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/10/10 14:03:54 (14 years ago)
Author:
abeham
Message:

#922

  • Corrected event pattern
File:
1 edited

Legend:

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

    r4722 r4763  
    186186    public event EventHandler<EventArgs<int, int>> ItemChanged;
    187187    private void OnItemChanged(int rowIndex, int columnIndex) {
    188       if (ItemChanged != null)
    189         ItemChanged(this, new EventArgs<int, int>(rowIndex, columnIndex));
     188      var handler = ItemChanged;
     189      if (handler != null) handler(this, new EventArgs<int, int>(rowIndex, columnIndex));
    190190      OnToStringChanged();
    191191    }
    192192    public event EventHandler Reset;
    193193    private void OnReset() {
    194       if (Reset != null)
    195         Reset(this, EventArgs.Empty);
     194      var handler = Reset;
     195      if (handler != null) handler(this, EventArgs.Empty);
    196196    }
    197197    public event EventHandler ColumnNamesChanged;
    198198    private void OnColumnNamesChanged() {
    199       EventHandler handler = ColumnNamesChanged;
    200       if (handler != null)
    201         handler(this, EventArgs.Empty);
     199      var handler = ColumnNamesChanged;
     200      if (handler != null) handler(this, EventArgs.Empty);
    202201    }
    203202    public event EventHandler RowNamesChanged;
    204203    private void OnRowNamesChanged() {
    205       EventHandler handler = RowNamesChanged;
    206       if (handler != null)
    207         handler(this, EventArgs.Empty);
     204      var handler = RowNamesChanged;
     205      if (handler != null) handler(this, EventArgs.Empty);
    208206    }
    209207    public event EventHandler SortableViewChanged;
    210208    private void OnSortableViewChanged() {
    211       EventHandler handler = SortableViewChanged;
    212       if (handler != null)
    213         handler(this, EventArgs.Empty);
     209      var handler = SortableViewChanged;
     210      if (handler != null) handler(this, EventArgs.Empty);
    214211    }
    215212    #endregion
Note: See TracChangeset for help on using the changeset viewer.