public IObservableListBindCacheSortedFixture()
        {
            _source = new SourceCache <Person, string>(p => p.Name);
            _sourceCacheNotifications = _source.Connect().AutoRefresh().Sort(_comparer, resetThreshold: 10).BindToObservableList(out _list).AsAggregator();

            _listNotifications = _list.Connect().AsAggregator();
        }
예제 #2
0
        public SortFixture()
        {
            _comparer = SortExpressionComparer <Person> .Ascending(p => p.Age).ThenByAscending(p => p.Name);

            _source  = new SourceCache <Person, string>(p => p.Key);
            _results = new SortedChangeSetAggregator <Person, string>(_source.Connect().Sort(_comparer));
        }
        public void Initialise()
        {
            _comparer = SortExpressionComparer<Person>.Ascending(p => p.Name).ThenByAscending(p => p.Age);

            _cache = new SourceCache<Person, string>(p => p.Name);
            _sortController = new SortController<Person>(_comparer);

            _results = new SortedChangeSetAggregator<Person, string>
                (
                    _cache.Connect().Sort(_sortController)
                );
        }
예제 #4
0
        public void Initialise()
        {
            _comparer = SortExpressionComparer <Person> .Ascending(p => p.Name).ThenByAscending(p => p.Age);

            _cache          = new SourceCache <Person, string>(p => p.Name);
            _sortController = new SortController <Person>(_comparer);

            _results = new SortedChangeSetAggregator <Person, string>
                       (
                _cache.Connect().Sort(_sortController)
                       );
        }
예제 #5
0
        public void Initialise()
        {
            _comparer = SortExpressionComparer <Person> .Ascending(p => p.Name).ThenByAscending(p => p.Age);

            _comparerObservable = new BehaviorSubject <IComparer <Person> >(_comparer);
            _cache = new SourceCache <Person, string>(p => p.Name);
            //  _sortController = new SortController<Person>(_comparer);

            _results = new SortedChangeSetAggregator <Person, string>
                       (
                _cache.Connect().Sort(_comparerObservable, resetThreshold: 25)
                       );
        }
예제 #6
0
        public void SortAfterFilter()
        {
            var source = new SourceCache <Person, string>(p => p.Key);

            var filterSubject = new BehaviorSubject <Func <Person, bool> >(p => true);

            var agg = new SortedChangeSetAggregator <ViewModel, TestString>(source.Connect().Filter(filterSubject).Group(x => (TestString)x.Key).Transform(x => new ViewModel(x.Key)).Sort(new ViewModel.Comparer()));

            source.Edit(
                x =>
            {
                x.AddOrUpdate(new Person("A", 1, "F"));
                x.AddOrUpdate(new Person("a", 1, "M"));
                x.AddOrUpdate(new Person("B", 1, "F"));
                x.AddOrUpdate(new Person("b", 1, "M"));
            });

            filterSubject.OnNext(p => p.Name.Equals("a", StringComparison.OrdinalIgnoreCase));
        }