public SetProxy() { _added = new ObserverSet <Action <T> >(); _removed = new ObserverSet <Action <T> >(); _target = null; _targetObserver = new Disposable(); }
/// <summary> /// Create a new intersection set. /// </summary> /// <param name="a"></param> /// <param name="b"></param> public IntersectionSet(IReadonlyObservableSet <T> a, IReadonlyObservableSet <T> b) { _a = a; _b = b; _added = new ObserverSet <Action <T> >(); _removed = new ObserverSet <Action <T> >(); _count = 0; foreach (var item in a) { if (b.Contains(item)) { _count++; } } _aAddedObserver = a.AddedWeak(AddedToA); _aRemovedObserver = a.RemovedWeak(RemovedFromA); _bAddedObserver = b.AddedWeak(AddedToB); _bRemovedObserver = b.RemovedWeak(RemovedFromB); }
public Set() { _items = new HashSet <T>(); _added = new ObserverSet <Action <T> >(); _removed = new ObserverSet <Action <T> >(); }