Exemplo n.º 1
0
        internal override AsyncEnumerableSorter <TElement> GetAsyncEnumerableSorter(AsyncEnumerableSorter <TElement> next, CancellationToken cancellationToken)
        {
            var sorter = new AsyncKeySelectorAsyncEnumerableSorterWithCancellation <TElement, TKey>(_keySelector, _comparer, _descending, next, cancellationToken);

            if (_parent != null)
            {
                return(_parent.GetAsyncEnumerableSorter(sorter, cancellationToken));
            }

            return(sorter);
        }
        protected internal override AsyncEnumerableSorter <TSource> GetEnumerableSorter(AsyncEnumerableSorter <TSource> next)
        {
            var sorter = AsyncEnumerableSorter.Create <TSource, TKey>(_keySelector, _comparer, _descending, next);

            if (_parent != null)
            {
                sorter = _parent.GetEnumerableSorter(sorter);
            }

            return(sorter);
        }
Exemplo n.º 3
0
 public AsyncKeySelectorAsyncEnumerableSorterWithCancellation(Func <TElement, CancellationToken, ValueTask <TKey> > keySelector, IComparer <TKey> comparer, bool descending, AsyncEnumerableSorter <TElement> next, CancellationToken cancellationToken)
     : base(comparer, descending, next)
 {
     _keySelector       = keySelector;
     _cancellationToken = cancellationToken;
 }
Exemplo n.º 4
0
 public AsyncKeySelectorAsyncEnumerableSorter(Func <TElement, ValueTask <TKey> > keySelector, IComparer <TKey> comparer, bool descending, AsyncEnumerableSorter <TElement> next)
     : base(comparer, descending, next)
 {
     _keySelector = keySelector;
 }
Exemplo n.º 5
0
 internal abstract AsyncEnumerableSorter <TElement> GetAsyncEnumerableSorter(AsyncEnumerableSorter <TElement> next, CancellationToken cancellationToken);
Exemplo n.º 6
0
 public AsyncEnumerableSorterBase(IComparer <TKey> comparer, bool descending, AsyncEnumerableSorter <TElement> next)
 {
     _comparer   = comparer;
     _descending = descending;
     _next       = next;
 }
 public AsyncEnumerableSorterWithAsyncSelector(Func <TSource, ValueTask <TKey> > keySelector, IComparer <TKey> comparer, bool descending, AsyncEnumerableSorter <TSource> next)
     : base(comparer, descending, next)
 {
     _keySelector = keySelector;
 }
 public static AsyncEnumerableSorter <TSource> Create <TSource, TKey>(Func <TSource, ValueTask <TKey> > keySelector, IComparer <TKey> comparer, bool descending, AsyncEnumerableSorter <TSource> next) => new AsyncEnumerableSorterWithAsyncSelector <TSource, TKey>(keySelector, comparer, descending, next);