예제 #1
0
 private void ListenToEvents(IListenable <int> collection, EventTypes events)
 {
     if (events.HasFlag(Changed))
     {
         collection.CollectionChanged += _changed;
     }
     if (events.HasFlag(Cleared))
     {
         collection.CollectionCleared += _cleared;
     }
     if (events.HasFlag(Removed))
     {
         collection.ItemsRemoved += _removed;
     }
     if (events.HasFlag(Added))
     {
         collection.ItemsAdded += _added;
     }
     if (events.HasFlag(Inserted))
     {
         collection.ItemInserted += _inserted;
     }
     if (events.HasFlag(RemovedAt))
     {
         collection.ItemRemovedAt += _removedAt;
     }
 }