Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/05/14 10:39:30 (10 years ago)
Author:
abeham
Message:

#2241: fixed event handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Job.cs

    r11171 r11346  
    101101    private void RegisterEventHandlers() {
    102102      Tasks.ItemsAdded += TasksOnItemsChanged;
    103       Tasks.ItemsRemoved += TasksOnItemsChanged;
     103      Tasks.ItemsRemoved += TasksOnItemsRemoved;
    104104      Tasks.ItemsReplaced += TasksOnItemsChanged;
    105105      Tasks.CollectionReset += TasksOnItemsChanged;
     
    118118        task.Value.PropertyChanged += TaskOnPropertyChanged;
    119119        task.Value.ToStringChanged += TaskOnToStringChanged;
     120      }
     121      OnTasksChanged();
     122      OnToStringChanged();
     123    }
     124
     125    private void TasksOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Task>> e) {
     126      foreach (var task in e.Items) {
     127        task.Value.PropertyChanged -= TaskOnPropertyChanged;
     128        task.Value.ToStringChanged -= TaskOnToStringChanged;
    120129      }
    121130      OnTasksChanged();
Note: See TracChangeset for help on using the changeset viewer.