// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; namespace System.Reactive.Linq { public static partial class Observable { #region + Aggregate + /// /// Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value. /// For aggregation behavior with incremental intermediate results, see . /// /// The type of the elements in the source sequence. /// The type of the result of the aggregation. /// An observable sequence to aggregate over. /// The initial accumulator value. /// An accumulator function to be invoked on each element. /// An observable sequence containing a single element with the final accumulator value. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Aggregate(this IObservable source, TAccumulate seed, Func accumulator) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); return s_impl.Aggregate(source, seed, accumulator); } /// /// Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value, /// and the specified result selector function is used to select the result value. /// /// The type of the elements in the source sequence. /// The type of the accumulator value. /// The type of the resulting value. /// An observable sequence to aggregate over. /// The initial accumulator value. /// An accumulator function to be invoked on each element. /// A function to transform the final accumulator value into the result value. /// An observable sequence containing a single element with the final accumulator value. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Aggregate(this IObservable source, TAccumulate seed, Func accumulator, Func resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return s_impl.Aggregate(source, seed, accumulator, resultSelector); } /// /// Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. /// For aggregation behavior with incremental intermediate results, see . /// /// The type of the elements in the source sequence and the result of the aggregation. /// An observable sequence to aggregate over. /// An accumulator function to be invoked on each element. /// An observable sequence containing a single element with the final accumulator value. /// or is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Aggregate(this IObservable source, Func accumulator) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); return s_impl.Aggregate(source, accumulator); } #endregion #region + All + /// /// Determines whether all elements of an observable sequence satisfy a condition. /// /// The type of the elements in the source sequence. /// An observable sequence whose elements to apply the predicate to. /// A function to test each element for a condition. /// An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable All(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.All(source, predicate); } #endregion #region + Any + /// /// Determines whether an observable sequence contains any elements. /// /// The type of the elements in the source sequence. /// An observable sequence to check for non-emptiness. /// An observable sequence containing a single element determining whether the source sequence contains any elements. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Any(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Any(source); } /// /// Determines whether any element of an observable sequence satisfies a condition. /// /// The type of the elements in the source sequence. /// An observable sequence whose elements to apply the predicate to. /// A function to test each element for a condition. /// An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Any(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.Any(source, predicate); } #endregion #region + Average + /// /// Computes the average of an observable sequence of values. /// /// A sequence of values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values. /// is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of values. /// /// A sequence of values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values. /// is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of values. /// /// A sequence of values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values. /// is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of values. /// /// A sequence of values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values. /// is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of values. /// /// A sequence of values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values. /// is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of nullable values. /// /// A sequence of nullable values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of nullable values. /// /// A sequence of nullable values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of nullable values. /// /// A sequence of nullable values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of nullable values. /// /// A sequence of nullable values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. /// (Asynchronous) The sum of the elements in the source sequence is larger than . public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of nullable values. /// /// A sequence of nullable values to calculate the average of. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Average(source); } /// /// Computes the average of an observable sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values. /// or is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } /// /// Computes the average of an observable sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values. /// or is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } /// /// Computes the average of an observable sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values. /// or is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } /// /// Computes the average of an observable sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values. /// or is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } /// /// Computes the average of an observable sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values. /// or is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } /// /// Computes the average of an observable sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// or is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } /// /// Computes the average of an observable sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// or is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } /// /// Computes the average of an observable sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// or is null. /// (Asynchronous) The source sequence is empty. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } /// /// Computes the average of an observable sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// or is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } /// /// Computes the average of an observable sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values to calculate the average of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null. /// or is null. /// (Asynchronous) The source sequence is empty. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Average(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Average(source, selector); } #endregion #region + Contains + /// /// Determines whether an observable sequence contains a specified element by using the default equality comparer. /// /// The type of the elements in the source sequence. /// An observable sequence in which to locate a value. /// The value to locate in the source sequence. /// An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Contains(this IObservable source, TSource value) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Contains(source, value); } /// /// Determines whether an observable sequence contains a specified element by using a specified System.Collections.Generic.IEqualityComparer<T>. /// /// The type of the elements in the source sequence. /// An observable sequence in which to locate a value. /// The value to locate in the source sequence. /// An equality comparer to compare elements. /// An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Contains(this IObservable source, TSource value, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.Contains(source, value, comparer); } #endregion #region + Count + /// /// Returns an observable sequence containing an that represents the total number of elements in an observable sequence. /// /// The type of the elements in the source sequence. /// An observable sequence that contains elements to be counted. /// An observable sequence containing a single element with the number of elements in the input sequence. /// is null. /// (Asynchronous) The number of elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Count(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Count(source); } /// /// Returns an observable sequence containing an that represents how many elements in the specified observable sequence satisfy a condition. /// /// The type of the elements in the source sequence. /// An observable sequence that contains elements to be counted. /// A function to test each element for a condition. /// An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Count(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.Count(source, predicate); } #endregion #region + ElementAt + /// /// Returns the element at a specified index in a sequence. /// /// The type of the elements in the source sequence. /// Observable sequence to return the element from. /// The zero-based index of the element to retrieve. /// An observable sequence that produces the element at the specified position in the source sequence. /// is null. /// is less than zero. /// (Asynchronous) is greater than or equal to the number of elements in the source sequence. public static IObservable ElementAt(this IObservable source, int index) { if (source == null) throw new ArgumentNullException("source"); if (index < 0) throw new ArgumentOutOfRangeException("index"); return s_impl.ElementAt(source, index); } #endregion #region + ElementAtOrDefault + /// /// Returns the element at a specified index in a sequence or a default value if the index is out of range. /// /// The type of the elements in the source sequence. /// Observable sequence to return the element from. /// The zero-based index of the element to retrieve. /// An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence. /// is null. /// is less than zero. public static IObservable ElementAtOrDefault(this IObservable source, int index) { if (source == null) throw new ArgumentNullException("source"); if (index < 0) throw new ArgumentOutOfRangeException("index"); return s_impl.ElementAtOrDefault(source, index); } #endregion #region + FirstAsync + /// /// Returns the first element of an observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// Sequence containing the first element in the observable sequence. /// is null. /// (Asynchronous) The source sequence is empty. public static IObservable FirstAsync(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.FirstAsync(source); } /// /// Returns the first element of an observable sequence that satisfies the condition in the predicate. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// A predicate function to evaluate for elements in the source sequence. /// Sequence containing the first element in the observable sequence that satisfies the condition in the predicate. /// or is null. /// (Asynchronous) No element satisfies the condition in the predicate. -or- The source sequence is empty. public static IObservable FirstAsync(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.FirstAsync(source, predicate); } #endregion #region + FirstOrDefaultAsync + /// /// Returns the first element of an observable sequence, or a default value if no such element exists. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// Sequence containing the first element in the observable sequence, or a default value if no such element exists. /// is null. public static IObservable FirstOrDefaultAsync(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.FirstOrDefaultAsync(source); } /// /// Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// A predicate function to evaluate for elements in the source sequence. /// Sequence containing the first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. /// or is null. public static IObservable FirstOrDefaultAsync(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.FirstOrDefaultAsync(source, predicate); } #endregion #region + IsEmpty + /// /// Determines whether an observable sequence is empty. /// /// The type of the elements in the source sequence. /// An observable sequence to check for emptiness. /// An observable sequence containing a single element determining whether the source sequence is empty. /// is null. public static IObservable IsEmpty(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.IsEmpty(source); } #endregion #region + LastAsync + /// /// Returns the last element of an observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// Sequence containing the last element in the observable sequence. /// is null. /// (Asynchronous) The source sequence is empty. public static IObservable LastAsync(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.LastAsync(source); } /// /// Returns the last element of an observable sequence that satisfies the condition in the predicate. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// A predicate function to evaluate for elements in the source sequence. /// Sequence containing the last element in the observable sequence that satisfies the condition in the predicate. /// or is null. /// (Asynchronous) No element satisfies the condition in the predicate. -or- The source sequence is empty. public static IObservable LastAsync(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.LastAsync(source, predicate); } #endregion #region + LastOrDefaultAsync + /// /// Returns the last element of an observable sequence, or a default value if no such element exists. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// Sequence containing the last element in the observable sequence, or a default value if no such element exists. /// is null. public static IObservable LastOrDefaultAsync(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.LastOrDefaultAsync(source); } /// /// Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// A predicate function to evaluate for elements in the source sequence. /// Sequence containing the last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. /// or is null. public static IObservable LastOrDefaultAsync(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.LastOrDefaultAsync(source, predicate); } #endregion #region + LongCount + /// /// Returns an observable sequence containing an that represents the total number of elements in an observable sequence. /// /// The type of the elements in the source sequence. /// An observable sequence that contains elements to be counted. /// An observable sequence containing a single element with the number of elements in the input sequence. /// is null. /// (Asynchronous) The number of elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable LongCount(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.LongCount(source); } /// /// Returns an observable sequence containing an that represents how many elements in the specified observable sequence satisfy a condition. /// /// The type of the elements in the source sequence. /// An observable sequence that contains elements to be counted. /// A function to test each element for a condition. /// An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable LongCount(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.LongCount(source, predicate); } #endregion #region + Max + /// /// Returns the maximum element in an observable sequence. /// /// The type of the elements in the source sequence. /// An observable sequence to determine the maximum element of. /// An observable sequence containing a single element with the maximum element in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence according to the specified comparer. /// /// The type of the elements in the source sequence. /// An observable sequence to determine the maximum element of. /// Comparer used to compare elements. /// An observable sequence containing a single element with the maximum element in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.Max(source, comparer); } /// /// Returns the maximum value in an observable sequence of values. /// /// A sequence of values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence of values. /// /// A sequence of values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence of values. /// /// A sequence of values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence of values. /// /// A sequence of values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence of values. /// /// A sequence of values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Returns the maximum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the maximum value of. /// An observable sequence containing a single element with the maximum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Max(source); } /// /// Invokes a transform function on each element of a sequence and returns the maximum value. /// /// The type of the elements in the source sequence. /// The type of the objects derived from the elements in the source sequence to determine the maximum of. /// An observable sequence to determine the mimimum element of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value that corresponds to the maximum element in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum value according to the specified comparer. /// /// The type of the elements in the source sequence. /// The type of the objects derived from the elements in the source sequence to determine the maximum of. /// An observable sequence to determine the mimimum element of. /// A transform function to apply to each element. /// Comparer used to compare elements. /// An observable sequence containing a single element with the value that corresponds to the maximum element in the source sequence. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.Max(source, selector, comparer); } /// /// Invokes a transform function on each element of a sequence and returns the maximum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the maximum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the maximum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the maximum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Max(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Max(source, selector); } #endregion #region + MaxBy + /// /// Returns the elements in an observable sequence with the maximum key value. /// /// The type of the elements in the source sequence. /// The type of the key computed for each element in the source sequence. /// An observable sequence to get the maximum elements for. /// Key selector function. /// An observable sequence containing a list of zero or more elements that have a maximum key value. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> MaxBy(this IObservable source, Func keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return s_impl.MaxBy(source, keySelector); } /// /// Returns the elements in an observable sequence with the maximum key value according to the specified comparer. /// /// The type of the elements in the source sequence. /// The type of the key computed for each element in the source sequence. /// An observable sequence to get the maximum elements for. /// Key selector function. /// Comparer used to compare key values. /// An observable sequence containing a list of zero or more elements that have a maximum key value. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> MaxBy(this IObservable source, Func keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.MaxBy(source, keySelector, comparer); } #endregion #region + Min + /// /// Returns the minimum element in an observable sequence. /// /// The type of the elements in the source sequence. /// An observable sequence to determine the mimimum element of. /// An observable sequence containing a single element with the minimum element in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum element in an observable sequence according to the specified comparer. /// /// The type of the elements in the source sequence. /// An observable sequence to determine the mimimum element of. /// Comparer used to compare elements. /// An observable sequence containing a single element with the minimum element in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.Min(source, comparer); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Min(source); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// The type of the objects derived from the elements in the source sequence to determine the minimum of. /// An observable sequence to determine the mimimum element of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value that corresponds to the minimum element in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value according to the specified comparer. /// /// The type of the elements in the source sequence. /// The type of the objects derived from the elements in the source sequence to determine the minimum of. /// An observable sequence to determine the mimimum element of. /// A transform function to apply to each element. /// Comparer used to compare elements. /// An observable sequence containing a single element with the value that corresponds to the minimum element in the source sequence. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.Min(source, selector, comparer); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Min(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Min(source, selector); } #endregion #region + MinBy + /// /// Returns the elements in an observable sequence with the minimum key value. /// /// The type of the elements in the source sequence. /// The type of the key computed for each element in the source sequence. /// An observable sequence to get the minimum elements for. /// Key selector function. /// An observable sequence containing a list of zero or more elements that have a minimum key value. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> MinBy(this IObservable source, Func keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return s_impl.MinBy(source, keySelector); } /// /// Returns the elements in an observable sequence with the minimum key value according to the specified comparer. /// /// The type of the elements in the source sequence. /// The type of the key computed for each element in the source sequence. /// An observable sequence to get the minimum elements for. /// Key selector function. /// Comparer used to compare key values. /// An observable sequence containing a list of zero or more elements that have a minimum key value. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> MinBy(this IObservable source, Func keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.MinBy(source, keySelector, comparer); } #endregion #region + SequenceEqual + /// /// Determines whether two sequences are equal by comparing the elements pairwise. /// /// The type of the elements in the source sequence. /// First observable sequence to compare. /// Second observable sequence to compare. /// An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable SequenceEqual(this IObservable first, IObservable second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); return s_impl.SequenceEqual(first, second); } /// /// Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer. /// /// The type of the elements in the source sequence. /// First observable sequence to compare. /// Second observable sequence to compare. /// Comparer used to compare elements of both sequences. /// An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable SequenceEqual(this IObservable first, IObservable second, IEqualityComparer comparer) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.SequenceEqual(first, second, comparer); } /// /// Determines whether an observable and enumerable sequence are equal by comparing the elements pairwise. /// /// The type of the elements in the source sequence. /// First observable sequence to compare. /// Second observable sequence to compare. /// An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable SequenceEqual(this IObservable first, IEnumerable second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); return s_impl.SequenceEqual(first, second); } /// /// Determines whether an observable and enumerable sequence are equal by comparing the elements pairwise using a specified equality comparer. /// /// The type of the elements in the source sequence. /// First observable sequence to compare. /// Second observable sequence to compare. /// Comparer used to compare elements of both sequences. /// An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable SequenceEqual(this IObservable first, IEnumerable second, IEqualityComparer comparer) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.SequenceEqual(first, second, comparer); } #endregion #region + SingleAsync + /// /// Returns the only element of an observable sequence, and reports an exception if there is not exactly one element in the observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// Sequence containing the single element in the observable sequence. /// is null. /// (Asynchronous) The source sequence contains more than one element. -or- The source sequence is empty. public static IObservable SingleAsync(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.SingleAsync(source); } /// /// Returns the only element of an observable sequence that satisfies the condition in the predicate, and reports an exception if there is not exactly one element in the observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// A predicate function to evaluate for elements in the source sequence. /// Sequence containing the single element in the observable sequence that satisfies the condition in the predicate. /// or is null. /// (Asynchronous) No element satisfies the condition in the predicate. -or- More than one element satisfies the condition in the predicate. -or- The source sequence is empty. public static IObservable SingleAsync(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.SingleAsync(source, predicate); } #endregion #region + SingleOrDefaultAsync + /// /// Returns the only element of an observable sequence, or a default value if the observable sequence is empty; this method reports an exception if there is more than one element in the observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// Sequence containing the single element in the observable sequence, or a default value if no such element exists. /// is null. /// (Asynchronous) The source sequence contains more than one element. public static IObservable SingleOrDefaultAsync(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.SingleOrDefaultAsync(source); } /// /// Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// A predicate function to evaluate for elements in the source sequence. /// Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. /// or is null. /// (Asynchronous) The sequence contains more than one element that satisfies the condition in the predicate. public static IObservable SingleOrDefaultAsync(this IObservable source, Func predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); return s_impl.SingleOrDefaultAsync(source, predicate); } #endregion #region + Sum + /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.Sum(source); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable Sum(this IObservable source, Func selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); return s_impl.Sum(source, selector); } #endregion #region + ToArray + /// /// Creates an array from an observable sequence. /// /// The type of the elements in the source sequence. /// The source observable sequence to get an array of elements for. /// An observable sequence containing a single element with an array containing all the elements of the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable ToArray(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.ToArray(source); } #endregion #region + ToDictionary + /// /// Creates a dictionary from an observable sequence according to a specified key selector function. /// /// The type of the elements in the source sequence. /// The type of the dictionary key computed for each element in the source sequence. /// An observable sequence to create a dictionary for. /// A function to extract a key from each element. /// An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> ToDictionary(this IObservable source, Func keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return s_impl.ToDictionary(source, keySelector); } /// /// Creates a dictionary from an observable sequence according to a specified key selector function, and a comparer. /// /// The type of the elements in the source sequence. /// The type of the dictionary key computed for each element in the source sequence. /// An observable sequence to create a dictionary for. /// A function to extract a key from each element. /// An equality comparer to compare keys. /// An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> ToDictionary(this IObservable source, Func keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.ToDictionary(source, keySelector, comparer); } /// /// Creates a dictionary from an observable sequence according to a specified key selector function, and an element selector function. /// /// The type of the elements in the source sequence. /// The type of the dictionary key computed for each element in the source sequence. /// The type of the dictionary value computed for each element in the source sequence. /// An observable sequence to create a dictionary for. /// A function to extract a key from each element. /// A transform function to produce a result element value from each element. /// An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> ToDictionary(this IObservable source, Func keySelector, Func elementSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); return s_impl.ToDictionary(source, keySelector, elementSelector); } /// /// Creates a dictionary from an observable sequence according to a specified key selector function, a comparer, and an element selector function. /// /// The type of the elements in the source sequence. /// The type of the dictionary key computed for each element in the source sequence. /// The type of the dictionary value computed for each element in the source sequence. /// An observable sequence to create a dictionary for. /// A function to extract a key from each element. /// A transform function to produce a result element value from each element. /// An equality comparer to compare keys. /// An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. /// or or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> ToDictionary(this IObservable source, Func keySelector, Func elementSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.ToDictionary(source, keySelector, elementSelector, comparer); } #endregion #region + ToList + /// /// Creates a list from an observable sequence. /// /// The type of the elements in the source sequence. /// The source observable sequence to get a list of elements for. /// An observable sequence containing a single element with a list containing all the elements of the source sequence. /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> ToList(this IObservable source) { if (source == null) throw new ArgumentNullException("source"); return s_impl.ToList(source); } #endregion #region + ToLookup + /// /// Creates a lookup from an observable sequence according to a specified key selector function. /// /// The type of the elements in the source sequence. /// The type of the lookup key computed for each element in the source sequence. /// An observable sequence to create a lookup for. /// A function to extract a key from each element. /// An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> ToLookup(this IObservable source, Func keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return s_impl.ToLookup(source, keySelector); } /// /// Creates a lookup from an observable sequence according to a specified key selector function, and a comparer. /// /// The type of the elements in the source sequence. /// The type of the lookup key computed for each element in the source sequence. /// An observable sequence to create a lookup for. /// A function to extract a key from each element. /// An equality comparer to compare keys. /// An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> ToLookup(this IObservable source, Func keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.ToLookup(source, keySelector, comparer); } /// /// Creates a lookup from an observable sequence according to a specified key selector function, and an element selector function. /// /// The type of the elements in the source sequence. /// The type of the lookup key computed for each element in the source sequence. /// The type of the lookup value computed for each element in the source sequence. /// An observable sequence to create a lookup for. /// A function to extract a key from each element. /// A transform function to produce a result element value from each element. /// An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> ToLookup(this IObservable source, Func keySelector, Func elementSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); return s_impl.ToLookup(source, keySelector, elementSelector); } /// /// Creates a lookup from an observable sequence according to a specified key selector function, a comparer, and an element selector function. /// /// The type of the elements in the source sequence. /// The type of the lookup key computed for each element in the source sequence. /// The type of the lookup value computed for each element in the source sequence. /// An observable sequence to create a lookup for. /// A function to extract a key from each element. /// A transform function to produce a result element value from each element. /// An equality comparer to compare keys. /// An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. /// or or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IObservable> ToLookup(this IObservable source, Func keySelector, Func elementSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return s_impl.ToLookup(source, keySelector, elementSelector, comparer); } #endregion } }