public void Setup() { _source = ClinqTestFactory.CreateTwoPersonSource(); _propertyAccessTree = new PropertyAccessTree(); ParameterNode parameterNode = new ParameterNode(typeof(Person), "person"); _propertyAccessTree.Children.Add(parameterNode); var agePropertyAccessNode = new PropertyAccessNode(typeof(Person).GetProperty("Age")); parameterNode.Children.Add(agePropertyAccessNode); _target = new NotifyCollectionChangedMonitor <Person>(_propertyAccessTree, _source); }
public GroupJoinReadOnlyContinuousCollection( IList <TOuter> outer, IList <TInner> inner, Expression <Func <TOuter, TKey> > outerKeySelector, Expression <Func <TInner, TKey> > innerKeySelector, Expression <Func <TOuter, ReadOnlyContinuousCollection <TInner>, TResult> > resultSelector) { _outer = outer; _inner = inner; _outerKeySelector = outerKeySelector.CachedCompile(); _innerKeySelector = innerKeySelector.CachedCompile(); _resultSelector = resultSelector.CachedCompile(); _keyToOuterLookup = new Dictionary <TKey, List <OuterEntry> >(_outer.Count); _outerEntries = new Dictionary <TOuter, OuterEntry>(_outer.Count); _keyToInnerLookup = new Dictionary <TKey, List <TInner> >(_inner.Count); _innerEntries = new Dictionary <TInner, InnerEntry>(); _outerReferenceTracker = new ReferenceCountTracker <TOuter>(outer); RebuildAll(); _outerNotifyCollectionChangedMonitor = new NotifyCollectionChangedMonitor <TOuter>(ExpressionPropertyAnalyzer.Analyze(outerKeySelector), outer); _outerNotifyCollectionChangedMonitor.Add += OnOuterAdd; _outerNotifyCollectionChangedMonitor.Remove += OnOuterRemove; _outerNotifyCollectionChangedMonitor.Reset += OnOuterReset; _outerNotifyCollectionChangedMonitor.Move += OnOuterMove; _outerNotifyCollectionChangedMonitor.Replace += OnOuterItemReplace; _outerNotifyCollectionChangedMonitor.ItemChanged += OnOuterKeyChanged; _innerNotifyCollectionChangedMonitor = new NotifyCollectionChangedMonitor <TInner>(ExpressionPropertyAnalyzer.Analyze(innerKeySelector), inner); _innerNotifyCollectionChangedMonitor.Add += OnInnerAdd; _innerNotifyCollectionChangedMonitor.Remove += OnInnerRemove; _innerNotifyCollectionChangedMonitor.Reset += OnInnerReset; _innerNotifyCollectionChangedMonitor.Move += OnInnerMove; _innerNotifyCollectionChangedMonitor.Replace += OnInnerItemReplace; _innerNotifyCollectionChangedMonitor.ItemChanged += OnInnerItemChanged; }
public void Setup() { _source = ClinqTestFactory.CreateTwoPersonSource(); _propertyAccessTree = new PropertyAccessTree(); ParameterNode parameterNode = new ParameterNode(typeof(Person), "person"); _propertyAccessTree.Children.Add(parameterNode); var agePropertyAccessNode = new PropertyAccessNode(typeof(Person).GetProperty("Age")); parameterNode.Children.Add(agePropertyAccessNode); _target = new NotifyCollectionChangedMonitor<Person>(_propertyAccessTree, _source); }