/* * WARNING: Auto-generated file (8/14/2012 12:14:10 AM) */ #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 source, IObservable bufferOpenings, Expression>> bufferClosingSelector) { if (source == null) throw new ArgumentNullException("source"); if (bufferOpenings == null) throw new ArgumentNullException("bufferOpenings"); if (bufferClosingSelector == null) throw new ArgumentNullException("bufferClosingSelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Buffer(default(IQbservable), default(IObservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TBufferOpening), typeof(TBufferClosing)), #endif source.Expression, GetSourceExpression(bufferOpenings), bufferClosingSelector ) ); } /// /// Uses to determine which source in to return, choosing an empty sequence if no match is found. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the value returned by the selector function, used to look up the resulting source. /// The type of the elements in the result sequence. /// Selector function invoked to determine the source to lookup in the dictionary. /// Dictionary of sources to select from based on the invocation result. /// The observable sequence retrieved from the dictionary based on the invocation result, or an empty sequence if no match is found. /// /// or is null. public static IQbservable Case(this IQbservableProvider provider, Expression> selector, IDictionary> sources) { if (provider == null) throw new ArgumentNullException("provider"); if (selector == null) throw new ArgumentNullException("selector"); if (sources == null) throw new ArgumentNullException("sources"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Case(default(IQbservableProvider), default(Expression>), default(IDictionary>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TValue), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), selector, Expression.Constant(sources, typeof(IDictionary>)) ) ); } /// /// Uses to determine which source in to return, choosing if no match is found. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the value returned by the selector function, used to look up the resulting source. /// The type of the elements in the result sequence. /// Selector function invoked to determine the source to lookup in the dictionary. /// Dictionary of sources to select from based on the invocation result. /// Default source to select in case no matching source in is found. /// The observable sequence retrieved from the dictionary based on the invocation result, or if no match is found. /// /// or or is null. public static IQbservable Case(this IQbservableProvider provider, Expression> selector, IDictionary> sources, IObservable defaultSource) { if (provider == null) throw new ArgumentNullException("provider"); if (selector == null) throw new ArgumentNullException("selector"); if (sources == null) throw new ArgumentNullException("sources"); if (defaultSource == null) throw new ArgumentNullException("defaultSource"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Case(default(IQbservableProvider), default(Expression>), default(IDictionary>), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TValue), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), selector, Expression.Constant(sources, typeof(IDictionary>)), GetSourceExpression(defaultSource) ) ); } /// /// Uses to determine which source in to return, choosing an empty sequence on the specified scheduler if no match is found. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the value returned by the selector function, used to look up the resulting source. /// The type of the elements in the result sequence. /// Selector function invoked to determine the source to lookup in the dictionary. /// Dictionary of sources to select from based on the invocation result. /// Scheduler to generate an empty sequence on in case no matching source in is found. /// The observable sequence retrieved from the dictionary based on the invocation result, or an empty sequence if no match is found. /// /// or or is null. public static IQbservable Case(this IQbservableProvider provider, Expression> selector, IDictionary> sources, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (selector == null) throw new ArgumentNullException("selector"); if (sources == null) throw new ArgumentNullException("sources"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Case(default(IQbservableProvider), default(Expression>), default(IDictionary>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TValue), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), selector, Expression.Constant(sources, typeof(IDictionary>)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts the elements of an observable sequence to the specified type. /// /// The type to convert the elements in the source sequence to. /// The observable sequence that contains the elements to be converted. /// An observable sequence that contains each element of the source sequence converted to the specified type. /// /// is null. public static IQbservable Cast(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Cast(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif source.Expression ) ); } /// /// Continues an observable sequence that is terminated by an exception with the next observable sequence. /// /// The type of the elements in the source sequence and handler sequence. /// First observable sequence whose exception (if any) is caught. /// Second observable sequence used to produce results when an error occurred in the first sequence. /// An observable sequence containing the first sequence's elements, followed by the elements of the second sequence in case an exception occurred. /// /// or is null. public static IQbservable Catch(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.Catch(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif first.Expression, GetSourceExpression(second) ) ); } /// /// Continues an observable sequence that is terminated by an exception with the next observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source and handler sequences. /// Observable sequences to catch exceptions for. /// An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. /// /// is null. public static IQbservable Catch(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.Catch(default(IQbservableProvider), default(IObservable[]))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Continues an observable sequence that is terminated by an exception with the next observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source and handler sequences. /// Observable sequences to catch exceptions for. /// An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. /// /// is null. public static IQbservable Catch(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.Catch(default(IQbservableProvider), default(IEnumerable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Continues an observable sequence that is terminated by an exception of the specified type with the observable sequence produced by the handler. /// /// The type of the elements in the source sequence and sequences returned by the exception handler function. /// The type of the exception to catch and handle. Needs to derive from . /// Source sequence. /// Exception handler function, producing another observable sequence. /// An observable sequence containing the source sequence's elements, followed by the elements produced by the handler's resulting observable sequence in case an exception occurred. /// /// or is null. public static IQbservable Catch(this IQbservable source, Expression>> handler) where TException : Exception { if (source == null) throw new ArgumentNullException("source"); if (handler == null) throw new ArgumentNullException("handler"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Catch(default(IQbservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TException)), #endif source.Expression, handler ) ); } /// /// Produces an enumerable sequence of consecutive (possibly empty) chunks of the source sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// The enumerable sequence that returns consecutive (possibly empty) chunks upon each iteration. /// /// is null. /// This operator requires the source's object (see ) to implement . public static IQueryable> Chunkify(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return ((IQueryProvider)source.Provider).CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Chunkify(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Produces an enumerable sequence that returns elements collected/aggregated from the source sequence between consecutive iterations. /// /// The type of the elements in the source sequence. /// The type of the elements produced by the merge operation during collection. /// Source observable sequence. /// Factory to create the initial collector object. /// Merges a sequence element with the current collector. /// Factory to replace the current collector by a new collector. /// The enumerable sequence that returns collected/aggregated elements from the source sequence upon each iteration. /// /// or or or is null. /// This operator requires the source's object (see ) to implement . public static IQueryable Collect(this IQbservable source, Expression> getInitialCollector, Expression> merge, Expression> getNewCollector) { if (source == null) throw new ArgumentNullException("source"); if (getInitialCollector == null) throw new ArgumentNullException("getInitialCollector"); if (merge == null) throw new ArgumentNullException("merge"); if (getNewCollector == null) throw new ArgumentNullException("getNewCollector"); return ((IQueryProvider)source.Provider).CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Collect(default(IQbservable), default(Expression>), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, getInitialCollector, merge, getNewCollector ) ); } /// /// Produces an enumerable sequence that returns elements collected/aggregated from the source sequence between consecutive iterations. /// /// The type of the elements in the source sequence. /// The type of the elements produced by the merge operation during collection. /// Source observable sequence. /// Factory to create a new collector object. /// Merges a sequence element with the current collector. /// The enumerable sequence that returns collected/aggregated elements from the source sequence upon each iteration. /// /// or or is null. /// This operator requires the source's object (see ) to implement . public static IQueryable Collect(this IQbservable source, Expression> newCollector, Expression> merge) { if (source == null) throw new ArgumentNullException("source"); if (newCollector == null) throw new ArgumentNullException("newCollector"); if (merge == null) throw new ArgumentNullException("merge"); return ((IQueryProvider)source.Provider).CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Collect(default(IQbservable), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, newCollector, merge ) ); } /// /// Merges the specified observable sequences into one observable sequence by emitting a list with the latest source elements whenever any of the observable sequences produces an element. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences, and in the lists in the result sequence. /// Observable sources. /// An observable sequence containing lists of the latest elements of the sources. /// /// is null. public static IQbservable> CombineLatest(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.CombineLatest(default(IQbservableProvider), default(IEnumerable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Merges the specified observable sequences into one observable sequence by emitting a list with the latest source elements whenever any of the observable sequences produces an element. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences, and in the lists in the result sequence. /// Observable sources. /// An observable sequence containing lists of the latest elements of the sources. /// /// is null. public static IQbservable> CombineLatest(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.CombineLatest(default(IQbservableProvider), default(IObservable[]))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// The type of the elements in the result sequence, returned by the selector function. /// Observable sources. /// Function to invoke whenever any of the sources produces an element. For efficiency, the input list is reused after the selector returns. Either aggregate or copy the values during the function call. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or is null. public static IQbservable CombineLatest(this IQbservableProvider provider, IEnumerable> sources, Expression, TResult>> resultSelector) { if (provider == null) throw new ArgumentNullException("provider"); if (sources == null) throw new ArgumentNullException("sources"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservableProvider), default(IEnumerable>), default(Expression, TResult>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources), resultSelector ) ); } /// /// Merges two observable sequences into one observable sequence by using the selector function whenever one of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Function to invoke whenever either of the sources produces an element. /// An observable sequence containing the result of combining elements of both sources using the specified result selector function. /// /// or or is null. public static IQbservable CombineLatest(this IQbservable first, IObservable second, Expression> resultSelector) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return first.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)), #endif first.Expression, GetSourceExpression(second), resultSelector ) ); } /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), resultSelector ) ); } /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), resultSelector ) ); } #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the thirteenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Thirteenth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, IObservable source13, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (source13 == null) throw new ArgumentNullException("source13"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TSource13), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), GetSourceExpression(source13), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the thirteenth source sequence. /// The type of the elements in the fourteenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Thirteenth observable source. /// Fourteenth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, IObservable source13, IObservable source14, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (source13 == null) throw new ArgumentNullException("source13"); if (source14 == null) throw new ArgumentNullException("source14"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TSource13), typeof(TSource14), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), GetSourceExpression(source13), GetSourceExpression(source14), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the thirteenth source sequence. /// The type of the elements in the fourteenth source sequence. /// The type of the elements in the fifteenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Thirteenth observable source. /// Fourteenth observable source. /// Fifteenth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, IObservable source13, IObservable source14, IObservable source15, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (source13 == null) throw new ArgumentNullException("source13"); if (source14 == null) throw new ArgumentNullException("source14"); if (source15 == null) throw new ArgumentNullException("source15"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TSource13), typeof(TSource14), typeof(TSource15), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), GetSourceExpression(source13), GetSourceExpression(source14), GetSourceExpression(source15), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the thirteenth source sequence. /// The type of the elements in the fourteenth source sequence. /// The type of the elements in the fifteenth source sequence. /// The type of the elements in the sixteenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Thirteenth observable source. /// Fourteenth observable source. /// Fifteenth observable source. /// Sixteenth observable source. /// Function to invoke whenever any of the sources produces an element. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or or or or or is null. public static IQbservable CombineLatest(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, IObservable source13, IObservable source14, IObservable source15, IObservable source16, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (source13 == null) throw new ArgumentNullException("source13"); if (source14 == null) throw new ArgumentNullException("source14"); if (source15 == null) throw new ArgumentNullException("source15"); if (source16 == null) throw new ArgumentNullException("source16"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.CombineLatest(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TSource13), typeof(TSource14), typeof(TSource15), typeof(TSource16), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), GetSourceExpression(source13), GetSourceExpression(source14), GetSourceExpression(source15), GetSourceExpression(source16), resultSelector ) ); } #endif /// /// Concatenates the second observable sequence to the first observable sequence upon successful termination of the first. /// /// The type of the elements in the source sequences. /// First observable sequence. /// Second observable sequence. /// An observable sequence that contains the elements of the first sequence, followed by those of the second the sequence. /// /// or is null. public static IQbservable Concat(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.Concat(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif first.Expression, GetSourceExpression(second) ) ); } /// /// Concatenates all of the specified observable sequences, as long as the previous observable sequence terminated successfully. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Observable sequences to concatenate. /// An observable sequence that contains the elements of each given sequence, in sequential order. /// /// is null. public static IQbservable Concat(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.Concat(default(IQbservableProvider), default(IObservable[]))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Concatenates all observable sequences in the given enumerable sequence, as long as the previous observable sequence terminated successfully. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Observable sequences to concatenate. /// An observable sequence that contains the elements of each given sequence, in sequential order. /// /// is null. public static IQbservable Concat(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.Concat(default(IQbservableProvider), default(IEnumerable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Concatenates all inner observable sequences, as long as the previous observable sequence terminated successfully. /// /// The type of the elements in the source sequences. /// Observable sequence of inner observable sequences. /// An observable sequence that contains the elements of each observed inner sequence, in sequential order. /// /// is null. public static IQbservable Concat(this IQbservable> sources) { if (sources == null) throw new ArgumentNullException("sources"); return sources.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Concat(default(IQbservable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif sources.Expression ) ); } #if !NO_TPL /// /// Concatenates all task results, as long as the previous task terminated successfully. /// /// The type of the results produced by the tasks. /// Observable sequence of tasks. /// An observable sequence that contains the results of each task, in sequential order. /// /// is null. /// If the tasks support cancellation, consider manual conversion of the tasks using , followed by a concatenation operation using . public static IQbservable Concat(this IQbservable> sources) { if (sources == null) throw new ArgumentNullException("sources"); return sources.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Concat(default(IQbservable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif sources.Expression ) ); } #endif /// /// 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 IQbservable Contains(this IQbservable source, TSource value) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Contains(default(IQbservable), default(TSource))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(value, typeof(TSource)) ) ); } /// /// 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 IQbservable Contains(this IQbservable source, TSource value, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Contains(default(IQbservable), default(TSource), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// 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 IQbservable Count(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Count(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// 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 IQbservable Count(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.Count(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Creates an observable sequence from a specified Subscribe method implementation. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// Implementation of the resulting observable sequence's Subscribe method. /// The observable sequence with the specified implementation for the Subscribe method. /// /// is null. /// /// Use of this operator is preferred over manual implementation of the IObservable<T> interface. In case /// you need a type implementing IObservable<T> rather than an anonymous implementation, consider using /// the abstract base class. /// public static IQbservable Create(this IQbservableProvider provider, Expression, IDisposable>> subscribe) { if (provider == null) throw new ArgumentNullException("provider"); if (subscribe == null) throw new ArgumentNullException("subscribe"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Create(default(IQbservableProvider), default(Expression, IDisposable>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), subscribe ) ); } /// /// Creates an observable sequence from a specified Subscribe method implementation. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// Implementation of the resulting observable sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable. /// The observable sequence with the specified implementation for the Subscribe method. /// /// is null. /// /// Use of this operator is preferred over manual implementation of the IObservable<T> interface. In case /// you need a type implementing IObservable<T> rather than an anonymous implementation, consider using /// the abstract base class. /// public static IQbservable Create(this IQbservableProvider provider, Expression, Action>> subscribe) { if (provider == null) throw new ArgumentNullException("provider"); if (subscribe == null) throw new ArgumentNullException("subscribe"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Create(default(IQbservableProvider), default(Expression, Action>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), subscribe ) ); } #if !NO_TPL /// /// Creates an observable sequence from a specified cancellable asynchronous Subscribe method. /// The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// Asynchronous method used to produce elements. /// The observable sequence surfacing the elements produced by the asynchronous method. /// /// is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. /// When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous subscribe function will be signaled. public static IQbservable Create(this IQbservableProvider provider, Expression, CancellationToken, Task>> subscribeAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (subscribeAsync == null) throw new ArgumentNullException("subscribeAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Create(default(IQbservableProvider), default(Expression, CancellationToken, Task>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), subscribeAsync ) ); } #endif #if !NO_TPL /// /// Creates an observable sequence from a specified asynchronous Subscribe method. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// Asynchronous method used to produce elements. /// The observable sequence surfacing the elements produced by the asynchronous method. /// /// is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. public static IQbservable Create(this IQbservableProvider provider, Expression, Task>> subscribeAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (subscribeAsync == null) throw new ArgumentNullException("subscribeAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Create(default(IQbservableProvider), default(Expression, Task>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), subscribeAsync ) ); } #endif #if !NO_TPL /// /// Creates an observable sequence from a specified cancellable asynchronous Subscribe method. /// The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// Asynchronous method used to implemented the resulting sequence's Subscribe method. /// The observable sequence with the specified implementation for the Subscribe method. /// /// is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. /// When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous subscribe function will be signaled. public static IQbservable Create(this IQbservableProvider provider, Expression, CancellationToken, Task>> subscribeAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (subscribeAsync == null) throw new ArgumentNullException("subscribeAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Create(default(IQbservableProvider), default(Expression, CancellationToken, Task>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), subscribeAsync ) ); } #endif #if !NO_TPL /// /// Creates an observable sequence from a specified asynchronous Subscribe method. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// Asynchronous method used to implemented the resulting sequence's Subscribe method. /// The observable sequence with the specified implementation for the Subscribe method. /// /// is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. public static IQbservable Create(this IQbservableProvider provider, Expression, Task>> subscribeAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (subscribeAsync == null) throw new ArgumentNullException("subscribeAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Create(default(IQbservableProvider), default(Expression, Task>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), subscribeAsync ) ); } #endif #if !NO_TPL /// /// Creates an observable sequence from a specified cancellable asynchronous Subscribe method. /// The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// Asynchronous method used to implemented the resulting sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable. /// The observable sequence with the specified implementation for the Subscribe method. /// /// is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. /// When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous subscribe function will be signaled. public static IQbservable Create(this IQbservableProvider provider, Expression, CancellationToken, Task>> subscribeAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (subscribeAsync == null) throw new ArgumentNullException("subscribeAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Create(default(IQbservableProvider), default(Expression, CancellationToken, Task>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), subscribeAsync ) ); } #endif #if !NO_TPL /// /// Creates an observable sequence from a specified asynchronous Subscribe method. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// Asynchronous method used to implemented the resulting sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable. /// The observable sequence with the specified implementation for the Subscribe method. /// /// is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. public static IQbservable Create(this IQbservableProvider provider, Expression, Task>> subscribeAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (subscribeAsync == null) throw new ArgumentNullException("subscribeAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Create(default(IQbservableProvider), default(Expression, Task>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), subscribeAsync ) ); } #endif /// /// Returns the elements of the specified sequence or the type parameter's default value in a singleton sequence if the sequence is empty. /// /// The type of the elements in the source sequence (if any), whose default value will be taken if the sequence is empty. /// The sequence to return a default value for if it is empty. /// An observable sequence that contains the default value for the TSource type if the source is empty; otherwise, the elements of the source itself. /// /// is null. public static IQbservable DefaultIfEmpty(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DefaultIfEmpty(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. /// /// The type of the elements in the source sequence (if any), and the specified default value which will be taken if the sequence is empty. /// The sequence to return the specified value for if it is empty. /// The value to return if the sequence is empty. /// An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. /// /// is null. public static IQbservable DefaultIfEmpty(this IQbservable source, TSource defaultValue) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DefaultIfEmpty(default(IQbservable), default(TSource))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(defaultValue, typeof(TSource)) ) ); } /// /// Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the sequence returned by the factory function, and in the resulting sequence. /// Observable factory function to invoke for each observer that subscribes to the resulting sequence. /// An observable sequence whose observers trigger an invocation of the given observable factory function. /// /// is null. public static IQbservable Defer(this IQbservableProvider provider, Expression>> observableFactory) { if (provider == null) throw new ArgumentNullException("provider"); if (observableFactory == null) throw new ArgumentNullException("observableFactory"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Defer(default(IQbservableProvider), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), observableFactory ) ); } #if !NO_TPL /// /// Returns an observable sequence that starts the specified asynchronous factory function whenever a new observer subscribes. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the sequence returned by the factory function, and in the resulting sequence. /// Asynchronous factory function to start for each observer that subscribes to the resulting sequence. /// An observable sequence whose observers trigger the given asynchronous observable factory function to be started. /// /// is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. public static IQbservable Defer(this IQbservableProvider provider, Expression>>> observableFactoryAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (observableFactoryAsync == null) throw new ArgumentNullException("observableFactoryAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Defer(default(IQbservableProvider), default(Expression>>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), observableFactoryAsync ) ); } #endif #if !NO_TPL /// /// Returns an observable sequence that starts the specified cancellable asynchronous factory function whenever a new observer subscribes. /// The CancellationToken passed to the asynchronous factory function is tied to the returned disposable subscription, allowing best-effort cancellation. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the sequence returned by the factory function, and in the resulting sequence. /// Asynchronous factory function to start for each observer that subscribes to the resulting sequence. /// An observable sequence whose observers trigger the given asynchronous observable factory function to be started. /// /// is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. /// When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous observable factory function will be signaled. public static IQbservable DeferAsync(this IQbservableProvider provider, Expression>>> observableFactoryAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (observableFactoryAsync == null) throw new ArgumentNullException("observableFactoryAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DeferAsync(default(IQbservableProvider), default(Expression>>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), observableFactoryAsync ) ); } #endif /// /// Time shifts the observable sequence to start propagating notifications at the specified absolute time. /// The relative time intervals between the values are preserved. /// /// The type of the elements in the source sequence. /// Source sequence to delay values for. /// Absolute time used to shift the observable sequence; the relative time shift gets computed upon subscription. If this value is less than or equal to DateTimeOffset.UtcNow, the scheduler will dispatch observer callbacks as soon as possible. /// Time-shifted sequence. /// /// is null. /// /// /// This operator is less efficient than DelaySubscription because it records all notifications and time-delays those. This allows for immediate propagation of errors. /// /// /// Observer callbacks for the resulting sequence will be run on the default scheduler. This effect is similar to using ObserveOn. /// /// /// Exceptions signaled by the source sequence through an OnError callback are forwarded immediately to the result sequence. Any OnNext notifications that were in the queue at the point of the OnError callback will be dropped. /// In order to delay error propagation, consider using the Observable.Materialize and Observable.Dematerialize operators, or use DelaySubscription. /// /// public static IQbservable Delay(this IQbservable source, DateTimeOffset dueTime) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Delay(default(IQbservable), default(DateTimeOffset))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(DateTimeOffset)) ) ); } /// /// Time shifts the observable sequence to start propagating notifications at the specified absolute time, using the specified scheduler to run timers. /// The relative time intervals between the values are preserved. /// /// The type of the elements in the source sequence. /// Source sequence to delay values for. /// Absolute time used to shift the observable sequence; the relative time shift gets computed upon subscription. If this value is less than or equal to DateTimeOffset.UtcNow, the scheduler will dispatch observer callbacks as soon as possible. /// Scheduler to run the delay timers on. /// Time-shifted sequence. /// /// or is null. /// /// /// This operator is less efficient than DelaySubscription because it records all notifications and time-delays those. This allows for immediate propagation of errors. /// /// /// Observer callbacks for the resulting sequence will be run on the specified scheduler. This effect is similar to using ObserveOn. /// /// /// Exceptions signaled by the source sequence through an OnError callback are forwarded immediately to the result sequence. Any OnNext notifications that were in the queue at the point of the OnError callback will be dropped. /// In order to delay error propagation, consider using the Observable.Materialize and Observable.Dematerialize operators, or use DelaySubscription. /// /// public static IQbservable Delay(this IQbservable source, DateTimeOffset dueTime, 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.Delay(default(IQbservable), default(DateTimeOffset), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(DateTimeOffset)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Time shifts the observable sequence by the specified relative time duration. /// The relative time intervals between the values are preserved. /// /// The type of the elements in the source sequence. /// Source sequence to delay values for. /// Relative time by which to shift the observable sequence. If this value is equal to TimeSpan.Zero, the scheduler will dispatch observer callbacks as soon as possible. /// Time-shifted sequence. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// /// This operator is less efficient than DelaySubscription because it records all notifications and time-delays those. This allows for immediate propagation of errors. /// /// /// Observer callbacks for the resulting sequence will be run on the default scheduler. This effect is similar to using ObserveOn. /// /// /// Exceptions signaled by the source sequence through an OnError callback are forwarded immediately to the result sequence. Any OnNext notifications that were in the queue at the point of the OnError callback will be dropped. /// In order to delay error propagation, consider using the Observable.Materialize and Observable.Dematerialize operators, or use DelaySubscription. /// /// public static IQbservable Delay(this IQbservable source, TimeSpan dueTime) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Delay(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)) ) ); } /// /// Time shifts the observable sequence by the specified relative time duration, using the specified scheduler to run timers. /// The relative time intervals between the values are preserved. /// /// The type of the elements in the source sequence. /// Source sequence to delay values for. /// Relative time by which to shift the observable sequence. If this value is equal to TimeSpan.Zero, the scheduler will dispatch observer callbacks as soon as possible. /// Scheduler to run the delay timers on. /// Time-shifted sequence. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// /// This operator is less efficient than DelaySubscription because it records all notifications and time-delays those. This allows for immediate propagation of errors. /// /// /// Observer callbacks for the resulting sequence will be run on the specified scheduler. This effect is similar to using ObserveOn. /// /// /// Exceptions signaled by the source sequence through an OnError callback are forwarded immediately to the result sequence. Any OnNext notifications that were in the queue at the point of the OnError callback will be dropped. /// /// /// Exceptions signaled by the source sequence through an OnError callback are forwarded immediately to the result sequence. Any OnNext notifications that were in the queue at the point of the OnError callback will be dropped. /// In order to delay error propagation, consider using the Observable.Materialize and Observable.Dematerialize operators, or use DelaySubscription. /// /// public static IQbservable Delay(this IQbservable source, TimeSpan dueTime, 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.Delay(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Time shifts the observable sequence based on a delay selector function for each element. /// /// The type of the elements in the source sequence. /// The type of the elements in the delay sequences used to denote the delay duration of each element in the source sequence. /// Source sequence to delay values for. /// Selector function to retrieve a sequence indicating the delay for each given element. /// Time-shifted sequence. /// /// or is null. public static IQbservable Delay(this IQbservable source, Expression>> delayDurationSelector) { if (source == null) throw new ArgumentNullException("source"); if (delayDurationSelector == null) throw new ArgumentNullException("delayDurationSelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Delay(default(IQbservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TDelay)), #endif source.Expression, delayDurationSelector ) ); } /// /// Time shifts the observable sequence based on a subscription delay and a delay selector function for each element. /// /// The type of the elements in the source sequence. /// The type of the elements in the delay sequences used to denote the delay duration of each element in the source sequence. /// Source sequence to delay values for. /// Sequence indicating the delay for the subscription to the source. /// Selector function to retrieve a sequence indicating the delay for each given element. /// Time-shifted sequence. /// /// or or is null. public static IQbservable Delay(this IQbservable source, IObservable subscriptionDelay, Expression>> delayDurationSelector) { if (source == null) throw new ArgumentNullException("source"); if (subscriptionDelay == null) throw new ArgumentNullException("subscriptionDelay"); if (delayDurationSelector == null) throw new ArgumentNullException("delayDurationSelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Delay(default(IQbservable), default(IObservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TDelay)), #endif source.Expression, GetSourceExpression(subscriptionDelay), delayDurationSelector ) ); } /// /// Time shifts the observable sequence by delaying the subscription to the specified absolute time. /// /// The type of the elements in the source sequence. /// Source sequence to delay subscription for. /// Absolute time to perform the subscription at. /// Time-shifted sequence. /// /// is null. /// /// /// This operator is more efficient than Delay but postpones all side-effects of subscription and affects error propagation timing. /// /// /// The side-effects of subscribing to the source sequence will be run on the default scheduler. Observer callbacks will not be affected. /// /// public static IQbservable DelaySubscription(this IQbservable source, DateTimeOffset dueTime) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DelaySubscription(default(IQbservable), default(DateTimeOffset))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(DateTimeOffset)) ) ); } /// /// Time shifts the observable sequence by delaying the subscription to the specified absolute time, using the specified scheduler to run timers. /// /// The type of the elements in the source sequence. /// Source sequence to delay subscription for. /// Absolute time to perform the subscription at. /// Scheduler to run the subscription delay timer on. /// Time-shifted sequence. /// /// or is null. /// /// /// This operator is more efficient than Delay but postpones all side-effects of subscription and affects error propagation timing. /// /// /// The side-effects of subscribing to the source sequence will be run on the specified scheduler. Observer callbacks will not be affected. /// /// public static IQbservable DelaySubscription(this IQbservable source, DateTimeOffset dueTime, 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.DelaySubscription(default(IQbservable), default(DateTimeOffset), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(DateTimeOffset)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Time shifts the observable sequence by delaying the subscription with the specified relative time duration. /// /// The type of the elements in the source sequence. /// Source sequence to delay subscription for. /// Relative time shift of the subscription. /// Time-shifted sequence. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// /// This operator is more efficient than Delay but postpones all side-effects of subscription and affects error propagation timing. /// /// /// The side-effects of subscribing to the source sequence will be run on the default scheduler. Observer callbacks will not be affected. /// /// public static IQbservable DelaySubscription(this IQbservable source, TimeSpan dueTime) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DelaySubscription(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)) ) ); } /// /// Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers. /// /// The type of the elements in the source sequence. /// Source sequence to delay subscription for. /// Relative time shift of the subscription. /// Scheduler to run the subscription delay timer on. /// Time-shifted sequence. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// /// This operator is more efficient than Delay but postpones all side-effects of subscription and affects error propagation timing. /// /// /// The side-effects of subscribing to the source sequence will be run on the specified scheduler. Observer callbacks will not be affected. /// /// public static IQbservable DelaySubscription(this IQbservable source, TimeSpan dueTime, 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.DelaySubscription(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Dematerializes the explicit notification values of an observable sequence as implicit notifications. /// /// The type of the elements materialized in the source sequence notification objects. /// An observable sequence containing explicit notification values which have to be turned into implicit notifications. /// An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. /// /// is null. public static IQbservable Dematerialize(this IQbservable> source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Dematerialize(default(IQbservable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Returns an observable sequence that contains only distinct elements. /// /// The type of the elements in the source sequence. /// An observable sequence to retain distinct elements for. /// An observable sequence only containing the distinct elements from the source sequence. /// /// is null. /// Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. public static IQbservable Distinct(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Distinct(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Returns an observable sequence that contains only distinct elements according to the comparer. /// /// The type of the elements in the source sequence. /// An observable sequence to retain distinct elements for. /// Equality comparer for source elements. /// An observable sequence only containing the distinct elements from the source sequence. /// /// or is null. /// Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. public static IQbservable Distinct(this IQbservable source, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Distinct(default(IQbservable), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Returns an observable sequence that contains only distinct elements according to the keySelector. /// /// The type of the elements in the source sequence. /// The type of the discriminator key computed for each element in the source sequence. /// An observable sequence to retain distinct elements for. /// A function to compute the comparison key for each element. /// An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. /// /// or is null. /// Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. public static IQbservable Distinct(this IQbservable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Distinct(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector ) ); } /// /// Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. /// /// The type of the elements in the source sequence. /// The type of the discriminator key computed for each element in the source sequence. /// An observable sequence to retain distinct elements for. /// A function to compute the comparison key for each element. /// Equality comparer for source elements. /// An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. /// /// or or is null. /// Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. public static IQbservable Distinct(this IQbservable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Distinct(default(IQbservable), default(Expression>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Returns an observable sequence that contains only distinct contiguous elements. /// /// The type of the elements in the source sequence. /// An observable sequence to retain distinct contiguous elements for. /// An observable sequence only containing the distinct contiguous elements from the source sequence. /// /// is null. public static IQbservable DistinctUntilChanged(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DistinctUntilChanged(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Returns an observable sequence that contains only distinct contiguous elements according to the comparer. /// /// The type of the elements in the source sequence. /// An observable sequence to retain distinct contiguous elements for. /// Equality comparer for source elements. /// An observable sequence only containing the distinct contiguous elements from the source sequence. /// /// or is null. public static IQbservable DistinctUntilChanged(this IQbservable source, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DistinctUntilChanged(default(IQbservable), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Returns an observable sequence that contains only distinct contiguous elements according to the keySelector. /// /// The type of the elements in the source sequence. /// The type of the discriminator key computed for each element in the source sequence. /// An observable sequence to retain distinct contiguous elements for, based on a computed key value. /// A function to compute the comparison key for each element. /// An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. /// /// or is null. public static IQbservable DistinctUntilChanged(this IQbservable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DistinctUntilChanged(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector ) ); } /// /// Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. /// /// The type of the elements in the source sequence. /// The type of the discriminator key computed for each element in the source sequence. /// An observable sequence to retain distinct contiguous elements for, based on a computed key value. /// A function to compute the comparison key for each element. /// Equality comparer for computed key values. /// An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. /// /// or or is null. public static IQbservable DistinctUntilChanged(this IQbservable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DistinctUntilChanged(default(IQbservable), default(Expression>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Invokes the observer's methods for each message in the source sequence. /// This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. /// /// The type of the elements in the source sequence. /// Source sequence. /// Observer whose methods to invoke as part of the source sequence's observation. /// The source sequence with the side-effecting behavior applied. /// /// or is null. public static IQbservable Do(this IQbservable source, IObserver observer) { if (source == null) throw new ArgumentNullException("source"); if (observer == null) throw new ArgumentNullException("observer"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Do(default(IQbservable), default(IObserver))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(observer, typeof(IObserver)) ) ); } /// /// Invokes an action for each element in the observable sequence, and propagates all observer messages through the result sequence. /// This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. /// /// The type of the elements in the source sequence. /// Source sequence. /// Action to invoke for each element in the observable sequence. /// The source sequence with the side-effecting behavior applied. /// /// or is null. public static IQbservable Do(this IQbservable source, Expression> onNext) { if (source == null) throw new ArgumentNullException("source"); if (onNext == null) throw new ArgumentNullException("onNext"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Do(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, onNext ) ); } /// /// Invokes an action for each element in the observable sequence and invokes an action upon graceful termination of the observable sequence. /// This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. /// /// The type of the elements in the source sequence. /// Source sequence. /// Action to invoke for each element in the observable sequence. /// Action to invoke upon graceful termination of the observable sequence. /// The source sequence with the side-effecting behavior applied. /// /// or or is null. public static IQbservable Do(this IQbservable source, Expression> onNext, Expression onCompleted) { if (source == null) throw new ArgumentNullException("source"); if (onNext == null) throw new ArgumentNullException("onNext"); if (onCompleted == null) throw new ArgumentNullException("onCompleted"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Do(default(IQbservable), default(Expression>), default(Expression))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, onNext, onCompleted ) ); } /// /// Invokes an action for each element in the observable sequence and invokes an action upon exceptional termination of the observable sequence. /// This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. /// /// The type of the elements in the source sequence. /// Source sequence. /// Action to invoke for each element in the observable sequence. /// Action to invoke upon exceptional termination of the observable sequence. /// The source sequence with the side-effecting behavior applied. /// /// or or is null. public static IQbservable Do(this IQbservable source, Expression> onNext, Expression> onError) { if (source == null) throw new ArgumentNullException("source"); if (onNext == null) throw new ArgumentNullException("onNext"); if (onError == null) throw new ArgumentNullException("onError"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Do(default(IQbservable), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, onNext, onError ) ); } /// /// Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. /// This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. /// /// The type of the elements in the source sequence. /// Source sequence. /// Action to invoke for each element in the observable sequence. /// Action to invoke upon exceptional termination of the observable sequence. /// Action to invoke upon graceful termination of the observable sequence. /// The source sequence with the side-effecting behavior applied. /// /// or or or is null. public static IQbservable Do(this IQbservable source, Expression> onNext, Expression> onError, Expression onCompleted) { if (source == null) throw new ArgumentNullException("source"); if (onNext == null) throw new ArgumentNullException("onNext"); if (onError == null) throw new ArgumentNullException("onError"); if (onCompleted == null) throw new ArgumentNullException("onCompleted"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Do(default(IQbservable), default(Expression>), default(Expression>), default(Expression))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, onNext, onError, onCompleted ) ); } /// /// Repeats the given as long as the specified holds, where the is evaluated after each repeated completed. /// /// The type of the elements in the source sequence. /// Source to repeat as long as the function evaluates to true. /// Condition that will be evaluated upon the completion of an iteration through the , to determine whether repetition of the source is required. /// The observable sequence obtained by concatenating the sequence as long as the holds. /// /// or is null. public static IQbservable DoWhile(this IQbservable source, Expression> condition) { if (source == null) throw new ArgumentNullException("source"); if (condition == null) throw new ArgumentNullException("condition"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.DoWhile(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, condition ) ); } /// /// 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 IQbservable ElementAt(this IQbservable source, int index) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ElementAt(default(IQbservable), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(index, typeof(int)) ) ); } /// /// 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 IQbservable ElementAtOrDefault(this IQbservable source, int index) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ElementAtOrDefault(default(IQbservable), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(index, typeof(int)) ) ); } /// /// Returns an empty observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// An observable sequence with no elements. public static IQbservable Empty(this IQbservableProvider provider) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Empty(default(IQbservableProvider))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)) ) ); } /// /// Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// Scheduler to send the termination call on. /// An observable sequence with no elements. /// /// is null. public static IQbservable Empty(this IQbservableProvider provider, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Empty(default(IQbservableProvider), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// Scheduler to send the termination call on. /// Object solely used to infer the type of the type parameter. This parameter is typically used when creating a sequence of anonymously typed elements. /// An observable sequence with no elements. /// /// is null. public static IQbservable Empty(this IQbservableProvider provider, IScheduler scheduler, TResult witness) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Empty(default(IQbservableProvider), default(IScheduler), default(TResult))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(scheduler, typeof(IScheduler)), Expression.Constant(witness, typeof(TResult)) ) ); } /// /// Returns an empty observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// Object solely used to infer the type of the type parameter. This parameter is typically used when creating a sequence of anonymously typed elements. /// An observable sequence with no elements. public static IQbservable Empty(this IQbservableProvider provider, TResult witness) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Empty(default(IQbservableProvider), default(TResult))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(witness, typeof(TResult)) ) ); } /// /// Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. /// /// The type of the elements in the source sequence. /// Source sequence. /// Action to invoke after the source observable sequence terminates. /// Source sequence with the action-invoking termination behavior applied. /// /// or is null. public static IQbservable Finally(this IQbservable source, Expression finallyAction) { if (source == null) throw new ArgumentNullException("source"); if (finallyAction == null) throw new ArgumentNullException("finallyAction"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Finally(default(IQbservable), default(Expression))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, finallyAction ) ); } /// /// 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 IQbservable FirstAsync(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FirstAsync(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// 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 IQbservable FirstAsync(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.FirstAsync(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// 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 IQbservable FirstOrDefaultAsync(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FirstOrDefaultAsync(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// 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 IQbservable FirstOrDefaultAsync(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.FirstOrDefaultAsync(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Concatenates the observable sequences obtained by running the for each element in the given enumerable . /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the enumerable source sequence. /// The type of the elements in the observable result sequence. /// Enumerable source for which each element will be mapped onto an observable source that will be concatenated in the result sequence. /// Function to select an observable source for each element in the . /// The observable sequence obtained by concatenating the sources returned by for each element in the . /// /// or is null. public static IQbservable For(this IQbservableProvider provider, IEnumerable source, Expression>> resultSelector) { if (provider == null) throw new ArgumentNullException("provider"); if (source == null) throw new ArgumentNullException("source"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.For(default(IQbservableProvider), default(IEnumerable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(source), resultSelector ) ); } #if !NO_TPL /// /// Converts to asynchronous action into an observable sequence. Each subscription to the resulting sequence causes the action to be started. /// /// Query provider used to construct the IQbservable<T> data source. /// Asynchronous action to convert. /// An observable sequence exposing a Unit value upon completion of the action, or an exception. /// /// is null. public static IQbservable FromAsync(this IQbservableProvider provider, Expression> actionAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (actionAsync == null) throw new ArgumentNullException("actionAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromAsync(default(IQbservableProvider), default(Expression>))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), actionAsync ) ); } #endif #if !NO_TPL /// /// Converts to asynchronous action into an observable sequence. Each subscription to the resulting sequence causes the action to be started. /// The CancellationToken passed to the asynchronous action is tied to the observable sequence's subscription that triggered the action's invocation and can be used for best-effort cancellation. /// /// Query provider used to construct the IQbservable<T> data source. /// Asynchronous action to convert. /// An observable sequence exposing a Unit value upon completion of the action, or an exception. /// When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous function will be signaled. /// /// is null. public static IQbservable FromAsync(this IQbservableProvider provider, Expression> actionAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (actionAsync == null) throw new ArgumentNullException("actionAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromAsync(default(IQbservableProvider), default(Expression>))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), actionAsync ) ); } #endif #if !NO_TPL /// /// Converts to asynchronous function into an observable sequence. Each subscription to the resulting sequence causes the function to be started. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the result returned by the asynchronous function. /// Asynchronous function to convert. /// An observable sequence exposing the result of invoking the function, or an exception. /// /// is null. public static IQbservable FromAsync(this IQbservableProvider provider, Expression>> functionAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (functionAsync == null) throw new ArgumentNullException("functionAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromAsync(default(IQbservableProvider), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), functionAsync ) ); } #endif #if !NO_TPL /// /// Converts to asynchronous function into an observable sequence. Each subscription to the resulting sequence causes the function to be started. /// The CancellationToken passed to the asynchronous function is tied to the observable sequence's subscription that triggered the function's invocation and can be used for best-effort cancellation. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the result returned by the asynchronous function. /// Asynchronous function to convert. /// An observable sequence exposing the result of invoking the function, or an exception. /// /// is null. /// When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous function will be signaled. public static IQbservable FromAsync(this IQbservableProvider provider, Expression>> functionAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (functionAsync == null) throw new ArgumentNullException("functionAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromAsync(default(IQbservableProvider), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), functionAsync ) ); } #endif /// /// Converts an Action-based .NET event to an observable sequence. Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events conforming to the standard .NET event pattern, use any of the FromEventPattern overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. /// /// or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEvent, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEvent, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEvent calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable FromEvent(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEvent(default(IQbservableProvider), default(Expression>), default(Expression>))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler ) ); } /// /// Converts an Action-based .NET event to an observable sequence. Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events conforming to the standard .NET event pattern, use any of the FromEventPattern overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. /// /// or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEvent calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEvent that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable FromEvent(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEvent(default(IQbservableProvider), default(Expression>), default(Expression>), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts a .NET event to an observable sequence, using a supplied event delegate type. Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events conforming to the standard .NET event pattern, use any of the FromEventPattern overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. /// /// or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEvent, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEvent, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEvent calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable FromEvent(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEvent(default(IQbservableProvider), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler ) ); } /// /// Converts a .NET event to an observable sequence, using a supplied event delegate type. Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events conforming to the standard .NET event pattern, use any of the FromEventPattern overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. /// /// or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEvent calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEvent that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable FromEvent(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEvent(default(IQbservableProvider), default(Expression>), default(Expression>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts a .NET event to an observable sequence, using a conversion function to obtain the event delegate. Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events conforming to the standard .NET event pattern, use any of the FromEventPattern overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the event data generated by the event. /// A function used to convert the given event handler to a delegate compatible with the underlying .NET event. The resulting delegate is used in calls to the addHandler and removeHandler action parameters. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. /// /// or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEvent, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEvent, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEvent calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable FromEvent(this IQbservableProvider provider, Expression, TDelegate>> conversion, Expression> addHandler, Expression> removeHandler) { if (provider == null) throw new ArgumentNullException("provider"); if (conversion == null) throw new ArgumentNullException("conversion"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEvent(default(IQbservableProvider), default(Expression, TDelegate>>), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), conversion, addHandler, removeHandler ) ); } /// /// Converts a .NET event to an observable sequence, using a conversion function to obtain the event delegate. Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events conforming to the standard .NET event pattern, use any of the FromEventPattern overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the event data generated by the event. /// A function used to convert the given event handler to a delegate compatible with the underlying .NET event. The resulting delegate is used in calls to the addHandler and removeHandler action parameters. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. /// /// or or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEvent calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEvent that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable FromEvent(this IQbservableProvider provider, Expression, TDelegate>> conversion, Expression> addHandler, Expression> removeHandler, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (conversion == null) throw new ArgumentNullException("conversion"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEvent(default(IQbservableProvider), default(Expression, TDelegate>>), default(Expression>), default(Expression>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), conversion, addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts a generic Action-based .NET event to an observable sequence. Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events conforming to the standard .NET event pattern, use any of the FromEventPattern overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. /// /// or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEvent, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEvent, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEvent calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable FromEvent(this IQbservableProvider provider, Expression>> addHandler, Expression>> removeHandler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEvent(default(IQbservableProvider), default(Expression>>), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler ) ); } /// /// Converts a generic Action-based .NET event to an observable sequence. Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events conforming to the standard .NET event pattern, use any of the FromEventPattern overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. /// /// or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEvent calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEvent that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable FromEvent(this IQbservableProvider provider, Expression>> addHandler, Expression>> removeHandler, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEvent(default(IQbservableProvider), default(Expression>>), default(Expression>>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #if !NO_EVENTARGS_CONSTRAINT /// /// Converts a .NET event, conforming to the standard .NET event pattern based on , to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>), default(Expression>))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler ) ); } #else /// /// Converts a .NET event, conforming to the standard .NET event pattern based on , to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>), default(Expression>))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler ) ); } #endif #if !NO_EVENTARGS_CONSTRAINT /// /// Converts a .NET event, conforming to the standard .NET event pattern based on , to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>), default(Expression>), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #else /// /// Converts a .NET event, conforming to the standard .NET event pattern based on , to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>), default(Expression>), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #endif #if !NO_EVENTARGS_CONSTRAINT /// /// Converts an instance .NET event, conforming to the standard .NET event pattern with an parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the target object type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Object instance that exposes the event to convert. /// Name of the event to convert. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, object target, string eventName) { if (provider == null) throw new ArgumentNullException("provider"); if (target == null) throw new ArgumentNullException("target"); if (eventName == null) throw new ArgumentNullException("eventName"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(object), default(string))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(target, typeof(object)), Expression.Constant(eventName, typeof(string)) ) ); } #else /// /// Converts an instance .NET event, conforming to the standard .NET event pattern with an parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the target object type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Object instance that exposes the event to convert. /// Name of the event to convert. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, object target, string eventName) { if (provider == null) throw new ArgumentNullException("provider"); if (target == null) throw new ArgumentNullException("target"); if (eventName == null) throw new ArgumentNullException("eventName"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(object), default(string))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(target, typeof(object)), Expression.Constant(eventName, typeof(string)) ) ); } #endif #if !NO_EVENTARGS_CONSTRAINT /// /// Converts an instance .NET event, conforming to the standard .NET event pattern with an parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the target object type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Object instance that exposes the event to convert. /// Name of the event to convert. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, object target, string eventName, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (target == null) throw new ArgumentNullException("target"); if (eventName == null) throw new ArgumentNullException("eventName"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(object), default(string), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(target, typeof(object)), Expression.Constant(eventName, typeof(string)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #else /// /// Converts an instance .NET event, conforming to the standard .NET event pattern with an parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the target object type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Object instance that exposes the event to convert. /// Name of the event to convert. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, object target, string eventName, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (target == null) throw new ArgumentNullException("target"); if (eventName == null) throw new ArgumentNullException("eventName"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(object), default(string), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(target, typeof(object)), Expression.Constant(eventName, typeof(string)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #endif #if !NO_EVENTARGS_CONSTRAINT /// /// Converts a static .NET event, conforming to the standard .NET event pattern with an parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the specified type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Type that exposes the static event to convert. /// Name of the event to convert. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Type type, string eventName) { if (provider == null) throw new ArgumentNullException("provider"); if (type == null) throw new ArgumentNullException("type"); if (eventName == null) throw new ArgumentNullException("eventName"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Type), default(string))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(type, typeof(Type)), Expression.Constant(eventName, typeof(string)) ) ); } #else /// /// Converts a static .NET event, conforming to the standard .NET event pattern with an parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the specified type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Type that exposes the static event to convert. /// Name of the event to convert. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Type type, string eventName) { if (provider == null) throw new ArgumentNullException("provider"); if (type == null) throw new ArgumentNullException("type"); if (eventName == null) throw new ArgumentNullException("eventName"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Type), default(string))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(type, typeof(Type)), Expression.Constant(eventName, typeof(string)) ) ); } #endif #if !NO_EVENTARGS_CONSTRAINT /// /// Converts a static .NET event, conforming to the standard .NET event pattern with an parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the specified type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Type that exposes the static event to convert. /// Name of the event to convert. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Type type, string eventName, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (type == null) throw new ArgumentNullException("type"); if (eventName == null) throw new ArgumentNullException("eventName"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Type), default(string), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(type, typeof(Type)), Expression.Constant(eventName, typeof(string)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #else /// /// Converts a static .NET event, conforming to the standard .NET event pattern with an parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the specified type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// Type that exposes the static event to convert. /// Name of the event to convert. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Type type, string eventName, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (type == null) throw new ArgumentNullException("type"); if (eventName == null) throw new ArgumentNullException("eventName"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Type), default(string), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(type, typeof(Type)), Expression.Constant(eventName, typeof(string)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #endif /// /// Converts a .NET event, conforming to the standard .NET event pattern based on a supplied event delegate type, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler ) ); } /// /// Converts a .NET event, conforming to the standard .NET event pattern based on a supplied event delegate type, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler, IScheduler scheduler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>), default(Expression>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts a .NET event, conforming to the standard .NET event pattern based on , to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the event data generated by the event. /// A function used to convert the given event handler to a delegate compatible with the underlying .NET event. The resulting delegate is used in calls to the addHandler and removeHandler action parameters. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression, TDelegate>> conversion, Expression> addHandler, Expression> removeHandler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (conversion == null) throw new ArgumentNullException("conversion"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression, TDelegate>>), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), conversion, addHandler, removeHandler ) ); } /// /// Converts a .NET event, conforming to the standard .NET event pattern based on , to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the event data generated by the event. /// A function used to convert the given event handler to a delegate compatible with the underlying .NET event. The resulting delegate is used in calls to the addHandler and removeHandler action parameters. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression, TDelegate>> conversion, Expression> addHandler, Expression> removeHandler, IScheduler scheduler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (conversion == null) throw new ArgumentNullException("conversion"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression, TDelegate>>), default(Expression>), default(Expression>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), conversion, addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts a .NET event, conforming to the standard .NET event pattern based on a supplied event delegate type with a strongly typed sender parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the sender that raises the event. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TSender), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler ) ); } /// /// Converts a .NET event, conforming to the standard .NET event pattern based on a supplied event delegate type with a strongly typed sender parameter, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate type of the event to be converted. /// The type of the sender that raises the event. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression> addHandler, Expression> removeHandler, IScheduler scheduler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>), default(Expression>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TDelegate), typeof(TSender), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts a .NET event, conforming to the standard .NET event pattern based on , to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression>> addHandler, Expression>> removeHandler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>>), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler ) ); } /// /// Converts a .NET event, conforming to the standard .NET event pattern based on , to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the event data generated by the event. /// Action that attaches the given event handler to the underlying .NET event. /// Action that detaches the given event handler from the underlying .NET event. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Expression>> addHandler, Expression>> removeHandler, IScheduler scheduler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (addHandler == null) throw new ArgumentNullException("addHandler"); if (removeHandler == null) throw new ArgumentNullException("removeHandler"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Expression>>), default(Expression>>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), addHandler, removeHandler, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts an instance .NET event, conforming to the standard .NET event pattern with strongly typed event arguments, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the target object type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the event data generated by the event. /// Object instance that exposes the event to convert. /// Name of the event to convert. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. -or- The event's second argument type is not assignable to TEventArgs. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, object target, string eventName) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (target == null) throw new ArgumentNullException("target"); if (eventName == null) throw new ArgumentNullException("eventName"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(object), default(string))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(target, typeof(object)), Expression.Constant(eventName, typeof(string)) ) ); } /// /// Converts an instance .NET event, conforming to the standard .NET event pattern with strongly typed event arguments, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the target object type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the event data generated by the event. /// Object instance that exposes the event to convert. /// Name of the event to convert. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. -or- The event's second argument type is not assignable to TEventArgs. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, object target, string eventName, IScheduler scheduler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (target == null) throw new ArgumentNullException("target"); if (eventName == null) throw new ArgumentNullException("eventName"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(object), default(string), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(target, typeof(object)), Expression.Constant(eventName, typeof(string)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts a static .NET event, conforming to the standard .NET event pattern with strongly typed event arguments, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the specified type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the event data generated by the event. /// Type that exposes the static event to convert. /// Name of the event to convert. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. -or- The event's second argument type is not assignable to TEventArgs. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Type type, string eventName) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (type == null) throw new ArgumentNullException("type"); if (eventName == null) throw new ArgumentNullException("eventName"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Type), default(string))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(type, typeof(Type)), Expression.Constant(eventName, typeof(string)) ) ); } /// /// Converts a static .NET event, conforming to the standard .NET event pattern with strongly typed event arguments, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the specified type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the event data generated by the event. /// Type that exposes the static event to convert. /// Name of the event to convert. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. -or- The event's second argument type is not assignable to TEventArgs. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Type type, string eventName, IScheduler scheduler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (type == null) throw new ArgumentNullException("type"); if (eventName == null) throw new ArgumentNullException("eventName"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Type), default(string), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(type, typeof(Type)), Expression.Constant(eventName, typeof(string)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts an instance .NET event, conforming to the standard .NET event pattern with a strongly typed sender and strongly typed event arguments, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the target object type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the sender that raises the event. /// The type of the event data generated by the event. /// Object instance that exposes the event to convert. /// Name of the event to convert. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. -or- The event's first argument type is not assignable to TSender. -or- The event's second argument type is not assignable to TEventArgs. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, object target, string eventName) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (target == null) throw new ArgumentNullException("target"); if (eventName == null) throw new ArgumentNullException("eventName"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(object), default(string))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSender), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(target, typeof(object)), Expression.Constant(eventName, typeof(string)) ) ); } /// /// Converts an instance .NET event, conforming to the standard .NET event pattern with a strongly typed sender and strongly typed event arguments, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the target object type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the sender that raises the event. /// The type of the event data generated by the event. /// Object instance that exposes the event to convert. /// Name of the event to convert. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. -or- The event's first argument type is not assignable to TSender. -or- The event's second argument type is not assignable to TEventArgs. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, object target, string eventName, IScheduler scheduler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (target == null) throw new ArgumentNullException("target"); if (eventName == null) throw new ArgumentNullException("eventName"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(object), default(string), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSender), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(target, typeof(object)), Expression.Constant(eventName, typeof(string)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Converts a static .NET event, conforming to the standard .NET event pattern with a strongly typed sender and strongly typed event arguments, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the specified type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the sender that raises the event. /// The type of the event data generated by the event. /// Type that exposes the static event to convert. /// Name of the event to convert. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. -or- The event's first argument type is not assignable to TSender. -or- The event's second argument type is not assignable to TEventArgs. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// The current is captured during the call to FromEventPattern, and is used to post add and remove handler invocations. /// This behavior ensures add and remove handler operations for thread-affine events are accessed from the same context, as required by some UI frameworks. /// /// /// If no SynchronizationContext is present at the point of calling FromEventPattern, add and remove handler invocations are made synchronously on the thread /// making the Subscribe or Dispose call, respectively. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions due to the free-threaded nature of Reactive Extensions. Doing so /// makes the captured SynchronizationContext predictable. This best practice also reduces clutter of bridging code inside queries, making the query expressions /// more concise and easier to understand. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Type type, string eventName) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (type == null) throw new ArgumentNullException("type"); if (eventName == null) throw new ArgumentNullException("eventName"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Type), default(string))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSender), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(type, typeof(Type)), Expression.Constant(eventName, typeof(string)) ) ); } /// /// Converts a static .NET event, conforming to the standard .NET event pattern with a strongly typed sender and strongly typed event arguments, to an observable sequence. /// Each event invocation is surfaced through an OnNext message in the resulting sequence. /// Reflection is used to discover the event based on the specified type and the specified event name. /// For conversion of events that don't conform to the standard .NET event pattern, use any of the FromEvent overloads instead. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the sender that raises the event. /// The type of the event data generated by the event. /// Type that exposes the static event to convert. /// Name of the event to convert. /// The scheduler to run the add and remove event handler logic on. /// The observable sequence that contains data representations of invocations of the underlying .NET event. /// /// or or is null. /// The event could not be found. -or- The event does not conform to the standard .NET event pattern. -or- The event's first argument type is not assignable to TSender. -or- The event's second argument type is not assignable to TEventArgs. /// /// /// Add and remove handler invocations are made whenever the number of observers grows beyond zero. /// As such, an event handler may be shared by multiple simultaneously active observers, using a subject for multicasting. /// /// /// Add and remove handler invocations are run on the specified scheduler. This behavior allows add and remove handler operations for thread-affine events to be /// accessed from the same context, as required by some UI frameworks. /// /// /// It's recommended to lift FromEventPattern calls outside event stream query expressions. This best practice reduces clutter of bridging code inside queries, /// making the query expressions more concise and easier to understand. This has additional benefits for overloads of FromEventPattern that omit the IScheduler /// parameter. For more information, see the remarks section on those overloads. /// /// /// public static IQbservable> FromEventPattern(this IQbservableProvider provider, Type type, string eventName, IScheduler scheduler) #if !NO_EVENTARGS_CONSTRAINT where TEventArgs : EventArgs #endif { if (provider == null) throw new ArgumentNullException("provider"); if (type == null) throw new ArgumentNullException("type"); if (eventName == null) throw new ArgumentNullException("eventName"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.FromEventPattern(default(IQbservableProvider), default(Type), default(string), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSender), typeof(TEventArgs)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(type, typeof(Type)), Expression.Constant(eventName, typeof(string)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Generates an observable sequence by running a state-driven loop producing the sequence's elements. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the state used in the generator loop. /// The type of the elements in the produced sequence. /// Initial state. /// Condition to terminate generation (upon returning false). /// Iteration step function. /// Selector function for results produced in the sequence. /// The generated sequence. /// /// or or is null. public static IQbservable Generate(this IQbservableProvider provider, TState initialState, Expression> condition, Expression> iterate, Expression> resultSelector) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (iterate == null) throw new ArgumentNullException("iterate"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Generate(default(IQbservableProvider), default(TState), default(Expression>), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TState), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(initialState, typeof(TState)), condition, iterate, resultSelector ) ); } /// /// Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the state used in the generator loop. /// The type of the elements in the produced sequence. /// Initial state. /// Condition to terminate generation (upon returning false). /// Iteration step function. /// Selector function for results produced in the sequence. /// Scheduler on which to run the generator loop. /// The generated sequence. /// /// or or or is null. public static IQbservable Generate(this IQbservableProvider provider, TState initialState, Expression> condition, Expression> iterate, Expression> resultSelector, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (iterate == null) throw new ArgumentNullException("iterate"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Generate(default(IQbservableProvider), default(TState), default(Expression>), default(Expression>), default(Expression>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TState), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(initialState, typeof(TState)), condition, iterate, resultSelector, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Generates an observable sequence by running a state-driven and temporal loop producing the sequence's elements. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the state used in the generator loop. /// The type of the elements in the produced sequence. /// Initial state. /// Condition to terminate generation (upon returning false). /// Iteration step function. /// Selector function for results produced in the sequence. /// Time selector function to control the speed of values being produced each iteration. /// The generated sequence. /// /// or or or is null. public static IQbservable Generate(this IQbservableProvider provider, TState initialState, Expression> condition, Expression> iterate, Expression> resultSelector, Expression> timeSelector) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (iterate == null) throw new ArgumentNullException("iterate"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); if (timeSelector == null) throw new ArgumentNullException("timeSelector"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Generate(default(IQbservableProvider), default(TState), default(Expression>), default(Expression>), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TState), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(initialState, typeof(TState)), condition, iterate, resultSelector, timeSelector ) ); } /// /// Generates an observable sequence by running a state-driven and temporal loop producing the sequence's elements. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the state used in the generator loop. /// The type of the elements in the produced sequence. /// Initial state. /// Condition to terminate generation (upon returning false). /// Iteration step function. /// Selector function for results produced in the sequence. /// Time selector function to control the speed of values being produced each iteration. /// The generated sequence. /// /// or or or is null. public static IQbservable Generate(this IQbservableProvider provider, TState initialState, Expression> condition, Expression> iterate, Expression> resultSelector, Expression> timeSelector) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (iterate == null) throw new ArgumentNullException("iterate"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); if (timeSelector == null) throw new ArgumentNullException("timeSelector"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Generate(default(IQbservableProvider), default(TState), default(Expression>), default(Expression>), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TState), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(initialState, typeof(TState)), condition, iterate, resultSelector, timeSelector ) ); } /// /// Generates an observable sequence by running a state-driven and temporal loop producing the sequence's elements, using the specified scheduler to run timers and to send out observer messages. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the state used in the generator loop. /// The type of the elements in the produced sequence. /// Initial state. /// Condition to terminate generation (upon returning false). /// Iteration step function. /// Selector function for results produced in the sequence. /// Time selector function to control the speed of values being produced each iteration. /// Scheduler on which to run the generator loop. /// The generated sequence. /// /// or or or or is null. public static IQbservable Generate(this IQbservableProvider provider, TState initialState, Expression> condition, Expression> iterate, Expression> resultSelector, Expression> timeSelector, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (iterate == null) throw new ArgumentNullException("iterate"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); if (timeSelector == null) throw new ArgumentNullException("timeSelector"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Generate(default(IQbservableProvider), default(TState), default(Expression>), default(Expression>), default(Expression>), default(Expression>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TState), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(initialState, typeof(TState)), condition, iterate, resultSelector, timeSelector, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Generates an observable sequence by running a state-driven and temporal loop producing the sequence's elements, using the specified scheduler to run timers and to send out observer messages. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the state used in the generator loop. /// The type of the elements in the produced sequence. /// Initial state. /// Condition to terminate generation (upon returning false). /// Iteration step function. /// Selector function for results produced in the sequence. /// Time selector function to control the speed of values being produced each iteration. /// Scheduler on which to run the generator loop. /// The generated sequence. /// /// or or or or is null. public static IQbservable Generate(this IQbservableProvider provider, TState initialState, Expression> condition, Expression> iterate, Expression> resultSelector, Expression> timeSelector, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (iterate == null) throw new ArgumentNullException("iterate"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); if (timeSelector == null) throw new ArgumentNullException("timeSelector"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Generate(default(IQbservableProvider), default(TState), default(Expression>), default(Expression>), default(Expression>), default(Expression>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TState), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(initialState, typeof(TState)), condition, iterate, resultSelector, timeSelector, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Groups the elements of an observable sequence according to a specified key selector function. /// /// The type of the elements in the source sequence. /// The type of the grouping key computed for each element in the source sequence. /// An observable sequence whose elements to group. /// A function to extract the key for each element. /// A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// /// or is null. public static IQbservable> GroupBy(this IQbservable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.GroupBy(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector ) ); } /// /// Groups the elements of an observable sequence according to a specified key selector function and comparer. /// /// The type of the elements in the source sequence. /// The type of the grouping key computed for each element in the source sequence. /// An observable sequence whose elements to group. /// A function to extract the key for each element. /// An equality comparer to compare keys with. /// A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// /// or or is null. public static IQbservable> GroupBy(this IQbservable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.GroupBy(default(IQbservable), default(Expression>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Groups the elements of an observable sequence and selects the resulting elements by using a specified function. /// /// The type of the elements in the source sequence. /// The type of the grouping key computed for each element in the source sequence. /// The type of the elements within the groups computed for each element in the source sequence. /// An observable sequence whose elements to group. /// A function to extract the key for each element. /// A function to map each source element to an element in an observable group. /// A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// /// or or is null. public static IQbservable> GroupBy(this IQbservable source, Expression> keySelector, Expression> elementSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.GroupBy(default(IQbservable), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), #endif source.Expression, keySelector, elementSelector ) ); } /// /// Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function. /// /// The type of the elements in the source sequence. /// The type of the grouping key computed for each element in the source sequence. /// The type of the elements within the groups computed for each element in the source sequence. /// An observable sequence whose elements to group. /// A function to extract the key for each element. /// A function to map each source element to an element in an observable group. /// An equality comparer to compare keys with. /// A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// /// or or or is null. public static IQbservable> GroupBy(this IQbservable source, Expression> keySelector, Expression> elementSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.GroupBy(default(IQbservable), default(Expression>), default(Expression>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), #endif source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Groups the elements of an observable sequence according to a specified key selector function. /// A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same /// key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. /// /// The type of the elements in the source sequence. /// The type of the grouping key computed for each element in the source sequence. /// The type of the elements in the duration sequences obtained for each group to denote its lifetime. /// An observable sequence whose elements to group. /// A function to extract the key for each element. /// A function to signal the expiration of a group. /// /// A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered. /// /// /// or or is null. public static IQbservable> GroupByUntil(this IQbservable source, Expression> keySelector, Expression, IObservable>> durationSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (durationSelector == null) throw new ArgumentNullException("durationSelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.GroupByUntil(default(IQbservable), default(Expression>), default(Expression, IObservable>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TDuration)), #endif source.Expression, keySelector, durationSelector ) ); } /// /// Groups the elements of an observable sequence according to a specified key selector function and comparer. /// A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same /// key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. /// /// The type of the elements in the source sequence. /// The type of the grouping key computed for each element in the source sequence. /// The type of the elements in the duration sequences obtained for each group to denote its lifetime. /// An observable sequence whose elements to group. /// A function to extract the key for each element. /// A function to signal the expiration of a group. /// An equality comparer to compare keys with. /// /// A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered. /// /// /// or or or is null. public static IQbservable> GroupByUntil(this IQbservable source, Expression> keySelector, Expression, IObservable>> durationSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (durationSelector == null) throw new ArgumentNullException("durationSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.GroupByUntil(default(IQbservable), default(Expression>), default(Expression, IObservable>>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TDuration)), #endif source.Expression, keySelector, durationSelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Groups the elements of an observable sequence according to a specified key selector function and selects the resulting elements by using a specified function. /// A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same /// key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. /// /// The type of the elements in the source sequence. /// The type of the grouping key computed for each element in the source sequence. /// The type of the elements within the groups computed for each element in the source sequence. /// The type of the elements in the duration sequences obtained for each group to denote its lifetime. /// An observable sequence whose elements to group. /// A function to extract the key for each element. /// A function to map each source element to an element in an observable group. /// A function to signal the expiration of a group. /// /// A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered. /// /// /// or or or is null. public static IQbservable> GroupByUntil(this IQbservable source, Expression> keySelector, Expression> elementSelector, Expression, IObservable>> durationSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (durationSelector == null) throw new ArgumentNullException("durationSelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.GroupByUntil(default(IQbservable), default(Expression>), default(Expression>), default(Expression, IObservable>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TDuration)), #endif source.Expression, keySelector, elementSelector, durationSelector ) ); } /// /// Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function. /// A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same /// key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. /// /// The type of the elements in the source sequence. /// The type of the grouping key computed for each element in the source sequence. /// The type of the elements within the groups computed for each element in the source sequence. /// The type of the elements in the duration sequences obtained for each group to denote its lifetime. /// An observable sequence whose elements to group. /// A function to extract the key for each element. /// A function to map each source element to an element in an observable group. /// A function to signal the expiration of a group. /// An equality comparer to compare keys with. /// /// A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. /// If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encountered. /// /// /// or or or or is null. public static IQbservable> GroupByUntil(this IQbservable source, Expression> keySelector, Expression> elementSelector, Expression, IObservable>> durationSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (durationSelector == null) throw new ArgumentNullException("durationSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.GroupByUntil(default(IQbservable), default(Expression>), default(Expression>), default(Expression, IObservable>>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TDuration)), #endif source.Expression, keySelector, elementSelector, durationSelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Correlates the elements of two sequences based on overlapping durations, and groups the results. /// /// The type of the elements in the left source sequence. /// The type of the elements in the right source sequence. /// The type of the elements in the duration sequence denoting the computed duration of each element in the left source sequence. /// The type of the elements in the duration sequence denoting the computed duration of each element in the right source sequence. /// The type of the elements in the result sequence, obtained by invoking the result selector function for source elements with overlapping duration. /// The left observable sequence to join elements for. /// The right observable sequence to join elements for. /// A function to select the duration of each element of the left observable sequence, used to determine overlap. /// A function to select the duration of each element of the right observable sequence, used to determine overlap. /// A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. /// An observable sequence that contains result elements computed from source elements that have an overlapping duration. /// /// or or or or is null. public static IQbservable GroupJoin(this IQbservable left, IObservable right, Expression>> leftDurationSelector, Expression>> rightDurationSelector, Expression, TResult>> resultSelector) { if (left == null) throw new ArgumentNullException("left"); if (right == null) throw new ArgumentNullException("right"); if (leftDurationSelector == null) throw new ArgumentNullException("leftDurationSelector"); if (rightDurationSelector == null) throw new ArgumentNullException("rightDurationSelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return left.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.GroupJoin(default(IQbservable), default(IObservable), default(Expression>>), default(Expression>>), default(Expression, TResult>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TLeft), typeof(TRight), typeof(TLeftDuration), typeof(TRightDuration), typeof(TResult)), #endif left.Expression, GetSourceExpression(right), leftDurationSelector, rightDurationSelector, resultSelector ) ); } /// /// If the specified evaluates true, select the sequence. Otherwise, return an empty sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the result sequence. /// Condition evaluated to decide which sequence to return. /// Sequence returned in case evaluates true. /// /// if evaluates true; an empty sequence otherwise. /// /// or is null. public static IQbservable If(this IQbservableProvider provider, Expression> condition, IObservable thenSource) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (thenSource == null) throw new ArgumentNullException("thenSource"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.If(default(IQbservableProvider), default(Expression>), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), condition, GetSourceExpression(thenSource) ) ); } /// /// If the specified evaluates true, select the sequence. Otherwise, select the sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the result sequence. /// Condition evaluated to decide which sequence to return. /// Sequence returned in case evaluates true. /// Sequence returned in case evaluates false. /// /// if evaluates true; otherwise. /// /// or or is null. public static IQbservable If(this IQbservableProvider provider, Expression> condition, IObservable thenSource, IObservable elseSource) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (thenSource == null) throw new ArgumentNullException("thenSource"); if (elseSource == null) throw new ArgumentNullException("elseSource"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.If(default(IQbservableProvider), default(Expression>), default(IObservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), condition, GetSourceExpression(thenSource), GetSourceExpression(elseSource) ) ); } /// /// If the specified evaluates true, select the sequence. Otherwise, return an empty sequence generated on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the result sequence. /// Condition evaluated to decide which sequence to return. /// Sequence returned in case evaluates true. /// Scheduler to generate an empty sequence on in case evaluates false. /// /// if evaluates true; an empty sequence otherwise. /// /// or or is null. public static IQbservable If(this IQbservableProvider provider, Expression> condition, IObservable thenSource, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (thenSource == null) throw new ArgumentNullException("thenSource"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.If(default(IQbservableProvider), default(Expression>), default(IObservable), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), condition, GetSourceExpression(thenSource), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Ignores all elements in an observable sequence leaving only the termination messages. /// /// The type of the elements in the source sequence. /// Source sequence. /// An empty observable sequence that signals termination, successful or exceptional, of the source sequence. /// /// is null. public static IQbservable IgnoreElements(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.IgnoreElements(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Returns an observable sequence that produces a value after each period. /// /// Query provider used to construct the IQbservable<T> data source. /// Period for producing the values in the resulting sequence. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. /// An observable sequence that produces a value after each period. /// /// is less than TimeSpan.Zero. /// /// Intervals are measured between the start of subsequent notifications, not between the end of the previous and the start of the next notification. /// If the observer takes longer than the interval period to handle the message, the subsequent notification will be delivered immediately after the /// current one has been handled. In case you need to control the time between the end and the start of consecutive notifications, consider using the /// /// operator instead. /// public static IQbservable Interval(this IQbservableProvider provider, TimeSpan period) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Interval(default(IQbservableProvider), default(TimeSpan))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(period, typeof(TimeSpan)) ) ); } /// /// Returns an observable sequence that produces a value after each period, using the specified scheduler to run timers and to send out observer messages. /// /// Query provider used to construct the IQbservable<T> data source. /// Period for producing the values in the resulting sequence. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. /// Scheduler to run the timer on. /// An observable sequence that produces a value after each period. /// /// is less than TimeSpan.Zero. /// /// is null. /// /// Intervals are measured between the start of subsequent notifications, not between the end of the previous and the start of the next notification. /// If the observer takes longer than the interval period to handle the message, the subsequent notification will be delivered immediately after the /// current one has been handled. In case you need to control the time between the end and the start of consecutive notifications, consider using the /// /// operator instead. /// public static IQbservable Interval(this IQbservableProvider provider, TimeSpan period, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Interval(default(IQbservableProvider), default(TimeSpan), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(period, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// 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 IQbservable IsEmpty(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.IsEmpty(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Correlates the elements of two sequences based on overlapping durations. /// /// The type of the elements in the left source sequence. /// The type of the elements in the right source sequence. /// The type of the elements in the duration sequence denoting the computed duration of each element in the left source sequence. /// The type of the elements in the duration sequence denoting the computed duration of each element in the right source sequence. /// The type of the elements in the result sequence, obtained by invoking the result selector function for source elements with overlapping duration. /// The left observable sequence to join elements for. /// The right observable sequence to join elements for. /// A function to select the duration of each element of the left observable sequence, used to determine overlap. /// A function to select the duration of each element of the right observable sequence, used to determine overlap. /// A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. /// An observable sequence that contains result elements computed from source elements that have an overlapping duration. /// /// or or or or is null. public static IQbservable Join(this IQbservable left, IObservable right, Expression>> leftDurationSelector, Expression>> rightDurationSelector, Expression> resultSelector) { if (left == null) throw new ArgumentNullException("left"); if (right == null) throw new ArgumentNullException("right"); if (leftDurationSelector == null) throw new ArgumentNullException("leftDurationSelector"); if (rightDurationSelector == null) throw new ArgumentNullException("rightDurationSelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return left.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Join(default(IQbservable), default(IObservable), default(Expression>>), default(Expression>>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TLeft), typeof(TRight), typeof(TLeftDuration), typeof(TRightDuration), typeof(TResult)), #endif left.Expression, GetSourceExpression(right), leftDurationSelector, rightDurationSelector, resultSelector ) ); } /// /// 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 IQbservable LastAsync(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.LastAsync(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// 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 IQbservable LastAsync(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.LastAsync(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// 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 IQbservable LastOrDefaultAsync(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.LastOrDefaultAsync(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// 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 IQbservable LastOrDefaultAsync(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.LastOrDefaultAsync(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Returns an enumerable sequence whose enumeration returns the latest observed element in the source observable sequence. /// Enumerators on the resulting sequence will never produce the same element repeatedly, and will block until the next element becomes available. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// The enumerable sequence that returns the last sampled element upon each iteration and subsequently blocks until the next element in the observable source sequence becomes available. /// This operator requires the source's object (see ) to implement . public static IQueryable Latest(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return ((IQueryProvider)source.Provider).CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Latest(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// 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 IQbservable LongCount(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.LongCount(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// 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 IQbservable LongCount(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.LongCount(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Materializes the implicit notifications of an observable sequence as explicit notification values. /// /// The type of the elements in the source sequence. /// An observable sequence to get notification values for. /// An observable sequence containing the materialized notification values from the source sequence. /// /// is null. public static IQbservable> Materialize(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Materialize(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// 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 IQbservable Max(this IQbservable source, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable), default(IComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(comparer, typeof(IComparer)) ) ); } /// /// 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, 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. /// 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 IQbservable Max(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.Max(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, 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 IQbservable Max(this IQbservable source, Expression> 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 source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Max(default(IQbservable), default(Expression>), default(IComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(comparer, typeof(IComparer)) ) ); } /// /// Returns the elements in an observable sequence with the maximum key value. /// /// The type of the elements in the source sequence. /// The type of the key computed for each element in the source sequence. /// An observable sequence to get the maximum elements for. /// Key selector function. /// An observable sequence containing a list of zero or more elements that have a maximum key value. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> MaxBy(this IQbservable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.MaxBy(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector ) ); } /// /// Returns the elements in an observable sequence with the maximum key value according to the specified comparer. /// /// The type of the elements in the source sequence. /// The type of the key computed for each element in the source sequence. /// An observable sequence to get the maximum elements for. /// Key selector function. /// Comparer used to compare key values. /// An observable sequence containing a list of zero or more elements that have a maximum key value. /// /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> MaxBy(this IQbservable source, Expression> keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.MaxBy(default(IQbservable), default(Expression>), default(IComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)) ) ); } /// /// Merges elements from two observable sequences into a single observable sequence. /// /// The type of the elements in the source sequences. /// First observable sequence. /// Second observable sequence. /// The observable sequence that merges the elements of the given sequences. /// /// or is null. public static IQbservable Merge(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.Merge(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif first.Expression, GetSourceExpression(second) ) ); } /// /// Merges elements from two observable sequences into a single observable sequence, using the specified scheduler for enumeration of and subscription to the sources. /// /// The type of the elements in the source sequences. /// First observable sequence. /// Second observable sequence. /// Scheduler used to introduce concurrency for making subscriptions to the given sequences. /// The observable sequence that merges the elements of the given sequences. /// /// or or is null. public static IQbservable Merge(this IQbservable first, IObservable second, IScheduler scheduler) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return first.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Merge(default(IQbservable), default(IObservable), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif first.Expression, GetSourceExpression(second), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Merges elements from all of the specified observable sequences into a single observable sequence, using the specified scheduler for enumeration of and subscription to the sources. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Observable sequences. /// Scheduler to run the enumeration of the sequence of sources on. /// The observable sequence that merges the elements of the observable sequences. /// /// or is null. public static IQbservable Merge(this IQbservableProvider provider, IScheduler scheduler, params IObservable[] sources) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); if (sources == null) throw new ArgumentNullException("sources"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Merge(default(IQbservableProvider), default(IScheduler), default(IObservable[]))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(scheduler, typeof(IScheduler)), GetSourceExpression(sources) ) ); } /// /// Merges elements from all inner observable sequences into a single observable sequence. /// /// The type of the elements in the source sequences. /// Observable sequence of inner observable sequences. /// The observable sequence that merges the elements of the inner sequences. /// /// is null. public static IQbservable Merge(this IQbservable> sources) { if (sources == null) throw new ArgumentNullException("sources"); return sources.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Merge(default(IQbservable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif sources.Expression ) ); } #if !NO_TPL /// /// Merges results from all source tasks into a single observable sequence. /// /// The type of the results produced by the source tasks. /// Observable sequence of tasks. /// The observable sequence that merges the results of the source tasks. /// /// is null. /// If the tasks support cancellation, consider manual conversion of the tasks using , followed by a merge operation using . public static IQbservable Merge(this IQbservable> sources) { if (sources == null) throw new ArgumentNullException("sources"); return sources.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Merge(default(IQbservable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif sources.Expression ) ); } #endif /// /// Merges elements from all of the specified observable sequences into a single observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Observable sequences. /// The observable sequence that merges the elements of the observable sequences. /// /// is null. public static IQbservable Merge(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.Merge(default(IQbservableProvider), default(IObservable[]))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Enumerable sequence of observable sequences. /// The observable sequence that merges the elements of the observable sequences. /// /// is null. public static IQbservable Merge(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.Merge(default(IQbservableProvider), default(IEnumerable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Merges elements from all inner observable sequences into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences. /// /// The type of the elements in the source sequences. /// Observable sequence of inner observable sequences. /// Maximum number of inner observable sequences being subscribed to concurrently. /// The observable sequence that merges the elements of the inner sequences. /// /// is null. /// /// is less than or equal to zero. public static IQbservable Merge(this IQbservable> sources, int maxConcurrent) { if (sources == null) throw new ArgumentNullException("sources"); return sources.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Merge(default(IQbservable>), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif sources.Expression, Expression.Constant(maxConcurrent, typeof(int)) ) ); } /// /// Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Enumerable sequence of observable sequences. /// Maximum number of observable sequences being subscribed to concurrently. /// The observable sequence that merges the elements of the observable sequences. /// /// is null. /// /// is less than or equal to zero. public static IQbservable Merge(this IQbservableProvider provider, IEnumerable> sources, int maxConcurrent) { 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.Merge(default(IQbservableProvider), default(IEnumerable>), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources), Expression.Constant(maxConcurrent, typeof(int)) ) ); } /// /// Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences, and using the specified scheduler for enumeration of and subscription to the sources. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Enumerable sequence of observable sequences. /// Maximum number of observable sequences being subscribed to concurrently. /// Scheduler to run the enumeration of the sequence of sources on. /// The observable sequence that merges the elements of the observable sequences. /// /// or is null. /// /// is less than or equal to zero. public static IQbservable Merge(this IQbservableProvider provider, IEnumerable> sources, int maxConcurrent, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (sources == null) throw new ArgumentNullException("sources"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Merge(default(IQbservableProvider), default(IEnumerable>), default(int), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources), Expression.Constant(maxConcurrent, typeof(int)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence, using the specified scheduler for enumeration of and subscription to the sources. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Enumerable sequence of observable sequences. /// Scheduler to run the enumeration of the sequence of sources on. /// The observable sequence that merges the elements of the observable sequences. /// /// or is null. public static IQbservable Merge(this IQbservableProvider provider, IEnumerable> sources, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (sources == null) throw new ArgumentNullException("sources"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Merge(default(IQbservableProvider), default(IEnumerable>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum value in an observable sequence of nullable values. /// /// A sequence of nullable values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum value in an observable sequence of values. /// /// A sequence of values to determine the minimum value of. /// An observable sequence containing a single element with the minimum value in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Returns the minimum element in an observable sequence. /// /// The type of the elements in the source sequence. /// An observable sequence to determine the mimimum element of. /// An observable sequence containing a single element with the minimum element in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Returns the minimum element in an observable sequence according to the specified comparer. /// /// The type of the elements in the source sequence. /// An observable sequence to determine the mimimum element of. /// Comparer used to compare elements. /// An observable sequence containing a single element with the minimum element in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable), default(IComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(comparer, typeof(IComparer)) ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum nullable value. /// /// The type of the elements in the source sequence. /// A sequence of values to determine the minimum value of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value of type that corresponds to the minimum value in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value. /// /// The type of the elements in the source sequence. /// The type of the objects derived from the elements in the source sequence to determine the minimum of. /// An observable sequence to determine the mimimum element of. /// A transform function to apply to each element. /// An observable sequence containing a single element with the value that corresponds to the minimum element in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(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.Min(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } /// /// Invokes a transform function on each element of a sequence and returns the minimum value according to the specified comparer. /// /// The type of the elements in the source sequence. /// The type of the objects derived from the elements in the source sequence to determine the minimum of. /// An observable sequence to determine the mimimum element of. /// A transform function to apply to each element. /// Comparer used to compare elements. /// An observable sequence containing a single element with the value that corresponds to the minimum element in the source sequence. /// /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Min(this IQbservable source, Expression> 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 source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Min(default(IQbservable), default(Expression>), default(IComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(comparer, typeof(IComparer)) ) ); } /// /// Returns the elements in an observable sequence with the minimum key value. /// /// The type of the elements in the source sequence. /// The type of the key computed for each element in the source sequence. /// An observable sequence to get the minimum elements for. /// Key selector function. /// An observable sequence containing a list of zero or more elements that have a minimum key value. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> MinBy(this IQbservable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.MinBy(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector ) ); } /// /// Returns the elements in an observable sequence with the minimum key value according to the specified comparer. /// /// The type of the elements in the source sequence. /// The type of the key computed for each element in the source sequence. /// An observable sequence to get the minimum elements for. /// Key selector function. /// Comparer used to compare key values. /// An observable sequence containing a list of zero or more elements that have a minimum key value. /// /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> MinBy(this IQbservable source, Expression> keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.MinBy(default(IQbservable), default(Expression>), default(IComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)) ) ); } /// /// Returns an enumerable sequence whose enumeration returns the most recently observed element in the source observable sequence, using the specified initial value in case no element has been sampled yet. /// Enumerators on the resulting sequence never block and can produce the same element repeatedly. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// Initial value that will be yielded by the enumerable sequence if no element has been sampled yet. /// The enumerable sequence that returns the last sampled element upon each iteration. /// /// is null. /// This operator requires the source's object (see ) to implement . public static IQueryable MostRecent(this IQbservable source, TSource initialValue) { if (source == null) throw new ArgumentNullException("source"); return ((IQueryProvider)source.Provider).CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.MostRecent(default(IQbservable), default(TSource))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(initialValue, typeof(TSource)) ) ); } /// /// Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each /// subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's /// invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay. /// /// The type of the elements in the source sequence. /// The type of the elements produced by the intermediate subject. /// The type of the elements in the result sequence. /// Source sequence which will be multicasted in the specified selector function. /// Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. /// Selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or or is null. public static IQbservable Multicast(this IQbservable source, Expression>> subjectSelector, Expression, IObservable>> selector) { if (source == null) throw new ArgumentNullException("source"); if (subjectSelector == null) throw new ArgumentNullException("subjectSelector"); if (selector == null) throw new ArgumentNullException("selector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Multicast(default(IQbservable), default(Expression>>), default(Expression, IObservable>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TIntermediate), typeof(TResult)), #endif source.Expression, subjectSelector, selector ) ); } /// /// Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// An observable sequence whose observers will never get called. public static IQbservable Never(this IQbservableProvider provider) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Never(default(IQbservableProvider))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)) ) ); } /// /// Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// Object solely used to infer the type of the type parameter. This parameter is typically used when creating a sequence of anonymously typed elements. /// An observable sequence whose observers will never get called. public static IQbservable Never(this IQbservableProvider provider, TResult witness) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Never(default(IQbservableProvider), default(TResult))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(witness, typeof(TResult)) ) ); } /// /// Returns an enumerable sequence whose enumeration blocks until the next element in the source observable sequence becomes available. /// Enumerators on the resulting sequence will block until the next element becomes available. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// The enumerable sequence that blocks upon each iteration until the next element in the observable source sequence becomes available. /// /// is null. /// This operator requires the source's object (see ) to implement . public static IQueryable Next(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return ((IQueryProvider)source.Provider).CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Next(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Wraps the source sequence in order to run its observer callbacks on the specified synchronization context. /// /// The type of the elements in the source sequence. /// Source sequence. /// Synchronization context to notify observers on. /// The source sequence whose observations happen on the specified synchronization context. /// /// or is null. /// /// This only invokes observer callbacks on a synchronization context. In case the subscription and/or unsubscription actions have side-effects /// that require to be run on a synchronization context, use . /// public static IQbservable ObserveOn(this IQbservable source, SynchronizationContext context) { if (source == null) throw new ArgumentNullException("source"); if (context == null) throw new ArgumentNullException("context"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ObserveOn(default(IQbservable), default(SynchronizationContext))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(context, typeof(SynchronizationContext)) ) ); } /// /// Wraps the source sequence in order to run its observer callbacks on the specified scheduler. /// /// The type of the elements in the source sequence. /// Source sequence. /// Scheduler to notify observers on. /// The source sequence whose observations happen on the specified scheduler. /// /// or is null. /// /// This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects /// that require to be run on a scheduler, use . /// public static IQbservable ObserveOn(this IQbservable source, 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.ObserveOn(default(IQbservable), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Filters the elements of an observable sequence based on the specified type. /// /// The type to filter the elements in the source sequence on. /// The observable sequence that contains the elements to be filtered. /// An observable sequence that contains elements from the input sequence of type TResult. /// /// is null. public static IQbservable OfType(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.OfType(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif source.Expression ) ); } /// /// Concatenates the second observable sequence to the first observable sequence upon successful or exceptional termination of the first. /// /// The type of the elements in the source sequences. /// First observable sequence whose exception (if any) is caught. /// Second observable sequence used to produce results after the first sequence terminates. /// An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. /// /// or is null. public static IQbservable OnErrorResumeNext(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.OnErrorResumeNext(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif first.Expression, GetSourceExpression(second) ) ); } /// /// Concatenates all of the specified observable sequences, even if the previous observable sequence terminated exceptionally. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Observable sequences to concatenate. /// An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. /// /// is null. public static IQbservable OnErrorResumeNext(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.OnErrorResumeNext(default(IQbservableProvider), default(IObservable[]))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Concatenates all observable sequences in the given enumerable sequence, even if the previous observable sequence terminated exceptionally. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// Observable sequences to concatenate. /// An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. /// /// is null. public static IQbservable OnErrorResumeNext(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.OnErrorResumeNext(default(IQbservableProvider), default(IEnumerable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence. /// This operator is a specialization of Multicast using a regular . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or is null. /// public static IQbservable Publish(this IQbservable source, Expression, IObservable>> 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.Publish(default(IQbservable), default(Expression, IObservable>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on. /// Initial value received by observers upon subscription. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or is null. /// public static IQbservable Publish(this IQbservable source, Expression, IObservable>> selector, TSource initialValue) { 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.Publish(default(IQbservable), default(Expression, IObservable>>), default(TSource))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(initialValue, typeof(TSource)) ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or is null. /// public static IQbservable PublishLast(this IQbservable source, Expression, IObservable>> 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.PublishLast(default(IQbservable), default(Expression, IObservable>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } /// /// Generates an observable sequence of integral numbers within a specified range. /// /// Query provider used to construct the IQbservable<T> data source. /// The value of the first integer in the sequence. /// The number of sequential integers to generate. /// An observable sequence that contains a range of sequential integral numbers. /// /// is less than zero. -or- + - 1 is larger than . public static IQbservable Range(this IQbservableProvider provider, int start, int count) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Range(default(IQbservableProvider), default(int), default(int))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(start, typeof(int)), Expression.Constant(count, typeof(int)) ) ); } /// /// Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. /// /// Query provider used to construct the IQbservable<T> data source. /// The value of the first integer in the sequence. /// The number of sequential integers to generate. /// Scheduler to run the generator loop on. /// An observable sequence that contains a range of sequential integral numbers. /// /// is less than zero. -or- + - 1 is larger than . /// /// is null. public static IQbservable Range(this IQbservableProvider provider, int start, int count, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Range(default(IQbservableProvider), default(int), default(int), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(start, typeof(int)), Expression.Constant(count, typeof(int)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequence. /// Connectable observable sequence. /// An observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence. /// /// is null. public static IQbservable RefCount(this IQbservableProvider provider, IConnectableObservable source) { if (provider == null) throw new ArgumentNullException("provider"); if (source == null) throw new ArgumentNullException("source"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.RefCount(default(IQbservableProvider), default(IConnectableObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(source, typeof(IConnectableObservable)) ) ); } /// /// Generates an observable sequence that repeats the given element infinitely. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the element that will be repeated in the produced sequence. /// Element to repeat. /// An observable sequence that repeats the given element infinitely. public static IQbservable Repeat(this IQbservableProvider provider, TResult value) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Repeat(default(IQbservableProvider), default(TResult))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(value, typeof(TResult)) ) ); } /// /// Generates an observable sequence that repeats the given element the specified number of times. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the element that will be repeated in the produced sequence. /// Element to repeat. /// Number of times to repeat the element. /// An observable sequence that repeats the given element the specified number of times. /// /// is less than zero. public static IQbservable Repeat(this IQbservableProvider provider, TResult value, int repeatCount) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Repeat(default(IQbservableProvider), default(TResult), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(value, typeof(TResult)), Expression.Constant(repeatCount, typeof(int)) ) ); } /// /// Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the element that will be repeated in the produced sequence. /// Element to repeat. /// Number of times to repeat the element. /// Scheduler to run the producer loop on. /// An observable sequence that repeats the given element the specified number of times. /// /// is less than zero. /// /// is null. public static IQbservable Repeat(this IQbservableProvider provider, TResult value, int repeatCount, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Repeat(default(IQbservableProvider), default(TResult), default(int), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(value, typeof(TResult)), Expression.Constant(repeatCount, typeof(int)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Generates an observable sequence that repeats the given element infinitely, using the specified scheduler to send out observer messages. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the element that will be repeated in the produced sequence. /// Element to repeat. /// Scheduler to run the producer loop on. /// An observable sequence that repeats the given element infinitely. /// /// is null. public static IQbservable Repeat(this IQbservableProvider provider, TResult value, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Repeat(default(IQbservableProvider), default(TResult), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(value, typeof(TResult)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Repeats the observable sequence indefinitely. /// /// The type of the elements in the source sequence. /// Observable sequence to repeat. /// The observable sequence producing the elements of the given sequence repeatedly and sequentially. /// /// is null. public static IQbservable Repeat(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Repeat(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Repeats the observable sequence a specified number of times. /// /// The type of the elements in the source sequence. /// Observable sequence to repeat. /// Number of times to repeat the sequence. /// The observable sequence producing the elements of the given sequence repeatedly. /// /// is null. /// /// is less than zero. public static IQbservable Repeat(this IQbservable source, int repeatCount) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Repeat(default(IQbservable), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(repeatCount, typeof(int)) ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying all notifications. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or is null. /// public static IQbservable Replay(this IQbservable source, Expression, IObservable>> 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.Replay(default(IQbservable), default(Expression, IObservable>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum element count for the replay buffer. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. /// Maximum element count of the replay buffer. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or is null. /// /// is less than zero. /// public static IQbservable Replay(this IQbservable source, Expression, IObservable>> selector, int bufferSize) { 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.Replay(default(IQbservable), default(Expression, IObservable>>), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(bufferSize, typeof(int)) ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum element count for the replay buffer. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. /// Maximum element count of the replay buffer. /// Scheduler where connected observers within the selector function will be invoked on. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or or is null. /// /// is less than zero. /// public static IQbservable Replay(this IQbservable source, Expression, IObservable>> selector, int bufferSize, IScheduler scheduler) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Replay(default(IQbservable), default(Expression, IObservable>>), default(int), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(bufferSize, typeof(int)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length and element count for the replay buffer. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. /// Maximum element count of the replay buffer. /// Maximum time length of the replay buffer. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or is null. /// /// is less than zero. /// /// is less than TimeSpan.Zero. /// public static IQbservable Replay(this IQbservable source, Expression, IObservable>> selector, int bufferSize, TimeSpan window) { 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.Replay(default(IQbservable), default(Expression, IObservable>>), default(int), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(bufferSize, typeof(int)), Expression.Constant(window, typeof(TimeSpan)) ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length and element count for the replay buffer. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. /// Maximum element count of the replay buffer. /// Maximum time length of the replay buffer. /// Scheduler where connected observers within the selector function will be invoked on. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or or is null. /// /// is less than zero. /// /// is less than TimeSpan.Zero. /// public static IQbservable Replay(this IQbservable source, Expression, IObservable>> selector, int bufferSize, TimeSpan window, IScheduler scheduler) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Replay(default(IQbservable), default(Expression, IObservable>>), default(int), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(bufferSize, typeof(int)), Expression.Constant(window, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying all notifications. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source. /// Scheduler where connected observers within the selector function will be invoked on. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or or is null. /// public static IQbservable Replay(this IQbservable source, Expression, IObservable>> selector, IScheduler scheduler) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Replay(default(IQbservable), default(Expression, IObservable>>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. /// Maximum time length of the replay buffer. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or is null. /// /// is less than TimeSpan.Zero. /// public static IQbservable Replay(this IQbservable source, Expression, IObservable>> selector, TimeSpan window) { 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.Replay(default(IQbservable), default(Expression, IObservable>>), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(window, typeof(TimeSpan)) ) ); } /// /// Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. /// This operator is a specialization of Multicast using a . /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence whose elements will be multicasted through a single shared subscription. /// Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. /// Maximum time length of the replay buffer. /// Scheduler where connected observers within the selector function will be invoked on. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or or is null. /// /// is less than TimeSpan.Zero. /// public static IQbservable Replay(this IQbservable source, Expression, IObservable>> selector, TimeSpan window, IScheduler scheduler) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Replay(default(IQbservable), default(Expression, IObservable>>), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector, Expression.Constant(window, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Repeats the source observable sequence until it successfully terminates. /// /// The type of the elements in the source sequence. /// Observable sequence to repeat until it successfully terminates. /// An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. /// /// is null. public static IQbservable Retry(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Retry(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Repeats the source observable sequence the specified number of times or until it successfully terminates. /// /// The type of the elements in the source sequence. /// Observable sequence to repeat until it successfully terminates. /// Number of times to repeat the sequence. /// An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. /// /// is null. /// /// is less than zero. public static IQbservable Retry(this IQbservable source, int retryCount) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Retry(default(IQbservable), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(retryCount, typeof(int)) ) ); } /// /// Returns an observable sequence that contains a single element. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the element that will be returned in the produced sequence. /// Single element in the resulting observable sequence. /// An observable sequence containing the single specified element. public static IQbservable Return(this IQbservableProvider provider, TResult value) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Return(default(IQbservableProvider), default(TResult))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(value, typeof(TResult)) ) ); } /// /// Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the element that will be returned in the produced sequence. /// Single element in the resulting observable sequence. /// Scheduler to send the single element on. /// An observable sequence containing the single specified element. /// /// is null. public static IQbservable Return(this IQbservableProvider provider, TResult value, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Return(default(IQbservableProvider), default(TResult), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(value, typeof(TResult)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Samples the observable sequence at each interval. /// Upon each sampling tick, the latest element (if any) in the source sequence during the last sampling interval is sent to the resulting sequence. /// /// The type of the elements in the source sequence. /// Source sequence to sample. /// Interval at which to sample. If this value is equal to TimeSpan.Zero, the scheduler will continuously sample the stream. /// Sampled observable sequence. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// Specifying a TimeSpan.Zero value for doesn't guarantee all source sequence elements will be preserved. This is a side-effect /// of the asynchrony introduced by the scheduler, where the sampling action may not execute immediately, despite the TimeSpan.Zero due time. /// public static IQbservable Sample(this IQbservable source, TimeSpan interval) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sample(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(interval, typeof(TimeSpan)) ) ); } /// /// Samples the observable sequence at each interval, using the specified scheduler to run sampling timers. /// Upon each sampling tick, the latest element (if any) in the source sequence during the last sampling interval is sent to the resulting sequence. /// /// The type of the elements in the source sequence. /// Source sequence to sample. /// Interval at which to sample. If this value is equal to TimeSpan.Zero, the scheduler will continuously sample the stream. /// Scheduler to run the sampling timer on. /// Sampled observable sequence. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// Specifying a TimeSpan.Zero value for doesn't guarantee all source sequence elements will be preserved. This is a side-effect /// of the asynchrony introduced by the scheduler, where the sampling action may not execute immediately, despite the TimeSpan.Zero due time. /// public static IQbservable Sample(this IQbservable source, TimeSpan interval, 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.Sample(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(interval, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Samples the source observable sequence using a samper observable sequence producing sampling ticks. /// Upon each sampling tick, the latest element (if any) in the source sequence during the last sampling interval is sent to the resulting sequence. /// /// The type of the elements in the source sequence. /// The type of the elements in the sampling sequence. /// Source sequence to sample. /// Sampling tick sequence. /// Sampled observable sequence. /// /// or is null. public static IQbservable Sample(this IQbservable source, IObservable sampler) { if (source == null) throw new ArgumentNullException("source"); if (sampler == null) throw new ArgumentNullException("sampler"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sample(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TSample)), #endif source.Expression, GetSourceExpression(sampler) ) ); } /// /// Applies an accumulator function over an observable sequence and returns each intermediate result. /// For aggregation behavior with no intermediate results, see . /// /// The type of the elements in the source sequence and the result of the aggregation. /// An observable sequence to accumulate over. /// An accumulator function to be invoked on each element. /// An observable sequence containing the accumulated values. /// /// or is null. public static IQbservable Scan(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.Scan(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, accumulator ) ); } /// /// Applies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. /// For aggregation behavior with no intermediate results, see . /// /// The type of the elements in the source sequence. /// The type of the result of the aggregation. /// An observable sequence to accumulate over. /// The initial accumulator value. /// An accumulator function to be invoked on each element. /// An observable sequence containing the accumulated values. /// /// or is null. public static IQbservable Scan(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.Scan(default(IQbservable), default(TAccumulate), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), #endif source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator ) ); } /// /// Projects each element of an observable sequence into a new form. /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence. /// A sequence of elements to invoke a transform function on. /// A transform function to apply to each source element. /// An observable sequence whose elements are the result of invoking the transform function on each element of source. /// /// or is null. public static IQbservable Select(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.Select(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } /// /// Projects each element of an observable sequence into a new form by incorporating the element's index. /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence. /// A sequence of elements to invoke a transform function on. /// A transform function to apply to each source element; the second parameter of the function represents the index of the source element. /// An observable sequence whose elements are the result of invoking the transform function on each element of source. /// /// or is null. public static IQbservable Select(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.Select(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } /// /// Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the elements in the projected intermediate sequences. /// The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements. /// An observable sequence of elements to project. /// A transform function to apply to each element. /// A transform function to apply to each element of the intermediate sequence. /// An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. /// /// or or is null. public static IQbservable SelectMany(this IQbservable source, Expression>> collectionSelector, Expression> resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (collectionSelector == null) throw new ArgumentNullException("collectionSelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SelectMany(default(IQbservable), default(Expression>>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), #endif source.Expression, collectionSelector, resultSelector ) ); } /// /// Projects each element of an observable sequence to an enumerable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the elements in the projected intermediate enumerable sequences. /// The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements. /// An observable sequence of elements to project. /// A transform function to apply to each element. /// A transform function to apply to each element of the intermediate sequence. /// An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. /// /// or or is null. /// The projected sequences are enumerated synchonously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the conversion. public static IQbservable SelectMany(this IQbservable source, Expression>> collectionSelector, Expression> resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (collectionSelector == null) throw new ArgumentNullException("collectionSelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SelectMany(default(IQbservable), default(Expression>>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), #endif source.Expression, collectionSelector, resultSelector ) ); } /// /// Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the elements in the other sequence and the elements in the result sequence. /// An observable sequence of elements to project. /// An observable sequence to project each element from the source sequence onto. /// An observable sequence whose elements are the result of projecting each source element onto the other sequence and merging all the resulting sequences together. /// /// or is null. public static IQbservable SelectMany(this IQbservable source, IObservable other) { if (source == null) throw new ArgumentNullException("source"); if (other == null) throw new ArgumentNullException("other"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SelectMany(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TOther)), #endif source.Expression, GetSourceExpression(other) ) ); } /// /// Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the elements in the projected inner sequences and the elements in the merged result sequence. /// An observable sequence of notifications to project. /// A transform function to apply to each element. /// A transform function to apply when an error occurs in the source sequence. /// A transform function to apply when the end of the source sequence is reached. /// An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. /// /// or or or is null. public static IQbservable SelectMany(this IQbservable source, Expression>> onNext, Expression>> onError, Expression>> onCompleted) { if (source == null) throw new ArgumentNullException("source"); if (onNext == null) throw new ArgumentNullException("onNext"); if (onError == null) throw new ArgumentNullException("onError"); if (onCompleted == null) throw new ArgumentNullException("onCompleted"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SelectMany(default(IQbservable), default(Expression>>), default(Expression>>), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, onNext, onError, onCompleted ) ); } /// /// Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the elements in the projected inner sequences and the elements in the merged result sequence. /// An observable sequence of elements to project. /// A transform function to apply to each element. /// An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. /// /// or is null. public static IQbservable SelectMany(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.SelectMany(default(IQbservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } #if !NO_TPL /// /// Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the result produced by the projected tasks and the elements in the merged result sequence. /// An observable sequence of elements to project. /// A transform function to apply to each element. /// An observable sequence whose elements are the result of the tasks executed for each element of the input sequence. /// This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using . /// /// or is null. public static IQbservable SelectMany(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.SelectMany(default(IQbservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } #endif #if !NO_TPL /// /// Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the result produced by the projected tasks and the elements in the merged result sequence. /// An observable sequence of elements to project. /// A transform function to apply to each element. /// An observable sequence whose elements are the result of the tasks executed for each element of the input sequence. /// This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using . /// /// or is null. public static IQbservable SelectMany(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.SelectMany(default(IQbservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } #endif /// /// Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence. /// An observable sequence of elements to project. /// A transform function to apply to each element. /// An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. /// /// or is null. /// The projected sequences are enumerated synchonously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the conversion. public static IQbservable SelectMany(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.SelectMany(default(IQbservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif source.Expression, selector ) ); } #if !NO_TPL /// /// Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the results produced by the projected intermediate tasks. /// The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate task results. /// An observable sequence of elements to project. /// A transform function to apply to each element. /// A transform function to apply to each element of the intermediate sequence. /// An observable sequence whose elements are the result of obtaining a task for each element of the input sequence and then mapping the task's result and its corresponding source element to a result element. /// /// or or is null. /// This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using . public static IQbservable SelectMany(this IQbservable source, Expression>> taskSelector, Expression> resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (taskSelector == null) throw new ArgumentNullException("taskSelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SelectMany(default(IQbservable), default(Expression>>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TTaskResult), typeof(TResult)), #endif source.Expression, taskSelector, resultSelector ) ); } #endif #if !NO_TPL /// /// Projects each element of an observable sequence to a task with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence. /// /// The type of the elements in the source sequence. /// The type of the results produced by the projected intermediate tasks. /// The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate task results. /// An observable sequence of elements to project. /// A transform function to apply to each element. /// A transform function to apply to each element of the intermediate sequence. /// An observable sequence whose elements are the result of obtaining a task for each element of the input sequence and then mapping the task's result and its corresponding source element to a result element. /// /// or or is null. /// This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using . public static IQbservable SelectMany(this IQbservable source, Expression>> taskSelector, Expression> resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (taskSelector == null) throw new ArgumentNullException("taskSelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SelectMany(default(IQbservable), default(Expression>>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TTaskResult), typeof(TResult)), #endif source.Expression, taskSelector, resultSelector ) ); } #endif /// /// Determines whether two sequences are equal by comparing the elements pairwise. /// /// The type of the elements in the source sequence. /// First observable sequence to compare. /// Second observable sequence to compare. /// An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable SequenceEqual(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.SequenceEqual(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif first.Expression, GetSourceExpression(second) ) ); } /// /// Determines whether an observable and enumerable sequence are equal by comparing the elements pairwise. /// /// The type of the elements in the source sequence. /// First observable sequence to compare. /// Second observable sequence to compare. /// An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable SequenceEqual(this IQbservable first, IEnumerable 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.SequenceEqual(default(IQbservable), default(IEnumerable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif first.Expression, GetSourceExpression(second) ) ); } /// /// Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer. /// /// The type of the elements in the source sequence. /// First observable sequence to compare. /// Second observable sequence to compare. /// Comparer used to compare elements of both sequences. /// An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer. /// /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable SequenceEqual(this IQbservable first, IObservable second, IEqualityComparer comparer) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (comparer == null) throw new ArgumentNullException("comparer"); return first.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SequenceEqual(default(IQbservable), default(IObservable), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Determines whether an observable and enumerable sequence are equal by comparing the elements pairwise using a specified equality comparer. /// /// The type of the elements in the source sequence. /// First observable sequence to compare. /// Second observable sequence to compare. /// Comparer used to compare elements of both sequences. /// An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer. /// /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable SequenceEqual(this IQbservable first, IEnumerable second, IEqualityComparer comparer) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (comparer == null) throw new ArgumentNullException("comparer"); return first.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SequenceEqual(default(IQbservable), default(IEnumerable), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Returns the only element of an observable sequence, and reports an exception if there is not exactly one element in the observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// Sequence containing the single element in the observable sequence. /// /// is null. /// (Asynchronous) The source sequence contains more than one element. -or- The source sequence is empty. public static IQbservable SingleAsync(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SingleAsync(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Returns the only element of an observable sequence that satisfies the condition in the predicate, and reports an exception if there is not exactly one element in the observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// A predicate function to evaluate for elements in the source sequence. /// Sequence containing the single element in the observable sequence that satisfies the condition in the predicate. /// /// or is null. /// (Asynchronous) No element satisfies the condition in the predicate. -or- More than one element satisfies the condition in the predicate. -or- The source sequence is empty. public static IQbservable SingleAsync(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.SingleAsync(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Returns the only element of an observable sequence, or a default value if the observable sequence is empty; this method reports an exception if there is more than one element in the observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// Sequence containing the single element in the observable sequence, or a default value if no such element exists. /// /// is null. /// (Asynchronous) The source sequence contains more than one element. public static IQbservable SingleOrDefaultAsync(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SingleOrDefaultAsync(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence. /// /// The type of the elements in the source sequence. /// Source observable sequence. /// A predicate function to evaluate for elements in the source sequence. /// Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. /// /// or is null. /// (Asynchronous) The sequence contains more than one element that satisfies the condition in the predicate. public static IQbservable SingleOrDefaultAsync(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.SingleOrDefaultAsync(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. /// /// The type of the elements in the source sequence. /// The sequence to take elements from. /// The number of elements to skip before returning the remaining elements. /// An observable sequence that contains the elements that occur after the specified index in the input sequence. /// /// is null. /// /// is less than zero. public static IQbservable Skip(this IQbservable source, int count) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Skip(default(IQbservable), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(count, typeof(int)) ) ); } /// /// Skips elements for the specified duration from the start of the observable source sequence. /// /// The type of the elements in the source sequence. /// Source sequence to skip elements for. /// Duration for skipping elements from the start of the sequence. /// An observable sequence with the elements skipped during the specified duration from the start of the source sequence. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// /// Specifying a TimeSpan.Zero value for doesn't guarantee no elements will be dropped from the start of the source sequence. /// This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded /// may not execute immediately, despite the TimeSpan.Zero due time. /// /// /// Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the . /// /// public static IQbservable Skip(this IQbservable source, TimeSpan duration) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Skip(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)) ) ); } /// /// Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. /// /// The type of the elements in the source sequence. /// Source sequence to skip elements for. /// Duration for skipping elements from the start of the sequence. /// Scheduler to run the timer on. /// An observable sequence with the elements skipped during the specified duration from the start of the source sequence. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// /// Specifying a TimeSpan.Zero value for doesn't guarantee no elements will be dropped from the start of the source sequence. /// This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded /// may not execute immediately, despite the TimeSpan.Zero due time. /// /// /// Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the . /// /// public static IQbservable Skip(this IQbservable source, TimeSpan duration, 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.Skip(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Bypasses a specified number of elements at the end of an observable sequence. /// /// The type of the elements in the source sequence. /// Source sequence. /// Number of elements to bypass at the end of the source sequence. /// An observable sequence containing the source sequence elements except for the bypassed ones at the end. /// /// is null. /// /// is less than zero. /// /// This operator accumulates a queue with a length enough to store the first elements. As more elements are /// received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. /// public static IQbservable SkipLast(this IQbservable source, int count) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SkipLast(default(IQbservable), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(count, typeof(int)) ) ); } /// /// Skips elements for the specified duration from the end of the observable source sequence. /// /// The type of the elements in the source sequence. /// Source sequence to skip elements for. /// Duration for skipping elements from the end of the sequence. /// An observable sequence with the elements skipped during the specified duration from the end of the source sequence. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// This operator accumulates a queue with a length enough to store elements received during the initial window. /// As more elements are received, elements older than the specified are taken from the queue and produced on the /// result sequence. This causes elements to be delayed with . /// public static IQbservable SkipLast(this IQbservable source, TimeSpan duration) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SkipLast(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)) ) ); } /// /// Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. /// /// The type of the elements in the source sequence. /// Source sequence to skip elements for. /// Duration for skipping elements from the end of the sequence. /// Scheduler to run the timer on. /// An observable sequence with the elements skipped during the specified duration from the end of the source sequence. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// This operator accumulates a queue with a length enough to store elements received during the initial window. /// As more elements are received, elements older than the specified are taken from the queue and produced on the /// result sequence. This causes elements to be delayed with . /// public static IQbservable SkipLast(this IQbservable source, TimeSpan duration, 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.SkipLast(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Skips elements from the observable source sequence until the specified start time. /// /// The type of the elements in the source sequence. /// Source sequence to skip elements for. /// Time to start taking elements from the source sequence. If this value is less than or equal to DateTimeOffset.UtcNow, no elements will be skipped. /// An observable sequence with the elements skipped until the specified start time. /// /// is null. /// /// Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the . /// public static IQbservable SkipUntil(this IQbservable source, DateTimeOffset startTime) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SkipUntil(default(IQbservable), default(DateTimeOffset))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(startTime, typeof(DateTimeOffset)) ) ); } /// /// Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers. /// /// The type of the elements in the source sequence. /// Source sequence to skip elements for. /// Time to start taking elements from the source sequence. If this value is less than or equal to DateTimeOffset.UtcNow, no elements will be skipped. /// Scheduler to run the timer on. /// An observable sequence with the elements skipped until the specified start time. /// /// or is null. /// /// Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the . /// public static IQbservable SkipUntil(this IQbservable source, DateTimeOffset startTime, 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.SkipUntil(default(IQbservable), default(DateTimeOffset), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(startTime, typeof(DateTimeOffset)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns the elements from the source observable sequence only after the other observable sequence produces an element. /// /// The type of the elements in the source sequence. /// The type of the elements in the other sequence that indicates the end of skip behavior. /// Source sequence to propagate elements for. /// Observable sequence that triggers propagation of elements of the source sequence. /// An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. /// /// or is null. public static IQbservable SkipUntil(this IQbservable source, IObservable other) { if (source == null) throw new ArgumentNullException("source"); if (other == null) throw new ArgumentNullException("other"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SkipUntil(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TOther)), #endif source.Expression, GetSourceExpression(other) ) ); } /// /// Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. /// /// The type of the elements in the source sequence. /// An observable sequence to return elements from. /// A function to test each element for a condition. /// An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. /// /// or is null. public static IQbservable SkipWhile(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.SkipWhile(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. /// The element's index is used in the logic of the predicate function. /// /// The type of the elements in the source sequence. /// An observable sequence to return elements from. /// A function to test each element for a condition; the second parameter of the function represents the index of the source element. /// An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. /// /// or is null. public static IQbservable SkipWhile(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.SkipWhile(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Invokes the action asynchronously, surfacing the result through an observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// Action to run asynchronously. /// An observable sequence exposing a Unit value upon completion of the action, or an exception. /// /// is null. /// /// /// /// The action is called immediately, not during the subscription of the resulting sequence. /// /// /// Multiple subscriptions to the resulting sequence can observe the action's outcome. /// /// /// public static IQbservable Start(this IQbservableProvider provider, Expression action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Start(default(IQbservableProvider), default(Expression))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), action ) ); } /// /// Invokes the action asynchronously on the specified scheduler, surfacing the result through an observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// Action to run asynchronously. /// Scheduler to run the action on. /// An observable sequence exposing a Unit value upon completion of the action, or an exception. /// /// or is null. /// /// /// /// The action is called immediately, not during the subscription of the resulting sequence. /// /// /// Multiple subscriptions to the resulting sequence can observe the action's outcome. /// /// /// public static IQbservable Start(this IQbservableProvider provider, Expression action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Start(default(IQbservableProvider), default(Expression), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Invokes the specified function asynchronously, surfacing the result through an observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the result returned by the function. /// Function to run asynchronously. /// An observable sequence exposing the function's result value, or an exception. /// /// is null. /// /// /// /// The function is called immediately, not during the subscription of the resulting sequence. /// /// /// Multiple subscriptions to the resulting sequence can observe the function's result. /// /// /// public static IQbservable Start(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Start(default(IQbservableProvider), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), function ) ); } /// /// Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the result returned by the function. /// Function to run asynchronously. /// Scheduler to run the function on. /// An observable sequence exposing the function's result value, or an exception. /// /// or is null. /// /// /// /// The function is called immediately, not during the subscription of the resulting sequence. /// /// /// Multiple subscriptions to the resulting sequence can observe the function's result. /// /// /// public static IQbservable Start(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Start(default(IQbservableProvider), default(Expression>), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #if !NO_TPL /// /// Invokes the asynchronous action, surfacing the result through an observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// Asynchronous action to run. /// An observable sequence exposing a Unit value upon completion of the action, or an exception. /// /// is null. /// /// /// /// The action is started immediately, not during the subscription of the resulting sequence. /// /// /// Multiple subscriptions to the resulting sequence can observe the action's outcome. /// /// /// public static IQbservable StartAsync(this IQbservableProvider provider, Expression> actionAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (actionAsync == null) throw new ArgumentNullException("actionAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.StartAsync(default(IQbservableProvider), default(Expression>))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), actionAsync ) ); } #endif #if !NO_TPL /// /// Invokes the asynchronous action, surfacing the result through an observable sequence. /// The CancellationToken is shared by all subscriptions on the resulting observable sequence. See the remarks section for more information. /// /// Query provider used to construct the IQbservable<T> data source. /// Asynchronous action to run. /// An observable sequence exposing a Unit value upon completion of the action, or an exception. /// /// is null. /// /// /// /// The action is started immediately, not during the subscription of the resulting sequence. /// /// /// Multiple subscriptions to the resulting sequence can observe the action's outcome. /// /// /// /// If any subscription to the resulting sequence is disposed, the CancellationToken is set. The observer associated to the disposed /// subscription won't see the TaskCanceledException, but other observers will. You can protect against this using the Catch operator. /// Be careful when handing out the resulting sequence because of this behavior. The most common use is to have a single subscription /// to the resulting sequence, which controls the CancellationToken state. Alternatively, you can control subscription behavior using /// multicast operators. /// /// /// /// public static IQbservable StartAsync(this IQbservableProvider provider, Expression> actionAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (actionAsync == null) throw new ArgumentNullException("actionAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.StartAsync(default(IQbservableProvider), default(Expression>))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), actionAsync ) ); } #endif #if !NO_TPL /// /// Invokes the asynchronous function, surfacing the result through an observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the result returned by the asynchronous function. /// Asynchronous function to run. /// An observable sequence exposing the function's result value, or an exception. /// /// is null. /// /// /// /// The function is started immediately, not during the subscription of the resulting sequence. /// /// /// Multiple subscriptions to the resulting sequence can observe the function's result. /// /// /// public static IQbservable StartAsync(this IQbservableProvider provider, Expression>> functionAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (functionAsync == null) throw new ArgumentNullException("functionAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.StartAsync(default(IQbservableProvider), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), functionAsync ) ); } #endif #if !NO_TPL /// /// Invokes the asynchronous function, surfacing the result through an observable sequence. /// The CancellationToken is shared by all subscriptions on the resulting observable sequence. See the remarks section for more information. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the result returned by the asynchronous function. /// Asynchronous function to run. /// An observable sequence exposing the function's result value, or an exception. /// /// is null. /// /// /// /// The function is started immediately, not during the subscription of the resulting sequence. /// /// /// Multiple subscriptions to the resulting sequence can observe the function's result. /// /// /// /// If any subscription to the resulting sequence is disposed, the CancellationToken is set. The observer associated to the disposed /// subscription won't see the TaskCanceledException, but other observers will. You can protect against this using the Catch operator. /// Be careful when handing out the resulting sequence because of this behavior. The most common use is to have a single subscription /// to the resulting sequence, which controls the CancellationToken state. Alternatively, you can control subscription behavior using /// multicast operators. /// /// /// /// public static IQbservable StartAsync(this IQbservableProvider provider, Expression>> functionAsync) { if (provider == null) throw new ArgumentNullException("provider"); if (functionAsync == null) throw new ArgumentNullException("functionAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.StartAsync(default(IQbservableProvider), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), functionAsync ) ); } #endif /// /// Prepends a sequence of values to an observable sequence. /// /// The type of the elements in the source sequence. /// Source sequence to prepend values to. /// Scheduler to emit the prepended values on. /// Values to prepend to the specified sequence. /// The source sequence prepended with the specified values. /// /// or or is null. public static IQbservable StartWith(this IQbservable source, IScheduler scheduler, params TSource[] values) { if (source == null) throw new ArgumentNullException("source"); if (scheduler == null) throw new ArgumentNullException("scheduler"); if (values == null) throw new ArgumentNullException("values"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.StartWith(default(IQbservable), default(IScheduler), default(TSource[]))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(scheduler, typeof(IScheduler)), Expression.Constant(values, typeof(TSource[])) ) ); } /// /// Prepends a sequence of values to an observable sequence. /// /// The type of the elements in the source sequence. /// Source sequence to prepend values to. /// Values to prepend to the specified sequence. /// The source sequence prepended with the specified values. /// /// or is null. public static IQbservable StartWith(this IQbservable source, params TSource[] values) { if (source == null) throw new ArgumentNullException("source"); if (values == null) throw new ArgumentNullException("values"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.StartWith(default(IQbservable), default(TSource[]))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(values, typeof(TSource[])) ) ); } /// /// Wraps the source sequence in order to run its subscription and unsubscription logic on the specified synchronization context. This operation is not commonly used; /// see the remarks section for more information on the distinction between SubscribeOn and ObserveOn. /// /// The type of the elements in the source sequence. /// Source sequence. /// Synchronization context to perform subscription and unsubscription actions on. /// The source sequence whose subscriptions and unsubscriptions happen on the specified synchronization context. /// /// or is null. /// /// This only performs the side-effects of subscription and unsubscription on the specified synchronization context. In order to invoke observer /// callbacks on a synchronization context, use . /// public static IQbservable SubscribeOn(this IQbservable source, SynchronizationContext context) { if (source == null) throw new ArgumentNullException("source"); if (context == null) throw new ArgumentNullException("context"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.SubscribeOn(default(IQbservable), default(SynchronizationContext))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(context, typeof(SynchronizationContext)) ) ); } /// /// Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; /// see the remarks section for more information on the distinction between SubscribeOn and ObserveOn. /// /// The type of the elements in the source sequence. /// Source sequence. /// Scheduler to perform subscription and unsubscription actions on. /// The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. /// /// or is null. /// /// This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer /// callbacks on a scheduler, use . /// public static IQbservable SubscribeOn(this IQbservable source, 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.SubscribeOn(default(IQbservable), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// (Asynchronous) The sum of the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of nullable values. /// /// A sequence of nullable values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of values. /// /// A sequence of values to calculate the sum of. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Sum(default(IQbservable))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif source.Expression ) ); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Computes the sum of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Computes the sum of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. /// /// The type of the elements in the source sequence. /// A sequence of values that are used to calculate a sum. /// A transform function to apply to each element. /// An observable sequence containing a single element with the sum of the values in the source sequence. /// /// or is null. /// (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than . /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable Sum(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.Sum(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, selector ) ); } /// /// Switches between the inner observable sequences such that the resulting sequence always produces elements from the most recently received inner observable sequence. /// Each time a new inner observable sequence is received, the previous inner observable sequence is unsubscribed from. /// /// The type of the elements in the source sequences. /// Observable sequence of inner observable sequences. /// The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. /// /// is null. public static IQbservable Switch(this IQbservable> sources) { if (sources == null) throw new ArgumentNullException("sources"); return sources.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Switch(default(IQbservable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif sources.Expression ) ); } #if !NO_TPL /// /// Switches between the tasks such that the resulting sequence always produces results from the most recently received task. /// Each time a new task is received, the previous task's result is ignored. /// /// The type of the results produced by the source tasks. /// Observable sequence of tasks. /// The observable sequence that at any point in time produces the result of the most recent task that has been received. /// /// is null. /// If the tasks support cancellation, consider manual conversion of the tasks using , followed by a switch operation using . public static IQbservable Switch(this IQbservable> sources) { if (sources == null) throw new ArgumentNullException("sources"); return sources.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Switch(default(IQbservable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif sources.Expression ) ); } #endif /// /// Synchronizes the observable sequence such that observer notifications cannot be delivered concurrently. /// This overload is useful to "fix" an observable sequence that exhibits concurrent callbacks on individual observers, which is invalid behavior for the query processor. /// /// The type of the elements in the source sequence. /// Source sequence. /// The source sequence whose outgoing calls to observers are synchronized. /// /// is null. /// /// It's invalid behavior - according to the observer grammar - for a sequence to exhibit concurrent callbacks on a given observer. /// This operator can be used to "fix" a source that doesn't conform to this rule. /// public static IQbservable Synchronize(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Synchronize(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Synchronizes the observable sequence such that observer notifications cannot be delivered concurrently, using the specified gate object. /// This overload is useful when writing n-ary query operators, in order to prevent concurrent callbacks from different sources by synchronizing on a common gate object. /// /// The type of the elements in the source sequence. /// Source sequence. /// Gate object to synchronize each observer call on. /// The source sequence whose outgoing calls to observers are synchronized on the given gate object. /// /// or is null. public static IQbservable Synchronize(this IQbservable source, object gate) { if (source == null) throw new ArgumentNullException("source"); if (gate == null) throw new ArgumentNullException("gate"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Synchronize(default(IQbservable), default(object))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(gate, typeof(object)) ) ); } /// /// Returns a specified number of contiguous elements from the start of an observable sequence. /// /// The type of the elements in the source sequence. /// The sequence to take elements from. /// The number of elements to return. /// An observable sequence that contains the specified number of elements from the start of the input sequence. /// /// is null. /// /// is less than zero. public static IQbservable Take(this IQbservable source, int count) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Take(default(IQbservable), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(count, typeof(int)) ) ); } /// /// Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of Take(0). /// /// The type of the elements in the source sequence. /// The sequence to take elements from. /// The number of elements to return. /// Scheduler used to produce an OnCompleted message in case count is set to 0. /// An observable sequence that contains the specified number of elements from the start of the input sequence. /// /// or is null. /// /// is less than zero. public static IQbservable Take(this IQbservable source, 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.Take(default(IQbservable), default(int), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(count, typeof(int)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Takes elements for the specified duration from the start of the observable source sequence. /// /// The type of the elements in the source sequence. /// Source sequence to take elements from. /// Duration for taking elements from the start of the sequence. /// An observable sequence with the elements taken during the specified duration from the start of the source sequence. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// Specifying a TimeSpan.Zero value for doesn't guarantee an empty sequence will be returned. This is a side-effect /// of the asynchrony introduced by the scheduler, where the action that stops forwarding callbacks from the source sequence may not execute /// immediately, despite the TimeSpan.Zero due time. /// public static IQbservable Take(this IQbservable source, TimeSpan duration) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Take(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)) ) ); } /// /// Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. /// /// The type of the elements in the source sequence. /// Source sequence to take elements from. /// Duration for taking elements from the start of the sequence. /// Scheduler to run the timer on. /// An observable sequence with the elements taken during the specified duration from the start of the source sequence. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// Specifying a TimeSpan.Zero value for doesn't guarantee an empty sequence will be returned. This is a side-effect /// of the asynchrony introduced by the scheduler, where the action that stops forwarding callbacks from the source sequence may not execute /// immediately, despite the TimeSpan.Zero due time. /// public static IQbservable Take(this IQbservable source, TimeSpan duration, 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.Take(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns a specified number of contiguous elements from the end of an observable sequence. /// /// The type of the elements in the source sequence. /// Source sequence. /// Number of elements to take from the end of the source sequence. /// An observable sequence containing the specified number of elements from the end of the source sequence. /// /// is null. /// /// is less than zero. /// /// This operator accumulates a buffer with a length enough to store elements elements. Upon completion of /// the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. /// public static IQbservable TakeLast(this IQbservable source, int count) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.TakeLast(default(IQbservable), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(count, typeof(int)) ) ); } /// /// Returns a specified number of contiguous elements from the end of an observable sequence, using the specified scheduler to drain the queue. /// /// The type of the elements in the source sequence. /// Source sequence. /// Number of elements to take from the end of the source sequence. /// Scheduler used to drain the queue upon completion of the source sequence. /// An observable sequence containing the specified number of elements from the end of the source sequence. /// /// or is null. /// /// is less than zero. /// /// This operator accumulates a buffer with a length enough to store elements elements. Upon completion of /// the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. /// public static IQbservable TakeLast(this IQbservable source, 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.TakeLast(default(IQbservable), default(int), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(count, typeof(int)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns elements within the specified duration from the end of the observable source sequence. /// /// The type of the elements in the source sequence. /// Source sequence to take elements from. /// Duration for taking elements from the end of the sequence. /// An observable sequence with the elements taken during the specified duration from the end of the source sequence. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// This operator accumulates a buffer with a length enough to store elements for any window during the lifetime of /// the source sequence. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the result elements /// to be delayed with . /// public static IQbservable TakeLast(this IQbservable source, TimeSpan duration) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.TakeLast(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)) ) ); } /// /// Returns elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. /// /// The type of the elements in the source sequence. /// Source sequence to take elements from. /// Duration for taking elements from the end of the sequence. /// Scheduler to run the timer on. /// An observable sequence with the elements taken during the specified duration from the end of the source sequence. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// This operator accumulates a buffer with a length enough to store elements for any window during the lifetime of /// the source sequence. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the result elements /// to be delayed with . /// public static IQbservable TakeLast(this IQbservable source, TimeSpan duration, 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.TakeLast(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements. /// /// The type of the elements in the source sequence. /// Source sequence to take elements from. /// Duration for taking elements from the end of the sequence. /// Scheduler to run the timer on. /// Scheduler to drain the collected elements. /// An observable sequence with the elements taken during the specified duration from the end of the source sequence. /// /// or or is null. /// /// is less than TimeSpan.Zero. /// /// This operator accumulates a buffer with a length enough to store elements for any window during the lifetime of /// the source sequence. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the result elements /// to be delayed with . /// public static IQbservable TakeLast(this IQbservable source, TimeSpan duration, IScheduler timerScheduler, IScheduler loopScheduler) { if (source == null) throw new ArgumentNullException("source"); if (timerScheduler == null) throw new ArgumentNullException("timerScheduler"); if (loopScheduler == null) throw new ArgumentNullException("loopScheduler"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.TakeLast(default(IQbservable), default(TimeSpan), default(IScheduler), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)), Expression.Constant(timerScheduler, typeof(IScheduler)), Expression.Constant(loopScheduler, typeof(IScheduler)) ) ); } /// /// Returns a list with the specified number of contiguous elements from the end of an observable sequence. /// /// The type of the elements in the source sequence. /// Source sequence. /// Number of elements to take from the end of the source sequence. /// An observable sequence containing a single list with the specified number of elements from the end of the source sequence. /// /// is null. /// /// is less than zero. /// /// This operator accumulates a buffer with a length enough to store elements. Upon completion of the /// source sequence, this buffer is produced on the result sequence. /// public static IQbservable> TakeLastBuffer(this IQbservable source, int count) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.TakeLastBuffer(default(IQbservable), default(int))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(count, typeof(int)) ) ); } /// /// Returns a list with the elements within the specified duration from the end of the observable source sequence. /// /// The type of the elements in the source sequence. /// Source sequence to take elements from. /// Duration for taking elements from the end of the sequence. /// An observable sequence containing a single list with the elements taken during the specified duration from the end of the source sequence. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// This operator accumulates a buffer with a length enough to store elements for any window during the lifetime of /// the source sequence. Upon completion of the source sequence, this buffer is produced on the result sequence. /// public static IQbservable> TakeLastBuffer(this IQbservable source, TimeSpan duration) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.TakeLastBuffer(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)) ) ); } /// /// Returns a list with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. /// /// The type of the elements in the source sequence. /// Source sequence to take elements from. /// Duration for taking elements from the end of the sequence. /// Scheduler to run the timer on. /// An observable sequence containing a single list with the elements taken during the specified duration from the end of the source sequence. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// This operator accumulates a buffer with a length enough to store elements for any window during the lifetime of /// the source sequence. Upon completion of the source sequence, this buffer is produced on the result sequence. /// public static IQbservable> TakeLastBuffer(this IQbservable source, TimeSpan duration, 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.TakeLastBuffer(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(duration, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Takes elements for the specified duration until the specified end time. /// /// The type of the elements in the source sequence. /// Source sequence to take elements from. /// Time to stop taking elements from the source sequence. If this value is less than or equal to DateTimeOffset.UtcNow, the result stream will complete immediately. /// An observable sequence with the elements taken until the specified end time. /// /// is null. public static IQbservable TakeUntil(this IQbservable source, DateTimeOffset endTime) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.TakeUntil(default(IQbservable), default(DateTimeOffset))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(endTime, typeof(DateTimeOffset)) ) ); } /// /// Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers. /// /// The type of the elements in the source sequence. /// Source sequence to take elements from. /// Time to stop taking elements from the source sequence. If this value is less than or equal to DateTimeOffset.UtcNow, the result stream will complete immediately. /// Scheduler to run the timer on. /// An observable sequence with the elements taken until the specified end time. /// /// or is null. public static IQbservable TakeUntil(this IQbservable source, DateTimeOffset endTime, 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.TakeUntil(default(IQbservable), default(DateTimeOffset), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(endTime, typeof(DateTimeOffset)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns the elements from the source observable sequence until the other observable sequence produces an element. /// /// The type of the elements in the source sequence. /// The type of the elements in the other sequence that indicates the end of take behavior. /// Source sequence to propagate elements for. /// Observable sequence that terminates propagation of elements of the source sequence. /// An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. /// /// or is null. public static IQbservable TakeUntil(this IQbservable source, IObservable other) { if (source == null) throw new ArgumentNullException("source"); if (other == null) throw new ArgumentNullException("other"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.TakeUntil(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TOther)), #endif source.Expression, GetSourceExpression(other) ) ); } /// /// Returns elements from an observable sequence as long as a specified condition is true. /// /// The type of the elements in the source sequence. /// A sequence to return elements from. /// A function to test each element for a condition. /// An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. /// /// or is null. public static IQbservable TakeWhile(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.TakeWhile(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Returns elements from an observable sequence as long as a specified condition is true. /// The element's index is used in the logic of the predicate function. /// /// The type of the elements in the source sequence. /// A sequence to return elements from. /// A function to test each element for a condition; the second parameter of the function represents the index of the source element. /// An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. /// /// or is null. public static IQbservable TakeWhile(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.TakeWhile(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Ignores elements from an observable sequence which are followed by another element within a specified relative time duration. /// /// The type of the elements in the source sequence. /// Source sequence to throttle. /// Throttling duration for each element. /// The throttled sequence. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// /// This operator throttles the source sequence by holding on to each element for the duration specified in . If another /// element is produced within this time window, the element is dropped and a new timer is started for the current element, repeating this whole /// process. For streams that never have gaps larger than or equal to between elements, the resulting stream won't /// produce any elements. In order to reduce the volume of a stream whilst guaranteeing the periodic production of elements, consider using the /// Observable.Sample set of operators. /// /// /// Specifying a TimeSpan.Zero value for is not recommended but supported, causing throttling timers to be scheduled /// that are due immediately. However, this doesn't guarantee all elements will be retained in the result sequence. This is a side-effect of the /// asynchrony introduced by the scheduler, where the action to forward the current element may not execute immediately, despite the TimeSpan.Zero /// due time. In such cases, the next element may arrive before the scheduler gets a chance to run the throttling action. /// /// public static IQbservable Throttle(this IQbservable source, TimeSpan dueTime) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Throttle(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)) ) ); } /// /// Ignores elements from an observable sequence which are followed by another element within a specified relative time duration, using the specified scheduler to run throttling timers. /// /// The type of the elements in the source sequence. /// Source sequence to throttle. /// Throttling duration for each element. /// Scheduler to run the throttle timers on. /// The throttled sequence. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// /// This operator throttles the source sequence by holding on to each element for the duration specified in . If another /// element is produced within this time window, the element is dropped and a new timer is started for the current element, repeating this whole /// process. For streams that never have gaps larger than or equal to between elements, the resulting stream won't /// produce any elements. In order to reduce the volume of a stream whilst guaranteeing the periodic production of elements, consider using the /// Observable.Sample set of operators. /// /// /// Specifying a TimeSpan.Zero value for is not recommended but supported, causing throttling timers to be scheduled /// that are due immediately. However, this doesn't guarantee all elements will be retained in the result sequence. This is a side-effect of the /// asynchrony introduced by the scheduler, where the action to forward the current element may not execute immediately, despite the TimeSpan.Zero /// due time. In such cases, the next element may arrive before the scheduler gets a chance to run the throttling action. /// /// public static IQbservable Throttle(this IQbservable source, TimeSpan dueTime, 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.Throttle(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Ignores elements from an observable sequence which are followed by another value within a computed throttle duration. /// /// The type of the elements in the source sequence. /// The type of the elements in the throttle sequences selected for each element in the source sequence. /// Source sequence to throttle. /// Selector function to retrieve a sequence indicating the throttle duration for each given element. /// The throttled sequence. /// /// or is null. /// /// This operator throttles the source sequence by holding on to each element for the duration denoted by . /// If another element is produced within this time window, the element is dropped and a new timer is started for the current element, repeating this /// whole process. For streams where the duration computed by applying the to each element overlaps with /// the occurrence of the successor element, the resulting stream won't produce any elements. In order to reduce the volume of a stream whilst /// guaranteeing the periodic production of elements, consider using the Observable.Sample set of operators. /// public static IQbservable Throttle(this IQbservable source, Expression>> throttleDurationSelector) { if (source == null) throw new ArgumentNullException("source"); if (throttleDurationSelector == null) throw new ArgumentNullException("throttleDurationSelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Throttle(default(IQbservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TThrottle)), #endif source.Expression, throttleDurationSelector ) ); } /// /// Returns an observable sequence that terminates with an exception. /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// Exception object used for the sequence's termination. /// The observable sequence that terminates exceptionally with the specified exception object. /// /// is null. public static IQbservable Throw(this IQbservableProvider provider, Exception exception) { if (provider == null) throw new ArgumentNullException("provider"); if (exception == null) throw new ArgumentNullException("exception"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Throw(default(IQbservableProvider), default(Exception))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(exception, typeof(Exception)) ) ); } /// /// Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single OnError message. /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// Exception object used for the sequence's termination. /// Scheduler to send the exceptional termination call on. /// The observable sequence that terminates exceptionally with the specified exception object. /// /// or is null. public static IQbservable Throw(this IQbservableProvider provider, Exception exception, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (exception == null) throw new ArgumentNullException("exception"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Throw(default(IQbservableProvider), default(Exception), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(exception, typeof(Exception)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single OnError message. /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// Exception object used for the sequence's termination. /// Scheduler to send the exceptional termination call on. /// Object solely used to infer the type of the type parameter. This parameter is typically used when creating a sequence of anonymously typed elements. /// The observable sequence that terminates exceptionally with the specified exception object. /// /// or is null. public static IQbservable Throw(this IQbservableProvider provider, Exception exception, IScheduler scheduler, TResult witness) { if (provider == null) throw new ArgumentNullException("provider"); if (exception == null) throw new ArgumentNullException("exception"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Throw(default(IQbservableProvider), default(Exception), default(IScheduler), default(TResult))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(exception, typeof(Exception)), Expression.Constant(scheduler, typeof(IScheduler)), Expression.Constant(witness, typeof(TResult)) ) ); } /// /// Returns an observable sequence that terminates with an exception. /// /// Query provider used to construct the IQbservable<T> data source. /// The type used for the IObservable<T> type parameter of the resulting sequence. /// Exception object used for the sequence's termination. /// Object solely used to infer the type of the type parameter. This parameter is typically used when creating a sequence of anonymously typed elements. /// The observable sequence that terminates exceptionally with the specified exception object. /// /// is null. public static IQbservable Throw(this IQbservableProvider provider, Exception exception, TResult witness) { if (provider == null) throw new ArgumentNullException("provider"); if (exception == null) throw new ArgumentNullException("exception"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Throw(default(IQbservableProvider), default(Exception), default(TResult))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(exception, typeof(Exception)), Expression.Constant(witness, typeof(TResult)) ) ); } /// /// Records the time interval between consecutive elements in an observable sequence. /// /// The type of the elements in the source sequence. /// Source sequence to record time intervals for. /// An observable sequence with time interval information on elements. /// /// is null. public static IQbservable> TimeInterval(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.TimeInterval(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Records the time interval between consecutive elements in an observable sequence, using the specified scheduler to compute time intervals. /// /// The type of the elements in the source sequence. /// Source sequence to record time intervals for. /// Scheduler used to compute time intervals. /// An observable sequence with time interval information on elements. /// /// or is null. public static IQbservable> TimeInterval(this IQbservable source, 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.TimeInterval(default(IQbservable), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Applies a timeout policy to the observable sequence based on an absolute time. /// If the sequence doesn't terminate before the specified absolute due time, a TimeoutException is propagated to the observer. /// /// The type of the elements in the source sequence. /// Source sequence to perform a timeout for. /// Time when a timeout occurs. If this value is less than or equal to DateTimeOffset.UtcNow, the timeout occurs immediately. /// The source sequence with a TimeoutException in case of a timeout. /// /// is null. /// (Asynchronous) If the sequence hasn't terminated before . /// /// In case you only want to timeout on the first element, consider using the /// operator applied to the source sequence and a delayed sequence. Alternatively, the general-purpose overload /// of Timeout, can be used. /// public static IQbservable Timeout(this IQbservable source, DateTimeOffset dueTime) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(DateTimeOffset))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(DateTimeOffset)) ) ); } /// /// Applies a timeout policy to the observable sequence based on an absolute time. /// If the sequence doesn't terminate before the specified absolute due time, the other observable sequence is used to produce future messages from that point on. /// /// The type of the elements in the source sequence and the other sequence used upon a timeout. /// Source sequence to perform a timeout for. /// Time when a timeout occurs. If this value is less than or equal to DateTimeOffset.UtcNow, the timeout occurs immediately. /// Sequence to return in case of a timeout. /// The source sequence switching to the other sequence in case of a timeout. /// /// or is null. /// /// In case you only want to timeout on the first element, consider using the /// operator applied to the source sequence and a delayed sequence. Alternatively, the general-purpose overload /// of Timeout, can be used. /// public static IQbservable Timeout(this IQbservable source, DateTimeOffset dueTime, IObservable other) { if (source == null) throw new ArgumentNullException("source"); if (other == null) throw new ArgumentNullException("other"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(DateTimeOffset), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(DateTimeOffset)), GetSourceExpression(other) ) ); } /// /// Applies a timeout policy to the observable sequence based on an absolute time, using the specified scheduler to run timeout timers. /// If the sequence doesn't terminate before the specified absolute due time, the other observable sequence is used to produce future messages from that point on. /// /// The type of the elements in the source sequence and the other sequence used upon a timeout. /// Source sequence to perform a timeout for. /// Time when a timeout occurs. If this value is less than or equal to DateTimeOffset.UtcNow, the timeout occurs immediately. /// Sequence to return in case of a timeout. /// Scheduler to run the timeout timers on. /// The source sequence switching to the other sequence in case of a timeout. /// /// or or is null. /// /// In case you only want to timeout on the first element, consider using the /// operator applied to the source sequence and a delayed sequence. Alternatively, the general-purpose overload /// of Timeout, can be used. /// public static IQbservable Timeout(this IQbservable source, DateTimeOffset dueTime, IObservable other, IScheduler scheduler) { if (source == null) throw new ArgumentNullException("source"); if (other == null) throw new ArgumentNullException("other"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(DateTimeOffset), default(IObservable), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(DateTimeOffset)), GetSourceExpression(other), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Applies a timeout policy to the observable sequence based on an absolute time, using the specified scheduler to run timeout timers. /// If the sequence doesn't terminate before the specified absolute due time, a TimeoutException is propagated to the observer. /// /// The type of the elements in the source sequence. /// Source sequence to perform a timeout for. /// Time when a timeout occurs. If this value is less than or equal to DateTimeOffset.UtcNow, the timeout occurs immediately. /// Scheduler to run the timeout timers on. /// The source sequence with a TimeoutException in case of a timeout. /// /// or is null. /// (Asynchronous) If the sequence hasn't terminated before . /// /// In case you only want to timeout on the first element, consider using the /// operator applied to the source sequence and a delayed sequence. Alternatively, the general-purpose overload /// of Timeout, can be used. /// public static IQbservable Timeout(this IQbservable source, DateTimeOffset dueTime, 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.Timeout(default(IQbservable), default(DateTimeOffset), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(DateTimeOffset)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Applies a timeout policy for each element in the observable sequence. /// If the next element isn't received within the specified timeout duration starting from its predecessor, a TimeoutException is propagated to the observer. /// /// The type of the elements in the source sequence. /// Source sequence to perform a timeout for. /// Maximum duration between values before a timeout occurs. /// The source sequence with a TimeoutException in case of a timeout. /// /// is null. /// /// is less than TimeSpan.Zero. /// (Asynchronous) If no element is produced within from the previous element. /// /// /// In case you only want to timeout on the first element, consider using the /// operator applied to the source sequence and a delayed sequence. Alternatively, the general-purpose overload /// of Timeout, can be used. /// /// /// Specifying a TimeSpan.Zero value for is not recommended but supported, causing timeout timers to be scheduled that are due /// immediately. However, this doesn't guarantee a timeout will occur, even for the first element. This is a side-effect of the asynchrony introduced by the /// scheduler, where the action to propagate a timeout may not execute immediately, despite the TimeSpan.Zero due time. In such cases, the next element may /// arrive before the scheduler gets a chance to run the timeout action. /// /// public static IQbservable Timeout(this IQbservable source, TimeSpan dueTime) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(TimeSpan))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)) ) ); } /// /// Applies a timeout policy for each element in the observable sequence. /// If the next element isn't received within the specified timeout duration starting from its predecessor, the other observable sequence is used to produce future messages from that point on. /// /// The type of the elements in the source sequence and the other sequence used upon a timeout. /// Source sequence to perform a timeout for. /// Maximum duration between values before a timeout occurs. /// Sequence to return in case of a timeout. /// The source sequence switching to the other sequence in case of a timeout. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// /// In case you only want to timeout on the first element, consider using the /// operator applied to the source sequence and a delayed sequence. Alternatively, the general-purpose overload /// of Timeout, can be used. /// /// /// Specifying a TimeSpan.Zero value for is not recommended but supported, causing timeout timers to be scheduled that are due /// immediately. However, this doesn't guarantee a timeout will occur, even for the first element. This is a side-effect of the asynchrony introduced by the /// scheduler, where the action to propagate a timeout may not execute immediately, despite the TimeSpan.Zero due time. In such cases, the next element may /// arrive before the scheduler gets a chance to run the timeout action. /// /// public static IQbservable Timeout(this IQbservable source, TimeSpan dueTime, IObservable other) { if (source == null) throw new ArgumentNullException("source"); if (other == null) throw new ArgumentNullException("other"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(TimeSpan), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)), GetSourceExpression(other) ) ); } /// /// Applies a timeout policy for each element in the observable sequence, using the specified scheduler to run timeout timers. /// If the next element isn't received within the specified timeout duration starting from its predecessor, the other observable sequence is used to produce future messages from that point on. /// /// The type of the elements in the source sequence and the other sequence used upon a timeout. /// Source sequence to perform a timeout for. /// Maximum duration between values before a timeout occurs. /// Sequence to return in case of a timeout. /// Scheduler to run the timeout timers on. /// The source sequence switching to the other sequence in case of a timeout. /// /// or or is null. /// /// is less than TimeSpan.Zero. /// /// /// In case you only want to timeout on the first element, consider using the /// operator applied to the source sequence and a delayed sequence. Alternatively, the general-purpose overload /// of Timeout, can be used. /// /// /// Specifying a TimeSpan.Zero value for is not recommended but supported, causing timeout timers to be scheduled that are due /// immediately. However, this doesn't guarantee a timeout will occur, even for the first element. This is a side-effect of the asynchrony introduced by the /// scheduler, where the action to propagate a timeout may not execute immediately, despite the TimeSpan.Zero due time. In such cases, the next element may /// arrive before the scheduler gets a chance to run the timeout action. /// /// public static IQbservable Timeout(this IQbservable source, TimeSpan dueTime, IObservable other, IScheduler scheduler) { if (source == null) throw new ArgumentNullException("source"); if (other == null) throw new ArgumentNullException("other"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(TimeSpan), default(IObservable), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)), GetSourceExpression(other), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Applies a timeout policy for each element in the observable sequence, using the specified scheduler to run timeout timers. /// If the next element isn't received within the specified timeout duration starting from its predecessor, a TimeoutException is propagated to the observer. /// /// The type of the elements in the source sequence. /// Source sequence to perform a timeout for. /// Maximum duration between values before a timeout occurs. /// Scheduler to run the timeout timers on. /// The source sequence with a TimeoutException in case of a timeout. /// /// or is null. /// /// is less than TimeSpan.Zero. /// (Asynchronous) If no element is produced within from the previous element. /// /// /// In case you only want to timeout on the first element, consider using the /// operator applied to the source sequence and a delayed sequence. Alternatively, the general-purpose overload /// of Timeout, can be used. /// /// /// Specifying a TimeSpan.Zero value for is not recommended but supported, causing timeout timers to be scheduled that are due /// immediately. However, this doesn't guarantee a timeout will occur, even for the first element. This is a side-effect of the asynchrony introduced by the /// scheduler, where the action to propagate a timeout may not execute immediately, despite the TimeSpan.Zero due time. In such cases, the next element may /// arrive before the scheduler gets a chance to run the timeout action. /// /// public static IQbservable Timeout(this IQbservable source, TimeSpan dueTime, 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.Timeout(default(IQbservable), default(TimeSpan), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(dueTime, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Applies a timeout policy to the observable sequence based on an initial timeout duration for the first element, and a timeout duration computed for each subsequent element. /// If the next element isn't received within the computed duration starting from its predecessor, a TimeoutException is propagated to the observer. /// /// The type of the elements in the source sequence. /// The type of the elements in the timeout sequences used to indicate the timeout duration for each element in the source sequence. /// Source sequence to perform a timeout for. /// Observable sequence that represents the timeout for the first element. /// Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. /// The source sequence with a TimeoutException in case of a timeout. /// /// or or is null. public static IQbservable Timeout(this IQbservable source, IObservable firstTimeout, Expression>> timeoutDurationSelector) { if (source == null) throw new ArgumentNullException("source"); if (firstTimeout == null) throw new ArgumentNullException("firstTimeout"); if (timeoutDurationSelector == null) throw new ArgumentNullException("timeoutDurationSelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(IObservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TTimeout)), #endif source.Expression, GetSourceExpression(firstTimeout), timeoutDurationSelector ) ); } /// /// Applies a timeout policy to the observable sequence based on an initial timeout duration for the first element, and a timeout duration computed for each subsequent element. /// If the next element isn't received within the computed duration starting from its predecessor, the other observable sequence is used to produce future messages from that point on. /// /// The type of the elements in the source sequence and the other sequence used upon a timeout. /// The type of the elements in the timeout sequences used to indicate the timeout duration for each element in the source sequence. /// Source sequence to perform a timeout for. /// Observable sequence that represents the timeout for the first element. /// Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. /// Sequence to return in case of a timeout. /// The source sequence switching to the other sequence in case of a timeout. /// /// or or or is null. public static IQbservable Timeout(this IQbservable source, IObservable firstTimeout, Expression>> timeoutDurationSelector, IObservable other) { if (source == null) throw new ArgumentNullException("source"); if (firstTimeout == null) throw new ArgumentNullException("firstTimeout"); if (timeoutDurationSelector == null) throw new ArgumentNullException("timeoutDurationSelector"); if (other == null) throw new ArgumentNullException("other"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(IObservable), default(Expression>>), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TTimeout)), #endif source.Expression, GetSourceExpression(firstTimeout), timeoutDurationSelector, GetSourceExpression(other) ) ); } /// /// Applies a timeout policy to the observable sequence based on a timeout duration computed for each element. /// If the next element isn't received within the computed duration starting from its predecessor, a TimeoutException is propagated to the observer. /// /// The type of the elements in the source sequence. /// The type of the elements in the timeout sequences used to indicate the timeout duration for each element in the source sequence. /// Source sequence to perform a timeout for. /// Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. /// The source sequence with a TimeoutException in case of a timeout. /// /// or is null. public static IQbservable Timeout(this IQbservable source, Expression>> timeoutDurationSelector) { if (source == null) throw new ArgumentNullException("source"); if (timeoutDurationSelector == null) throw new ArgumentNullException("timeoutDurationSelector"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TTimeout)), #endif source.Expression, timeoutDurationSelector ) ); } /// /// Applies a timeout policy to the observable sequence based on a timeout duration computed for each element. /// If the next element isn't received within the computed duration starting from its predecessor, the other observable sequence is used to produce future messages from that point on. /// /// The type of the elements in the source sequence and the other sequence used upon a timeout. /// The type of the elements in the timeout sequences used to indicate the timeout duration for each element in the source sequence. /// Source sequence to perform a timeout for. /// Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. /// Sequence to return in case of a timeout. /// The source sequence switching to the other sequence in case of a timeout. /// /// or or is null. public static IQbservable Timeout(this IQbservable source, Expression>> timeoutDurationSelector, IObservable other) { if (source == null) throw new ArgumentNullException("source"); if (timeoutDurationSelector == null) throw new ArgumentNullException("timeoutDurationSelector"); if (other == null) throw new ArgumentNullException("other"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timeout(default(IQbservable), default(Expression>>), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TTimeout)), #endif source.Expression, timeoutDurationSelector, GetSourceExpression(other) ) ); } /// /// Returns an observable sequence that produces a single value at the specified absolute due time. /// /// Query provider used to construct the IQbservable<T> data source. /// Absolute time at which to produce the value. If this value is less than or equal to DateTimeOffset.UtcNow, the timer will fire as soon as possible. /// An observable sequence that produces a value at due time. public static IQbservable Timer(this IQbservableProvider provider, DateTimeOffset dueTime) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timer(default(IQbservableProvider), default(DateTimeOffset))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(dueTime, typeof(DateTimeOffset)) ) ); } /// /// Returns an observable sequence that periodically produces a value starting at the specified initial absolute due time. /// /// Query provider used to construct the IQbservable<T> data source. /// Absolute time at which to produce the first value. If this value is less than or equal to DateTimeOffset.UtcNow, the timer will fire as soon as possible. /// Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. /// An observable sequence that produces a value at due time and then after each period. /// /// is less than TimeSpan.Zero. public static IQbservable Timer(this IQbservableProvider provider, DateTimeOffset dueTime, TimeSpan period) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timer(default(IQbservableProvider), default(DateTimeOffset), default(TimeSpan))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(dueTime, typeof(DateTimeOffset)), Expression.Constant(period, typeof(TimeSpan)) ) ); } /// /// Returns an observable sequence that periodically produces a value starting at the specified initial absolute due time, using the specified scheduler to run timers. /// /// Query provider used to construct the IQbservable<T> data source. /// Absolute time at which to produce the first value. If this value is less than or equal to DateTimeOffset.UtcNow, the timer will fire as soon as possible. /// Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. /// Scheduler to run timers on. /// An observable sequence that produces a value at due time and then after each period. /// /// is less than TimeSpan.Zero. /// /// is null. public static IQbservable Timer(this IQbservableProvider provider, DateTimeOffset dueTime, TimeSpan period, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timer(default(IQbservableProvider), default(DateTimeOffset), default(TimeSpan), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(dueTime, typeof(DateTimeOffset)), Expression.Constant(period, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns an observable sequence that produces a single value at the specified absolute due time, using the specified scheduler to run the timer. /// /// Query provider used to construct the IQbservable<T> data source. /// Absolute time at which to produce the value. If this value is less than or equal to DateTimeOffset.UtcNow, the timer will fire as soon as possible. /// Scheduler to run the timer on. /// An observable sequence that produces a value at due time. /// /// is null. public static IQbservable Timer(this IQbservableProvider provider, DateTimeOffset dueTime, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timer(default(IQbservableProvider), default(DateTimeOffset), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(dueTime, typeof(DateTimeOffset)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns an observable sequence that produces a single value after the specified relative due time has elapsed. /// /// Query provider used to construct the IQbservable<T> data source. /// Relative time at which to produce the value. If this value is less than or equal to TimeSpan.Zero, the timer will fire as soon as possible. /// An observable sequence that produces a value after the due time has elapsed. public static IQbservable Timer(this IQbservableProvider provider, TimeSpan dueTime) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timer(default(IQbservableProvider), default(TimeSpan))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(dueTime, typeof(TimeSpan)) ) ); } /// /// Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed. /// /// Query provider used to construct the IQbservable<T> data source. /// Relative time at which to produce the first value. If this value is less than or equal to TimeSpan.Zero, the timer will fire as soon as possible. /// Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. /// An observable sequence that produces a value after due time has elapsed and then after each period. /// /// is less than TimeSpan.Zero. public static IQbservable Timer(this IQbservableProvider provider, TimeSpan dueTime, TimeSpan period) { if (provider == null) throw new ArgumentNullException("provider"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timer(default(IQbservableProvider), default(TimeSpan), default(TimeSpan))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(dueTime, typeof(TimeSpan)), Expression.Constant(period, typeof(TimeSpan)) ) ); } /// /// Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed, using the specified scheduler to run timers. /// /// Query provider used to construct the IQbservable<T> data source. /// Relative time at which to produce the first value. If this value is less than or equal to TimeSpan.Zero, the timer will fire as soon as possible. /// Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. /// Scheduler to run timers on. /// An observable sequence that produces a value after due time has elapsed and then each period. /// /// is less than TimeSpan.Zero. /// /// is null. public static IQbservable Timer(this IQbservableProvider provider, TimeSpan dueTime, TimeSpan period, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timer(default(IQbservableProvider), default(TimeSpan), default(TimeSpan), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(dueTime, typeof(TimeSpan)), Expression.Constant(period, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Returns an observable sequence that produces a single value after the specified relative due time has elapsed, using the specified scheduler to run the timer. /// /// Query provider used to construct the IQbservable<T> data source. /// Relative time at which to produce the value. If this value is less than or equal to TimeSpan.Zero, the timer will fire as soon as possible. /// Scheduler to run the timer on. /// An observable sequence that produces a value after the due time has elapsed. /// /// is null. public static IQbservable Timer(this IQbservableProvider provider, TimeSpan dueTime, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timer(default(IQbservableProvider), default(TimeSpan), default(IScheduler))), #else (MethodInfo)MethodInfo.GetCurrentMethod(), #endif Expression.Constant(provider, typeof(IQbservableProvider)), Expression.Constant(dueTime, typeof(TimeSpan)), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Timestamps each element in an observable sequence using the local system clock. /// /// The type of the elements in the source sequence. /// Source sequence to timestamp elements for. /// An observable sequence with timestamp information on elements. /// /// is null. public static IQbservable> Timestamp(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Timestamp(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Timestamp each element in an observable sequence using the clock of the specified scheduler. /// /// The type of the elements in the source sequence. /// Source sequence to timestamp elements for. /// Scheduler used to compute timestamps. /// An observable sequence with timestamp information on elements. /// /// or is null. public static IQbservable> Timestamp(this IQbservable source, 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.Timestamp(default(IQbservable), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Creates an array from an observable sequence. /// /// The type of the elements in the source sequence. /// The source observable sequence to get an array of elements for. /// An observable sequence containing a single element with an array containing all the elements of the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable ToArray(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToArray(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Creates a dictionary from an observable sequence according to a specified key selector function. /// /// The type of the elements in the source sequence. /// The type of the dictionary key computed for each element in the source sequence. /// An observable sequence to create a dictionary for. /// A function to extract a key from each element. /// An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> ToDictionary(this IQbservable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToDictionary(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector ) ); } /// /// Creates a dictionary from an observable sequence according to a specified key selector function, and a comparer. /// /// The type of the elements in the source sequence. /// The type of the dictionary key computed for each element in the source sequence. /// An observable sequence to create a dictionary for. /// A function to extract a key from each element. /// An equality comparer to compare keys. /// An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. /// /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> ToDictionary(this IQbservable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToDictionary(default(IQbservable), default(Expression>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Creates a dictionary from an observable sequence according to a specified key selector function, and an element selector function. /// /// The type of the elements in the source sequence. /// The type of the dictionary key computed for each element in the source sequence. /// The type of the dictionary value computed for each element in the source sequence. /// An observable sequence to create a dictionary for. /// A function to extract a key from each element. /// A transform function to produce a result element value from each element. /// An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. /// /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> ToDictionary(this IQbservable source, Expression> keySelector, Expression> elementSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToDictionary(default(IQbservable), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), #endif source.Expression, keySelector, elementSelector ) ); } /// /// Creates a dictionary from an observable sequence according to a specified key selector function, a comparer, and an element selector function. /// /// The type of the elements in the source sequence. /// The type of the dictionary key computed for each element in the source sequence. /// The type of the dictionary value computed for each element in the source sequence. /// An observable sequence to create a dictionary for. /// A function to extract a key from each element. /// A transform function to produce a result element value from each element. /// An equality comparer to compare keys. /// An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. /// /// or or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> ToDictionary(this IQbservable source, Expression> keySelector, Expression> elementSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToDictionary(default(IQbservable), default(Expression>), default(Expression>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), #endif source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Converts an observable sequence to an enumerable sequence. /// /// The type of the elements in the source sequence. /// An observable sequence to convert to an enumerable sequence. /// The enumerable sequence containing the elements in the observable sequence. /// /// is null. /// This operator requires the source's object (see ) to implement . public static IQueryable ToQueryable(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return ((IQueryProvider)source.Provider).CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToQueryable(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Creates a list from an observable sequence. /// /// The type of the elements in the source sequence. /// The source observable sequence to get a list of elements for. /// An observable sequence containing a single element with a list containing all the elements of the source sequence. /// /// is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> ToList(this IQbservable source) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToList(default(IQbservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression ) ); } /// /// Creates a lookup from an observable sequence according to a specified key selector function. /// /// The type of the elements in the source sequence. /// The type of the lookup key computed for each element in the source sequence. /// An observable sequence to create a lookup for. /// A function to extract a key from each element. /// An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. /// /// or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> ToLookup(this IQbservable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToLookup(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector ) ); } /// /// Creates a lookup from an observable sequence according to a specified key selector function, and a comparer. /// /// The type of the elements in the source sequence. /// The type of the lookup key computed for each element in the source sequence. /// An observable sequence to create a lookup for. /// A function to extract a key from each element. /// An equality comparer to compare keys. /// An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. /// /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> ToLookup(this IQbservable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToLookup(default(IQbservable), default(Expression>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), #endif source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Creates a lookup from an observable sequence according to a specified key selector function, and an element selector function. /// /// The type of the elements in the source sequence. /// The type of the lookup key computed for each element in the source sequence. /// The type of the lookup value computed for each element in the source sequence. /// An observable sequence to create a lookup for. /// A function to extract a key from each element. /// A transform function to produce a result element value from each element. /// An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. /// /// or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> ToLookup(this IQbservable source, Expression> keySelector, Expression> elementSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToLookup(default(IQbservable), default(Expression>), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), #endif source.Expression, keySelector, elementSelector ) ); } /// /// Creates a lookup from an observable sequence according to a specified key selector function, a comparer, and an element selector function. /// /// The type of the elements in the source sequence. /// The type of the lookup key computed for each element in the source sequence. /// The type of the lookup value computed for each element in the source sequence. /// An observable sequence to create a lookup for. /// A function to extract a key from each element. /// A transform function to produce a result element value from each element. /// An equality comparer to compare keys. /// An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. /// /// or or or is null. /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. public static IQbservable> ToLookup(this IQbservable source, Expression> keySelector, Expression> elementSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToLookup(default(IQbservable), default(Expression>), default(Expression>), default(IEqualityComparer))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), #endif source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer)) ) ); } /// /// Converts an enumerable sequence to an observable sequence. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequence. /// Enumerable sequence to convert to an observable sequence. /// The observable sequence whose elements are pulled from the given enumerable sequence. /// /// is null. public static IQbservable ToObservable(this IQbservableProvider provider, IEnumerable source) { if (provider == null) throw new ArgumentNullException("provider"); if (source == null) throw new ArgumentNullException("source"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToObservable(default(IQbservableProvider), default(IEnumerable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(source) ) ); } /// /// Converts an enumerable sequence to an observable sequence, using the specified scheduler to run the enumeration loop. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequence. /// Enumerable sequence to convert to an observable sequence. /// Scheduler to run the enumeration of the input sequence on. /// The observable sequence whose elements are pulled from the given enumerable sequence. /// /// or is null. public static IQbservable ToObservable(this IQbservableProvider provider, IEnumerable source, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (source == null) throw new ArgumentNullException("source"); if (scheduler == null) throw new ArgumentNullException("scheduler"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.ToObservable(default(IQbservableProvider), default(IEnumerable), default(IScheduler))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(source), Expression.Constant(scheduler, typeof(IScheduler)) ) ); } /// /// Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// The type of the resource used during the generation of the resulting sequence. Needs to implement . /// Factory function to obtain a resource object. /// Factory function to obtain an observable sequence that depends on the obtained resource. /// An observable sequence whose lifetime controls the lifetime of the dependent resource object. /// /// or is null. public static IQbservable Using(this IQbservableProvider provider, Expression> resourceFactory, Expression>> observableFactory) where TResource : IDisposable { if (provider == null) throw new ArgumentNullException("provider"); if (resourceFactory == null) throw new ArgumentNullException("resourceFactory"); if (observableFactory == null) throw new ArgumentNullException("observableFactory"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Using(default(IQbservableProvider), default(Expression>), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult), typeof(TResource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), resourceFactory, observableFactory ) ); } #if !NO_TPL /// /// Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. The resource is obtained and used through asynchronous methods. /// The CancellationToken passed to the asynchronous methods is tied to the returned disposable subscription, allowing best-effort cancellation at any stage of the resource acquisition or usage. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the produced sequence. /// The type of the resource used during the generation of the resulting sequence. Needs to implement . /// Asynchronous factory function to obtain a resource object. /// Asynchronous factory function to obtain an observable sequence that depends on the obtained resource. /// An observable sequence whose lifetime controls the lifetime of the dependent resource object. /// /// or is null. /// This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11. /// When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous resource factory and observable factory functions will be signaled. public static IQbservable Using(this IQbservableProvider provider, Expression>> resourceFactoryAsync, Expression>>> observableFactoryAsync) where TResource : IDisposable { if (provider == null) throw new ArgumentNullException("provider"); if (resourceFactoryAsync == null) throw new ArgumentNullException("resourceFactoryAsync"); if (observableFactoryAsync == null) throw new ArgumentNullException("observableFactoryAsync"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Using(default(IQbservableProvider), default(Expression>>), default(Expression>>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult), typeof(TResource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), resourceFactoryAsync, observableFactoryAsync ) ); } #endif /// /// Filters the elements of an observable sequence based on a predicate. /// /// The type of the elements in the source sequence. /// An observable sequence whose elements to filter. /// A function to test each source element for a condition. /// An observable sequence that contains elements from the input sequence that satisfy the condition. /// /// or is null. public static IQbservable Where(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.Where(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Filters the elements of an observable sequence based on a predicate by incorporating the element's index. /// /// The type of the elements in the source sequence. /// An observable sequence whose elements to filter. /// A function to test each source element for a conditio; the second parameter of the function represents the index of the source element. /// An observable sequence that contains elements from the input sequence that satisfy the condition. /// /// or is null. public static IQbservable Where(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.Where(default(IQbservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif source.Expression, predicate ) ); } /// /// Repeats the given as long as the specified holds, where the is evaluated before each repeated is subscribed to. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequence. /// Source to repeat as long as the function evaluates to true. /// Condition that will be evaluated before subscription to the , to determine whether repetition of the source is required. /// The observable sequence obtained by concatenating the sequence as long as the holds. /// /// or is null. public static IQbservable While(this IQbservableProvider provider, Expression> condition, IObservable source) { if (provider == null) throw new ArgumentNullException("provider"); if (condition == null) throw new ArgumentNullException("condition"); if (source == null) throw new ArgumentNullException("source"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.While(default(IQbservableProvider), default(Expression>), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), condition, GetSourceExpression(source) ) ); } /// /// Projects each element of an observable sequence into consecutive non-overlapping windows which are produced based on element count information. /// /// The type of the elements in the source sequence, and in the windows in the result sequence. /// Source sequence to produce windows over. /// Length of each window. /// An observable sequence of windows. /// /// is null. /// /// is less than or equal to zero. public static IQbservable> Window(this IQbservable source, int count) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Window(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 windows which are produced based on element count information. /// /// The type of the elements in the source sequence, and in the windows in the result sequence. /// Source sequence to produce windows over. /// Length of each window. /// Number of elements to skip between creation of consecutive windows. /// An observable sequence of windows. /// /// is null. /// /// or is less than or equal to zero. public static IQbservable> Window(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.Window(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 windows which are produced based on timing information. /// /// The type of the elements in the source sequence, and in the windows in the result sequence. /// Source sequence to produce windows over. /// Length of each window. /// The sequence of windows. /// /// is null. /// /// is less than TimeSpan.Zero. /// /// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create windows as fast as it can. /// Because all source sequence elements end up in one of the windows, some windows 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 window and to create a new window may not execute immediately, despite the TimeSpan.Zero due time. /// public static IQbservable> Window(this IQbservable source, TimeSpan timeSpan) { if (source == null) throw new ArgumentNullException("source"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Window(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 window that is completed 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 windows in the result sequence. /// Source sequence to produce windows over. /// Maximum time length of a window. /// Maximum element count of a window. /// An observable sequence of windows. /// /// 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 windows as fast as it can. /// Because all source sequence elements end up in one of the windows, some windows 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 window and to create a new window may not execute immediately, despite the TimeSpan.Zero due time. /// public static IQbservable> Window(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.Window(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 window that is completed 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 windows in the result sequence. /// Source sequence to produce windows over. /// Maximum time length of a window. /// Maximum element count of a window. /// Scheduler to run windowing timers on. /// An observable sequence of windows. /// /// 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 windows as fast as it can. /// Because all source sequence elements end up in one of the windows, some windows 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 window and to create a new window may not execute immediately, despite the TimeSpan.Zero due time. /// public static IQbservable> Window(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.Window(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 windows 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 windows in the result sequence. /// Source sequence to produce windows over. /// Length of each window. /// Scheduler to run windowing timers on. /// An observable sequence of windows. /// /// or is null. /// /// is less than TimeSpan.Zero. /// /// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create windows as fast as it can. /// Because all source sequence elements end up in one of the windows, some windows 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 window and to create a new window may not execute immediately, despite the TimeSpan.Zero due time. /// public static IQbservable> Window(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.Window(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 windows which are produced based on timing information. /// /// The type of the elements in the source sequence, and in the windows in the result sequence. /// Source sequence to produce windows over. /// Length of each window. /// Interval between creation of consecutive windows. /// An observable sequence of windows. /// /// is null. /// /// or is less than TimeSpan.Zero. /// /// /// Specifying a TimeSpan.Zero value for is not recommended but supported, causing the scheduler to create windows with minimum duration /// length. However, some windows 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 window 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 windows as fast as it can. /// However, this doesn't mean all windows 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 window may not execute immediately, despite the TimeSpan.Zero due time. /// /// public static IQbservable> Window(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.Window(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 windows 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 windows in the result sequence. /// Source sequence to produce windows over. /// Length of each window. /// Interval between creation of consecutive windows. /// Scheduler to run windowing timers on. /// An observable sequence of windows. /// /// 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 windows with minimum duration /// length. However, some windows 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 window 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 windows as fast as it can. /// However, this doesn't mean all windows 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 window may not execute immediately, despite the TimeSpan.Zero due time. /// /// public static IQbservable> Window(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.Window(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 windows. /// /// The type of the elements in the source sequence, and in the windows in the result sequence. /// The type of the elements in the sequences indicating window boundary events. /// Source sequence to produce windows over. /// Sequence of window boundary markers. The current window is closed and a new window is opened upon receiving a boundary marker. /// An observable sequence of windows. /// /// or is null. public static IQbservable> Window(this IQbservable source, IObservable windowBoundaries) { if (source == null) throw new ArgumentNullException("source"); if (windowBoundaries == null) throw new ArgumentNullException("windowBoundaries"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Window(default(IQbservable), default(IObservable))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TWindowBoundary)), #endif source.Expression, GetSourceExpression(windowBoundaries) ) ); } /// /// Projects each element of an observable sequence into consecutive non-overlapping windows. /// /// The type of the elements in the source sequence, and in the windows in the result sequence. /// The type of the elements in the sequences indicating window closing events. /// Source sequence to produce windows over. /// A function invoked to define the boundaries of the produced windows. A new window is started when the previous one is closed. /// An observable sequence of windows. /// /// or is null. public static IQbservable> Window(this IQbservable source, Expression>> windowClosingSelector) { if (source == null) throw new ArgumentNullException("source"); if (windowClosingSelector == null) throw new ArgumentNullException("windowClosingSelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Window(default(IQbservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TWindowClosing)), #endif source.Expression, windowClosingSelector ) ); } /// /// Projects each element of an observable sequence into zero or more windows. /// /// The type of the elements in the source sequence, and in the windows in the result sequence. /// The type of the elements in the sequence indicating window opening events, also passed to the closing selector to obtain a sequence of window closing events. /// The type of the elements in the sequences indicating window closing events. /// Source sequence to produce windows over. /// Observable sequence whose elements denote the creation of new windows. /// A function invoked to define the closing of each produced window. /// An observable sequence of windows. /// /// or or is null. public static IQbservable> Window(this IQbservable source, IObservable windowOpenings, Expression>> windowClosingSelector) { if (source == null) throw new ArgumentNullException("source"); if (windowOpenings == null) throw new ArgumentNullException("windowOpenings"); if (windowClosingSelector == null) throw new ArgumentNullException("windowClosingSelector"); return source.Provider.CreateQuery>( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Window(default(IQbservable), default(IObservable), default(Expression>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TWindowOpening), typeof(TWindowClosing)), #endif source.Expression, GetSourceExpression(windowOpenings), windowClosingSelector ) ); } /// /// Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences, and in the lists in the result sequence. /// Observable sources. /// An observable sequence containing lists of elements at corresponding indexes. /// /// is null. public static IQbservable> Zip(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.Zip(default(IQbservableProvider), default(IEnumerable>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences, and in the lists in the result sequence. /// Observable sources. /// An observable sequence containing lists of elements at corresponding indexes. /// /// is null. public static IQbservable> Zip(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.Zip(default(IQbservableProvider), default(IObservable[]))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the elements in the source sequences. /// The type of the elements in the result sequence, returned by the selector function. /// Observable sources. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or is null. public static IQbservable Zip(this IQbservableProvider provider, IEnumerable> sources, Expression, TResult>> resultSelector) { if (provider == null) throw new ArgumentNullException("provider"); if (sources == null) throw new ArgumentNullException("sources"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservableProvider), default(IEnumerable>), default(Expression, TResult>>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), #endif Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources), resultSelector ) ); } /// /// Merges two observable sequences into one observable sequence by combining their elements in a pairwise fashion. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Function to invoke for each consecutive pair of elements from the first and second source. /// An observable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function. /// /// or or is null. public static IQbservable Zip(this IQbservable first, IObservable second, Expression> resultSelector) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return first.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)), #endif first.Expression, GetSourceExpression(second), resultSelector ) ); } /// /// Merges an observable sequence and an enumerable sequence into one observable sequence by using the selector function. /// /// The type of the elements in the first observable source sequence. /// The type of the elements in the second enumerable source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second enumerable source. /// Function to invoke for each consecutive pair of elements from the first and second source. /// An observable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function. /// /// or or is null. public static IQbservable Zip(this IQbservable first, IEnumerable second, Expression> resultSelector) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return first.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IEnumerable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)), #endif first.Expression, GetSourceExpression(second), resultSelector ) ); } /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), resultSelector ) ); } /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), resultSelector ) ); } #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the thirteenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Thirteenth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, IObservable source13, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (source13 == null) throw new ArgumentNullException("source13"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TSource13), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), GetSourceExpression(source13), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the thirteenth source sequence. /// The type of the elements in the fourteenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Thirteenth observable source. /// Fourteenth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, IObservable source13, IObservable source14, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (source13 == null) throw new ArgumentNullException("source13"); if (source14 == null) throw new ArgumentNullException("source14"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TSource13), typeof(TSource14), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), GetSourceExpression(source13), GetSourceExpression(source14), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the thirteenth source sequence. /// The type of the elements in the fourteenth source sequence. /// The type of the elements in the fifteenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Thirteenth observable source. /// Fourteenth observable source. /// Fifteenth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, IObservable source13, IObservable source14, IObservable source15, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (source13 == null) throw new ArgumentNullException("source13"); if (source14 == null) throw new ArgumentNullException("source14"); if (source15 == null) throw new ArgumentNullException("source15"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TSource13), typeof(TSource14), typeof(TSource15), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), GetSourceExpression(source13), GetSourceExpression(source14), GetSourceExpression(source15), resultSelector ) ); } #endif #if !NO_LARGEARITY /// /// Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the third source sequence. /// The type of the elements in the fourth source sequence. /// The type of the elements in the fifth source sequence. /// The type of the elements in the sixth source sequence. /// The type of the elements in the seventh source sequence. /// The type of the elements in the eighth source sequence. /// The type of the elements in the ninth source sequence. /// The type of the elements in the tenth source sequence. /// The type of the elements in the eleventh source sequence. /// The type of the elements in the twelfth source sequence. /// The type of the elements in the thirteenth source sequence. /// The type of the elements in the fourteenth source sequence. /// The type of the elements in the fifteenth source sequence. /// The type of the elements in the sixteenth source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable source. /// Second observable source. /// Third observable source. /// Fourth observable source. /// Fifth observable source. /// Sixth observable source. /// Seventh observable source. /// Eighth observable source. /// Ninth observable source. /// Tenth observable source. /// Eleventh observable source. /// Twelfth observable source. /// Thirteenth observable source. /// Fourteenth observable source. /// Fifteenth observable source. /// Sixteenth observable source. /// Function to invoke for each series of elements at corresponding indexes in the sources. /// An observable sequence containing the result of combining elements of the sources using the specified result selector function. /// /// or or or or or or or or or or or or or or or or is null. public static IQbservable Zip(this IQbservable source1, IObservable source2, IObservable source3, IObservable source4, IObservable source5, IObservable source6, IObservable source7, IObservable source8, IObservable source9, IObservable source10, IObservable source11, IObservable source12, IObservable source13, IObservable source14, IObservable source15, IObservable source16, Expression> resultSelector) { if (source1 == null) throw new ArgumentNullException("source1"); if (source2 == null) throw new ArgumentNullException("source2"); if (source3 == null) throw new ArgumentNullException("source3"); if (source4 == null) throw new ArgumentNullException("source4"); if (source5 == null) throw new ArgumentNullException("source5"); if (source6 == null) throw new ArgumentNullException("source6"); if (source7 == null) throw new ArgumentNullException("source7"); if (source8 == null) throw new ArgumentNullException("source8"); if (source9 == null) throw new ArgumentNullException("source9"); if (source10 == null) throw new ArgumentNullException("source10"); if (source11 == null) throw new ArgumentNullException("source11"); if (source12 == null) throw new ArgumentNullException("source12"); if (source13 == null) throw new ArgumentNullException("source13"); if (source14 == null) throw new ArgumentNullException("source14"); if (source15 == null) throw new ArgumentNullException("source15"); if (source16 == null) throw new ArgumentNullException("source16"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); return source1.Provider.CreateQuery( Expression.Call( null, #if CRIPPLED_REFLECTION InfoOf(() => Qbservable.Zip(default(IQbservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(IObservable), default(Expression>))), #else ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TSource3), typeof(TSource4), typeof(TSource5), typeof(TSource6), typeof(TSource7), typeof(TSource8), typeof(TSource9), typeof(TSource10), typeof(TSource11), typeof(TSource12), typeof(TSource13), typeof(TSource14), typeof(TSource15), typeof(TSource16), typeof(TResult)), #endif source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3), GetSourceExpression(source4), GetSourceExpression(source5), GetSourceExpression(source6), GetSourceExpression(source7), GetSourceExpression(source8), GetSourceExpression(source9), GetSourceExpression(source10), GetSourceExpression(source11), GetSourceExpression(source12), GetSourceExpression(source13), GetSourceExpression(source14), GetSourceExpression(source15), GetSourceExpression(source16), resultSelector ) ); } #endif /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression))); #else var m = (MethodInfo)MethodInfo.GetCurrentMethod(); #endif return () => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression), default(IScheduler))); #else var m = (MethodInfo)MethodInfo.GetCurrentMethod(); #endif return () => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1)); #endif return (t1) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1)); #endif return (t1) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2)); #endif return (t1, t2) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2)); #endif return (t1, t2) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3)); #endif return (t1, t2, t3) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3)); #endif return (t1, t2, t3) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4)); #endif return (t1, t2, t3, t4) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4)); #endif return (t1, t2, t3, t4) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)) ) ); } #if !NO_LARGEARITY /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5)); #endif return (t1, t2, t3, t4, t5) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5)); #endif return (t1, t2, t3, t4, t5) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6)); #endif return (t1, t2, t3, t4, t5, t6) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6)); #endif return (t1, t2, t3, t4, t5, t6) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7)); #endif return (t1, t2, t3, t4, t5, t6, t7) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7)); #endif return (t1, t2, t3, t4, t5, t6, t7) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// The type of the thirteenth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// The type of the thirteenth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// The type of the thirteenth argument passed to the action. /// The type of the fourteenth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// The type of the thirteenth argument passed to the action. /// The type of the fourteenth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// The type of the thirteenth argument passed to the action. /// The type of the fourteenth argument passed to the action. /// The type of the fifteenth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TArg15)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)), Expression.Constant(t15, typeof(TArg15)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// The type of the thirteenth argument passed to the action. /// The type of the fourteenth argument passed to the action. /// The type of the fifteenth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TArg15)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)), Expression.Constant(t15, typeof(TArg15)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the default scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// The type of the thirteenth argument passed to the action. /// The type of the fourteenth argument passed to the action. /// The type of the fifteenth argument passed to the action. /// The type of the sixteenth argument passed to the action. /// Action to convert to an asynchronous action. /// Asynchronous action. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TArg15), typeof(TArg16)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)), Expression.Constant(t15, typeof(TArg15)), Expression.Constant(t16, typeof(TArg16)) ) ); } /// /// Converts the function into an asynchronous action. Each invocation of the resulting asynchronous action causes an invocation of the original synchronous action on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the action. /// The type of the second argument passed to the action. /// The type of the third argument passed to the action. /// The type of the fourth argument passed to the action. /// The type of the fifth argument passed to the action. /// The type of the sixth argument passed to the action. /// The type of the seventh argument passed to the action. /// The type of the eighth argument passed to the action. /// The type of the ninth argument passed to the action. /// The type of the tenth argument passed to the action. /// The type of the eleventh argument passed to the action. /// The type of the twelfth argument passed to the action. /// The type of the thirteenth argument passed to the action. /// The type of the fourteenth argument passed to the action. /// The type of the fifteenth argument passed to the action. /// The type of the sixteenth argument passed to the action. /// Action to convert to an asynchronous action. /// Scheduler to invoke the original action on. /// Asynchronous action. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> action, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (action == null) throw new ArgumentNullException("action"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TArg15), typeof(TArg16)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), action, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)), Expression.Constant(t15, typeof(TArg15)), Expression.Constant(t16, typeof(TArg16)) ) ); } #endif /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)); #endif return () => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)); #endif return () => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TResult)); #endif return (t1) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TResult)); #endif return (t1) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TResult)); #endif return (t1, t2) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TResult)); #endif return (t1, t2) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TResult)); #endif return (t1, t2, t3) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TResult)); #endif return (t1, t2, t3) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TResult)); #endif return (t1, t2, t3, t4) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TResult)); #endif return (t1, t2, t3, t4) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)) ) ); } #if !NO_LARGEARITY /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TResult)); #endif return (t1, t2, t3, t4, t5) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TResult)); #endif return (t1, t2, t3, t4, t5) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the thirteenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the thirteenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the thirteenth argument passed to the function. /// The type of the fourteenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the thirteenth argument passed to the function. /// The type of the fourteenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the thirteenth argument passed to the function. /// The type of the fourteenth argument passed to the function. /// The type of the fifteenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TArg15), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)), Expression.Constant(t15, typeof(TArg15)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the thirteenth argument passed to the function. /// The type of the fourteenth argument passed to the function. /// The type of the fifteenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TArg15), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)), Expression.Constant(t15, typeof(TArg15)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the thirteenth argument passed to the function. /// The type of the fourteenth argument passed to the function. /// The type of the fifteenth argument passed to the function. /// The type of the sixteenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Asynchronous function. /// /// is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TArg15), typeof(TArg16), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)), Expression.Constant(t15, typeof(TArg15)), Expression.Constant(t16, typeof(TArg16)) ) ); } /// /// Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the function. /// The type of the second argument passed to the function. /// The type of the third argument passed to the function. /// The type of the fourth argument passed to the function. /// The type of the fifth argument passed to the function. /// The type of the sixth argument passed to the function. /// The type of the seventh argument passed to the function. /// The type of the eighth argument passed to the function. /// The type of the ninth argument passed to the function. /// The type of the tenth argument passed to the function. /// The type of the eleventh argument passed to the function. /// The type of the twelfth argument passed to the function. /// The type of the thirteenth argument passed to the function. /// The type of the fourteenth argument passed to the function. /// The type of the fifteenth argument passed to the function. /// The type of the sixteenth argument passed to the function. /// The type of the result returned by the function. /// Function to convert to an asynchronous function. /// Scheduler to invoke the original function on. /// Asynchronous function. /// /// or is null. public static Func> ToAsync(this IQbservableProvider provider, Expression> function, IScheduler scheduler) { if (provider == null) throw new ArgumentNullException("provider"); if (function == null) throw new ArgumentNullException("function"); if (scheduler == null) throw new ArgumentNullException("scheduler"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.ToAsync(default(IQbservableProvider), default(Expression>), default(IScheduler))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TArg15), typeof(TArg16), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), function, Expression.Constant(scheduler, typeof(IScheduler)) ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)), Expression.Constant(t15, typeof(TArg15)), Expression.Constant(t16, typeof(TArg16)) ) ); } #endif /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = (MethodInfo)MethodInfo.GetCurrentMethod(); #endif return () => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1)); #endif return (t1) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2)); #endif return (t1, t2) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)) ) ); } #if !NO_LARGEARITY /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3)); #endif return (t1, t2, t3) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4)); #endif return (t1, t2, t3, t4) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5)); #endif return (t1, t2, t3, t4, t5) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6)); #endif return (t1, t2, t3, t4, t5, t6) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7)); #endif return (t1, t2, t3, t4, t5, t6, t7) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The type of the eleventh argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The type of the eleventh argument passed to the begin delegate. /// The type of the twelfth argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The type of the eleventh argument passed to the begin delegate. /// The type of the twelfth argument passed to the begin delegate. /// The type of the thirteenth argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The type of the eleventh argument passed to the begin delegate. /// The type of the twelfth argument passed to the begin delegate. /// The type of the thirteenth argument passed to the begin delegate. /// The type of the fourteenth argument passed to the begin delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)) ) ); } #endif /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)); #endif return () => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TResult)); #endif return (t1) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TResult)); #endif return (t1, t2) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)) ) ); } #if !NO_LARGEARITY /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TResult)); #endif return (t1, t2, t3) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TResult)); #endif return (t1, t2, t3, t4) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TResult)); #endif return (t1, t2, t3, t4, t5) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The type of the eleventh argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The type of the eleventh argument passed to the begin delegate. /// The type of the twelfth argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The type of the eleventh argument passed to the begin delegate. /// The type of the twelfth argument passed to the begin delegate. /// The type of the thirteenth argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)) ) ); } /// /// Converts a Begin/End invoke function pair into an asynchronous function. /// /// Query provider used to construct the IQbservable<T> data source. /// The type of the first argument passed to the begin delegate. /// The type of the second argument passed to the begin delegate. /// The type of the third argument passed to the begin delegate. /// The type of the fourth argument passed to the begin delegate. /// The type of the fifth argument passed to the begin delegate. /// The type of the sixth argument passed to the begin delegate. /// The type of the seventh argument passed to the begin delegate. /// The type of the eighth argument passed to the begin delegate. /// The type of the ninth argument passed to the begin delegate. /// The type of the tenth argument passed to the begin delegate. /// The type of the eleventh argument passed to the begin delegate. /// The type of the twelfth argument passed to the begin delegate. /// The type of the thirteenth argument passed to the begin delegate. /// The type of the fourteenth argument passed to the begin delegate. /// The type of the result returned by the end delegate. /// The delegate that begins the asynchronous operation. /// The delegate that ends the asynchronous operation. /// Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. /// /// or is null. /// Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result. #if PREFERASYNC [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)] #endif public static Func> FromAsyncPattern(this IQbservableProvider provider, Expression> begin, Expression>end) { if (provider == null) throw new ArgumentNullException("provider"); if (begin == null) throw new ArgumentNullException("begin"); if (end == null) throw new ArgumentNullException("end"); #if CRIPPLED_REFLECTION var m = InfoOf(() => Qbservable.FromAsyncPattern(default(IQbservableProvider), default(Expression>), default(Expression>))); #else var m = ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TArg1), typeof(TArg2), typeof(TArg3), typeof(TArg4), typeof(TArg5), typeof(TArg6), typeof(TArg7), typeof(TArg8), typeof(TArg9), typeof(TArg10), typeof(TArg11), typeof(TArg12), typeof(TArg13), typeof(TArg14), typeof(TResult)); #endif return (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) => provider.CreateQuery( Expression.Invoke( Expression.Call( null, m, Expression.Constant(provider, typeof(IQbservableProvider)), begin, end ), Expression.Constant(t1, typeof(TArg1)), Expression.Constant(t2, typeof(TArg2)), Expression.Constant(t3, typeof(TArg3)), Expression.Constant(t4, typeof(TArg4)), Expression.Constant(t5, typeof(TArg5)), Expression.Constant(t6, typeof(TArg6)), Expression.Constant(t7, typeof(TArg7)), Expression.Constant(t8, typeof(TArg8)), Expression.Constant(t9, typeof(TArg9)), Expression.Constant(t10, typeof(TArg10)), Expression.Constant(t11, typeof(TArg11)), Expression.Constant(t12, typeof(TArg12)), Expression.Constant(t13, typeof(TArg13)), Expression.Constant(t14, typeof(TArg14)) ) ); } #endif } } #endif #pragma warning restore 1591