Exemple #1
0
 public SafeObservingCollection(SafeObservedCollection <T> otherCollection)
 {
     otherCollection.Lock();
     viewedCollection = otherCollection;
     otherCollection.OnCollectionChanged += new NotifyCollectionChangedEventHandler(collection_OnCollectionChanged);
     foreach (var item in otherCollection)
     {
         collection.Add(item);
     }
     otherCollection.Unlock();
     SafeObservingCollectionManager.Register(this);
 }
Exemple #2
0
 public void Dispose()
 {
     viewedCollection.OnCollectionChanged -= new NotifyCollectionChangedEventHandler(collection_OnCollectionChanged);
     SafeObservingCollectionManager.Unregister(this);
     Clear();
 }