/*
* WARNING: Auto-generated file (11/21/2013 11:07:25 AM)
* Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory).
*/
#pragma warning disable 1591
#if !NO_EXPRESSIONS
using System;
using System.Reactive.Concurrency;
using System.Collections.Generic;
using System.Reactive.Joins;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading;
using System.Reactive;
using System.Reactive.Subjects;
#if !NO_TPL
using System.Threading.Tasks;
#endif
#if !NO_REMOTING
using System.Runtime.Remoting.Lifetime;
#endif
namespace System.Reactive.Linq
{
public static partial class Qbservable
{
///
/// 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 IQbservable Aggregate(this IQbservable source, Expression> accumulator)
{
if (source == null)
throw new ArgumentNullException("source");
if (accumulator == null)
throw new ArgumentNullException("accumulator");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Aggregate(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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.
/// 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 IQbservable Aggregate(this IQbservable source, TAccumulate seed, Expression> accumulator)
{
if (source == null)
throw new ArgumentNullException("source");
if (accumulator == null)
throw new ArgumentNullException("accumulator");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Aggregate(default(IQbservable), default(TAccumulate), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)),
#endif
source.Expression,
Expression.Constant(seed, typeof(TAccumulate)),
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 IQbservable Aggregate(this IQbservable source, TAccumulate seed, Expression> accumulator, Expression> resultSelector)
{
if (source == null)
throw new ArgumentNullException("source");
if (accumulator == null)
throw new ArgumentNullException("accumulator");
if (resultSelector == null)
throw new ArgumentNullException("resultSelector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Aggregate(default(IQbservable), default(TAccumulate), default(Expression>), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)),
#endif
source.Expression,
Expression.Constant(seed, typeof(TAccumulate)),
accumulator,
resultSelector
)
);
}
///
/// 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 IQbservable All(this IQbservable source, Expression> predicate)
{
if (source == null)
throw new ArgumentNullException("source");
if (predicate == null)
throw new ArgumentNullException("predicate");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.All(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
predicate
)
);
}
///
/// Propagates the observable sequence that reacts first.
///
/// The type of the elements in the source sequences.
/// First observable sequence.
/// Second observable sequence.
/// An observable sequence that surfaces either of the given sequences, whichever reacted first.
///
/// or is null.
public static IQbservable Amb(this IQbservable first, IObservable second)
{
if (first == null)
throw new ArgumentNullException("first");
if (second == null)
throw new ArgumentNullException("second");
return first.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Amb(default(IQbservable), default(IObservable))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
first.Expression,
GetSourceExpression(second)
)
);
}
///
/// Propagates the observable sequence that reacts first.
///
/// Query provider used to construct the IQbservable<T> data source.
/// The type of the elements in the source sequences.
/// Observable sources competing to react first.
/// An observable sequence that surfaces any of the given sequences, whichever reacted first.
///
/// is null.
public static IQbservable Amb(this IQbservableProvider provider, params IObservable[] sources)
{
if (provider == null)
throw new ArgumentNullException("provider");
if (sources == null)
throw new ArgumentNullException("sources");
return provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Amb(default(IQbservableProvider), default(IObservable[]))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
Expression.Constant(provider, typeof(IQbservableProvider)),
GetSourceExpression(sources)
)
);
}
///
/// Propagates the observable sequence that reacts first.
///
/// Query provider used to construct the IQbservable<T> data source.
/// The type of the elements in the source sequences.
/// Observable sources competing to react first.
/// An observable sequence that surfaces any of the given sequences, whichever reacted first.
///
/// is null.
public static IQbservable Amb(this IQbservableProvider provider, IEnumerable> sources)
{
if (provider == null)
throw new ArgumentNullException("provider");
if (sources == null)
throw new ArgumentNullException("sources");
return provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Amb(default(IQbservableProvider), default(IEnumerable>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
Expression.Constant(provider, typeof(IQbservableProvider)),
GetSourceExpression(sources)
)
);
}
///
/// 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 IQbservable Any(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Any(default(IQbservable))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Any(this IQbservable source, Expression> predicate)
{
if (source == null)
throw new ArgumentNullException("source");
if (predicate == null)
throw new ArgumentNullException("predicate");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Any(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
predicate
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
source.Expression
)
);
}
///
/// 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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
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 IQbservable Average(this IQbservable source, Expression> selector)
{
if (source == null)
throw new ArgumentNullException("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Average(default(IQbservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
selector
)
);
}
///
/// Projects each element of an observable sequence into consecutive non-overlapping buffers which are produced based on element count information.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// Source sequence to produce buffers over.
/// Length of each buffer.
/// An observable sequence of buffers.
///
/// is null.
///
/// is less than or equal to zero.
public static IQbservable> Buffer(this IQbservable source, int count)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(int))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
Expression.Constant(count, typeof(int))
)
);
}
///
/// Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// Source sequence to produce buffers over.
/// Length of each buffer.
/// Number of elements to skip between creation of consecutive buffers.
/// An observable sequence of buffers.
///
/// is null.
///
/// or is less than or equal to zero.
public static IQbservable> Buffer(this IQbservable source, int count, int skip)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(int), default(int))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
Expression.Constant(count, typeof(int)),
Expression.Constant(skip, typeof(int))
)
);
}
///
/// Projects each element of an observable sequence into consecutive non-overlapping buffers which are produced based on timing information.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// Source sequence to produce buffers over.
/// Length of each buffer.
/// An observable sequence of buffers.
///
/// is null.
///
/// is less than TimeSpan.Zero.
///
/// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create buffers as fast as it can.
/// Because all source sequence elements end up in one of the buffers, some buffers won't have a zero time span. This is a side-effect of the asynchrony introduced
/// by the scheduler, where the action to close the current buffer and to create a new buffer may not execute immediately, despite the TimeSpan.Zero due time.
///
public static IQbservable> Buffer(this IQbservable source, TimeSpan timeSpan)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(TimeSpan))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
Expression.Constant(timeSpan, typeof(TimeSpan))
)
);
}
///
/// Projects each element of an observable sequence into a buffer that's sent out when either it's full or a given amount of time has elapsed.
/// A useful real-world analogy of this overload is the behavior of a ferry leaving the dock when all seats are taken, or at the scheduled time of departure, whichever event occurs first.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// Source sequence to produce buffers over.
/// Maximum time length of a window.
/// Maximum element count of a window.
/// An observable sequence of buffers.
///
/// is null.
///
/// is less than TimeSpan.Zero. -or- is less than or equal to zero.
///
/// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create buffers as fast as it can.
/// Because all source sequence elements end up in one of the buffers, some buffers won't have a zero time span. This is a side-effect of the asynchrony introduced
/// by the scheduler, where the action to close the current buffer and to create a new buffer may not execute immediately, despite the TimeSpan.Zero due time.
///
public static IQbservable> Buffer(this IQbservable source, TimeSpan timeSpan, int count)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(TimeSpan), default(int))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
Expression.Constant(timeSpan, typeof(TimeSpan)),
Expression.Constant(count, typeof(int))
)
);
}
///
/// Projects each element of an observable sequence into a buffer that's sent out when either it's full or a given amount of time has elapsed, using the specified scheduler to run timers.
/// A useful real-world analogy of this overload is the behavior of a ferry leaving the dock when all seats are taken, or at the scheduled time of departure, whichever event occurs first.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// Source sequence to produce buffers over.
/// Maximum time length of a buffer.
/// Maximum element count of a buffer.
/// Scheduler to run buffering timers on.
/// An observable sequence of buffers.
///
/// or is null.
///
/// is less than TimeSpan.Zero. -or- is less than or equal to zero.
///
/// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create buffers as fast as it can.
/// Because all source sequence elements end up in one of the buffers, some buffers won't have a zero time span. This is a side-effect of the asynchrony introduced
/// by the scheduler, where the action to close the current buffer and to create a new buffer may not execute immediately, despite the TimeSpan.Zero due time.
///
public static IQbservable> Buffer(this IQbservable source, TimeSpan timeSpan, int count, IScheduler scheduler)
{
if (source == null)
throw new ArgumentNullException("source");
if (scheduler == null)
throw new ArgumentNullException("scheduler");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(TimeSpan), default(int), default(IScheduler))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
Expression.Constant(timeSpan, typeof(TimeSpan)),
Expression.Constant(count, typeof(int)),
Expression.Constant(scheduler, typeof(IScheduler))
)
);
}
///
/// Projects each element of an observable sequence into consecutive non-overlapping buffers which are produced based on timing information, using the specified scheduler to run timers.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// Source sequence to produce buffers over.
/// Length of each buffer.
/// Scheduler to run buffering timers on.
/// An observable sequence of buffers.
///
/// or is null.
///
/// is less than TimeSpan.Zero.
///
/// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create buffers as fast as it can.
/// Because all source sequence elements end up in one of the buffers, some buffers won't have a zero time span. This is a side-effect of the asynchrony introduced
/// by the scheduler, where the action to close the current buffer and to create a new buffer may not execute immediately, despite the TimeSpan.Zero due time.
///
public static IQbservable> Buffer(this IQbservable source, TimeSpan timeSpan, IScheduler scheduler)
{
if (source == null)
throw new ArgumentNullException("source");
if (scheduler == null)
throw new ArgumentNullException("scheduler");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(TimeSpan), default(IScheduler))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
Expression.Constant(timeSpan, typeof(TimeSpan)),
Expression.Constant(scheduler, typeof(IScheduler))
)
);
}
///
/// Projects each element of an observable sequence into zero or more buffers which are produced based on timing information.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// Source sequence to produce buffers over.
/// Length of each buffer.
/// Interval between creation of consecutive buffers.
/// An observable sequence of buffers.
///
/// is null.
///
/// or is less than TimeSpan.Zero.
///
///
/// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create buffers with minimum duration
/// length. However, some buffers won't have a zero time span. This is a side-effect of the asynchrony introduced by the scheduler, where the action to close the
/// current buffer may not execute immediately, despite the TimeSpan.Zero due time.
///
///
/// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create buffers as fast as it can.
/// However, this doesn't mean all buffers will start at the beginning of the source sequence. This is a side-effect of the asynchrony introduced by the scheduler,
/// where the action to create a new buffer may not execute immediately, despite the TimeSpan.Zero due time.
///
///
public static IQbservable> Buffer(this IQbservable source, TimeSpan timeSpan, TimeSpan timeShift)
{
if (source == null)
throw new ArgumentNullException("source");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(TimeSpan), default(TimeSpan))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
Expression.Constant(timeSpan, typeof(TimeSpan)),
Expression.Constant(timeShift, typeof(TimeSpan))
)
);
}
///
/// Projects each element of an observable sequence into zero or more buffers which are produced based on timing information, using the specified scheduler to run timers.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// Source sequence to produce buffers over.
/// Length of each buffer.
/// Interval between creation of consecutive buffers.
/// Scheduler to run buffering timers on.
/// An observable sequence of buffers.
///
/// or is null.
///
/// or is less than TimeSpan.Zero.
///
///
/// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create buffers with minimum duration
/// length. However, some buffers won't have a zero time span. This is a side-effect of the asynchrony introduced by the scheduler, where the action to close the
/// current buffer may not execute immediately, despite the TimeSpan.Zero due time.
///
///
/// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create buffers as fast as it can.
/// However, this doesn't mean all buffers will start at the beginning of the source sequence. This is a side-effect of the asynchrony introduced by the scheduler,
/// where the action to create a new buffer may not execute immediately, despite the TimeSpan.Zero due time.
///
///
public static IQbservable> Buffer(this IQbservable source, TimeSpan timeSpan, TimeSpan timeShift, IScheduler scheduler)
{
if (source == null)
throw new ArgumentNullException("source");
if (scheduler == null)
throw new ArgumentNullException("scheduler");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(TimeSpan), default(TimeSpan), default(IScheduler))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
source.Expression,
Expression.Constant(timeSpan, typeof(TimeSpan)),
Expression.Constant(timeShift, typeof(TimeSpan)),
Expression.Constant(scheduler, typeof(IScheduler))
)
);
}
///
/// Projects each element of an observable sequence into consecutive non-overlapping buffers.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// The type of the elements in the sequences indicating buffer boundary events.
/// Source sequence to produce buffers over.
/// Sequence of buffer boundary markers. The current buffer is closed and a new buffer is opened upon receiving a boundary marker.
/// An observable sequence of buffers.
///
/// or is null.
public static IQbservable> Buffer(this IQbservable source, IObservable bufferBoundaries)
{
if (source == null)
throw new ArgumentNullException("source");
if (bufferBoundaries == null)
throw new ArgumentNullException("bufferBoundaries");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(IObservable))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TBufferBoundary)),
#endif
source.Expression,
GetSourceExpression(bufferBoundaries)
)
);
}
///
/// Projects each element of an observable sequence into consecutive non-overlapping buffers.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// The type of the elements in the sequences indicating buffer closing events.
/// Source sequence to produce buffers over.
/// A function invoked to define the boundaries of the produced buffers. A new buffer is started when the previous one is closed.
/// An observable sequence of buffers.
///
/// or is null.
public static IQbservable> Buffer(this IQbservable source, Expression>> bufferClosingSelector)
{
if (source == null)
throw new ArgumentNullException("source");
if (bufferClosingSelector == null)
throw new ArgumentNullException("bufferClosingSelector");
return source.Provider.CreateQuery>(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => Qbservable.Buffer(default(IQbservable), default(Expression>>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TBufferClosing)),
#endif
source.Expression,
bufferClosingSelector
)
);
}
///
/// Projects each element of an observable sequence into zero or more buffers.
///
/// The type of the elements in the source sequence, and in the lists in the result sequence.
/// The type of the elements in the sequence indicating buffer opening events, also passed to the closing selector to obtain a sequence of buffer closing events.
/// The type of the elements in the sequences indicating buffer closing events.
/// Source sequence to produce buffers over.
/// Observable sequence whose elements denote the creation of new buffers.
/// A function invoked to define the closing of each produced buffer.
/// An observable sequence of buffers.
///
/// or or is null.
public static IQbservable> Buffer(this IQbservable