public INotifyEnumerable <TResult> AsNotifiable() { if (notifyEnumerable == null) { var innerExpression = Inner as IEnumerableExpression <TInner>; IEnumerable <TInner> inner = Inner; if (innerExpression != null) { inner = innerExpression.AsNotifiable(); } notifyEnumerable = Source.AsNotifiable().Join(inner, OuterKeySelector, InnerKeySelector, ResultSelector, Comparer); } return(notifyEnumerable); }
public ObservableSelect(INotifyEnumerable <TSource> source, ObservingFunc <TSource, TResult> lambda) { if (source == null) { throw new ArgumentNullException("source"); } if (lambda == null) { throw new ArgumentNullException("lambda"); } this.source = source; this.lambda = lambda; }
public ObservableWhere(INotifyEnumerable <T> source, ObservingFunc <T, bool> lambda) { if (source == null) { throw new ArgumentNullException("source"); } if (lambda == null) { throw new ArgumentNullException("lambda"); } this.source = source; this.lambda = lambda; }
public ObservableSimpleSelectMany(INotifyEnumerable <TSource> source, ObservingFunc <TSource, IEnumerable <TResult> > selector) { if (source == null) { throw new ArgumentNullException("source"); } if (selector == null) { throw new ArgumentNullException("selector"); } this.source = source; this.selector = selector; }
public ObservableConcat(INotifyEnumerable <TSource> source, IEnumerable <TSource> source2) { if (source == null) { throw new ArgumentNullException("source"); } if (source2 == null) { throw new ArgumentNullException("source2"); } this.source = source; this.source2 = source2; Attach(); }
public ObservableOrderBy(INotifyEnumerable <TItem> source, ObservingFunc <TItem, TKey> keySelector, IComparer <TKey> comparer) { if (source == null) { throw new ArgumentNullException("source"); } if (keySelector == null) { throw new ArgumentNullException("keySelector"); } this.source = source; this.keySelector = keySelector; this.searchTree = new SortedDictionary <TKey, Collection <TItem> >(comparer); }
public ObservableGroupBy(INotifyEnumerable <TItem> source, ObservingFunc <TItem, TKey> keySelector, IEqualityComparer <TKey> comparer) { if (source == null) { throw new ArgumentNullException("source"); } if (keySelector == null) { throw new ArgumentNullException("keySelector"); } this.groups = new Dictionary <TKey, ObservableGroup <TKey, TItem> >(comparer); this.source = source; this.keySelector = keySelector; }
public ObservableExcept(INotifyEnumerable <TSource> source, IEnumerable <TSource> source2, IEqualityComparer <TSource> comparer) { if (source == null) { throw new ArgumentNullException("source"); } if (source2 == null) { throw new ArgumentNullException("source2"); } this.source = source; this.source2 = source2; sourceItems = new Dictionary <TSource, int>(comparer); Attach(); }
public ObservableConcat(INotifyEnumerable <TSource> source, IEnumerable <TSource> source2) { if (source == null) { throw new ArgumentNullException("source"); } if (source2 == null) { throw new ArgumentNullException("source2"); } this.source = source; this.source2 = source2; this.observableSource2 = source2 as INotifyEnumerable <TSource>; if (observableSource2 == null) { observableSource2 = (source2 as IEnumerableExpression <TSource>)?.AsNotifiable(); } }
public ObservableOrderBy(INotifyEnumerable <TItem> source, ObservingFunc <TItem, TKey> keySelector, IComparer <TKey> comparer) { if (source == null) { throw new ArgumentNullException("source"); } if (keySelector == null) { throw new ArgumentNullException("keySelector"); } this.source = source; this.keySelector = keySelector; this.searchTree = new SortedDictionary <TKey, ObservableCollection <TItem> >(comparer); this.manualRaiseSequences = new ManualObservableCollectionView <IEnumerable <TItem> >(searchTree.Values); Attach(); }
public ObservableIntersect(INotifyEnumerable <TSource> source, IEnumerable <TSource> source2, IEqualityComparer <TSource> comparer) { if (source == null) { throw new ArgumentNullException("source"); } if (source2 == null) { throw new ArgumentNullException("source2"); } this.source = source; this.source2 = source2; this.observableSource2 = source2 as INotifyEnumerable <TSource>; if (observableSource2 == null) { observableSource2 = (source2 as IEnumerableExpression <TSource>)?.AsNotifiable(); } sourceItems = new Dictionary <TSource, int>(comparer); }
protected ObservableSetComparer(INotifyEnumerable <T> source1, IEnumerable <T> source2, IEqualityComparer <T> comparer) { if (source1 == null) { throw new ArgumentNullException("source1"); } if (source2 == null) { throw new ArgumentNullException("source2"); } this.source1 = source1; this.source2 = source2; if (source1 != source2) { this.entries = new Dictionary <T, Entry>(comparer); } Attach(); }
public ObservableSelectMany(INotifyEnumerable <TSource> source, ObservingFunc <TSource, IEnumerable <TIntermediate> > func, ObservingFunc <TSource, TIntermediate, TResult> selector) { if (source == null) { throw new ArgumentNullException("source"); } if (func == null) { throw new ArgumentNullException("func"); } if (selector == null) { throw new ArgumentNullException("selector"); } this.source = source; this.func = func; this.selector = selector; }
protected void AttachCore() { if (childrenCollection == null) { childrenCollection = Element.Children.AsNotifiable(); } else { childrenCollection.Attach(); } childrenCollection.CollectionChanged += ChildrenChanged; if (childCollections == null) { childCollections = new Dictionary <IModelElement, INotifyEnumerable <IModelElement> >(); } foreach (var child in childrenCollection) { var descendants = child.Descendants().AsNotifiable(); descendants.CollectionChanged += PropagateChildChanges; childCollections.Add(child, descendants); } }
private void AddElements(IEnumerableExpression <T> elements) { if (elements != null) { if (Incremental) { var incElements = elements.AsNotifiable(); foreach (var node in incElements) { GetOrCreate(node, true); } incElements.CollectionChanged += RootElementsChanged; this.incElements = incElements; } else { foreach (var node in elements) { GetOrCreate(node, true); } } } }
protected ObservableSetComparer(INotifyEnumerable <T> source1, IEnumerable <T> source2, IEqualityComparer <T> comparer) { if (source1 == null) { throw new ArgumentNullException("source1"); } if (source2 == null) { throw new ArgumentNullException("source2"); } this.source1 = source1; this.source2 = source2; this.observableSource2 = source2 as INotifyEnumerable <T>; if (observableSource2 == null) { observableSource2 = (source2 as IEnumerableExpression <T>)?.AsNotifiable(); } this.entries = new Dictionary <T, Entry>(comparer); Successors.Attached += (obj, e) => Attach(); Successors.Detached += (obj, e) => Detach(); }
public ObservableGroupJoin(INotifyEnumerable <TOuter> outerSource, IEnumerable <TInner> innerSource, ObservingFunc <TOuter, TKey> outerKeySelector, ObservingFunc <TInner, TKey> innerKeySelector, ObservingFunc <TOuter, IEnumerable <TInner>, TResult> resultSelector, IEqualityComparer <TKey> comparer) { if (outerSource == null) { throw new ArgumentNullException("outerSource"); } if (innerSource == null) { throw new ArgumentNullException("innerSource"); } if (outerKeySelector == null) { throw new ArgumentNullException("outerKeySelector"); } if (innerKeySelector == null) { throw new ArgumentNullException("innerKeySelector"); } if (resultSelector == null) { throw new ArgumentNullException("resultSelector"); } this.outerSource = outerSource; this.innerSource = innerSource; this.outerKeySelector = outerKeySelector; this.innerKeySelector = innerKeySelector; this.resultSelector = resultSelector; this.observableInnerSource = innerSource as INotifyEnumerable <TInner>; if (observableInnerSource == null) { observableInnerSource = (innerSource as IEnumerableExpression <TInner>)?.AsNotifiable(); } groups = new Dictionary <TKey, KeyGroup>(comparer); }
public ObservableLambdaAny(INotifyEnumerable <TSource> source, Expression <Func <TSource, bool> > selector) : base(new ObservableSelect <TSource, bool>(source, selector), 0) { }
public static ObservableLambdaAny <TSource> Create(INotifyEnumerable <TSource> source, Expression <Func <TSource, bool> > selector) { return(new ObservableLambdaAny <TSource>(source, selector)); }
public ObservableAny(INotifyEnumerable <TSource> source) : base(source, 0) { }
public static ObservableAny <TSource> Create(INotifyEnumerable <TSource> source) { return(new ObservableAny <TSource>(source)); }
public static ObservableSingleOrDefault <TSource> CreateForPredicate(INotifyEnumerable <TSource> source, Expression <Func <TSource, bool> > predicate) { return(new ObservableSingleOrDefault <TSource>(source.Where(predicate))); }
public static ObservableSingleOrDefault <TSource> Create(INotifyEnumerable <TSource> source) { return(new ObservableSingleOrDefault <TSource>(source)); }
public static INotifyValue <long> SumLambdaLong <TSource>(INotifyEnumerable <TSource> source, Expression <Func <TSource, long> > selector) { return(SumLong(source.Select(selector))); }
public static INotifyValue <int> SumLambdaInt <TSource>(INotifyEnumerable <TSource> source, Expression <Func <TSource, int> > selector) { return(SumInt(source.Select(selector))); }
public ObservableNullableDecimalSum(INotifyEnumerable <decimal?> source) : base(source, new SumData <decimal>()) { }
public ObservableNullableDoubleSum(INotifyEnumerable <double?> source) : base(source, new SumData <double>()) { }
public ObservableNullableFloatSum(INotifyEnumerable <float?> source) : base(source, new SumData <float>()) { }
public Notifiable(CustomCollection <T> parent, INotifyEnumerable <T> inner) { Parent = parent; Inner = inner; }
public ObservableNullableLongSum(INotifyEnumerable <long?> source) : base(source, new SumData <long>()) { }