// 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