Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4763 for trunk/sources


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

#922

  • Corrected event pattern
Location:
trunk/sources
Files:
2 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
  • trunk/sources/HeuristicLab.Optimization/3.3/Result.cs

    r4725 r4763  
    130130    public event EventHandler ValueChanged;
    131131    private void OnValueChanged() {
    132       if (ValueChanged != null)
    133         ValueChanged(this, EventArgs.Empty);
     132      var handler = ValueChanged;
     133      if (handler != null) handler(this, EventArgs.Empty);
    134134      OnItemImageChanged();
    135135      OnToStringChanged();
Note: See TracChangeset for help on using the changeset viewer.