示例#1
0
        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();
        }
示例#2
0
        public ObservableThenBy(IOrderableNotifyEnumerable <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.comparer    = comparer;
            manualNotifier   = new ManualObservableCollectionView <IEnumerable <TItem> >(SL.SelectMany(source.Sequences,
                                                                                                       sequence => searchTrees[sequence].Values));

            Attach();
        }
示例#3
0
 public KeyGroup()
 {
     collectionView = new ManualObservableCollectionView <TInner>(InnerKeys.Select(key => key.Tag));
 }