Class Observable
Provides a set of static methods for writing in-memory queries over observable sequences.
Inherited Members
Namespace: System.Reactive.Linq
Assembly: System.Reactive.Linq.dll
Syntax
public static class Observable
Methods
| Improve this Doc View SourceAggregate<TSource>(IObservable<TSource>, Func<TSource, TSource, TSource>)
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 Scan<TSource>(IObservable<TSource>, Func<TSource, TSource, TSource>).
Declaration
public static IObservable<TSource> Aggregate<TSource>(this IObservable<TSource> source, Func<TSource, TSource, TSource> accumulator)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to aggregate over. |
Func<TSource, TSource, TSource> | accumulator | An accumulator function to be invoked on each element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing a single element with the final accumulator value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and the result of the aggregation. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
Aggregate<TSource, TAccumulate>(IObservable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>)
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 Scan<TSource, TAccumulate>(IObservable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>).
Declaration
public static IObservable<TAccumulate> Aggregate<TSource, TAccumulate>(this IObservable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> accumulator)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to aggregate over. |
TAccumulate | seed | The initial accumulator value. |
Func<TAccumulate, TSource, TAccumulate> | accumulator | An accumulator function to be invoked on each element. |
Returns
Type | Description |
---|---|
IObservable<TAccumulate> | An observable sequence containing a single element with the final accumulator value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TAccumulate | The type of the result of the aggregation. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Aggregate<TSource, TAccumulate, TResult>(IObservable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>, Func<TAccumulate, TResult>)
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.
Declaration
public static IObservable<TResult> Aggregate<TSource, TAccumulate, TResult>(this IObservable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> accumulator, Func<TAccumulate, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to aggregate over. |
TAccumulate | seed | The initial accumulator value. |
Func<TAccumulate, TSource, TAccumulate> | accumulator | An accumulator function to be invoked on each element. |
Func<TAccumulate, TResult> | resultSelector | A function to transform the final accumulator value into the result value. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing a single element with the final accumulator value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TAccumulate | The type of the accumulator value. |
TResult | The type of the resulting value. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
All<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Determines whether all elements of an observable sequence satisfy a condition.
Declaration
public static IObservable<bool> All<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to apply the predicate to. |
Func<TSource, Boolean> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Amb<TSource>(IEnumerable<IObservable<TSource>>)
Propagates the observable sequence that reacts first.
Declaration
public static IObservable<TSource> Amb<TSource>(this IEnumerable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Observable sources competing to react first. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that surfaces any of the given sequences, whichever reacted first. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Amb<TSource>(IObservable<TSource>, IObservable<TSource>)
Propagates the observable sequence that reacts first.
Declaration
public static IObservable<TSource> Amb<TSource>(this IObservable<TSource> first, IObservable<TSource> second)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence. |
IObservable<TSource> | second | Second observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that surfaces either of the given sequences, whichever reacted first. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Amb<TSource>(IObservable<TSource>[])
Propagates the observable sequence that reacts first.
Declaration
public static IObservable<TSource> Amb<TSource>(params IObservable<TSource>[] sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource>[] | sources | Observable sources competing to react first. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that surfaces any of the given sequences, whichever reacted first. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
And<TLeft, TRight>(IObservable<TLeft>, IObservable<TRight>)
Creates a pattern that matches when both observable sequences have an available element.
Declaration
public static Pattern<TLeft, TRight> And<TLeft, TRight>(this IObservable<TLeft> left, IObservable<TRight> right)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TLeft> | left | Observable sequence to match with the right sequence. |
IObservable<TRight> | right | Observable sequence to match with the left sequence. |
Returns
Type | Description |
---|---|
Pattern<TLeft, TRight> | Pattern object that matches when both observable sequences have an available element. |
Type Parameters
Name | Description |
---|---|
TLeft | The type of the elements in the left sequence. |
TRight | The type of the elements in the right sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Any<TSource>(IObservable<TSource>)
Determines whether an observable sequence contains any elements.
Declaration
public static IObservable<bool> Any<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to check for non-emptiness. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | An observable sequence containing a single element determining whether the source sequence contains any elements. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Any<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Determines whether any element of an observable sequence satisfies a condition.
Declaration
public static IObservable<bool> Any<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to apply the predicate to. |
Func<TSource, Boolean> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
AsObservable<TSource>(IObservable<TSource>)
Hides the identity of an observable sequence.
Declaration
public static IObservable<TSource> AsObservable<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose identity to hide. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that hides the identity of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Average(IObservable<Decimal>)
Computes the average of an observable sequence of Decimal values.
Declaration
public static IObservable<decimal> Average(this IObservable<decimal> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Decimal> | source | A sequence of Decimal values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Decimal> | An observable sequence containing a single element with the average of the sequence of values. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Average(IObservable<Double>)
Computes the average of an observable sequence of Double values.
Declaration
public static IObservable<double> Average(this IObservable<double> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Double> | source | A sequence of Double values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the average of the sequence of values. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
Average(IObservable<Int32>)
Computes the average of an observable sequence of Int32 values.
Declaration
public static IObservable<double> Average(this IObservable<int> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Int32> | source | A sequence of Int32 values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the average of the sequence of values. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Average(IObservable<Int64>)
Computes the average of an observable sequence of Int64 values.
Declaration
public static IObservable<double> Average(this IObservable<long> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Int64> | source | A sequence of Int64 values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the average of the sequence of values. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Average(IObservable<Nullable<Decimal>>)
Computes the average of an observable sequence of nullable Decimal values.
Declaration
public static IObservable<decimal?> Average(this IObservable<decimal?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Decimal>> | source | A sequence of nullable Decimal values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Decimal>> | 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. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Average(IObservable<Nullable<Double>>)
Computes the average of an observable sequence of nullable Double values.
Declaration
public static IObservable<double?> Average(this IObservable<double?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Double>> | source | A sequence of nullable Double values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | 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. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
Average(IObservable<Nullable<Int32>>)
Computes the average of an observable sequence of nullable Int32 values.
Declaration
public static IObservable<double?> Average(this IObservable<int?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Int32>> | source | A sequence of nullable Int32 values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | 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. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Average(IObservable<Nullable<Int64>>)
Computes the average of an observable sequence of nullable Int64 values.
Declaration
public static IObservable<double?> Average(this IObservable<long?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Int64>> | source | A sequence of nullable Int64 values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | 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. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Average(IObservable<Nullable<Single>>)
Computes the average of an observable sequence of nullable Single values.
Declaration
public static IObservable<float?> Average(this IObservable<float?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Single>> | source | A sequence of nullable Single values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Single>> | 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. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
Average(IObservable<Single>)
Computes the average of an observable sequence of Single values.
Declaration
public static IObservable<float> Average(this IObservable<float> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Single> | source | A sequence of Single values to calculate the average of. |
Returns
Type | Description |
---|---|
IObservable<Single> | An observable sequence containing a single element with the average of the sequence of values. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
Average<TSource>(IObservable<TSource>, Func<TSource, Decimal>)
Computes the average of an observable sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<decimal> Average<TSource>(this IObservable<TSource> source, Func<TSource, decimal> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Decimal> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Decimal> | An observable sequence containing a single element with the average of the sequence of values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Average<TSource>(IObservable<TSource>, Func<TSource, Double>)
Computes the average of an observable sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<double> Average<TSource>(this IObservable<TSource> source, Func<TSource, double> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Double> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the average of the sequence of values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
Average<TSource>(IObservable<TSource>, Func<TSource, Int32>)
Computes the average of an observable sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<double> Average<TSource>(this IObservable<TSource> source, Func<TSource, int> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Int32> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the average of the sequence of values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Average<TSource>(IObservable<TSource>, Func<TSource, Int64>)
Computes the average of an observable sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<double> Average<TSource>(this IObservable<TSource> source, Func<TSource, long> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Int64> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the average of the sequence of values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Average<TSource>(IObservable<TSource>, Func<TSource, Nullable<Decimal>>)
Computes the average of an observable sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<decimal?> Average<TSource>(this IObservable<TSource> source, Func<TSource, decimal?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Nullable<Decimal>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Decimal>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Average<TSource>(IObservable<TSource>, Func<TSource, Nullable<Double>>)
Computes the average of an observable sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<double?> Average<TSource>(this IObservable<TSource> source, Func<TSource, double?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Nullable<Double>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
Average<TSource>(IObservable<TSource>, Func<TSource, Nullable<Int32>>)
Computes the average of an observable sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<double?> Average<TSource>(this IObservable<TSource> source, Func<TSource, int?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Nullable<Int32>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Average<TSource>(IObservable<TSource>, Func<TSource, Nullable<Int64>>)
Computes the average of an observable sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<double?> Average<TSource>(this IObservable<TSource> source, Func<TSource, long?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Nullable<Int64>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Average<TSource>(IObservable<TSource>, Func<TSource, Nullable<Single>>)
Computes the average of an observable sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<float?> Average<TSource>(this IObservable<TSource> source, Func<TSource, float?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Nullable<Single>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Single>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
Average<TSource>(IObservable<TSource>, Func<TSource, Single>)
Computes the average of an observable sequence of Single values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<float> Average<TSource>(this IObservable<TSource> source, Func<TSource, float> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to calculate the average of. |
Func<TSource, Single> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Single> | An observable sequence containing a single element with the average of the sequence of values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
Buffer<TSource>(IObservable<TSource>, Int32)
Projects each element of an observable sequence into consecutive non-overlapping buffers which are produced based on element count information.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource>(this IObservable<TSource> source, int count)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
Int32 | count | Length of each buffer. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Buffer<TSource>(IObservable<TSource>, Int32, Int32)
Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource>(this IObservable<TSource> source, int count, int skip)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
Int32 | count | Length of each buffer. |
Int32 | skip | Number of elements to skip between creation of consecutive buffers. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Buffer<TSource>(IObservable<TSource>, TimeSpan)
Projects each element of an observable sequence into consecutive non-overlapping buffers which are produced based on timing information.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource>(this IObservable<TSource> source, TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
TimeSpan | timeSpan | Length of each buffer. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Buffer<TSource>(IObservable<TSource>, TimeSpan, Int32)
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.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, int count)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
TimeSpan | timeSpan | Maximum time length of a window. |
Int32 | count | Maximum element count of a window. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Buffer<TSource>(IObservable<TSource>, TimeSpan, Int32, IScheduler)
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.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, int count, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
TimeSpan | timeSpan | Maximum time length of a buffer. |
Int32 | count | Maximum element count of a buffer. |
IScheduler | scheduler | Scheduler to run buffering timers on. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Buffer<TSource>(IObservable<TSource>, TimeSpan, 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.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
TimeSpan | timeSpan | Length of each buffer. |
IScheduler | scheduler | Scheduler to run buffering timers on. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Buffer<TSource>(IObservable<TSource>, TimeSpan, TimeSpan)
Projects each element of an observable sequence into zero or more buffers which are produced based on timing information.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, TimeSpan timeShift)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
TimeSpan | timeSpan | Length of each buffer. |
TimeSpan | timeShift | Interval between creation of consecutive buffers. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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 timeShift
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Buffer<TSource>(IObservable<TSource>, TimeSpan, TimeSpan, IScheduler)
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.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, TimeSpan timeShift, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
TimeSpan | timeSpan | Length of each buffer. |
TimeSpan | timeShift | Interval between creation of consecutive buffers. |
IScheduler | scheduler | Scheduler to run buffering timers on. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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 timeShift
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Buffer<TSource, TBufferClosing>(IObservable<TSource>, Func<IObservable<TBufferClosing>>)
Projects each element of an observable sequence into consecutive non-overlapping buffers.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource, TBufferClosing>(this IObservable<TSource> source, Func<IObservable<TBufferClosing>> bufferClosingSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
Func<IObservable<TBufferClosing>> | bufferClosingSelector | A function invoked to define the boundaries of the produced buffers. A new buffer is started when the previous one is closed. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
TBufferClosing | The type of the elements in the sequences indicating buffer closing events. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Buffer<TSource, TBufferBoundary>(IObservable<TSource>, IObservable<TBufferBoundary>)
Projects each element of an observable sequence into consecutive non-overlapping buffers.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource, TBufferBoundary>(this IObservable<TSource> source, IObservable<TBufferBoundary> bufferBoundaries)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
IObservable<TBufferBoundary> | bufferBoundaries | Sequence of buffer boundary markers. The current buffer is closed and a new buffer is opened upon receiving a boundary marker. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
TBufferBoundary | The type of the elements in the sequences indicating buffer boundary events. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Buffer<TSource, TBufferOpening, TBufferClosing>(IObservable<TSource>, IObservable<TBufferOpening>, Func<TBufferOpening, IObservable<TBufferClosing>>)
Projects each element of an observable sequence into zero or more buffers.
Declaration
public static IObservable<IList<TSource>> Buffer<TSource, TBufferOpening, TBufferClosing>(this IObservable<TSource> source, IObservable<TBufferOpening> bufferOpenings, Func<TBufferOpening, IObservable<TBufferClosing>> bufferClosingSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce buffers over. |
IObservable<TBufferOpening> | bufferOpenings | Observable sequence whose elements denote the creation of new buffers. |
Func<TBufferOpening, IObservable<TBufferClosing>> | bufferClosingSelector | A function invoked to define the closing of each produced buffer. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence of buffers. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the lists in the result sequence. |
TBufferOpening | 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. |
TBufferClosing | The type of the elements in the sequences indicating buffer closing events. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Case<TValue, TResult>(Func<TValue>, IDictionary<TValue, IObservable<TResult>>)
Uses selector
to determine which source in sources
to return, choosing an empty sequence if no match is found.
Declaration
public static IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources)
Parameters
Type | Name | Description |
---|---|---|
Func<TValue> | selector | Selector function invoked to determine the source to lookup in the |
IDictionary<TValue, IObservable<TResult>> | sources | Dictionary of sources to select from based on the |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence retrieved from the |
Type Parameters
Name | Description |
---|---|
TValue | The type of the value returned by the selector function, used to look up the resulting source. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Case<TValue, TResult>(Func<TValue>, IDictionary<TValue, IObservable<TResult>>, IObservable<TResult>)
Uses selector
to determine which source in sources
to return, choosing defaultSource
if no match is found.
Declaration
public static IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources, IObservable<TResult> defaultSource)
Parameters
Type | Name | Description |
---|---|---|
Func<TValue> | selector | Selector function invoked to determine the source to lookup in the |
IDictionary<TValue, IObservable<TResult>> | sources | Dictionary of sources to select from based on the |
IObservable<TResult> | defaultSource | Default source to select in case no matching source in |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence retrieved from the |
Type Parameters
Name | Description |
---|---|
TValue | The type of the value returned by the selector function, used to look up the resulting source. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Case<TValue, TResult>(Func<TValue>, IDictionary<TValue, IObservable<TResult>>, IScheduler)
Uses selector
to determine which source in sources
to return, choosing an empty sequence on the specified scheduler if no match is found.
Declaration
public static IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TValue> | selector | Selector function invoked to determine the source to lookup in the |
IDictionary<TValue, IObservable<TResult>> | sources | Dictionary of sources to select from based on the |
IScheduler | scheduler | Scheduler to generate an empty sequence on in case no matching source in |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence retrieved from the |
Type Parameters
Name | Description |
---|---|
TValue | The type of the value returned by the selector function, used to look up the resulting source. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Cast<TResult>(IObservable<Object>)
Converts the elements of an observable sequence to the specified type.
Declaration
public static IObservable<TResult> Cast<TResult>(this IObservable<object> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Object> | source | The observable sequence that contains the elements to be converted. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains each element of the source sequence converted to the specified type. |
Type Parameters
Name | Description |
---|---|
TResult | The type to convert the elements in the source sequence to. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Catch<TSource>(IEnumerable<IObservable<TSource>>)
Continues an observable sequence that is terminated by an exception with the next observable sequence.
Declaration
public static IObservable<TSource> Catch<TSource>(this IEnumerable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Observable sequences to catch exceptions for. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source and handler sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Catch<TSource>(IObservable<TSource>, IObservable<TSource>)
Continues an observable sequence that is terminated by an exception with the next observable sequence.
Declaration
public static IObservable<TSource> Catch<TSource>(this IObservable<TSource> first, IObservable<TSource> second)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence whose exception (if any) is caught. |
IObservable<TSource> | second | Second observable sequence used to produce results when an error occurred in the first sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing the first sequence's elements, followed by the elements of the second sequence in case an exception occurred. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and handler sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Catch<TSource>(IObservable<TSource>[])
Continues an observable sequence that is terminated by an exception with the next observable sequence.
Declaration
public static IObservable<TSource> Catch<TSource>(params IObservable<TSource>[] sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource>[] | sources | Observable sequences to catch exceptions for. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source and handler sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Catch<TSource, TException>(IObservable<TSource>, Func<TException, IObservable<TSource>>)
Continues an observable sequence that is terminated by an exception of the specified type with the observable sequence produced by the handler.
Declaration
public static IObservable<TSource> Catch<TSource, TException>(this IObservable<TSource> source, Func<TException, IObservable<TSource>> handler)
where TException : Exception
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Func<TException, IObservable<TSource>> | handler | Exception handler function, producing another observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and sequences returned by the exception handler function. |
TException | The type of the exception to catch and handle. Needs to derive from Exception. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Chunkify<TSource>(IObservable<TSource>)
Produces an enumerable sequence of consecutive (possibly empty) chunks of the source sequence.
Declaration
public static IEnumerable<IList<TSource>> Chunkify<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
IEnumerable<IList<TSource>> | The enumerable sequence that returns consecutive (possibly empty) chunks upon each iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Collect<TSource, TResult>(IObservable<TSource>, Func<TResult>, Func<TResult, TSource, TResult>)
Produces an enumerable sequence that returns elements collected/aggregated from the source sequence between consecutive iterations.
Declaration
public static IEnumerable<TResult> Collect<TSource, TResult>(this IObservable<TSource> source, Func<TResult> newCollector, Func<TResult, TSource, TResult> merge)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TResult> | newCollector | Factory to create a new collector object. |
Func<TResult, TSource, TResult> | merge | Merges a sequence element with the current collector. |
Returns
Type | Description |
---|---|
IEnumerable<TResult> | The enumerable sequence that returns collected/aggregated elements from the source sequence upon each iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements produced by the merge operation during collection. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Collect<TSource, TResult>(IObservable<TSource>, Func<TResult>, Func<TResult, TSource, TResult>, Func<TResult, TResult>)
Produces an enumerable sequence that returns elements collected/aggregated from the source sequence between consecutive iterations.
Declaration
public static IEnumerable<TResult> Collect<TSource, TResult>(this IObservable<TSource> source, Func<TResult> getInitialCollector, Func<TResult, TSource, TResult> merge, Func<TResult, TResult> getNewCollector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TResult> | getInitialCollector | Factory to create the initial collector object. |
Func<TResult, TSource, TResult> | merge | Merges a sequence element with the current collector. |
Func<TResult, TResult> | getNewCollector | Factory to replace the current collector by a new collector. |
Returns
Type | Description |
---|---|
IEnumerable<TResult> | The enumerable sequence that returns collected/aggregated elements from the source sequence upon each iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements produced by the merge operation during collection. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource>(IEnumerable<IObservable<TSource>>)
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.
Declaration
public static IObservable<IList<TSource>> CombineLatest<TSource>(this IEnumerable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Observable sources. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing lists of the latest elements of the sources. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences, and in the lists in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource>(IObservable<TSource>[])
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.
Declaration
public static IObservable<IList<TSource>> CombineLatest<TSource>(params IObservable<TSource>[] sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource>[] | sources | Observable sources. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing lists of the latest elements of the sources. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences, and in the lists in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, IObservable<TSource13>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, IObservable<TSource13> source13, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
IObservable<TSource13> | source13 | Thirteenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TSource13 | The type of the elements in the thirteenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, IObservable<TSource13>, IObservable<TSource14>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, IObservable<TSource13> source13, IObservable<TSource14> source14, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
IObservable<TSource13> | source13 | Thirteenth observable source. |
IObservable<TSource14> | source14 | Fourteenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TSource13 | The type of the elements in the thirteenth source sequence. |
TSource14 | The type of the elements in the fourteenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, IObservable<TSource13>, IObservable<TSource14>, IObservable<TSource15>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, IObservable<TSource13> source13, IObservable<TSource14> source14, IObservable<TSource15> source15, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
IObservable<TSource13> | source13 | Thirteenth observable source. |
IObservable<TSource14> | source14 | Fourteenth observable source. |
IObservable<TSource15> | source15 | Fifteenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TSource13 | The type of the elements in the thirteenth source sequence. |
TSource14 | The type of the elements in the fourteenth source sequence. |
TSource15 | The type of the elements in the fifteenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, IObservable<TSource13>, IObservable<TSource14>, IObservable<TSource15>, IObservable<TSource16>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, IObservable<TSource13> source13, IObservable<TSource14> source14, IObservable<TSource15> source15, IObservable<TSource16> source16, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
IObservable<TSource13> | source13 | Thirteenth observable source. |
IObservable<TSource14> | source14 | Fourteenth observable source. |
IObservable<TSource15> | source15 | Fifteenth observable source. |
IObservable<TSource16> | source16 | Sixteenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TSource13 | The type of the elements in the thirteenth source sequence. |
TSource14 | The type of the elements in the fourteenth source sequence. |
TSource15 | The type of the elements in the fifteenth source sequence. |
TSource16 | The type of the elements in the sixteenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource, TResult>(IEnumerable<IObservable<TSource>>, Func<IList<TSource>, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource, TResult>(this IEnumerable<IObservable<TSource>> sources, Func<IList<TSource>, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Observable sources. |
Func<IList<TSource>, TResult> | resultSelector | 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. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TResult>(IObservable<TSource1>, IObservable<TSource2>, Func<TSource1, TSource2, TResult>)
Merges two observable sequences into one observable sequence by using the selector function whenever one of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TResult>(this IObservable<TSource1> first, IObservable<TSource2> second, Func<TSource1, TSource2, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | first | First observable source. |
IObservable<TSource2> | second | Second observable source. |
Func<TSource1, TSource2, TResult> | resultSelector | Function to invoke whenever either of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of both sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, Func<TSource1, TSource2, TSource3, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, Func<TSource1, TSource2, TSource3, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
Func<TSource1, TSource2, TSource3, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, Func<TSource1, TSource2, TSource3, TSource4, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, Func<TSource1, TSource2, TSource3, TSource4, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult>)
Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
Declaration
public static IObservable<TResult> CombineLatest<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult> | resultSelector | Function to invoke whenever any of the sources produces an element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Concat<TSource>(IEnumerable<IObservable<TSource>>)
Concatenates all observable sequences in the given enumerable sequence, as long as the previous observable sequence terminated successfully.
Declaration
public static IObservable<TSource> Concat<TSource>(this IEnumerable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Observable sequences to concatenate. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the elements of each given sequence, in sequential order. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Concat<TSource>(IObservable<TSource>, IObservable<TSource>)
Concatenates the second observable sequence to the first observable sequence upon successful termination of the first.
Declaration
public static IObservable<TSource> Concat<TSource>(this IObservable<TSource> first, IObservable<TSource> second)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence. |
IObservable<TSource> | second | Second observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the elements of the first sequence, followed by those of the second the sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Concat<TSource>(IObservable<TSource>[])
Concatenates all of the specified observable sequences, as long as the previous observable sequence terminated successfully.
Declaration
public static IObservable<TSource> Concat<TSource>(params IObservable<TSource>[] sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource>[] | sources | Observable sequences to concatenate. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the elements of each given sequence, in sequential order. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Concat<TSource>(IObservable<IObservable<TSource>>)
Concatenates all inner observable sequences, as long as the previous observable sequence terminated successfully.
Declaration
public static IObservable<TSource> Concat<TSource>(this IObservable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<IObservable<TSource>> | sources | Observable sequence of inner observable sequences. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the elements of each observed inner sequence, in sequential order. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Concat<TSource>(IObservable<Task<TSource>>)
Concatenates all task results, as long as the previous task terminated successfully.
Declaration
public static IObservable<TSource> Concat<TSource>(this IObservable<Task<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Task<TSource>> | sources | Observable sequence of tasks. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the results of each task, in sequential order. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the results produced by the tasks. |
Remarks
If the tasks support cancellation, consider manual conversion of the tasks using FromAsync<TResult>(Func<CancellationToken, Task<TResult>>), followed by a concatenation operation using Concat<TSource>(IObservable<IObservable<TSource>>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Contains<TSource>(IObservable<TSource>, TSource)
Determines whether an observable sequence contains a specified element by using the default equality comparer.
Declaration
public static IObservable<bool> Contains<TSource>(this IObservable<TSource> source, TSource value)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence in which to locate a value. |
TSource | value | The value to locate in the source sequence. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Contains<TSource>(IObservable<TSource>, TSource, IEqualityComparer<TSource>)
Determines whether an observable sequence contains a specified element by using a specified System.Collections.Generic.IEqualityComparer<T>.
Declaration
public static IObservable<bool> Contains<TSource>(this IObservable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence in which to locate a value. |
TSource | value | The value to locate in the source sequence. |
IEqualityComparer<TSource> | comparer | An equality comparer to compare elements. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Count<TSource>(IObservable<TSource>)
Returns an observable sequence containing an Int32 that represents the total number of elements in an observable sequence.
Declaration
public static IObservable<int> Count<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence that contains elements to be counted. |
Returns
Type | Description |
---|---|
IObservable<Int32> | An observable sequence containing a single element with the number of elements in the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The number of elements in the source sequence is larger than MaxValue. |
Count<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns an observable sequence containing an Int32 that represents how many elements in the specified observable sequence satisfy a condition.
Declaration
public static IObservable<int> Count<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence that contains elements to be counted. |
Func<TSource, Boolean> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
IObservable<Int32> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Create<TResult>(Func<IObserver<TResult>, Action>)
Creates an observable sequence from a specified Subscribe method implementation.
Declaration
public static IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Action> subscribe)
Parameters
Type | Name | Description |
---|---|---|
Func<IObserver<TResult>, Action> | subscribe | Implementation of the resulting observable sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence with the specified implementation for the Subscribe method. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
Remarks
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 ObservableBase<T> abstract base class.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Create<TResult>(Func<IObserver<TResult>, IDisposable>)
Creates an observable sequence from a specified Subscribe method implementation.
Declaration
public static IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, IDisposable> subscribe)
Parameters
Type | Name | Description |
---|---|---|
Func<IObserver<TResult>, IDisposable> | subscribe | Implementation of the resulting observable sequence's Subscribe method. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence with the specified implementation for the Subscribe method. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
Remarks
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 ObservableBase<T> abstract base class.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task<Action>>)
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.
Declaration
public static IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task<Action>> subscribeAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<IObserver<TResult>, CancellationToken, Task<Action>> | subscribeAsync | Asynchronous method used to implemented the resulting sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence with the specified implementation for the Subscribe method. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task<IDisposable>>)
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.
Declaration
public static IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task<IDisposable>> subscribeAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<IObserver<TResult>, CancellationToken, Task<IDisposable>> | subscribeAsync | Asynchronous method used to implemented the resulting sequence's Subscribe method. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence with the specified implementation for the Subscribe method. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task>)
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.
Declaration
public static IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task> subscribeAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<IObserver<TResult>, CancellationToken, Task> | subscribeAsync | Asynchronous method used to produce elements. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence surfacing the elements produced by the asynchronous method. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Create<TResult>(Func<IObserver<TResult>, Task<Action>>)
Creates an observable sequence from a specified asynchronous Subscribe method.
Declaration
public static IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Task<Action>> subscribeAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<IObserver<TResult>, Task<Action>> | subscribeAsync | Asynchronous method used to implemented the resulting sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence with the specified implementation for the Subscribe method. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Create<TResult>(Func<IObserver<TResult>, Task<IDisposable>>)
Creates an observable sequence from a specified asynchronous Subscribe method.
Declaration
public static IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Task<IDisposable>> subscribeAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<IObserver<TResult>, Task<IDisposable>> | subscribeAsync | Asynchronous method used to implemented the resulting sequence's Subscribe method. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence with the specified implementation for the Subscribe method. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Create<TResult>(Func<IObserver<TResult>, Task>)
Creates an observable sequence from a specified asynchronous Subscribe method.
Declaration
public static IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Task> subscribeAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<IObserver<TResult>, Task> | subscribeAsync | Asynchronous method used to produce elements. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence surfacing the elements produced by the asynchronous method. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DefaultIfEmpty<TSource>(IObservable<TSource>)
Returns the elements of the specified sequence or the type parameter's default value in a singleton sequence if the sequence is empty.
Declaration
public static IObservable<TSource> DefaultIfEmpty<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | The sequence to return a default value for if it is empty. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the default value for the TSource type if the source is empty; otherwise, the elements of the source itself. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence (if any), whose default value will be taken if the sequence is empty. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DefaultIfEmpty<TSource>(IObservable<TSource>, TSource)
Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
Declaration
public static IObservable<TSource> DefaultIfEmpty<TSource>(this IObservable<TSource> source, TSource defaultValue)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | The sequence to return the specified value for if it is empty. |
TSource | defaultValue | The value to return if the sequence is empty. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. |
Type Parameters
Name | Description |
---|---|
TSource | 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. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Defer<TResult>(Func<IObservable<TResult>>)
Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
Declaration
public static IObservable<TResult> Defer<TResult>(Func<IObservable<TResult>> observableFactory)
Parameters
Type | Name | Description |
---|---|---|
Func<IObservable<TResult>> | observableFactory | Observable factory function to invoke for each observer that subscribes to the resulting sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose observers trigger an invocation of the given observable factory function. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the sequence returned by the factory function, and in the resulting sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Defer<TResult>(Func<Task<IObservable<TResult>>>)
Returns an observable sequence that starts the specified asynchronous factory function whenever a new observer subscribes.
Declaration
public static IObservable<TResult> Defer<TResult>(Func<Task<IObservable<TResult>>> observableFactoryAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<Task<IObservable<TResult>>> | observableFactoryAsync | Asynchronous factory function to start for each observer that subscribes to the resulting sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose observers trigger the given asynchronous observable factory function to be started. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the sequence returned by the factory function, and in the resulting sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DeferAsync<TResult>(Func<CancellationToken, Task<IObservable<TResult>>>)
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.
Declaration
public static IObservable<TResult> DeferAsync<TResult>(Func<CancellationToken, Task<IObservable<TResult>>> observableFactoryAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task<IObservable<TResult>>> | observableFactoryAsync | Asynchronous factory function to start for each observer that subscribes to the resulting sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose observers trigger the given asynchronous observable factory function to be started. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the sequence returned by the factory function, and in the resulting sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Delay<TSource>(IObservable<TSource>, DateTimeOffset)
Time shifts the observable sequence to start propagating notifications at the specified absolute time. The relative time intervals between the values are preserved.
Declaration
public static IObservable<TSource> Delay<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay values for. |
DateTimeOffset | dueTime | 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. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is less efficient than DelaySubscription<TSource>(IObservable<TSource>, DateTimeOffset) 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 Materialize<TSource>(IObservable<TSource>) and Dematerialize<TSource>(IObservable<Notification<TSource>>) operators, or use DelaySubscription<TSource>(IObservable<TSource>, DateTimeOffset).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Delay<TSource>(IObservable<TSource>, DateTimeOffset, IScheduler)
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.
Declaration
public static IObservable<TSource> Delay<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay values for. |
DateTimeOffset | dueTime | 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. |
IScheduler | scheduler | Scheduler to run the delay timers on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is less efficient than DelaySubscription<TSource>(IObservable<TSource>, DateTimeOffset, IScheduler) 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 Materialize<TSource>(IObservable<TSource>) and Dematerialize<TSource>(IObservable<Notification<TSource>>) operators, or use DelaySubscription<TSource>(IObservable<TSource>, DateTimeOffset, IScheduler).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Delay<TSource>(IObservable<TSource>, TimeSpan)
Time shifts the observable sequence by the specified relative time duration. The relative time intervals between the values are preserved.
Declaration
public static IObservable<TSource> Delay<TSource>(this IObservable<TSource> source, TimeSpan dueTime)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay values for. |
TimeSpan | dueTime | 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. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is less efficient than DelaySubscription<TSource>(IObservable<TSource>, TimeSpan) 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 Materialize<TSource>(IObservable<TSource>) and Dematerialize<TSource>(IObservable<Notification<TSource>>) operators, or use DelaySubscription<TSource>(IObservable<TSource>, TimeSpan).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Delay<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
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.
Declaration
public static IObservable<TSource> Delay<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay values for. |
TimeSpan | dueTime | 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. |
IScheduler | scheduler | Scheduler to run the delay timers on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is less efficient than DelaySubscription<TSource>(IObservable<TSource>, TimeSpan, IScheduler) 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 Materialize<TSource>(IObservable<TSource>) and Dematerialize<TSource>(IObservable<Notification<TSource>>) operators, or use DelaySubscription<TSource>(IObservable<TSource>, TimeSpan, IScheduler).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Delay<TSource, TDelay>(IObservable<TSource>, Func<TSource, IObservable<TDelay>>)
Time shifts the observable sequence based on a delay selector function for each element.
Declaration
public static IObservable<TSource> Delay<TSource, TDelay>(this IObservable<TSource> source, Func<TSource, IObservable<TDelay>> delayDurationSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay values for. |
Func<TSource, IObservable<TDelay>> | delayDurationSelector | Selector function to retrieve a sequence indicating the delay for each given element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TDelay | The type of the elements in the delay sequences used to denote the delay duration of each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Delay<TSource, TDelay>(IObservable<TSource>, IObservable<TDelay>, Func<TSource, IObservable<TDelay>>)
Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
Declaration
public static IObservable<TSource> Delay<TSource, TDelay>(this IObservable<TSource> source, IObservable<TDelay> subscriptionDelay, Func<TSource, IObservable<TDelay>> delayDurationSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay values for. |
IObservable<TDelay> | subscriptionDelay | Sequence indicating the delay for the subscription to the source. |
Func<TSource, IObservable<TDelay>> | delayDurationSelector | Selector function to retrieve a sequence indicating the delay for each given element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TDelay | The type of the elements in the delay sequences used to denote the delay duration of each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DelaySubscription<TSource>(IObservable<TSource>, DateTimeOffset)
Time shifts the observable sequence by delaying the subscription to the specified absolute time.
Declaration
public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay subscription for. |
DateTimeOffset | dueTime | Absolute time to perform the subscription at. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is more efficient than Delay<TSource>(IObservable<TSource>, DateTimeOffset) 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DelaySubscription<TSource>(IObservable<TSource>, DateTimeOffset, IScheduler)
Time shifts the observable sequence by delaying the subscription to the specified absolute time, using the specified scheduler to run timers.
Declaration
public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay subscription for. |
DateTimeOffset | dueTime | Absolute time to perform the subscription at. |
IScheduler | scheduler | Scheduler to run the subscription delay timer on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is more efficient than Delay<TSource>(IObservable<TSource>, DateTimeOffset, IScheduler) 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DelaySubscription<TSource>(IObservable<TSource>, TimeSpan)
Time shifts the observable sequence by delaying the subscription with the specified relative time duration.
Declaration
public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, TimeSpan dueTime)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay subscription for. |
TimeSpan | dueTime | Relative time shift of the subscription. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is more efficient than Delay<TSource>(IObservable<TSource>, TimeSpan) 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
DelaySubscription<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.
Declaration
public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to delay subscription for. |
TimeSpan | dueTime | Relative time shift of the subscription. |
IScheduler | scheduler | Scheduler to run the subscription delay timer on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Time-shifted sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is more efficient than Delay<TSource>(IObservable<TSource>, TimeSpan, IScheduler) 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Dematerialize<TSource>(IObservable<Notification<TSource>>)
Dematerializes the explicit notification values of an observable sequence as implicit notifications.
Declaration
public static IObservable<TSource> Dematerialize<TSource>(this IObservable<Notification<TSource>> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Notification<TSource>> | source | An observable sequence containing explicit notification values which have to be turned into implicit notifications. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements materialized in the source sequence notification objects. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Distinct<TSource>(IObservable<TSource>)
Returns an observable sequence that contains only distinct elements.
Declaration
public static IObservable<TSource> Distinct<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to retain distinct elements for. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence only containing the distinct elements from the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Distinct<TSource>(IObservable<TSource>, IEqualityComparer<TSource>)
Returns an observable sequence that contains only distinct elements according to the comparer.
Declaration
public static IObservable<TSource> Distinct<TSource>(this IObservable<TSource> source, IEqualityComparer<TSource> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to retain distinct elements for. |
IEqualityComparer<TSource> | comparer | Equality comparer for source elements. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence only containing the distinct elements from the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Distinct<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>)
Returns an observable sequence that contains only distinct elements according to the keySelector.
Declaration
public static IObservable<TSource> Distinct<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to retain distinct elements for. |
Func<TSource, TKey> | keySelector | A function to compute the comparison key for each element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the discriminator key computed for each element in the source sequence. |
Remarks
Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Distinct<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>)
Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
Declaration
public static IObservable<TSource> Distinct<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to retain distinct elements for. |
Func<TSource, TKey> | keySelector | A function to compute the comparison key for each element. |
IEqualityComparer<TKey> | comparer | Equality comparer for source elements. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the discriminator key computed for each element in the source sequence. |
Remarks
Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DistinctUntilChanged<TSource>(IObservable<TSource>)
Returns an observable sequence that contains only distinct contiguous elements.
Declaration
public static IObservable<TSource> DistinctUntilChanged<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to retain distinct contiguous elements for. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence only containing the distinct contiguous elements from the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DistinctUntilChanged<TSource>(IObservable<TSource>, IEqualityComparer<TSource>)
Returns an observable sequence that contains only distinct contiguous elements according to the comparer.
Declaration
public static IObservable<TSource> DistinctUntilChanged<TSource>(this IObservable<TSource> source, IEqualityComparer<TSource> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to retain distinct contiguous elements for. |
IEqualityComparer<TSource> | comparer | Equality comparer for source elements. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence only containing the distinct contiguous elements from the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DistinctUntilChanged<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>)
Returns an observable sequence that contains only distinct contiguous elements according to the keySelector.
Declaration
public static IObservable<TSource> DistinctUntilChanged<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to retain distinct contiguous elements for, based on a computed key value. |
Func<TSource, TKey> | keySelector | A function to compute the comparison key for each element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the discriminator key computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DistinctUntilChanged<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>)
Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
Declaration
public static IObservable<TSource> DistinctUntilChanged<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to retain distinct contiguous elements for, based on a computed key value. |
Func<TSource, TKey> | keySelector | A function to compute the comparison key for each element. |
IEqualityComparer<TKey> | comparer | Equality comparer for computed key values. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the discriminator key computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Do<TSource>(IObservable<TSource>, Action<TSource>)
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.
Declaration
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource> | onNext | Action to invoke for each element in the observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with the side-effecting behavior applied. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Do<TSource>(IObservable<TSource>, Action<TSource>, Action)
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.
Declaration
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext, Action onCompleted)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource> | onNext | Action to invoke for each element in the observable sequence. |
Action | onCompleted | Action to invoke upon graceful termination of the observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with the side-effecting behavior applied. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Do<TSource>(IObservable<TSource>, Action<TSource>, Action<Exception>)
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.
Declaration
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext, Action<Exception> onError)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource> | onNext | Action to invoke for each element in the observable sequence. |
Action<Exception> | onError | Action to invoke upon exceptional termination of the observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with the side-effecting behavior applied. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Do<TSource>(IObservable<TSource>, Action<TSource>, Action<Exception>, Action)
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.
Declaration
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext, Action<Exception> onError, Action onCompleted)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource> | onNext | Action to invoke for each element in the observable sequence. |
Action<Exception> | onError | Action to invoke upon exceptional termination of the observable sequence. |
Action | onCompleted | Action to invoke upon graceful termination of the observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with the side-effecting behavior applied. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Do<TSource>(IObservable<TSource>, IObserver<TSource>)
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.
Declaration
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, IObserver<TSource> observer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
IObserver<TSource> | observer | Observer whose methods to invoke as part of the source sequence's observation. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with the side-effecting behavior applied. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
DoWhile<TSource>(IObservable<TSource>, Func<Boolean>)
Repeats the given source
as long as the specified condition
holds, where the condition
is evaluated after each repeated source
completed.
Declaration
public static IObservable<TSource> DoWhile<TSource>(this IObservable<TSource> source, Func<bool> condition)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source to repeat as long as the |
Func<Boolean> | condition | Condition that will be evaluated upon the completion of an iteration through the |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence obtained by concatenating the |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ElementAt<TSource>(IObservable<TSource>, Int32)
Returns the element at a specified index in a sequence.
Declaration
public static IObservable<TSource> ElementAt<TSource>(this IObservable<TSource> source, int index)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Observable sequence to return the element from. |
Int32 | index | The zero-based index of the element to retrieve. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that produces the element at the specified position in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentOutOfRangeException | (Asynchronous) |
ElementAtOrDefault<TSource>(IObservable<TSource>, Int32)
Returns the element at a specified index in a sequence or a default value if the index is out of range.
Declaration
public static IObservable<TSource> ElementAtOrDefault<TSource>(this IObservable<TSource> source, int index)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Observable sequence to return the element from. |
Int32 | index | The zero-based index of the element to retrieve. |
Returns
Type | Description |
---|---|
IObservable<TSource> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Empty<TResult>()
Returns an empty observable sequence.
Declaration
public static IObservable<TResult> Empty<TResult>()
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence with no elements. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Empty<TResult>(TResult)
Returns an empty observable sequence.
Declaration
public static IObservable<TResult> Empty<TResult>(TResult witness)
Parameters
Type | Name | Description |
---|---|---|
TResult | witness | Object solely used to infer the type of the |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence with no elements. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Empty<TResult>(IScheduler)
Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
Declaration
public static IObservable<TResult> Empty<TResult>(IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IScheduler | scheduler | Scheduler to send the termination call on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence with no elements. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Empty<TResult>(IScheduler, TResult)
Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
Declaration
public static IObservable<TResult> Empty<TResult>(IScheduler scheduler, TResult witness)
Parameters
Type | Name | Description |
---|---|---|
IScheduler | scheduler | Scheduler to send the termination call on. |
TResult | witness | Object solely used to infer the type of the |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence with no elements. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Finally<TSource>(IObservable<TSource>, Action)
Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
Declaration
public static IObservable<TSource> Finally<TSource>(this IObservable<TSource> source, Action finallyAction)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action | finallyAction | Action to invoke after the source observable sequence terminates. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Source sequence with the action-invoking termination behavior applied. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
First<TSource>(IObservable<TSource>)
Returns the first element of an observable sequence.
Declaration
public static TSource First<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
TSource | The first element in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The source sequence is empty. |
See Also
| Improve this Doc View SourceFirst<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the first element of an observable sequence that satisfies the condition in the predicate.
Declaration
public static TSource First<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
TSource | The first element in the observable sequence that satisfies the condition in the predicate. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | No element satisfies the condition in the predicate. -or- The source sequence is empty. |
See Also
| Improve this Doc View SourceFirstAsync<TSource>(IObservable<TSource>)
Returns the first element of an observable sequence.
Declaration
public static IObservable<TSource> FirstAsync<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sequence containing the first element in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
FirstAsync<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the first element of an observable sequence that satisfies the condition in the predicate.
Declaration
public static IObservable<TSource> FirstAsync<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sequence containing the first element in the observable sequence that satisfies the condition in the predicate. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) No element satisfies the condition in the predicate. -or- The source sequence is empty. |
FirstOrDefault<TSource>(IObservable<TSource>)
Returns the first element of an observable sequence, or a default value if no such element exists.
Declaration
public static TSource FirstOrDefault<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
TSource | The first element in the observable sequence, or a default value if no such element exists. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFirstOrDefault<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
Declaration
public static TSource FirstOrDefault<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
TSource | The first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFirstOrDefaultAsync<TSource>(IObservable<TSource>)
Returns the first element of an observable sequence, or a default value if no such element exists.
Declaration
public static IObservable<TSource> FirstOrDefaultAsync<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sequence containing the first element in the observable sequence, or a default value if no such element exists. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FirstOrDefaultAsync<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
Declaration
public static IObservable<TSource> FirstOrDefaultAsync<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
For<TSource, TResult>(IEnumerable<TSource>, Func<TSource, IObservable<TResult>>)
Concatenates the observable sequences obtained by running the resultSelector
for each element in the given enumerable source
.
Declaration
public static IObservable<TResult> For<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, IObservable<TResult>> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TSource> | source | Enumerable source for which each element will be mapped onto an observable source that will be concatenated in the result sequence. |
Func<TSource, IObservable<TResult>> | resultSelector | Function to select an observable source for each element in the |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence obtained by concatenating the sources returned by |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the enumerable source sequence. |
TResult | The type of the elements in the observable result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ForEach<TSource>(IObservable<TSource>, Action<TSource, Int32>)
Invokes an action for each element in the observable sequence, incorporating the element's index, and blocks until the sequence is terminated.
Declaration
public static void ForEach<TSource>(this IObservable<TSource> source, Action<TSource, int> onNext)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource, Int32> | onNext | Action to invoke for each element in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Because of its blocking nature, this operator is mainly used for testing.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ForEach<TSource>(IObservable<TSource>, Action<TSource>)
Invokes an action for each element in the observable sequence, and blocks until the sequence is terminated.
Declaration
public static void ForEach<TSource>(this IObservable<TSource> source, Action<TSource> onNext)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource> | onNext | Action to invoke for each element in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Because of its blocking nature, this operator is mainly used for testing.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ForEachAsync<TSource>(IObservable<TSource>, Action<TSource, Int32>)
Invokes an action for each element in the observable sequence, incorporating the element's index, and returns a Task object that will get signaled when the sequence terminates.
Declaration
public static Task ForEachAsync<TSource>(this IObservable<TSource> source, Action<TSource, int> onNext)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource, Int32> | onNext | Action to invoke for each element in the observable sequence. |
Returns
Type | Description |
---|---|
Task | Task that signals the termination of the sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ForEachAsync<TSource>(IObservable<TSource>, Action<TSource, Int32>, CancellationToken)
Invokes an action for each element in the observable sequence, incorporating the element's index, and returns a Task object that will get signaled when the sequence terminates. The loop can be quit prematurely by setting the specified cancellation token.
Declaration
public static Task ForEachAsync<TSource>(this IObservable<TSource> source, Action<TSource, int> onNext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource, Int32> | onNext | Action to invoke for each element in the observable sequence. |
CancellationToken | cancellationToken | Cancellation token used to stop the loop. |
Returns
Type | Description |
---|---|
Task | Task that signals the termination of the sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ForEachAsync<TSource>(IObservable<TSource>, Action<TSource>)
Invokes an action for each element in the observable sequence, and returns a Task object that will get signaled when the sequence terminates.
Declaration
public static Task ForEachAsync<TSource>(this IObservable<TSource> source, Action<TSource> onNext)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource> | onNext | Action to invoke for each element in the observable sequence. |
Returns
Type | Description |
---|---|
Task | Task that signals the termination of the sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ForEachAsync<TSource>(IObservable<TSource>, Action<TSource>, CancellationToken)
Invokes an action for each element in the observable sequence, and returns a Task object that will get signaled when the sequence terminates. The loop can be quit prematurely by setting the specified cancellation token.
Declaration
public static Task ForEachAsync<TSource>(this IObservable<TSource> source, Action<TSource> onNext, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Action<TSource> | onNext | Action to invoke for each element in the observable sequence. |
CancellationToken | cancellationToken | Cancellation token used to stop the loop. |
Returns
Type | Description |
---|---|
Task | Task that signals the termination of the sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsync(Func<CancellationToken, Task>)
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.
Declaration
public static IObservable<Unit> FromAsync(Func<CancellationToken, Task> actionAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task> | actionAsync | Asynchronous action to convert. |
Returns
Type | Description |
---|---|
IObservable<Unit> | An observable sequence exposing a Unit value upon completion of the action, or an exception. |
Remarks
When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous function will be signaled.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsync(Func<Task>)
Converts to asynchronous action into an observable sequence. Each subscription to the resulting sequence causes the action to be started.
Declaration
public static IObservable<Unit> FromAsync(Func<Task> actionAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<Task> | actionAsync | Asynchronous action to convert. |
Returns
Type | Description |
---|---|
IObservable<Unit> | An observable sequence exposing a Unit value upon completion of the action, or an exception. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsync<TResult>(Func<CancellationToken, Task<TResult>>)
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.
Declaration
public static IObservable<TResult> FromAsync<TResult>(Func<CancellationToken, Task<TResult>> functionAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task<TResult>> | functionAsync | Asynchronous function to convert. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence exposing the result of invoking the function, or an exception. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result returned by the asynchronous function. |
Remarks
When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous function will be signaled.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsync<TResult>(Func<Task<TResult>>)
Converts to asynchronous function into an observable sequence. Each subscription to the resulting sequence causes the function to be started.
Declaration
public static IObservable<TResult> FromAsync<TResult>(Func<Task<TResult>> functionAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<Task<TResult>> | functionAsync | Asynchronous function to convert. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence exposing the result of invoking the function, or an exception. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result returned by the asynchronous function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern(Func<AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<IObservable<Unit>> FromAsyncPattern(Func<AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1>(Func<TArg1, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, IObservable<Unit>> FromAsyncPattern<TArg1>(Func<TArg1, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TResult>(Func<AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<IObservable<TResult>> FromAsyncPattern<TResult>(Func<AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
TArg11 | The type of the eleventh argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
TArg11 | The type of the eleventh argument passed to the begin delegate. |
TArg12 | The type of the twelfth argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
TArg11 | The type of the eleventh argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
TArg11 | The type of the eleventh argument passed to the begin delegate. |
TArg12 | The type of the twelfth argument passed to the begin delegate. |
TArg13 | The type of the thirteenth argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
TArg11 | The type of the eleventh argument passed to the begin delegate. |
TArg12 | The type of the twelfth argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
TArg11 | The type of the eleventh argument passed to the begin delegate. |
TArg12 | The type of the twelfth argument passed to the begin delegate. |
TArg13 | The type of the thirteenth argument passed to the begin delegate. |
TArg14 | The type of the fourteenth argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
TArg11 | The type of the eleventh argument passed to the begin delegate. |
TArg12 | The type of the twelfth argument passed to the begin delegate. |
TArg13 | The type of the thirteenth argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
TArg10 | The type of the tenth argument passed to the begin delegate. |
TArg11 | The type of the eleventh argument passed to the begin delegate. |
TArg12 | The type of the twelfth argument passed to the begin delegate. |
TArg13 | The type of the thirteenth argument passed to the begin delegate. |
TArg14 | The type of the fourteenth argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2>(Func<TArg1, TArg2, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2>(Func<TArg1, TArg2, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TResult>(Func<TArg1, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, IObservable<TResult>> FromAsyncPattern<TArg1, TResult>(Func<TArg1, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3>(Func<TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3>(Func<TArg1, TArg2, TArg3, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TResult>(Func<TArg1, TArg2, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TResult>(Func<TArg1, TArg2, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4>(Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4>(Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TResult>(Func<TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TResult>(Func<TArg1, TArg2, TArg3, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TResult>(Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TResult>(Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Action<IAsyncResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<Unit>> | Function that can be used to start the asynchronous operation and retrieve the result (represented as a Unit value) as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TArg9 | The type of the ninth argument passed to the begin delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>)
Converts a Begin/End invoke function pair into an asynchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, AsyncCallback, Object, IAsyncResult> | begin | The delegate that begins the asynchronous operation. |
Func<IAsyncResult, TResult> | end | The delegate that ends the asynchronous operation. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<TResult>> | Function that can be used to start the asynchronous operation and retrieve the result as an observable sequence. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the begin delegate. |
TArg2 | The type of the second argument passed to the begin delegate. |
TArg3 | The type of the third argument passed to the begin delegate. |
TArg4 | The type of the fourth argument passed to the begin delegate. |
TArg5 | The type of the fifth argument passed to the begin delegate. |
TArg6 | The type of the sixth argument passed to the begin delegate. |
TArg7 | The type of the seventh argument passed to the begin delegate. |
TArg8 | The type of the eighth argument passed to the begin delegate. |
TResult | The type of the result returned by the end delegate. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FromEvent(Action<Action>, Action<Action>)
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.
Declaration
public static IObservable<Unit> FromEvent(Action<Action> addHandler, Action<Action> removeHandler)
Parameters
Type | Name | Description |
---|---|---|
Action<Action> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<Action> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
Returns
Type | Description |
---|---|
IObservable<Unit> | The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEvent(Action<Action>, Action<Action>, IScheduler)
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.
Declaration
public static IObservable<Unit> FromEvent(Action<Action> addHandler, Action<Action> removeHandler, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<Action> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<Action> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<Unit> | The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEvent<TEventArgs>(Action<Action<TEventArgs>>, Action<Action<TEventArgs>>)
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.
Declaration
public static IObservable<TEventArgs> FromEvent<TEventArgs>(Action<Action<TEventArgs>> addHandler, Action<Action<TEventArgs>> removeHandler)
Parameters
Type | Name | Description |
---|---|---|
Action<Action<TEventArgs>> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<Action<TEventArgs>> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
Returns
Type | Description |
---|---|
IObservable<TEventArgs> | The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEvent<TEventArgs>(Action<Action<TEventArgs>>, Action<Action<TEventArgs>>, 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.
Declaration
public static IObservable<TEventArgs> FromEvent<TEventArgs>(Action<Action<TEventArgs>> addHandler, Action<Action<TEventArgs>> removeHandler, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<Action<TEventArgs>> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<Action<TEventArgs>> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<TEventArgs> | The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEvent<TDelegate, TEventArgs>(Action<TDelegate>, Action<TDelegate>)
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.
Declaration
public static IObservable<TEventArgs> FromEvent<TDelegate, TEventArgs>(Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
Parameters
Type | Name | Description |
---|---|---|
Action<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
Returns
Type | Description |
---|---|
IObservable<TEventArgs> | The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEvent<TDelegate, TEventArgs>(Action<TDelegate>, Action<TDelegate>, 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.
Declaration
public static IObservable<TEventArgs> FromEvent<TDelegate, TEventArgs>(Action<TDelegate> addHandler, Action<TDelegate> removeHandler, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<TEventArgs> | The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEvent<TDelegate, TEventArgs>(Func<Action<TEventArgs>, TDelegate>, Action<TDelegate>, Action<TDelegate>)
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.
Declaration
public static IObservable<TEventArgs> FromEvent<TDelegate, TEventArgs>(Func<Action<TEventArgs>, TDelegate> conversion, Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
Parameters
Type | Name | Description |
---|---|---|
Func<Action<TEventArgs>, TDelegate> | conversion | 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<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
Returns
Type | Description |
---|---|
IObservable<TEventArgs> | The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEvent<TDelegate, TEventArgs>(Func<Action<TEventArgs>, TDelegate>, Action<TDelegate>, Action<TDelegate>, 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.
Declaration
public static IObservable<TEventArgs> FromEvent<TDelegate, TEventArgs>(Func<Action<TEventArgs>, TDelegate> conversion, Action<TDelegate> addHandler, Action<TDelegate> removeHandler, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<Action<TEventArgs>, TDelegate> | conversion | 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<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<TEventArgs> | The observable sequence that contains the event argument objects passed to the invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEventPattern(Action<EventHandler>, Action<EventHandler>)
Converts a .NET event, conforming to the standard .NET event pattern based on EventHandler, 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.
Declaration
public static IObservable<EventPattern<EventArgs>> FromEventPattern(Action<EventHandler> addHandler, Action<EventHandler> removeHandler)
Parameters
Type | Name | Description |
---|---|---|
Action<EventHandler> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<EventHandler> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<EventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEventPattern(Action<EventHandler>, Action<EventHandler>, IScheduler)
Converts a .NET event, conforming to the standard .NET event pattern based on EventHandler, 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.
Declaration
public static IObservable<EventPattern<EventArgs>> FromEventPattern(Action<EventHandler> addHandler, Action<EventHandler> removeHandler, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<EventHandler> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<EventHandler> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<EventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEventPattern(Object, String)
Converts an instance .NET event, conforming to the standard .NET event pattern with an EventArgs 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.
Declaration
public static IObservable<EventPattern<EventArgs>> FromEventPattern(object target, string eventName)
Parameters
Type | Name | Description |
---|---|---|
Object | target | Object instance that exposes the event to convert. |
String | eventName | Name of the event to convert. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<EventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The event could not be found. -or- The event does not conform to the standard .NET event pattern. |
See Also
| Improve this Doc View SourceFromEventPattern(Object, String, IScheduler)
Converts an instance .NET event, conforming to the standard .NET event pattern with an EventArgs 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.
Declaration
public static IObservable<EventPattern<EventArgs>> FromEventPattern(object target, string eventName, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Object | target | Object instance that exposes the event to convert. |
String | eventName | Name of the event to convert. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<EventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The event could not be found. -or- The event does not conform to the standard .NET event pattern. |
See Also
| Improve this Doc View SourceFromEventPattern(Type, String)
Converts a static .NET event, conforming to the standard .NET event pattern with an EventArgs 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.
Declaration
public static IObservable<EventPattern<EventArgs>> FromEventPattern(Type type, string eventName)
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type that exposes the static event to convert. |
String | eventName | Name of the event to convert. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<EventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The event could not be found. -or- The event does not conform to the standard .NET event pattern. |
See Also
| Improve this Doc View SourceFromEventPattern(Type, String, IScheduler)
Converts a static .NET event, conforming to the standard .NET event pattern with an EventArgs 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.
Declaration
public static IObservable<EventPattern<EventArgs>> FromEventPattern(Type type, string eventName, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type that exposes the static event to convert. |
String | eventName | Name of the event to convert. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<EventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The event could not be found. -or- The event does not conform to the standard .NET event pattern. |
See Also
| Improve this Doc View SourceFromEventPattern<TEventArgs>(Action<EventHandler<TEventArgs>>, Action<EventHandler<TEventArgs>>)
Converts a .NET event, conforming to the standard .NET event pattern based on EventHandler<TEventArgs>, 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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(Action<EventHandler<TEventArgs>> addHandler, Action<EventHandler<TEventArgs>> removeHandler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Action<EventHandler<TEventArgs>> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<EventHandler<TEventArgs>> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
See Also
| Improve this Doc View SourceFromEventPattern<TEventArgs>(Action<EventHandler<TEventArgs>>, Action<EventHandler<TEventArgs>>, IScheduler)
Converts a .NET event, conforming to the standard .NET event pattern based on EventHandler<TEventArgs>, 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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(Action<EventHandler<TEventArgs>> addHandler, Action<EventHandler<TEventArgs>> removeHandler, IScheduler scheduler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Action<EventHandler<TEventArgs>> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<EventHandler<TEventArgs>> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
See Also
| Improve this Doc View SourceFromEventPattern<TEventArgs>(Object, 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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(object target, string eventName)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Object | target | Object instance that exposes the event to convert. |
String | eventName | Name of the event to convert. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | 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. |
See Also
| Improve this Doc View SourceFromEventPattern<TEventArgs>(Object, String, 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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(object target, string eventName, IScheduler scheduler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Object | target | Object instance that exposes the event to convert. |
String | eventName | Name of the event to convert. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | 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. |
See Also
| Improve this Doc View SourceFromEventPattern<TEventArgs>(Type, 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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(Type type, string eventName)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type that exposes the static event to convert. |
String | eventName | Name of the event to convert. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | 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. |
See Also
| Improve this Doc View SourceFromEventPattern<TEventArgs>(Type, String, 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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(Type type, string eventName, IScheduler scheduler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type that exposes the static event to convert. |
String | eventName | Name of the event to convert. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | 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. |
See Also
| Improve this Doc View SourceFromEventPattern<TDelegate, TEventArgs>(Action<TDelegate>, Action<TDelegate>)
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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Action<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEventPattern<TDelegate, TEventArgs>(Action<TDelegate>, Action<TDelegate>, IScheduler)
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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(Action<TDelegate> addHandler, Action<TDelegate> removeHandler, IScheduler scheduler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Action<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEventPattern<TDelegate, TEventArgs>(Func<EventHandler<TEventArgs>, TDelegate>, Action<TDelegate>, Action<TDelegate>)
Converts a .NET event, conforming to the standard .NET event pattern based on EventHandler<TEventArgs>, 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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(Func<EventHandler<TEventArgs>, TDelegate> conversion, Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Func<EventHandler<TEventArgs>, TDelegate> | conversion | 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<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEventPattern<TDelegate, TEventArgs>(Func<EventHandler<TEventArgs>, TDelegate>, Action<TDelegate>, Action<TDelegate>, IScheduler)
Converts a .NET event, conforming to the standard .NET event pattern based on EventHandler<TEventArgs>, 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.
Declaration
public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(Func<EventHandler<TEventArgs>, TDelegate> conversion, Action<TDelegate> addHandler, Action<TDelegate> removeHandler, IScheduler scheduler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Func<EventHandler<TEventArgs>, TDelegate> | conversion | 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<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEventPattern<TSender, TEventArgs>(Object, 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.
Declaration
public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TSender, TEventArgs>(object target, string eventName)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Object | target | Object instance that exposes the event to convert. |
String | eventName | Name of the event to convert. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TSender, TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TSender | The type of the sender that raises the event. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | 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. |
See Also
| Improve this Doc View SourceFromEventPattern<TSender, TEventArgs>(Object, String, 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.
Declaration
public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TSender, TEventArgs>(object target, string eventName, IScheduler scheduler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Object | target | Object instance that exposes the event to convert. |
String | eventName | Name of the event to convert. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TSender, TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TSender | The type of the sender that raises the event. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | 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. |
See Also
| Improve this Doc View SourceFromEventPattern<TSender, TEventArgs>(Type, 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.
Declaration
public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TSender, TEventArgs>(Type type, string eventName)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type that exposes the static event to convert. |
String | eventName | Name of the event to convert. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TSender, TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TSender | The type of the sender that raises the event. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | 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. |
See Also
| Improve this Doc View SourceFromEventPattern<TSender, TEventArgs>(Type, String, 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.
Declaration
public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TSender, TEventArgs>(Type type, string eventName, IScheduler scheduler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type that exposes the static event to convert. |
String | eventName | Name of the event to convert. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TSender, TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TSender | The type of the sender that raises the event. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | 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. |
See Also
| Improve this Doc View SourceFromEventPattern<TDelegate, TSender, TEventArgs>(Action<TDelegate>, Action<TDelegate>)
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.
Declaration
public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TDelegate, TSender, TEventArgs>(Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Action<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TSender, TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TSender | The type of the sender that raises the event. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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 SynchronizationContext 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceFromEventPattern<TDelegate, TSender, TEventArgs>(Action<TDelegate>, Action<TDelegate>, 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.
Declaration
public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TDelegate, TSender, TEventArgs>(Action<TDelegate> addHandler, Action<TDelegate> removeHandler, IScheduler scheduler)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
Action<TDelegate> | addHandler | Action that attaches the given event handler to the underlying .NET event. |
Action<TDelegate> | removeHandler | Action that detaches the given event handler from the underlying .NET event. |
IScheduler | scheduler | The scheduler to run the add and remove event handler logic on. |
Returns
Type | Description |
---|---|
IObservable<EventPattern<TSender, TEventArgs>> | The observable sequence that contains data representations of invocations of the underlying .NET event. |
Type Parameters
Name | Description |
---|---|
TDelegate | The delegate type of the event to be converted. |
TSender | The type of the sender that raises the event. |
TEventArgs | The type of the event data generated by the event. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceGenerate<TState, TResult>(TState, Func<TState, Boolean>, Func<TState, TState>, Func<TState, TResult>)
Generates an observable sequence by running a state-driven loop producing the sequence's elements.
Declaration
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
TState | initialState | Initial state. |
Func<TState, Boolean> | condition | Condition to terminate generation (upon returning false). |
Func<TState, TState> | iterate | Iteration step function. |
Func<TState, TResult> | resultSelector | Selector function for results produced in the sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The generated sequence. |
Type Parameters
Name | Description |
---|---|
TState | The type of the state used in the generator loop. |
TResult | The type of the elements in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Generate<TState, TResult>(TState, Func<TState, Boolean>, Func<TState, TState>, Func<TState, TResult>, Func<TState, DateTimeOffset>)
Generates an observable sequence by running a state-driven and temporal loop producing the sequence's elements.
Declaration
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector, Func<TState, DateTimeOffset> timeSelector)
Parameters
Type | Name | Description |
---|---|---|
TState | initialState | Initial state. |
Func<TState, Boolean> | condition | Condition to terminate generation (upon returning false). |
Func<TState, TState> | iterate | Iteration step function. |
Func<TState, TResult> | resultSelector | Selector function for results produced in the sequence. |
Func<TState, DateTimeOffset> | timeSelector | Time selector function to control the speed of values being produced each iteration. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The generated sequence. |
Type Parameters
Name | Description |
---|---|
TState | The type of the state used in the generator loop. |
TResult | The type of the elements in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Generate<TState, TResult>(TState, Func<TState, Boolean>, Func<TState, TState>, Func<TState, TResult>, Func<TState, DateTimeOffset>, 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.
Declaration
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector, Func<TState, DateTimeOffset> timeSelector, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
TState | initialState | Initial state. |
Func<TState, Boolean> | condition | Condition to terminate generation (upon returning false). |
Func<TState, TState> | iterate | Iteration step function. |
Func<TState, TResult> | resultSelector | Selector function for results produced in the sequence. |
Func<TState, DateTimeOffset> | timeSelector | Time selector function to control the speed of values being produced each iteration. |
IScheduler | scheduler | Scheduler on which to run the generator loop. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The generated sequence. |
Type Parameters
Name | Description |
---|---|
TState | The type of the state used in the generator loop. |
TResult | The type of the elements in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Generate<TState, TResult>(TState, Func<TState, Boolean>, Func<TState, TState>, Func<TState, TResult>, Func<TState, TimeSpan>)
Generates an observable sequence by running a state-driven and temporal loop producing the sequence's elements.
Declaration
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector, Func<TState, TimeSpan> timeSelector)
Parameters
Type | Name | Description |
---|---|---|
TState | initialState | Initial state. |
Func<TState, Boolean> | condition | Condition to terminate generation (upon returning false). |
Func<TState, TState> | iterate | Iteration step function. |
Func<TState, TResult> | resultSelector | Selector function for results produced in the sequence. |
Func<TState, TimeSpan> | timeSelector | Time selector function to control the speed of values being produced each iteration. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The generated sequence. |
Type Parameters
Name | Description |
---|---|
TState | The type of the state used in the generator loop. |
TResult | The type of the elements in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Generate<TState, TResult>(TState, Func<TState, Boolean>, Func<TState, TState>, Func<TState, TResult>, Func<TState, TimeSpan>, 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.
Declaration
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector, Func<TState, TimeSpan> timeSelector, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
TState | initialState | Initial state. |
Func<TState, Boolean> | condition | Condition to terminate generation (upon returning false). |
Func<TState, TState> | iterate | Iteration step function. |
Func<TState, TResult> | resultSelector | Selector function for results produced in the sequence. |
Func<TState, TimeSpan> | timeSelector | Time selector function to control the speed of values being produced each iteration. |
IScheduler | scheduler | Scheduler on which to run the generator loop. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The generated sequence. |
Type Parameters
Name | Description |
---|---|
TState | The type of the state used in the generator loop. |
TResult | The type of the elements in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Generate<TState, TResult>(TState, Func<TState, Boolean>, Func<TState, TState>, Func<TState, TResult>, IScheduler)
Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
Declaration
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
TState | initialState | Initial state. |
Func<TState, Boolean> | condition | Condition to terminate generation (upon returning false). |
Func<TState, TState> | iterate | Iteration step function. |
Func<TState, TResult> | resultSelector | Selector function for results produced in the sequence. |
IScheduler | scheduler | Scheduler on which to run the generator loop. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The generated sequence. |
Type Parameters
Name | Description |
---|---|
TState | The type of the state used in the generator loop. |
TResult | The type of the elements in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GetEnumerator<TSource>(IObservable<TSource>)
Returns an enumerator that enumerates all values of the observable sequence.
Declaration
public static IEnumerator<TSource> GetEnumerator<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to get an enumerator for. |
Returns
Type | Description |
---|---|
IEnumerator<TSource> | The enumerator that can be used to enumerate over the elements in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GroupBy<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>)
Groups the elements of an observable sequence according to a specified key selector function.
Declaration
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TSource>> | A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GroupBy<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>)
Groups the elements of an observable sequence according to a specified key selector function and comparer.
Declaration
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys with. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TSource>> | A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GroupBy<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>, Int32)
Groups the elements of an observable sequence with the specified initial capacity according to a specified key selector function.
Declaration
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, int capacity)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Int32 | capacity | The initial number of elements that the underlying dictionary can contain. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TSource>> | A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
GroupBy<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>, Int32, IEqualityComparer<TKey>)
Groups the elements of an observable sequence with the specified initial capacity according to a specified key selector function and comparer.
Declaration
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, int capacity, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Int32 | capacity | The initial number of elements that the underlying dictionary can contain. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys with. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TSource>> | A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
GroupBy<TSource, TKey, TElement>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>)
Groups the elements of an observable sequence and selects the resulting elements by using a specified function.
Declaration
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<TSource, TElement> | elementSelector | A function to map each source element to an element in an observable group. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TElement>> | A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GroupBy<TSource, TKey, TElement>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, IEqualityComparer<TKey>)
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.
Declaration
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<TSource, TElement> | elementSelector | A function to map each source element to an element in an observable group. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys with. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TElement>> | A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GroupBy<TSource, TKey, TElement>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, Int32)
Groups the elements of an observable sequence with the specified initial capacity and selects the resulting elements by using a specified function.
Declaration
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, int capacity)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<TSource, TElement> | elementSelector | A function to map each source element to an element in an observable group. |
Int32 | capacity | The initial number of elements that the underlying dictionary can contain. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TElement>> | A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
GroupBy<TSource, TKey, TElement>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, Int32, IEqualityComparer<TKey>)
Groups the elements of an observable sequence with the specified initial capacity according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
Declaration
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, int capacity, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<TSource, TElement> | elementSelector | A function to map each source element to an element in an observable group. |
Int32 | capacity | The initial number of elements that the underlying dictionary can contain. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys with. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TElement>> | A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
GroupByUntil<TSource, TKey, TDuration>(IObservable<TSource>, Func<TSource, TKey>, Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>>)
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.
Declaration
public static IObservable<IGroupedObservable<TKey, TSource>> GroupByUntil<TSource, TKey, TDuration>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>> durationSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>> | durationSelector | A function to signal the expiration of a group. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TSource>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TDuration | The type of the elements in the duration sequences obtained for each group to denote its lifetime. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GroupByUntil<TSource, TKey, TDuration>(IObservable<TSource>, Func<TSource, TKey>, Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>>, IEqualityComparer<TKey>)
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.
Declaration
public static IObservable<IGroupedObservable<TKey, TSource>> GroupByUntil<TSource, TKey, TDuration>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>> durationSelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>> | durationSelector | A function to signal the expiration of a group. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys with. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TSource>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TDuration | The type of the elements in the duration sequences obtained for each group to denote its lifetime. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GroupByUntil<TSource, TKey, TDuration>(IObservable<TSource>, Func<TSource, TKey>, Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>>, Int32)
Groups the elements of an observable sequence with the specified initial capacity 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.
Declaration
public static IObservable<IGroupedObservable<TKey, TSource>> GroupByUntil<TSource, TKey, TDuration>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>> durationSelector, int capacity)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>> | durationSelector | A function to signal the expiration of a group. |
Int32 | capacity | The initial number of elements that the underlying dictionary can contain. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TSource>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TDuration | The type of the elements in the duration sequences obtained for each group to denote its lifetime. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
GroupByUntil<TSource, TKey, TDuration>(IObservable<TSource>, Func<TSource, TKey>, Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>>, Int32, IEqualityComparer<TKey>)
Groups the elements of an observable sequence with the specified initial capacity 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.
Declaration
public static IObservable<IGroupedObservable<TKey, TSource>> GroupByUntil<TSource, TKey, TDuration>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>> durationSelector, int capacity, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>> | durationSelector | A function to signal the expiration of a group. |
Int32 | capacity | The initial number of elements that the underlying dictionary can contain. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys with. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TSource>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TDuration | The type of the elements in the duration sequences obtained for each group to denote its lifetime. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
GroupByUntil<TSource, TKey, TElement, TDuration>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>>)
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.
Declaration
public static IObservable<IGroupedObservable<TKey, TElement>> GroupByUntil<TSource, TKey, TElement, TDuration>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>> durationSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<TSource, TElement> | elementSelector | A function to map each source element to an element in an observable group. |
Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>> | durationSelector | A function to signal the expiration of a group. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TElement>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
TDuration | The type of the elements in the duration sequences obtained for each group to denote its lifetime. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GroupByUntil<TSource, TKey, TElement, TDuration>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>>, IEqualityComparer<TKey>)
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.
Declaration
public static IObservable<IGroupedObservable<TKey, TElement>> GroupByUntil<TSource, TKey, TElement, TDuration>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>> durationSelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<TSource, TElement> | elementSelector | A function to map each source element to an element in an observable group. |
Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>> | durationSelector | A function to signal the expiration of a group. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys with. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TElement>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
TDuration | The type of the elements in the duration sequences obtained for each group to denote its lifetime. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GroupByUntil<TSource, TKey, TElement, TDuration>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>>, Int32)
Groups the elements of an observable sequence with the specified initial capacity 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.
Declaration
public static IObservable<IGroupedObservable<TKey, TElement>> GroupByUntil<TSource, TKey, TElement, TDuration>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>> durationSelector, int capacity)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<TSource, TElement> | elementSelector | A function to map each source element to an element in an observable group. |
Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>> | durationSelector | A function to signal the expiration of a group. |
Int32 | capacity | The initial number of elements that the underlying dictionary can contain. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TElement>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
TDuration | The type of the elements in the duration sequences obtained for each group to denote its lifetime. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
GroupByUntil<TSource, TKey, TElement, TDuration>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>>, Int32, IEqualityComparer<TKey>)
Groups the elements of an observable sequence with the specified initial capacity 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.
Declaration
public static IObservable<IGroupedObservable<TKey, TElement>> GroupByUntil<TSource, TKey, TElement, TDuration>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>> durationSelector, int capacity, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to group. |
Func<TSource, TKey> | keySelector | A function to extract the key for each element. |
Func<TSource, TElement> | elementSelector | A function to map each source element to an element in an observable group. |
Func<IGroupedObservable<TKey, TElement>, IObservable<TDuration>> | durationSelector | A function to signal the expiration of a group. |
Int32 | capacity | The initial number of elements that the underlying dictionary can contain. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys with. |
Returns
Type | Description |
---|---|
IObservable<IGroupedObservable<TKey, TElement>> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
TDuration | The type of the elements in the duration sequences obtained for each group to denote its lifetime. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
GroupJoin<TLeft, TRight, TLeftDuration, TRightDuration, TResult>(IObservable<TLeft>, IObservable<TRight>, Func<TLeft, IObservable<TLeftDuration>>, Func<TRight, IObservable<TRightDuration>>, Func<TLeft, IObservable<TRight>, TResult>)
Correlates the elements of two sequences based on overlapping durations, and groups the results.
Declaration
public static IObservable<TResult> GroupJoin<TLeft, TRight, TLeftDuration, TRightDuration, TResult>(this IObservable<TLeft> left, IObservable<TRight> right, Func<TLeft, IObservable<TLeftDuration>> leftDurationSelector, Func<TRight, IObservable<TRightDuration>> rightDurationSelector, Func<TLeft, IObservable<TRight>, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TLeft> | left | The left observable sequence to join elements for. |
IObservable<TRight> | right | The right observable sequence to join elements for. |
Func<TLeft, IObservable<TLeftDuration>> | leftDurationSelector | A function to select the duration of each element of the left observable sequence, used to determine overlap. |
Func<TRight, IObservable<TRightDuration>> | rightDurationSelector | A function to select the duration of each element of the right observable sequence, used to determine overlap. |
Func<TLeft, IObservable<TRight>, TResult> | resultSelector | A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains result elements computed from source elements that have an overlapping duration. |
Type Parameters
Name | Description |
---|---|
TLeft | The type of the elements in the left source sequence. |
TRight | The type of the elements in the right source sequence. |
TLeftDuration | The type of the elements in the duration sequence denoting the computed duration of each element in the left source sequence. |
TRightDuration | The type of the elements in the duration sequence denoting the computed duration of each element in the right source sequence. |
TResult | The type of the elements in the result sequence, obtained by invoking the result selector function for source elements with overlapping duration. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
If<TResult>(Func<Boolean>, IObservable<TResult>)
If the specified condition
evaluates true, select the thenSource
sequence. Otherwise, return an empty sequence.
Declaration
public static IObservable<TResult> If<TResult>(Func<bool> condition, IObservable<TResult> thenSource)
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | condition | Condition evaluated to decide which sequence to return. |
IObservable<TResult> | thenSource | Sequence returned in case |
Returns
Type | Description |
---|---|
IObservable<TResult> |
|
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
If<TResult>(Func<Boolean>, IObservable<TResult>, IObservable<TResult>)
If the specified condition
evaluates true, select the thenSource
sequence. Otherwise, select the elseSource
sequence.
Declaration
public static IObservable<TResult> If<TResult>(Func<bool> condition, IObservable<TResult> thenSource, IObservable<TResult> elseSource)
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | condition | Condition evaluated to decide which sequence to return. |
IObservable<TResult> | thenSource | Sequence returned in case |
IObservable<TResult> | elseSource | Sequence returned in case |
Returns
Type | Description |
---|---|
IObservable<TResult> |
|
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
If<TResult>(Func<Boolean>, IObservable<TResult>, IScheduler)
If the specified condition
evaluates true, select the thenSource
sequence. Otherwise, return an empty sequence generated on the specified scheduler.
Declaration
public static IObservable<TResult> If<TResult>(Func<bool> condition, IObservable<TResult> thenSource, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | condition | Condition evaluated to decide which sequence to return. |
IObservable<TResult> | thenSource | Sequence returned in case |
IScheduler | scheduler | Scheduler to generate an empty sequence on in case |
Returns
Type | Description |
---|---|
IObservable<TResult> |
|
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IgnoreElements<TSource>(IObservable<TSource>)
Ignores all elements in an observable sequence leaving only the termination messages.
Declaration
public static IObservable<TSource> IgnoreElements<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An empty observable sequence that signals termination, successful or exceptional, of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Interval(TimeSpan)
Returns an observable sequence that produces a value after each period.
Declaration
public static IObservable<long> Interval(TimeSpan period)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | period | 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. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value after each period. |
Remarks
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 Generate<TState, TResult>(TState, Func<TState, Boolean>, Func<TState, TState>, Func<TState, TResult>, Func<TState, TimeSpan>) operator instead.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Interval(TimeSpan, IScheduler)
Returns an observable sequence that produces a value after each period, using the specified scheduler to run timers and to send out observer messages.
Declaration
public static IObservable<long> Interval(TimeSpan period, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | period | 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. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value after each period. |
Remarks
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 Generate<TState, TResult>(TState, Func<TState, Boolean>, Func<TState, TState>, Func<TState, TResult>, Func<TState, TimeSpan>, IScheduler) operator instead.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
ArgumentNullException |
|
IsEmpty<TSource>(IObservable<TSource>)
Determines whether an observable sequence is empty.
Declaration
public static IObservable<bool> IsEmpty<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to check for emptiness. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | An observable sequence containing a single element determining whether the source sequence is empty. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Join<TLeft, TRight, TLeftDuration, TRightDuration, TResult>(IObservable<TLeft>, IObservable<TRight>, Func<TLeft, IObservable<TLeftDuration>>, Func<TRight, IObservable<TRightDuration>>, Func<TLeft, TRight, TResult>)
Correlates the elements of two sequences based on overlapping durations.
Declaration
public static IObservable<TResult> Join<TLeft, TRight, TLeftDuration, TRightDuration, TResult>(this IObservable<TLeft> left, IObservable<TRight> right, Func<TLeft, IObservable<TLeftDuration>> leftDurationSelector, Func<TRight, IObservable<TRightDuration>> rightDurationSelector, Func<TLeft, TRight, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TLeft> | left | The left observable sequence to join elements for. |
IObservable<TRight> | right | The right observable sequence to join elements for. |
Func<TLeft, IObservable<TLeftDuration>> | leftDurationSelector | A function to select the duration of each element of the left observable sequence, used to determine overlap. |
Func<TRight, IObservable<TRightDuration>> | rightDurationSelector | A function to select the duration of each element of the right observable sequence, used to determine overlap. |
Func<TLeft, TRight, TResult> | resultSelector | A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains result elements computed from source elements that have an overlapping duration. |
Type Parameters
Name | Description |
---|---|
TLeft | The type of the elements in the left source sequence. |
TRight | The type of the elements in the right source sequence. |
TLeftDuration | The type of the elements in the duration sequence denoting the computed duration of each element in the left source sequence. |
TRightDuration | The type of the elements in the duration sequence denoting the computed duration of each element in the right source sequence. |
TResult | The type of the elements in the result sequence, obtained by invoking the result selector function for source elements with overlapping duration. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Last<TSource>(IObservable<TSource>)
Returns the last element of an observable sequence.
Declaration
public static TSource Last<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
TSource | The last element in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The source sequence is empty. |
See Also
| Improve this Doc View SourceLast<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the last element of an observable sequence that satisfies the condition in the predicate.
Declaration
public static TSource Last<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
TSource | The last element in the observable sequence that satisfies the condition in the predicate. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | No element satisfies the condition in the predicate. -or- The source sequence is empty. |
See Also
| Improve this Doc View SourceLastAsync<TSource>(IObservable<TSource>)
Returns the last element of an observable sequence.
Declaration
public static IObservable<TSource> LastAsync<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sequence containing the last element in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence is empty. |
LastAsync<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the last element of an observable sequence that satisfies the condition in the predicate.
Declaration
public static IObservable<TSource> LastAsync<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sequence containing the last element in the observable sequence that satisfies the condition in the predicate. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) No element satisfies the condition in the predicate. -or- The source sequence is empty. |
LastOrDefault<TSource>(IObservable<TSource>)
Returns the last element of an observable sequence, or a default value if no such element exists.
Declaration
public static TSource LastOrDefault<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
TSource | The last element in the observable sequence, or a default value if no such element exists. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceLastOrDefault<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
Declaration
public static TSource LastOrDefault<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
TSource | The last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceLastOrDefaultAsync<TSource>(IObservable<TSource>)
Returns the last element of an observable sequence, or a default value if no such element exists.
Declaration
public static IObservable<TSource> LastOrDefaultAsync<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sequence containing the last element in the observable sequence, or a default value if no such element exists. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
LastOrDefaultAsync<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
Declaration
public static IObservable<TSource> LastOrDefaultAsync<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Latest<TSource>(IObservable<TSource>)
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.
Declaration
public static IEnumerable<TSource> Latest<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
IEnumerable<TSource> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
LongCount<TSource>(IObservable<TSource>)
Returns an observable sequence containing an Int64 that represents the total number of elements in an observable sequence.
Declaration
public static IObservable<long> LongCount<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence that contains elements to be counted. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence containing a single element with the number of elements in the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The number of elements in the source sequence is larger than MaxValue. |
LongCount<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns an observable sequence containing an Int64 that represents how many elements in the specified observable sequence satisfy a condition.
Declaration
public static IObservable<long> LongCount<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence that contains elements to be counted. |
Func<TSource, Boolean> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
IObservable<Int64> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Materialize<TSource>(IObservable<TSource>)
Materializes the implicit notifications of an observable sequence as explicit notification values.
Declaration
public static IObservable<Notification<TSource>> Materialize<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to get notification values for. |
Returns
Type | Description |
---|---|
IObservable<Notification<TSource>> | An observable sequence containing the materialized notification values from the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Decimal>)
Returns the maximum value in an observable sequence of Decimal values.
Declaration
public static IObservable<decimal> Max(this IObservable<decimal> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Decimal> | source | A sequence of Decimal values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Decimal> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Double>)
Returns the maximum value in an observable sequence of Double values.
Declaration
public static IObservable<double> Max(this IObservable<double> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Double> | source | A sequence of Double values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Int32>)
Returns the maximum value in an observable sequence of Int32 values.
Declaration
public static IObservable<int> Max(this IObservable<int> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Int32> | source | A sequence of Int32 values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Int32> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Int64>)
Returns the maximum value in an observable sequence of Int64 values.
Declaration
public static IObservable<long> Max(this IObservable<long> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Int64> | source | A sequence of Int64 values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Nullable<Decimal>>)
Returns the maximum value in an observable sequence of nullable Decimal values.
Declaration
public static IObservable<decimal?> Max(this IObservable<decimal?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Decimal>> | source | A sequence of nullable Decimal values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Decimal>> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Nullable<Double>>)
Returns the maximum value in an observable sequence of nullable Double values.
Declaration
public static IObservable<double?> Max(this IObservable<double?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Double>> | source | A sequence of nullable Double values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Nullable<Int32>>)
Returns the maximum value in an observable sequence of nullable Int32 values.
Declaration
public static IObservable<int?> Max(this IObservable<int?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Int32>> | source | A sequence of nullable Int32 values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int32>> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Nullable<Int64>>)
Returns the maximum value in an observable sequence of nullable Int64 values.
Declaration
public static IObservable<long?> Max(this IObservable<long?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Int64>> | source | A sequence of nullable Int64 values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int64>> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Nullable<Single>>)
Returns the maximum value in an observable sequence of nullable Single values.
Declaration
public static IObservable<float?> Max(this IObservable<float?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Single>> | source | A sequence of nullable Single values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Single>> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max(IObservable<Single>)
Returns the maximum value in an observable sequence of Single values.
Declaration
public static IObservable<float> Max(this IObservable<float> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Single> | source | A sequence of Single values to determine the maximum value of. |
Returns
Type | Description |
---|---|
IObservable<Single> | An observable sequence containing a single element with the maximum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>)
Returns the maximum element in an observable sequence.
Declaration
public static IObservable<TSource> Max<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to determine the maximum element of. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing a single element with the maximum element in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, IComparer<TSource>)
Returns the maximum value in an observable sequence according to the specified comparer.
Declaration
public static IObservable<TSource> Max<TSource>(this IObservable<TSource> source, IComparer<TSource> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to determine the maximum element of. |
IComparer<TSource> | comparer | Comparer used to compare elements. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing a single element with the maximum element in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Decimal>)
Invokes a transform function on each element of a sequence and returns the maximum Decimal value.
Declaration
public static IObservable<decimal> Max<TSource>(this IObservable<TSource> source, Func<TSource, decimal> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Decimal> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Decimal> | An observable sequence containing a single element with the value of type Decimal that corresponds to the maximum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Double>)
Invokes a transform function on each element of a sequence and returns the maximum Double value.
Declaration
public static IObservable<double> Max<TSource>(this IObservable<TSource> source, Func<TSource, double> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Double> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the value of type Double that corresponds to the maximum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Int32>)
Invokes a transform function on each element of a sequence and returns the maximum Int32 value.
Declaration
public static IObservable<int> Max<TSource>(this IObservable<TSource> source, Func<TSource, int> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Int32> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Int32> | An observable sequence containing a single element with the value of type Int32 that corresponds to the maximum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Int64>)
Invokes a transform function on each element of a sequence and returns the maximum Int64 value.
Declaration
public static IObservable<long> Max<TSource>(this IObservable<TSource> source, Func<TSource, long> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Int64> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence containing a single element with the value of type Int64 that corresponds to the maximum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Nullable<Decimal>>)
Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value.
Declaration
public static IObservable<decimal?> Max<TSource>(this IObservable<TSource> source, Func<TSource, decimal?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Nullable<Decimal>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Decimal>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Nullable<Double>>)
Invokes a transform function on each element of a sequence and returns the maximum nullable Double value.
Declaration
public static IObservable<double?> Max<TSource>(this IObservable<TSource> source, Func<TSource, double?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Nullable<Double>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Nullable<Int32>>)
Invokes a transform function on each element of a sequence and returns the maximum nullable Int32 value.
Declaration
public static IObservable<int?> Max<TSource>(this IObservable<TSource> source, Func<TSource, int?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Nullable<Int32>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int32>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Nullable<Int64>>)
Invokes a transform function on each element of a sequence and returns the maximum nullable Int64 value.
Declaration
public static IObservable<long?> Max<TSource>(this IObservable<TSource> source, Func<TSource, long?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Nullable<Int64>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int64>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Nullable<Single>>)
Invokes a transform function on each element of a sequence and returns the maximum nullable Single value.
Declaration
public static IObservable<float?> Max<TSource>(this IObservable<TSource> source, Func<TSource, float?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Nullable<Single>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Single>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource>(IObservable<TSource>, Func<TSource, Single>)
Invokes a transform function on each element of a sequence and returns the maximum Single value.
Declaration
public static IObservable<float> Max<TSource>(this IObservable<TSource> source, Func<TSource, float> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the maximum value of. |
Func<TSource, Single> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Single> | An observable sequence containing a single element with the value of type Single that corresponds to the maximum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource, TResult>(IObservable<TSource>, Func<TSource, TResult>)
Invokes a transform function on each element of a sequence and returns the maximum value.
Declaration
public static IObservable<TResult> Max<TSource, TResult>(this IObservable<TSource> source, Func<TSource, TResult> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to determine the mimimum element of. |
Func<TSource, TResult> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing a single element with the value that corresponds to the maximum element in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the objects derived from the elements in the source sequence to determine the maximum of. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Max<TSource, TResult>(IObservable<TSource>, Func<TSource, TResult>, IComparer<TResult>)
Invokes a transform function on each element of a sequence and returns the maximum value according to the specified comparer.
Declaration
public static IObservable<TResult> Max<TSource, TResult>(this IObservable<TSource> source, Func<TSource, TResult> selector, IComparer<TResult> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to determine the mimimum element of. |
Func<TSource, TResult> | selector | A transform function to apply to each element. |
IComparer<TResult> | comparer | Comparer used to compare elements. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing a single element with the value that corresponds to the maximum element in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the objects derived from the elements in the source sequence to determine the maximum of. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
MaxBy<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>)
Returns the elements in an observable sequence with the maximum key value.
Declaration
public static IObservable<IList<TSource>> MaxBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to get the maximum elements for. |
Func<TSource, TKey> | keySelector | Key selector function. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing a list of zero or more elements that have a maximum key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the key computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
MaxBy<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>, IComparer<TKey>)
Returns the elements in an observable sequence with the maximum key value according to the specified comparer.
Declaration
public static IObservable<IList<TSource>> MaxBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to get the maximum elements for. |
Func<TSource, TKey> | keySelector | Key selector function. |
IComparer<TKey> | comparer | Comparer used to compare key values. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing a list of zero or more elements that have a maximum key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the key computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Merge<TSource>(IEnumerable<IObservable<TSource>>)
Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence.
Declaration
public static IObservable<TSource> Merge<TSource>(this IEnumerable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Enumerable sequence of observable sequences. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the observable sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Merge<TSource>(IEnumerable<IObservable<TSource>>, Int32)
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.
Declaration
public static IObservable<TSource> Merge<TSource>(this IEnumerable<IObservable<TSource>> sources, int maxConcurrent)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Enumerable sequence of observable sequences. |
Int32 | maxConcurrent | Maximum number of observable sequences being subscribed to concurrently. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the observable sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Merge<TSource>(IEnumerable<IObservable<TSource>>, Int32, IScheduler)
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.
Declaration
public static IObservable<TSource> Merge<TSource>(this IEnumerable<IObservable<TSource>> sources, int maxConcurrent, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Enumerable sequence of observable sequences. |
Int32 | maxConcurrent | Maximum number of observable sequences being subscribed to concurrently. |
IScheduler | scheduler | Scheduler to run the enumeration of the sequence of sources on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the observable sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Merge<TSource>(IEnumerable<IObservable<TSource>>, 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.
Declaration
public static IObservable<TSource> Merge<TSource>(this IEnumerable<IObservable<TSource>> sources, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Enumerable sequence of observable sequences. |
IScheduler | scheduler | Scheduler to run the enumeration of the sequence of sources on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the observable sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Merge<TSource>(IObservable<TSource>, IObservable<TSource>)
Merges elements from two observable sequences into a single observable sequence.
Declaration
public static IObservable<TSource> Merge<TSource>(this IObservable<TSource> first, IObservable<TSource> second)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence. |
IObservable<TSource> | second | Second observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the given sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Merge<TSource>(IObservable<TSource>, IObservable<TSource>, IScheduler)
Merges elements from two observable sequences into a single observable sequence, using the specified scheduler for enumeration of and subscription to the sources.
Declaration
public static IObservable<TSource> Merge<TSource>(this IObservable<TSource> first, IObservable<TSource> second, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence. |
IObservable<TSource> | second | Second observable sequence. |
IScheduler | scheduler | Scheduler used to introduce concurrency for making subscriptions to the given sequences. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the given sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Merge<TSource>(IObservable<TSource>[])
Merges elements from all of the specified observable sequences into a single observable sequence.
Declaration
public static IObservable<TSource> Merge<TSource>(params IObservable<TSource>[] sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource>[] | sources | Observable sequences. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the observable sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Merge<TSource>(IObservable<IObservable<TSource>>)
Merges elements from all inner observable sequences into a single observable sequence.
Declaration
public static IObservable<TSource> Merge<TSource>(this IObservable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<IObservable<TSource>> | sources | Observable sequence of inner observable sequences. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the inner sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Merge<TSource>(IObservable<IObservable<TSource>>, Int32)
Merges elements from all inner observable sequences into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences.
Declaration
public static IObservable<TSource> Merge<TSource>(this IObservable<IObservable<TSource>> sources, int maxConcurrent)
Parameters
Type | Name | Description |
---|---|---|
IObservable<IObservable<TSource>> | sources | Observable sequence of inner observable sequences. |
Int32 | maxConcurrent | Maximum number of inner observable sequences being subscribed to concurrently. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the inner sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Merge<TSource>(IObservable<Task<TSource>>)
Merges results from all source tasks into a single observable sequence.
Declaration
public static IObservable<TSource> Merge<TSource>(this IObservable<Task<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Task<TSource>> | sources | Observable sequence of tasks. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the results of the source tasks. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the results produced by the source tasks. |
Remarks
If the tasks support cancellation, consider manual conversion of the tasks using FromAsync<TResult>(Func<CancellationToken, Task<TResult>>), followed by a merge operation using Merge<TSource>(IObservable<IObservable<TSource>>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Merge<TSource>(IScheduler, IObservable<TSource>[])
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.
Declaration
public static IObservable<TSource> Merge<TSource>(IScheduler scheduler, params IObservable<TSource>[] sources)
Parameters
Type | Name | Description |
---|---|---|
IScheduler | scheduler | Scheduler to run the enumeration of the sequence of sources on. |
IObservable<TSource>[] | sources | Observable sequences. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that merges the elements of the observable sequences. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Decimal>)
Returns the minimum value in an observable sequence of Decimal values.
Declaration
public static IObservable<decimal> Min(this IObservable<decimal> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Decimal> | source | A sequence of Decimal values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Decimal> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Double>)
Returns the minimum value in an observable sequence of Double values.
Declaration
public static IObservable<double> Min(this IObservable<double> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Double> | source | A sequence of Double values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Int32>)
Returns the minimum value in an observable sequence of Int32 values.
Declaration
public static IObservable<int> Min(this IObservable<int> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Int32> | source | A sequence of Int32 values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Int32> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Int64>)
Returns the minimum value in an observable sequence of Int64 values.
Declaration
public static IObservable<long> Min(this IObservable<long> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Int64> | source | A sequence of Int64 values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Nullable<Decimal>>)
Returns the minimum value in an observable sequence of nullable Decimal values.
Declaration
public static IObservable<decimal?> Min(this IObservable<decimal?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Decimal>> | source | A sequence of nullable Decimal values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Decimal>> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Nullable<Double>>)
Returns the minimum value in an observable sequence of nullable Double values.
Declaration
public static IObservable<double?> Min(this IObservable<double?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Double>> | source | A sequence of nullable Double values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Nullable<Int32>>)
Returns the minimum value in an observable sequence of nullable Int32 values.
Declaration
public static IObservable<int?> Min(this IObservable<int?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Int32>> | source | A sequence of nullable Int32 values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int32>> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Nullable<Int64>>)
Returns the minimum value in an observable sequence of nullable Int64 values.
Declaration
public static IObservable<long?> Min(this IObservable<long?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Int64>> | source | A sequence of nullable Int64 values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int64>> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Nullable<Single>>)
Returns the minimum value in an observable sequence of nullable Single values.
Declaration
public static IObservable<float?> Min(this IObservable<float?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Single>> | source | A sequence of nullable Single values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Single>> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min(IObservable<Single>)
Returns the minimum value in an observable sequence of Single values.
Declaration
public static IObservable<float> Min(this IObservable<float> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Single> | source | A sequence of Single values to determine the minimum value of. |
Returns
Type | Description |
---|---|
IObservable<Single> | An observable sequence containing a single element with the minimum value in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>)
Returns the minimum element in an observable sequence.
Declaration
public static IObservable<TSource> Min<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to determine the mimimum element of. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing a single element with the minimum element in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, IComparer<TSource>)
Returns the minimum element in an observable sequence according to the specified comparer.
Declaration
public static IObservable<TSource> Min<TSource>(this IObservable<TSource> source, IComparer<TSource> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to determine the mimimum element of. |
IComparer<TSource> | comparer | Comparer used to compare elements. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing a single element with the minimum element in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Decimal>)
Invokes a transform function on each element of a sequence and returns the minimum Decimal value.
Declaration
public static IObservable<decimal> Min<TSource>(this IObservable<TSource> source, Func<TSource, decimal> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Decimal> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Decimal> | An observable sequence containing a single element with the value of type Decimal that corresponds to the minimum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Double>)
Invokes a transform function on each element of a sequence and returns the minimum Double value.
Declaration
public static IObservable<double> Min<TSource>(this IObservable<TSource> source, Func<TSource, double> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Double> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the value of type Double that corresponds to the minimum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Int32>)
Invokes a transform function on each element of a sequence and returns the minimum Int32 value.
Declaration
public static IObservable<int> Min<TSource>(this IObservable<TSource> source, Func<TSource, int> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Int32> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Int32> | An observable sequence containing a single element with the value of type Int32 that corresponds to the minimum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Int64>)
Invokes a transform function on each element of a sequence and returns the minimum Int64 value.
Declaration
public static IObservable<long> Min<TSource>(this IObservable<TSource> source, Func<TSource, long> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Int64> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence containing a single element with the value of type Int64 that corresponds to the minimum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Nullable<Decimal>>)
Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value.
Declaration
public static IObservable<decimal?> Min<TSource>(this IObservable<TSource> source, Func<TSource, decimal?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Nullable<Decimal>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Decimal>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Nullable<Double>>)
Invokes a transform function on each element of a sequence and returns the minimum nullable Double value.
Declaration
public static IObservable<double?> Min<TSource>(this IObservable<TSource> source, Func<TSource, double?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Nullable<Double>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Nullable<Int32>>)
Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value.
Declaration
public static IObservable<int?> Min<TSource>(this IObservable<TSource> source, Func<TSource, int?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Nullable<Int32>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int32>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Nullable<Int64>>)
Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value.
Declaration
public static IObservable<long?> Min<TSource>(this IObservable<TSource> source, Func<TSource, long?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Nullable<Int64>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int64>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Nullable<Single>>)
Invokes a transform function on each element of a sequence and returns the minimum nullable Single value.
Declaration
public static IObservable<float?> Min<TSource>(this IObservable<TSource> source, Func<TSource, float?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Nullable<Single>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Single>> | An observable sequence containing a single element with the value of type System.Nullable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource>(IObservable<TSource>, Func<TSource, Single>)
Invokes a transform function on each element of a sequence and returns the minimum Single value.
Declaration
public static IObservable<float> Min<TSource>(this IObservable<TSource> source, Func<TSource, float> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values to determine the minimum value of. |
Func<TSource, Single> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Single> | An observable sequence containing a single element with the value of type Single that corresponds to the minimum value in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource, TResult>(IObservable<TSource>, Func<TSource, TResult>)
Invokes a transform function on each element of a sequence and returns the minimum value.
Declaration
public static IObservable<TResult> Min<TSource, TResult>(this IObservable<TSource> source, Func<TSource, TResult> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to determine the mimimum element of. |
Func<TSource, TResult> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing a single element with the value that corresponds to the minimum element in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the objects derived from the elements in the source sequence to determine the minimum of. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Min<TSource, TResult>(IObservable<TSource>, Func<TSource, TResult>, IComparer<TResult>)
Invokes a transform function on each element of a sequence and returns the minimum value according to the specified comparer.
Declaration
public static IObservable<TResult> Min<TSource, TResult>(this IObservable<TSource> source, Func<TSource, TResult> selector, IComparer<TResult> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to determine the mimimum element of. |
Func<TSource, TResult> | selector | A transform function to apply to each element. |
IComparer<TResult> | comparer | Comparer used to compare elements. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing a single element with the value that corresponds to the minimum element in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the objects derived from the elements in the source sequence to determine the minimum of. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
MinBy<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>)
Returns the elements in an observable sequence with the minimum key value.
Declaration
public static IObservable<IList<TSource>> MinBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to get the minimum elements for. |
Func<TSource, TKey> | keySelector | Key selector function. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing a list of zero or more elements that have a minimum key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the key computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
MinBy<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>, IComparer<TKey>)
Returns the elements in an observable sequence with the minimum key value according to the specified comparer.
Declaration
public static IObservable<IList<TSource>> MinBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to get the minimum elements for. |
Func<TSource, TKey> | keySelector | Key selector function. |
IComparer<TKey> | comparer | Comparer used to compare key values. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing a list of zero or more elements that have a minimum key value. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the key computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
MostRecent<TSource>(IObservable<TSource>, TSource)
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.
Declaration
public static IEnumerable<TSource> MostRecent<TSource>(this IObservable<TSource> source, TSource initialValue)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
TSource | initialValue | Initial value that will be yielded by the enumerable sequence if no element has been sampled yet. |
Returns
Type | Description |
---|---|
IEnumerable<TSource> | The enumerable sequence that returns the last sampled element upon each iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Multicast<TSource, TResult>(IObservable<TSource>, ISubject<TSource, TResult>)
Multicasts the source sequence notifications through the specified subject to the resulting connectable observable. Upon connection of the connectable observable, the subject is subscribed to the source exactly one, and messages are forwarded to the observers registered with the connectable observable. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
Declaration
public static IConnectableObservable<TResult> Multicast<TSource, TResult>(this IObservable<TSource> source, ISubject<TSource, TResult> subject)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be pushed into the specified subject. |
ISubject<TSource, TResult> | subject | Subject to push source elements into. |
Returns
Type | Description |
---|---|
IConnectableObservable<TResult> | A connectable observable sequence that upon connection causes the source sequence to push results into the specified subject. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Multicast<TSource, TIntermediate, TResult>(IObservable<TSource>, Func<ISubject<TSource, TIntermediate>>, Func<IObservable<TIntermediate>, IObservable<TResult>>)
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.
Declaration
public static IObservable<TResult> Multicast<TSource, TIntermediate, TResult>(this IObservable<TSource> source, Func<ISubject<TSource, TIntermediate>> subjectSelector, Func<IObservable<TIntermediate>, IObservable<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence which will be multicasted in the specified selector function. |
Func<ISubject<TSource, TIntermediate>> | subjectSelector | Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. |
Func<IObservable<TIntermediate>, IObservable<TResult>> | selector | Selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TIntermediate | The type of the elements produced by the intermediate subject. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Never<TResult>()
Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
Declaration
public static IObservable<TResult> Never<TResult>()
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose observers will never get called. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Never<TResult>(TResult)
Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
Declaration
public static IObservable<TResult> Never<TResult>(TResult witness)
Parameters
Type | Name | Description |
---|---|---|
TResult | witness | Object solely used to infer the type of the |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose observers will never get called. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Next<TSource>(IObservable<TSource>)
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.
Declaration
public static IEnumerable<TSource> Next<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
IEnumerable<TSource> | The enumerable sequence that blocks upon each iteration until the next element in the observable source sequence becomes available. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ObserveOn<TSource>(IObservable<TSource>, IScheduler)
Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
Declaration
public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
IScheduler | scheduler | Scheduler to notify observers on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence whose observations happen on the specified scheduler. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
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 SubscribeOn<TSource>(IObservable<TSource>, IScheduler).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ObserveOn<TSource>(IObservable<TSource>, SynchronizationContext)
Wraps the source sequence in order to run its observer callbacks on the specified synchronization context.
Declaration
public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, SynchronizationContext context)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
SynchronizationContext | context | Synchronization context to notify observers on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence whose observations happen on the specified synchronization context. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
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 SubscribeOn<TSource>(IObservable<TSource>, SynchronizationContext).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OfType<TResult>(IObservable<Object>)
Filters the elements of an observable sequence based on the specified type.
Declaration
public static IObservable<TResult> OfType<TResult>(this IObservable<object> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Object> | source | The observable sequence that contains the elements to be filtered. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains elements from the input sequence of type TResult. |
Type Parameters
Name | Description |
---|---|
TResult | The type to filter the elements in the source sequence on. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OnErrorResumeNext<TSource>(IEnumerable<IObservable<TSource>>)
Concatenates all observable sequences in the given enumerable sequence, even if the previous observable sequence terminated exceptionally.
Declaration
public static IObservable<TSource> OnErrorResumeNext<TSource>(this IEnumerable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Observable sequences to concatenate. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OnErrorResumeNext<TSource>(IObservable<TSource>, IObservable<TSource>)
Concatenates the second observable sequence to the first observable sequence upon successful or exceptional termination of the first.
Declaration
public static IObservable<TSource> OnErrorResumeNext<TSource>(this IObservable<TSource> first, IObservable<TSource> second)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence whose exception (if any) is caught. |
IObservable<TSource> | second | Second observable sequence used to produce results after the first sequence terminates. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OnErrorResumeNext<TSource>(IObservable<TSource>[])
Concatenates all of the specified observable sequences, even if the previous observable sequence terminated exceptionally.
Declaration
public static IObservable<TSource> OnErrorResumeNext<TSource>(params IObservable<TSource>[] sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource>[] | sources | Observable sequences to concatenate. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Publish<TSource>(IObservable<TSource>)
Returns a connectable observable sequence that shares a single subscription to the underlying sequence. This operator is a specialization of Multicast using a regular Subject<T>.
Declaration
public static IConnectableObservable<TSource> Publish<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive all notifications of the source from the time of the subscription on.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
Publish<TSource>(IObservable<TSource>, TSource)
Returns 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 BehaviorSubject<T>.
Declaration
public static IConnectableObservable<TSource> Publish<TSource>(this IObservable<TSource> source, TSource initialValue)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
TSource | initialValue | Initial value received by observers upon subscription. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourcePublish<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>)
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 Subject<T>.
Declaration
public static IObservable<TResult> Publish<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
Publish<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>, 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 and starts with initialValue. This operator is a specialization of Multicast using a BehaviorSubject<T>.
Declaration
public static IObservable<TResult> Publish<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, TSource initialValue)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
TSource | initialValue | Initial value received by observers upon subscription. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourcePublishLast<TSource>(IObservable<TSource>)
Returns 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 AsyncSubject<T>.
Declaration
public static IConnectableObservable<TSource> PublishLast<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will only receive the last notification of the source.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
PublishLast<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>)
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 AsyncSubject<T>.
Declaration
public static IObservable<TResult> PublishLast<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
Range(Int32, Int32)
Generates an observable sequence of integral numbers within a specified range.
Declaration
public static IObservable<int> Range(int start, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | start | The value of the first integer in the sequence. |
Int32 | count | The number of sequential integers to generate. |
Returns
Type | Description |
---|---|
IObservable<Int32> | An observable sequence that contains a range of sequential integral numbers. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Range(Int32, Int32, IScheduler)
Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
Declaration
public static IObservable<int> Range(int start, int count, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Int32 | start | The value of the first integer in the sequence. |
Int32 | count | The number of sequential integers to generate. |
IScheduler | scheduler | Scheduler to run the generator loop on. |
Returns
Type | Description |
---|---|
IObservable<Int32> | An observable sequence that contains a range of sequential integral numbers. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
ArgumentNullException |
|
RefCount<TSource>(IConnectableObservable<TSource>)
Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.
Declaration
public static IObservable<TSource> RefCount<TSource>(this IConnectableObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IConnectableObservable<TSource> | source | Connectable observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Repeat<TResult>(TResult)
Generates an observable sequence that repeats the given element infinitely.
Declaration
public static IObservable<TResult> Repeat<TResult>(TResult value)
Parameters
Type | Name | Description |
---|---|---|
TResult | value | Element to repeat. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that repeats the given element infinitely. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the element that will be repeated in the produced sequence. |
Repeat<TResult>(TResult, Int32)
Generates an observable sequence that repeats the given element the specified number of times.
Declaration
public static IObservable<TResult> Repeat<TResult>(TResult value, int repeatCount)
Parameters
Type | Name | Description |
---|---|---|
TResult | value | Element to repeat. |
Int32 | repeatCount | Number of times to repeat the element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that repeats the given element the specified number of times. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the element that will be repeated in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Repeat<TResult>(TResult, Int32, IScheduler)
Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
Declaration
public static IObservable<TResult> Repeat<TResult>(TResult value, int repeatCount, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
TResult | value | Element to repeat. |
Int32 | repeatCount | Number of times to repeat the element. |
IScheduler | scheduler | Scheduler to run the producer loop on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that repeats the given element the specified number of times. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the element that will be repeated in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
ArgumentNullException |
|
Repeat<TResult>(TResult, IScheduler)
Generates an observable sequence that repeats the given element infinitely, using the specified scheduler to send out observer messages.
Declaration
public static IObservable<TResult> Repeat<TResult>(TResult value, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
TResult | value | Element to repeat. |
IScheduler | scheduler | Scheduler to run the producer loop on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that repeats the given element infinitely. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the element that will be repeated in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Repeat<TSource>(IObservable<TSource>)
Repeats the observable sequence indefinitely.
Declaration
public static IObservable<TSource> Repeat<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Observable sequence to repeat. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence producing the elements of the given sequence repeatedly and sequentially. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Repeat<TSource>(IObservable<TSource>, Int32)
Repeats the observable sequence a specified number of times.
Declaration
public static IObservable<TSource> Repeat<TSource>(this IObservable<TSource> source, int repeatCount)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Observable sequence to repeat. |
Int32 | repeatCount | Number of times to repeat the sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence producing the elements of the given sequence repeatedly. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Replay<TSource>(IObservable<TSource>)
Returns 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 ReplaySubject<T>.
Declaration
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive all the notifications of the source.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceReplay<TSource>(IObservable<TSource>, Int32)
Returns 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 ReplaySubject<T>.
Declaration
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Int32 | bufferSize | Maximum element count of the replay buffer. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource>(IObservable<TSource>, Int32, IScheduler)
Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying bufferSize notifications. This operator is a specialization of Multicast using a ReplaySubject<T>.
Declaration
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Int32 | bufferSize | Maximum element count of the replay buffer. |
IScheduler | scheduler | Scheduler where connected observers will be invoked on. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource>(IObservable<TSource>, Int32, TimeSpan)
Returns 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 ReplaySubject<T>.
Declaration
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize, TimeSpan window)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Int32 | bufferSize | Maximum element count of the replay buffer. |
TimeSpan | window | Maximum time length of the replay buffer. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource>(IObservable<TSource>, Int32, TimeSpan, IScheduler)
Returns 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 ReplaySubject<T>.
Declaration
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize, TimeSpan window, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Int32 | bufferSize | Maximum element count of the replay buffer. |
TimeSpan | window | Maximum time length of the replay buffer. |
IScheduler | scheduler | Scheduler where connected observers will be invoked on. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource>(IObservable<TSource>, IScheduler)
Returns 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 ReplaySubject<T>.
Declaration
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
IScheduler | scheduler | Scheduler where connected observers will be invoked on. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive all the notifications of the source.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceReplay<TSource>(IObservable<TSource>, TimeSpan)
Returns 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 ReplaySubject<T>.
Declaration
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, TimeSpan window)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
TimeSpan | window | Maximum time length of the replay buffer. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
Returns 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 ReplaySubject<T>.
Declaration
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, TimeSpan window, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
TimeSpan | window | Maximum time length of the replay buffer. |
IScheduler | scheduler | Scheduler where connected observers will be invoked on. |
Returns
Type | Description |
---|---|
IConnectableObservable<TSource> | A connectable observable sequence that shares a single subscription to the underlying sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>)
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 ReplaySubject<T>.
Declaration
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceReplay<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>, Int32)
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 ReplaySubject<T>.
Declaration
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
Int32 | bufferSize | Maximum element count of the replay buffer. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>, Int32, 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 element count for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject<T>.
Declaration
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
Int32 | bufferSize | Maximum element count of the replay buffer. |
IScheduler | scheduler | Scheduler where connected observers within the selector function will be invoked on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>, Int32, 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 ReplaySubject<T>.
Declaration
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize, TimeSpan window)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
Int32 | bufferSize | Maximum element count of the replay buffer. |
TimeSpan | window | Maximum time length of the replay buffer. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>, Int32, TimeSpan, 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 ReplaySubject<T>.
Declaration
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize, TimeSpan window, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
Int32 | bufferSize | Maximum element count of the replay buffer. |
TimeSpan | window | Maximum time length of the replay buffer. |
IScheduler | scheduler | Scheduler where connected observers within the selector function will be invoked on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>, 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 ReplaySubject<T>.
Declaration
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
IScheduler | scheduler | Scheduler where connected observers within the selector function will be invoked on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
| Improve this Doc View SourceReplay<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>, 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 ReplaySubject<T>.
Declaration
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, TimeSpan window)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
TimeSpan | window | Maximum time length of the replay buffer. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceReplay<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>, TimeSpan, 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 ReplaySubject<T>.
Declaration
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, TimeSpan window, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence whose elements will be multicasted through a single shared subscription. |
Func<IObservable<TSource>, IObservable<TResult>> | selector | 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. |
TimeSpan | window | Maximum time length of the replay buffer. |
IScheduler | scheduler | Scheduler where connected observers within the selector function will be invoked on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
See Also
| Improve this Doc View SourceRetry<TSource>(IObservable<TSource>)
Repeats the source observable sequence until it successfully terminates.
Declaration
public static IObservable<TSource> Retry<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Observable sequence to repeat until it successfully terminates. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Retry<TSource>(IObservable<TSource>, Int32)
Repeats the source observable sequence the specified number of times or until it successfully terminates.
Declaration
public static IObservable<TSource> Retry<TSource>(this IObservable<TSource> source, int retryCount)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Observable sequence to repeat until it successfully terminates. |
Int32 | retryCount | Number of times to repeat the sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Return<TResult>(TResult)
Returns an observable sequence that contains a single element.
Declaration
public static IObservable<TResult> Return<TResult>(TResult value)
Parameters
Type | Name | Description |
---|---|---|
TResult | value | Single element in the resulting observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the single specified element. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the element that will be returned in the produced sequence. |
Return<TResult>(TResult, IScheduler)
Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
Declaration
public static IObservable<TResult> Return<TResult>(TResult value, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
TResult | value | Single element in the resulting observable sequence. |
IScheduler | scheduler | Scheduler to send the single element on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the single specified element. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the element that will be returned in the produced sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Sample<TSource>(IObservable<TSource>, TimeSpan)
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.
Declaration
public static IObservable<TSource> Sample<TSource>(this IObservable<TSource> source, TimeSpan interval)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to sample. |
TimeSpan | interval | Interval at which to sample. If this value is equal to TimeSpan.Zero, the scheduler will continuously sample the stream. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sampled observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Specifying a TimeSpan.Zero value for interval
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Sample<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
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.
Declaration
public static IObservable<TSource> Sample<TSource>(this IObservable<TSource> source, TimeSpan interval, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to sample. |
TimeSpan | interval | Interval at which to sample. If this value is equal to TimeSpan.Zero, the scheduler will continuously sample the stream. |
IScheduler | scheduler | Scheduler to run the sampling timer on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sampled observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Specifying a TimeSpan.Zero value for interval
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Sample<TSource, TSample>(IObservable<TSource>, IObservable<TSample>)
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.
Declaration
public static IObservable<TSource> Sample<TSource, TSample>(this IObservable<TSource> source, IObservable<TSample> sampler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to sample. |
IObservable<TSample> | sampler | Sampling tick sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sampled observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TSample | The type of the elements in the sampling sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Scan<TSource>(IObservable<TSource>, Func<TSource, TSource, TSource>)
Applies an accumulator function over an observable sequence and returns each intermediate result. For aggregation behavior with no intermediate results, see Aggregate<TSource>(IObservable<TSource>, Func<TSource, TSource, TSource>).
Declaration
public static IObservable<TSource> Scan<TSource>(this IObservable<TSource> source, Func<TSource, TSource, TSource> accumulator)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to accumulate over. |
Func<TSource, TSource, TSource> | accumulator | An accumulator function to be invoked on each element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing the accumulated values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and the result of the aggregation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Scan<TSource, TAccumulate>(IObservable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>)
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 Aggregate<TSource, TAccumulate>(IObservable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>).
Declaration
public static IObservable<TAccumulate> Scan<TSource, TAccumulate>(this IObservable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> accumulator)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to accumulate over. |
TAccumulate | seed | The initial accumulator value. |
Func<TAccumulate, TSource, TAccumulate> | accumulator | An accumulator function to be invoked on each element. |
Returns
Type | Description |
---|---|
IObservable<TAccumulate> | An observable sequence containing the accumulated values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TAccumulate | The type of the result of the aggregation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Select<TSource, TResult>(IObservable<TSource>, Func<TSource, TResult>)
Projects each element of an observable sequence into a new form.
Declaration
public static IObservable<TResult> Select<TSource, TResult>(this IObservable<TSource> source, Func<TSource, TResult> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of elements to invoke a transform function on. |
Func<TSource, TResult> | selector | A transform function to apply to each source element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of invoking the transform function on each element of source. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Select<TSource, TResult>(IObservable<TSource>, Func<TSource, Int32, TResult>)
Projects each element of an observable sequence into a new form by incorporating the element's index.
Declaration
public static IObservable<TResult> Select<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, TResult> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of elements to invoke a transform function on. |
Func<TSource, Int32, TResult> | selector | A transform function to apply to each source element; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of invoking the transform function on each element of source. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, IEnumerable<TResult>>)
Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, IEnumerable<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, IEnumerable<TResult>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence. |
Remarks
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 ToObservable<TSource>(IEnumerable<TSource>) conversion.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, Int32, IEnumerable<TResult>>)
Projects each element of an observable sequence to an enumerable sequence by incorporating the element's index and concatenates the resulting enumerable sequences into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, IEnumerable<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Int32, IEnumerable<TResult>> | selector | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence. |
Remarks
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 ToObservable<TSource>(IEnumerable<TSource>) conversion.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, Int32, IObservable<TResult>>)
Projects each element of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Int32, IObservable<TResult>> | selector | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner sequences and the elements in the merged result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, Int32, IObservable<TResult>>, Func<Exception, IObservable<TResult>>, Func<IObservable<TResult>>)
Projects each notification of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, IObservable<TResult>> onNext, Func<Exception, IObservable<TResult>> onError, Func<IObservable<TResult>> onCompleted)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of notifications to project. |
Func<TSource, Int32, IObservable<TResult>> | onNext | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Func<Exception, IObservable<TResult>> | onError | A transform function to apply when an error occurs in the source sequence. |
Func<IObservable<TResult>> | onCompleted | A transform function to apply when the end of the source sequence is reached. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner sequences and the elements in the merged result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, Int32, CancellationToken, Task<TResult>>)
Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support and merges all of the task results into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Int32, CancellationToken, Task<TResult>> | selector | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of the tasks executed for each element of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the result produced by the projected tasks and the elements in the merged result sequence. |
Remarks
This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable<TResult>(Task<TResult>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, Int32, Task<TResult>>)
Projects each element of an observable sequence to a task by incorporating the element's index and merges all of the task results into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, Task<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Int32, Task<TResult>> | selector | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of the tasks executed for each element of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the result produced by the projected tasks and the elements in the merged result sequence. |
Remarks
This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable<TResult>(Task<TResult>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, IObservable<TResult>>)
Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, IObservable<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, IObservable<TResult>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner sequences and the elements in the merged result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, IObservable<TResult>>, Func<Exception, IObservable<TResult>>, Func<IObservable<TResult>>)
Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, IObservable<TResult>> onNext, Func<Exception, IObservable<TResult>> onError, Func<IObservable<TResult>> onCompleted)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of notifications to project. |
Func<TSource, IObservable<TResult>> | onNext | A transform function to apply to each element. |
Func<Exception, IObservable<TResult>> | onError | A transform function to apply when an error occurs in the source sequence. |
Func<IObservable<TResult>> | onCompleted | A transform function to apply when the end of the source sequence is reached. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner sequences and the elements in the merged result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, CancellationToken, Task<TResult>>)
Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, CancellationToken, Task<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, CancellationToken, Task<TResult>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of the tasks executed for each element of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the result produced by the projected tasks and the elements in the merged result sequence. |
Remarks
This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable<TResult>(Task<TResult>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, Task<TResult>>)
Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, Task<TResult>> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Task<TResult>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose elements are the result of the tasks executed for each element of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the result produced by the projected tasks and the elements in the merged result sequence. |
Remarks
This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable<TResult>(Task<TResult>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TOther>(IObservable<TSource>, IObservable<TOther>)
Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
Declaration
public static IObservable<TOther> SelectMany<TSource, TOther>(this IObservable<TSource> source, IObservable<TOther> other)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
IObservable<TOther> | other | An observable sequence to project each element from the source sequence onto. |
Returns
Type | Description |
---|---|
IObservable<TOther> | An observable sequence whose elements are the result of projecting each source element onto the other sequence and merging all the resulting sequences together. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TOther | The type of the elements in the other sequence and the elements in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TCollection, TResult>(IObservable<TSource>, Func<TSource, IEnumerable<TCollection>>, Func<TSource, TCollection, TResult>)
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.
Declaration
public static IObservable<TResult> SelectMany<TSource, TCollection, TResult>(this IObservable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, IEnumerable<TCollection>> | collectionSelector | A transform function to apply to each element. |
Func<TSource, TCollection, TResult> | resultSelector | A transform function to apply to each element of the intermediate sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TCollection | The type of the elements in the projected intermediate enumerable sequences. |
TResult | 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. |
Remarks
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 ToObservable<TSource>(IEnumerable<TSource>) conversion.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TCollection, TResult>(IObservable<TSource>, Func<TSource, Int32, IEnumerable<TCollection>>, Func<TSource, Int32, TCollection, Int32, TResult>)
Projects each element of an observable sequence to an enumerable sequence by incorporating the element's index, 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.
Declaration
public static IObservable<TResult> SelectMany<TSource, TCollection, TResult>(this IObservable<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector, Func<TSource, int, TCollection, int, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Int32, IEnumerable<TCollection>> | collectionSelector | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Func<TSource, Int32, TCollection, Int32, TResult> | resultSelector | A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element and the fourth parameter represents the index of the intermediate element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TCollection | The type of the elements in the projected intermediate enumerable sequences. |
TResult | 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. |
Remarks
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 ToObservable<TSource>(IEnumerable<TSource>) conversion.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TCollection, TResult>(IObservable<TSource>, Func<TSource, Int32, IObservable<TCollection>>, Func<TSource, Int32, TCollection, Int32, TResult>)
Projects each element of an observable sequence to an observable sequence by incorporating the element's index, 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.
Declaration
public static IObservable<TResult> SelectMany<TSource, TCollection, TResult>(this IObservable<TSource> source, Func<TSource, int, IObservable<TCollection>> collectionSelector, Func<TSource, int, TCollection, int, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Int32, IObservable<TCollection>> | collectionSelector | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Func<TSource, Int32, TCollection, Int32, TResult> | resultSelector | A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element and the fourth parameter represents the index of the intermediate element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TCollection | The type of the elements in the projected intermediate sequences. |
TResult | 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. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource>, Func<TSource, Int32, CancellationToken, Task<TTaskResult>>, Func<TSource, Int32, TTaskResult, TResult>)
Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Int32, CancellationToken, Task<TTaskResult>> | taskSelector | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Func<TSource, Int32, TTaskResult, TResult> | resultSelector | A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TTaskResult | The type of the results produced by the projected intermediate tasks. |
TResult | 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. |
Remarks
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 ToObservable<TResult>(Task<TResult>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource>, Func<TSource, Int32, Task<TTaskResult>>, Func<TSource, Int32, TTaskResult, TResult>)
Projects each element of an observable sequence to a task by incorporating the element's index, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
Declaration
public static IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IObservable<TSource> source, Func<TSource, int, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Int32, Task<TTaskResult>> | taskSelector | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Func<TSource, Int32, TTaskResult, TResult> | resultSelector | A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TResult> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TTaskResult | The type of the results produced by the projected intermediate tasks. |
TResult | 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. |
Remarks
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 ToObservable<TResult>(Task<TResult>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TCollection, TResult>(IObservable<TSource>, Func<TSource, IObservable<TCollection>>, Func<TSource, TCollection, TResult>)
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.
Declaration
public static IObservable<TResult> SelectMany<TSource, TCollection, TResult>(this IObservable<TSource> source, Func<TSource, IObservable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, IObservable<TCollection>> | collectionSelector | A transform function to apply to each element. |
Func<TSource, TCollection, TResult> | resultSelector | A transform function to apply to each element of the intermediate sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TCollection | The type of the elements in the projected intermediate sequences. |
TResult | 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. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource>, Func<TSource, CancellationToken, Task<TTaskResult>>, Func<TSource, TTaskResult, TResult>)
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.
Declaration
public static IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IObservable<TSource> source, Func<TSource, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, CancellationToken, Task<TTaskResult>> | taskSelector | A transform function to apply to each element. |
Func<TSource, TTaskResult, TResult> | resultSelector | A transform function to apply to each element of the intermediate sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TTaskResult | The type of the results produced by the projected intermediate tasks. |
TResult | 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. |
Remarks
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 ToObservable<TResult>(Task<TResult>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource>, Func<TSource, Task<TTaskResult>>, Func<TSource, TTaskResult, TResult>)
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.
Declaration
public static IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IObservable<TSource> source, Func<TSource, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence of elements to project. |
Func<TSource, Task<TTaskResult>> | taskSelector | A transform function to apply to each element. |
Func<TSource, TTaskResult, TResult> | resultSelector | A transform function to apply to each element of the intermediate sequence. |
Returns
Type | Description |
---|---|
IObservable<TResult> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TTaskResult | The type of the results produced by the projected intermediate tasks. |
TResult | 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. |
Remarks
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 ToObservable<TResult>(Task<TResult>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SequenceEqual<TSource>(IObservable<TSource>, IEnumerable<TSource>)
Determines whether an observable and enumerable sequence are equal by comparing the elements pairwise.
Declaration
public static IObservable<bool> SequenceEqual<TSource>(this IObservable<TSource> first, IEnumerable<TSource> second)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence to compare. |
IEnumerable<TSource> | second | Second observable sequence to compare. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SequenceEqual<TSource>(IObservable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)
Determines whether an observable and enumerable sequence are equal by comparing the elements pairwise using a specified equality comparer.
Declaration
public static IObservable<bool> SequenceEqual<TSource>(this IObservable<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence to compare. |
IEnumerable<TSource> | second | Second observable sequence to compare. |
IEqualityComparer<TSource> | comparer | Comparer used to compare elements of both sequences. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SequenceEqual<TSource>(IObservable<TSource>, IObservable<TSource>)
Determines whether two sequences are equal by comparing the elements pairwise.
Declaration
public static IObservable<bool> SequenceEqual<TSource>(this IObservable<TSource> first, IObservable<TSource> second)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence to compare. |
IObservable<TSource> | second | Second observable sequence to compare. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SequenceEqual<TSource>(IObservable<TSource>, IObservable<TSource>, IEqualityComparer<TSource>)
Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer.
Declaration
public static IObservable<bool> SequenceEqual<TSource>(this IObservable<TSource> first, IObservable<TSource> second, IEqualityComparer<TSource> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | first | First observable sequence to compare. |
IObservable<TSource> | second | Second observable sequence to compare. |
IEqualityComparer<TSource> | comparer | Comparer used to compare elements of both sequences. |
Returns
Type | Description |
---|---|
IObservable<Boolean> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Single<TSource>(IObservable<TSource>)
Returns the only element of an observable sequence, and throws an exception if there is not exactly one element in the observable sequence.
Declaration
public static TSource Single<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
TSource | The single element in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The source sequence contains more than one element. -or- The source sequence is empty. |
See Also
| Improve this Doc View SourceSingle<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the only element of an observable sequence that satisfies the condition in the predicate, and throws an exception if there is not exactly one element matching the predicate in the observable sequence.
Declaration
public static TSource Single<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
TSource | The single element in the observable sequence that satisfies the condition in the predicate. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | 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. |
See Also
| Improve this Doc View SourceSingleAsync<TSource>(IObservable<TSource>)
Returns the only element of an observable sequence, and reports an exception if there is not exactly one element in the observable sequence.
Declaration
public static IObservable<TSource> SingleAsync<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sequence containing the single element in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence contains more than one element. -or- The source sequence is empty. |
SingleAsync<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
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.
Declaration
public static IObservable<TSource> SingleAsync<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sequence containing the single element in the observable sequence that satisfies the condition in the predicate. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (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. |
SingleOrDefault<TSource>(IObservable<TSource>)
Returns the only element of an observable sequence, or a default value if the observable sequence is empty; this method throws an exception if there is more than one element in the observable sequence.
Declaration
public static TSource SingleOrDefault<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
TSource | The single element in the observable sequence, or a default value if no such element exists. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The source sequence contains more than one element. |
See Also
| Improve this Doc View SourceSingleOrDefault<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns the only element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists; this method throws an exception if there is more than one element matching the predicate in the observable sequence.
Declaration
public static TSource SingleOrDefault<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
TSource | The single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The sequence contains more than one element that satisfies the condition in the predicate. |
See Also
| Improve this Doc View SourceSingleOrDefaultAsync<TSource>(IObservable<TSource>)
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.
Declaration
public static IObservable<TSource> SingleOrDefaultAsync<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | Sequence containing the single element in the observable sequence, or a default value if no such element exists. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The source sequence contains more than one element. |
SingleOrDefaultAsync<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
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.
Declaration
public static IObservable<TSource> SingleOrDefaultAsync<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Func<TSource, Boolean> | predicate | A predicate function to evaluate for elements in the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | (Asynchronous) The sequence contains more than one element that satisfies the condition in the predicate. |
Skip<TSource>(IObservable<TSource>, Int32)
Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
Declaration
public static IObservable<TSource> Skip<TSource>(this IObservable<TSource> source, int count)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | The sequence to take elements from. |
Int32 | count | The number of elements to skip before returning the remaining elements. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the elements that occur after the specified index in the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Skip<TSource>(IObservable<TSource>, TimeSpan)
Skips elements for the specified duration from the start of the observable source sequence.
Declaration
public static IObservable<TSource> Skip<TSource>(this IObservable<TSource> source, TimeSpan duration)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to skip elements for. |
TimeSpan | duration | Duration for skipping elements from the start of the sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements skipped during the specified duration from the start of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Specifying a TimeSpan.Zero value for duration
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 duration
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Skip<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
Declaration
public static IObservable<TSource> Skip<TSource>(this IObservable<TSource> source, TimeSpan duration, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to skip elements for. |
TimeSpan | duration | Duration for skipping elements from the start of the sequence. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements skipped during the specified duration from the start of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Specifying a TimeSpan.Zero value for duration
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 duration
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
SkipLast<TSource>(IObservable<TSource>, Int32)
Bypasses a specified number of elements at the end of an observable sequence.
Declaration
public static IObservable<TSource> SkipLast<TSource>(this IObservable<TSource> source, int count)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Int32 | count | Number of elements to bypass at the end of the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing the source sequence elements except for the bypassed ones at the end. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a queue with a length enough to store the first count
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
SkipLast<TSource>(IObservable<TSource>, TimeSpan)
Skips elements for the specified duration from the end of the observable source sequence.
Declaration
public static IObservable<TSource> SkipLast<TSource>(this IObservable<TSource> source, TimeSpan duration)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to skip elements for. |
TimeSpan | duration | Duration for skipping elements from the end of the sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements skipped during the specified duration from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a queue with a length enough to store elements received during the initial duration
window.
As more elements are received, elements older than the specified duration
are taken from the queue and produced on the
result sequence. This causes elements to be delayed with duration
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
SkipLast<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
Declaration
public static IObservable<TSource> SkipLast<TSource>(this IObservable<TSource> source, TimeSpan duration, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to skip elements for. |
TimeSpan | duration | Duration for skipping elements from the end of the sequence. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements skipped during the specified duration from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a queue with a length enough to store elements received during the initial duration
window.
As more elements are received, elements older than the specified duration
are taken from the queue and produced on the
result sequence. This causes elements to be delayed with duration
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
SkipUntil<TSource>(IObservable<TSource>, DateTimeOffset)
Skips elements from the observable source sequence until the specified start time.
Declaration
public static IObservable<TSource> SkipUntil<TSource>(this IObservable<TSource> source, DateTimeOffset startTime)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to skip elements for. |
DateTimeOffset | startTime | 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. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements skipped until the specified start time. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the startTime
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SkipUntil<TSource>(IObservable<TSource>, DateTimeOffset, IScheduler)
Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers.
Declaration
public static IObservable<TSource> SkipUntil<TSource>(this IObservable<TSource> source, DateTimeOffset startTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to skip elements for. |
DateTimeOffset | startTime | 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. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements skipped until the specified start time. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the startTime
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SkipUntil<TSource, TOther>(IObservable<TSource>, IObservable<TOther>)
Returns the elements from the source observable sequence only after the other observable sequence produces an element.
Declaration
public static IObservable<TSource> SkipUntil<TSource, TOther>(this IObservable<TSource> source, IObservable<TOther> other)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to propagate elements for. |
IObservable<TOther> | other | Observable sequence that triggers propagation of elements of the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TOther | The type of the elements in the other sequence that indicates the end of skip behavior. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SkipWhile<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
Declaration
public static IObservable<TSource> SkipWhile<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to return elements from. |
Func<TSource, Boolean> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
IObservable<TSource> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SkipWhile<TSource>(IObservable<TSource>, Func<TSource, Int32, Boolean>)
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.
Declaration
public static IObservable<TSource> SkipWhile<TSource>(this IObservable<TSource> source, Func<TSource, int, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to return elements from. |
Func<TSource, Int32, Boolean> | predicate | A function to test each element for a condition; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | 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. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Start(Action)
Invokes the action asynchronously, surfacing the result through an observable sequence.
Declaration
public static IObservable<Unit> Start(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | Action to run asynchronously. |
Returns
Type | Description |
---|---|
IObservable<Unit> | An observable sequence exposing a Unit value upon completion of the action, or an exception. |
Remarks
- 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Start(Action, IScheduler)
Invokes the action asynchronously on the specified scheduler, surfacing the result through an observable sequence.
Declaration
public static IObservable<Unit> Start(Action action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action | action | Action to run asynchronously. |
IScheduler | scheduler | Scheduler to run the action on. |
Returns
Type | Description |
---|---|
IObservable<Unit> | An observable sequence exposing a Unit value upon completion of the action, or an exception. |
Remarks
- 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Start<TResult>(Func<TResult>)
Invokes the specified function asynchronously, surfacing the result through an observable sequence.
Declaration
public static IObservable<TResult> Start<TResult>(Func<TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TResult> | function | Function to run asynchronously. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence exposing the function's result value, or an exception. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result returned by the function. |
Remarks
- 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Start<TResult>(Func<TResult>, IScheduler)
Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence
Declaration
public static IObservable<TResult> Start<TResult>(Func<TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TResult> | function | Function to run asynchronously. |
IScheduler | scheduler | Scheduler to run the function on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence exposing the function's result value, or an exception. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result returned by the function. |
Remarks
- 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
StartAsync(Func<CancellationToken, Task>)
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.
Declaration
public static IObservable<Unit> StartAsync(Func<CancellationToken, Task> actionAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task> | actionAsync | Asynchronous action to run. |
Returns
Type | Description |
---|---|
IObservable<Unit> | An observable sequence exposing a Unit value upon completion of the action, or an exception. |
Remarks
- 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
StartAsync(Func<Task>)
Invokes the asynchronous action, surfacing the result through an observable sequence.
Declaration
public static IObservable<Unit> StartAsync(Func<Task> actionAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<Task> | actionAsync | Asynchronous action to run. |
Returns
Type | Description |
---|---|
IObservable<Unit> | An observable sequence exposing a Unit value upon completion of the action, or an exception. |
Remarks
- 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
StartAsync<TResult>(Func<CancellationToken, Task<TResult>>)
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.
Declaration
public static IObservable<TResult> StartAsync<TResult>(Func<CancellationToken, Task<TResult>> functionAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task<TResult>> | functionAsync | Asynchronous function to run. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence exposing the function's result value, or an exception. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result returned by the asynchronous function. |
Remarks
- 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
StartAsync<TResult>(Func<Task<TResult>>)
Invokes the asynchronous function, surfacing the result through an observable sequence.
Declaration
public static IObservable<TResult> StartAsync<TResult>(Func<Task<TResult>> functionAsync)
Parameters
Type | Name | Description |
---|---|---|
Func<Task<TResult>> | functionAsync | Asynchronous function to run. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence exposing the function's result value, or an exception. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result returned by the asynchronous function. |
Remarks
- 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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
StartWith<TSource>(IObservable<TSource>, TSource[])
Prepends a sequence of values to an observable sequence.
Declaration
public static IObservable<TSource> StartWith<TSource>(this IObservable<TSource> source, params TSource[] values)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to prepend values to. |
TSource[] | values | Values to prepend to the specified sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence prepended with the specified values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
StartWith<TSource>(IObservable<TSource>, IEnumerable<TSource>)
Prepends a sequence of values to an observable sequence.
Declaration
public static IObservable<TSource> StartWith<TSource>(this IObservable<TSource> source, IEnumerable<TSource> values)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to prepend values to. |
IEnumerable<TSource> | values | Values to prepend to the specified sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence prepended with the specified values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
StartWith<TSource>(IObservable<TSource>, IScheduler, TSource[])
Prepends a sequence of values to an observable sequence.
Declaration
public static IObservable<TSource> StartWith<TSource>(this IObservable<TSource> source, IScheduler scheduler, params TSource[] values)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to prepend values to. |
IScheduler | scheduler | Scheduler to emit the prepended values on. |
TSource[] | values | Values to prepend to the specified sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence prepended with the specified values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
StartWith<TSource>(IObservable<TSource>, IScheduler, IEnumerable<TSource>)
Prepends a sequence of values to an observable sequence.
Declaration
public static IObservable<TSource> StartWith<TSource>(this IObservable<TSource> source, IScheduler scheduler, IEnumerable<TSource> values)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to prepend values to. |
IScheduler | scheduler | Scheduler to emit the prepended values on. |
IEnumerable<TSource> | values | Values to prepend to the specified sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence prepended with the specified values. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Subscribe<TSource>(IEnumerable<TSource>, IObserver<TSource>)
Subscribes an observer to an enumerable sequence.
Declaration
public static IDisposable Subscribe<TSource>(this IEnumerable<TSource> source, IObserver<TSource> observer)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TSource> | source | Enumerable sequence to subscribe to. |
IObserver<TSource> | observer | Observer that will receive notifications from the enumerable sequence. |
Returns
Type | Description |
---|---|
IDisposable | Disposable object that can be used to unsubscribe the observer from the enumerable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Subscribe<TSource>(IEnumerable<TSource>, IObserver<TSource>, IScheduler)
Subscribes an observer to an enumerable sequence, using the specified scheduler to run the enumeration loop.
Declaration
public static IDisposable Subscribe<TSource>(this IEnumerable<TSource> source, IObserver<TSource> observer, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TSource> | source | Enumerable sequence to subscribe to. |
IObserver<TSource> | observer | Observer that will receive notifications from the enumerable sequence. |
IScheduler | scheduler | Scheduler to perform the enumeration on. |
Returns
Type | Description |
---|---|
IDisposable | Disposable object that can be used to unsubscribe the observer from the enumerable |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SubscribeOn<TSource>(IObservable<TSource>, IScheduler)
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.
Declaration
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
IScheduler | scheduler | Scheduler to perform subscription and unsubscription actions on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer callbacks on a scheduler, use ObserveOn<TSource>(IObservable<TSource>, IScheduler).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SubscribeOn<TSource>(IObservable<TSource>, SynchronizationContext)
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.
Declaration
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, SynchronizationContext context)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
SynchronizationContext | context | Synchronization context to perform subscription and unsubscription actions on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence whose subscriptions and unsubscriptions happen on the specified synchronization context. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
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 ObserveOn<TSource>(IObservable<TSource>, SynchronizationContext).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Sum(IObservable<Decimal>)
Computes the sum of a sequence of Decimal values.
Declaration
public static IObservable<decimal> Sum(this IObservable<decimal> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Decimal> | source | A sequence of Decimal values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Decimal> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Sum(IObservable<Double>)
Computes the sum of a sequence of Double values.
Declaration
public static IObservable<double> Sum(this IObservable<double> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Double> | source | A sequence of Double values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Sum(IObservable<Int32>)
Computes the sum of a sequence of Int32 values.
Declaration
public static IObservable<int> Sum(this IObservable<int> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Int32> | source | A sequence of Int32 values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Int32> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Sum(IObservable<Int64>)
Computes the sum of a sequence of Int64 values.
Declaration
public static IObservable<long> Sum(this IObservable<long> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Int64> | source | A sequence of Int64 values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Sum(IObservable<Nullable<Decimal>>)
Computes the sum of a sequence of nullable Decimal values.
Declaration
public static IObservable<decimal?> Sum(this IObservable<decimal?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Decimal>> | source | A sequence of nullable Decimal values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Decimal>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Sum(IObservable<Nullable<Double>>)
Computes the sum of a sequence of nullable Double values.
Declaration
public static IObservable<double?> Sum(this IObservable<double?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Double>> | source | A sequence of nullable Double values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Sum(IObservable<Nullable<Int32>>)
Computes the sum of a sequence of nullable Int32 values.
Declaration
public static IObservable<int?> Sum(this IObservable<int?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Int32>> | source | A sequence of nullable Int32 values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int32>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Sum(IObservable<Nullable<Int64>>)
Computes the sum of a sequence of nullable Int64 values.
Declaration
public static IObservable<long?> Sum(this IObservable<long?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Int64>> | source | A sequence of nullable Int64 values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int64>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the elements in the source sequence is larger than MaxValue. |
Sum(IObservable<Nullable<Single>>)
Computes the sum of a sequence of nullable Single values.
Declaration
public static IObservable<float?> Sum(this IObservable<float?> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Nullable<Single>> | source | A sequence of nullable Single values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Single>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Sum(IObservable<Single>)
Computes the sum of a sequence of Single values.
Declaration
public static IObservable<float> Sum(this IObservable<float> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Single> | source | A sequence of Single values to calculate the sum of. |
Returns
Type | Description |
---|---|
IObservable<Single> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Sum<TSource>(IObservable<TSource>, Func<TSource, Decimal>)
Computes the sum of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<decimal> Sum<TSource>(this IObservable<TSource> source, Func<TSource, decimal> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Decimal> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Decimal> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Sum<TSource>(IObservable<TSource>, Func<TSource, Double>)
Computes the sum of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<double> Sum<TSource>(this IObservable<TSource> source, Func<TSource, double> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Double> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Double> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Sum<TSource>(IObservable<TSource>, Func<TSource, Int32>)
Computes the sum of a sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<int> Sum<TSource>(this IObservable<TSource> source, Func<TSource, int> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Int32> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Int32> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Sum<TSource>(IObservable<TSource>, Func<TSource, Int64>)
Computes the sum of a sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<long> Sum<TSource>(this IObservable<TSource> source, Func<TSource, long> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Int64> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Sum<TSource>(IObservable<TSource>, Func<TSource, Nullable<Decimal>>)
Computes the sum of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<decimal?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, decimal?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Nullable<Decimal>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Decimal>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Sum<TSource>(IObservable<TSource>, Func<TSource, Nullable<Double>>)
Computes the sum of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<double?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, double?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Nullable<Double>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Double>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Sum<TSource>(IObservable<TSource>, Func<TSource, Nullable<Int32>>)
Computes the sum of a sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<int?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, int?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Nullable<Int32>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int32>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Sum<TSource>(IObservable<TSource>, Func<TSource, Nullable<Int64>>)
Computes the sum of a sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<long?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, long?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Nullable<Int64>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Int64>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
OverflowException | (Asynchronous) The sum of the projected values for the elements in the source sequence is larger than MaxValue. |
Sum<TSource>(IObservable<TSource>, Func<TSource, Nullable<Single>>)
Computes the sum of a sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<float?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, float?> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Nullable<Single>> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Nullable<Single>> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Sum<TSource>(IObservable<TSource>, Func<TSource, Single>)
Computes the sum of a sequence of Single values that are obtained by invoking a transform function on each element of the input sequence.
Declaration
public static IObservable<float> Sum<TSource>(this IObservable<TSource> source, Func<TSource, float> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence of values that are used to calculate a sum. |
Func<TSource, Single> | selector | A transform function to apply to each element. |
Returns
Type | Description |
---|---|
IObservable<Single> | An observable sequence containing a single element with the sum of the values in the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Switch<TSource>(IObservable<IObservable<TSource>>)
Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. Each time a new inner observable sequence is received, unsubscribe from the previous inner observable sequence.
Declaration
public static IObservable<TSource> Switch<TSource>(this IObservable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<IObservable<TSource>> | sources | Observable sequence of inner observable sequences. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Switch<TSource>(IObservable<Task<TSource>>)
Transforms an observable sequence of tasks into an observable sequence producing values only from the most recent observable sequence. Each time a new task is received, the previous task's result is ignored.
Declaration
public static IObservable<TSource> Switch<TSource>(this IObservable<Task<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Task<TSource>> | sources | Observable sequence of tasks. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence that at any point in time produces the result of the most recent task that has been received. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the results produced by the source tasks. |
Remarks
If the tasks support cancellation, consider manual conversion of the tasks using FromAsync<TResult>(Func<CancellationToken, Task<TResult>>), followed by a switch operation using Switch<TSource>(IObservable<IObservable<TSource>>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Synchronize<TSource>(IObservable<TSource>)
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.
Declaration
public static IObservable<TSource> Synchronize<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence whose outgoing calls to observers are synchronized. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Synchronize<TSource>(IObservable<TSource>, Object)
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.
Declaration
public static IObservable<TSource> Synchronize<TSource>(this IObservable<TSource> source, object gate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Object | gate | Gate object to synchronize each observer call on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence whose outgoing calls to observers are synchronized on the given gate object. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Take<TSource>(IObservable<TSource>, Int32)
Returns a specified number of contiguous elements from the start of an observable sequence.
Declaration
public static IObservable<TSource> Take<TSource>(this IObservable<TSource> source, int count)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | The sequence to take elements from. |
Int32 | count | The number of elements to return. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the specified number of elements from the start of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Take<TSource>(IObservable<TSource>, Int32, IScheduler)
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).
Declaration
public static IObservable<TSource> Take<TSource>(this IObservable<TSource> source, int count, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | The sequence to take elements from. |
Int32 | count | The number of elements to return. |
IScheduler | scheduler | Scheduler used to produce an OnCompleted message in case |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the specified number of elements from the start of the input sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Take<TSource>(IObservable<TSource>, TimeSpan)
Takes elements for the specified duration from the start of the observable source sequence.
Declaration
public static IObservable<TSource> Take<TSource>(this IObservable<TSource> source, TimeSpan duration)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to take elements from. |
TimeSpan | duration | Duration for taking elements from the start of the sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements taken during the specified duration from the start of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Specifying a TimeSpan.Zero value for duration
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Take<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
Declaration
public static IObservable<TSource> Take<TSource>(this IObservable<TSource> source, TimeSpan duration, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to take elements from. |
TimeSpan | duration | Duration for taking elements from the start of the sequence. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements taken during the specified duration from the start of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
Specifying a TimeSpan.Zero value for duration
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TakeLast<TSource>(IObservable<TSource>, Int32)
Returns a specified number of contiguous elements from the end of an observable sequence.
Declaration
public static IObservable<TSource> TakeLast<TSource>(this IObservable<TSource> source, int count)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Int32 | count | Number of elements to take from the end of the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing the specified number of elements from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a buffer with a length enough to store elements count
elements. Upon completion of
the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TakeLast<TSource>(IObservable<TSource>, Int32, IScheduler)
Returns a specified number of contiguous elements from the end of an observable sequence, using the specified scheduler to drain the queue.
Declaration
public static IObservable<TSource> TakeLast<TSource>(this IObservable<TSource> source, int count, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Int32 | count | Number of elements to take from the end of the source sequence. |
IScheduler | scheduler | Scheduler used to drain the queue upon completion of the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing the specified number of elements from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a buffer with a length enough to store elements count
elements. Upon completion of
the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TakeLast<TSource>(IObservable<TSource>, TimeSpan)
Returns elements within the specified duration from the end of the observable source sequence.
Declaration
public static IObservable<TSource> TakeLast<TSource>(this IObservable<TSource> source, TimeSpan duration)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to take elements from. |
TimeSpan | duration | Duration for taking elements from the end of the sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements taken during the specified duration from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a buffer with a length enough to store elements for any duration
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 duration
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TakeLast<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
Returns elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
Declaration
public static IObservable<TSource> TakeLast<TSource>(this IObservable<TSource> source, TimeSpan duration, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to take elements from. |
TimeSpan | duration | Duration for taking elements from the end of the sequence. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements taken during the specified duration from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a buffer with a length enough to store elements for any duration
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 duration
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TakeLast<TSource>(IObservable<TSource>, TimeSpan, IScheduler, 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.
Declaration
public static IObservable<TSource> TakeLast<TSource>(this IObservable<TSource> source, TimeSpan duration, IScheduler timerScheduler, IScheduler loopScheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to take elements from. |
TimeSpan | duration | Duration for taking elements from the end of the sequence. |
IScheduler | timerScheduler | Scheduler to run the timer on. |
IScheduler | loopScheduler | Scheduler to drain the collected elements. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements taken during the specified duration from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a buffer with a length enough to store elements for any duration
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 duration
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TakeLastBuffer<TSource>(IObservable<TSource>, Int32)
Returns a list with the specified number of contiguous elements from the end of an observable sequence.
Declaration
public static IObservable<IList<TSource>> TakeLastBuffer<TSource>(this IObservable<TSource> source, int count)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence. |
Int32 | count | Number of elements to take from the end of the source sequence. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing a single list with the specified number of elements from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a buffer with a length enough to store count
elements. Upon completion of the
source sequence, this buffer is produced on the result sequence.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TakeLastBuffer<TSource>(IObservable<TSource>, TimeSpan)
Returns a list with the elements within the specified duration from the end of the observable source sequence.
Declaration
public static IObservable<IList<TSource>> TakeLastBuffer<TSource>(this IObservable<TSource> source, TimeSpan duration)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to take elements from. |
TimeSpan | duration | Duration for taking elements from the end of the sequence. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing a single list with the elements taken during the specified duration from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a buffer with a length enough to store elements for any duration
window during the lifetime of
the source sequence. Upon completion of the source sequence, this buffer is produced on the result sequence.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TakeLastBuffer<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
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.
Declaration
public static IObservable<IList<TSource>> TakeLastBuffer<TSource>(this IObservable<TSource> source, TimeSpan duration, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to take elements from. |
TimeSpan | duration | Duration for taking elements from the end of the sequence. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing a single list with the elements taken during the specified duration from the end of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator accumulates a buffer with a length enough to store elements for any duration
window during the lifetime of
the source sequence. Upon completion of the source sequence, this buffer is produced on the result sequence.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TakeUntil<TSource>(IObservable<TSource>, DateTimeOffset)
Takes elements for the specified duration until the specified end time.
Declaration
public static IObservable<TSource> TakeUntil<TSource>(this IObservable<TSource> source, DateTimeOffset endTime)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to take elements from. |
DateTimeOffset | endTime | 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. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements taken until the specified end time. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TakeUntil<TSource>(IObservable<TSource>, DateTimeOffset, IScheduler)
Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers.
Declaration
public static IObservable<TSource> TakeUntil<TSource>(this IObservable<TSource> source, DateTimeOffset endTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to take elements from. |
DateTimeOffset | endTime | 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. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence with the elements taken until the specified end time. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TakeUntil<TSource, TOther>(IObservable<TSource>, IObservable<TOther>)
Returns the elements from the source observable sequence until the other observable sequence produces an element.
Declaration
public static IObservable<TSource> TakeUntil<TSource, TOther>(this IObservable<TSource> source, IObservable<TOther> other)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to propagate elements for. |
IObservable<TOther> | other | Observable sequence that terminates propagation of elements of the source sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TOther | The type of the elements in the other sequence that indicates the end of take behavior. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TakeWhile<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Returns elements from an observable sequence as long as a specified condition is true.
Declaration
public static IObservable<TSource> TakeWhile<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence to return elements from. |
Func<TSource, Boolean> | predicate | A function to test each element for a condition. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TakeWhile<TSource>(IObservable<TSource>, Func<TSource, Int32, Boolean>)
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.
Declaration
public static IObservable<TSource> TakeWhile<TSource>(this IObservable<TSource> source, Func<TSource, int, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | A sequence to return elements from. |
Func<TSource, Int32, Boolean> | predicate | A function to test each element for a condition; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Then<TSource, TResult>(IObservable<TSource>, Func<TSource, TResult>)
Matches when the observable sequence has an available element and projects the element by invoking the selector function.
Declaration
public static Plan<TResult> Then<TSource, TResult>(this IObservable<TSource> source, Func<TSource, TResult> selector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Observable sequence to apply the selector on. |
Func<TSource, TResult> | selector | Selector that will be invoked for elements in the source sequence. |
Returns
Type | Description |
---|---|
Plan<TResult> | Plan that produces the projected results, to be fed (with other plans) to the When operator. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Throttle<TSource>(IObservable<TSource>, TimeSpan)
Ignores elements from an observable sequence which are followed by another element within a specified relative time duration.
Declaration
public static IObservable<TSource> Throttle<TSource>(this IObservable<TSource> source, TimeSpan dueTime)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to throttle. |
TimeSpan | dueTime | Throttling duration for each element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The throttled sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator throttles the source sequence by holding on to each element for the duration specified in dueTime
. 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 dueTime
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 dueTime
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Throttle<TSource>(IObservable<TSource>, TimeSpan, IScheduler)
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.
Declaration
public static IObservable<TSource> Throttle<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to throttle. |
TimeSpan | dueTime | Throttling duration for each element. |
IScheduler | scheduler | Scheduler to run the throttle timers on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The throttled sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
This operator throttles the source sequence by holding on to each element for the duration specified in dueTime
. 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 dueTime
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 dueTime
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Throttle<TSource, TThrottle>(IObservable<TSource>, Func<TSource, IObservable<TThrottle>>)
Ignores elements from an observable sequence which are followed by another value within a computed throttle duration.
Declaration
public static IObservable<TSource> Throttle<TSource, TThrottle>(this IObservable<TSource> source, Func<TSource, IObservable<TThrottle>> throttleDurationSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to throttle. |
Func<TSource, IObservable<TThrottle>> | throttleDurationSelector | Selector function to retrieve a sequence indicating the throttle duration for each given element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The throttled sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TThrottle | The type of the elements in the throttle sequences selected for each element in the source sequence. |
Remarks
This operator throttles the source sequence by holding on to each element for the duration denoted by throttleDurationSelector
.
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 throttleDurationSelector
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Throw<TResult>(Exception)
Returns an observable sequence that terminates with an exception.
Declaration
public static IObservable<TResult> Throw<TResult>(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Exception object used for the sequence's termination. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence that terminates exceptionally with the specified exception object. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Throw<TResult>(Exception, TResult)
Returns an observable sequence that terminates with an exception.
Declaration
public static IObservable<TResult> Throw<TResult>(Exception exception, TResult witness)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Exception object used for the sequence's termination. |
TResult | witness | Object solely used to infer the type of the |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence that terminates exceptionally with the specified exception object. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Throw<TResult>(Exception, IScheduler)
Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single OnError message.
Declaration
public static IObservable<TResult> Throw<TResult>(Exception exception, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Exception object used for the sequence's termination. |
IScheduler | scheduler | Scheduler to send the exceptional termination call on. |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence that terminates exceptionally with the specified exception object. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Throw<TResult>(Exception, IScheduler, TResult)
Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single OnError message.
Declaration
public static IObservable<TResult> Throw<TResult>(Exception exception, IScheduler scheduler, TResult witness)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Exception object used for the sequence's termination. |
IScheduler | scheduler | Scheduler to send the exceptional termination call on. |
TResult | witness | Object solely used to infer the type of the |
Returns
Type | Description |
---|---|
IObservable<TResult> | The observable sequence that terminates exceptionally with the specified exception object. |
Type Parameters
Name | Description |
---|---|
TResult | The type used for the IObservable<T> type parameter of the resulting sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TimeInterval<TSource>(IObservable<TSource>)
Records the time interval between consecutive elements in an observable sequence.
Declaration
public static IObservable<TimeInterval<TSource>> TimeInterval<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to record time intervals for. |
Returns
Type | Description |
---|---|
IObservable<TimeInterval<TSource>> | An observable sequence with time interval information on elements. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TimeInterval<TSource>(IObservable<TSource>, IScheduler)
Records the time interval between consecutive elements in an observable sequence, using the specified scheduler to compute time intervals.
Declaration
public static IObservable<TimeInterval<TSource>> TimeInterval<TSource>(this IObservable<TSource> source, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to record time intervals for. |
IScheduler | scheduler | Scheduler used to compute time intervals. |
Returns
Type | Description |
---|---|
IObservable<TimeInterval<TSource>> | An observable sequence with time interval information on elements. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timeout<TSource>(IObservable<TSource>, 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, a TimeoutException is propagated to the observer.
Declaration
public static IObservable<TSource> Timeout<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
DateTimeOffset | dueTime | Time when a timeout occurs. If this value is less than or equal to DateTimeOffset.UtcNow, the timeout occurs immediately. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with a TimeoutException in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
In case you only want to timeout on the first element, consider using the Amb<TSource>(IObservable<TSource>, IObservable<TSource>) operator applied to the source sequence and a delayed Throw<TResult>(Exception) sequence. Alternatively, the general-purpose overload of Timeout, Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>) can be used.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TimeoutException | (Asynchronous) If the sequence hasn't terminated before |
Timeout<TSource>(IObservable<TSource>, DateTimeOffset, IObservable<TSource>)
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.
Declaration
public static IObservable<TSource> Timeout<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime, IObservable<TSource> other)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
DateTimeOffset | dueTime | Time when a timeout occurs. If this value is less than or equal to DateTimeOffset.UtcNow, the timeout occurs immediately. |
IObservable<TSource> | other | Sequence to return in case of a timeout. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence switching to the other sequence in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and the other sequence used upon a timeout. |
Remarks
In case you only want to timeout on the first element, consider using the Amb<TSource>(IObservable<TSource>, IObservable<TSource>) operator applied to the source sequence and a delayed Throw<TResult>(Exception) sequence. Alternatively, the general-purpose overload of Timeout, Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>) can be used.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timeout<TSource>(IObservable<TSource>, DateTimeOffset, IObservable<TSource>, 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, the other observable sequence is used to produce future messages from that point on.
Declaration
public static IObservable<TSource> Timeout<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime, IObservable<TSource> other, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
DateTimeOffset | dueTime | Time when a timeout occurs. If this value is less than or equal to DateTimeOffset.UtcNow, the timeout occurs immediately. |
IObservable<TSource> | other | Sequence to return in case of a timeout. |
IScheduler | scheduler | Scheduler to run the timeout timers on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence switching to the other sequence in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and the other sequence used upon a timeout. |
Remarks
In case you only want to timeout on the first element, consider using the Amb<TSource>(IObservable<TSource>, IObservable<TSource>) operator applied to the source sequence and a delayed Throw<TResult>(Exception) sequence. Alternatively, the general-purpose overload of Timeout, Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>) can be used.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timeout<TSource>(IObservable<TSource>, DateTimeOffset, 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.
Declaration
public static IObservable<TSource> Timeout<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
DateTimeOffset | dueTime | Time when a timeout occurs. If this value is less than or equal to DateTimeOffset.UtcNow, the timeout occurs immediately. |
IScheduler | scheduler | Scheduler to run the timeout timers on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with a TimeoutException in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
In case you only want to timeout on the first element, consider using the Amb<TSource>(IObservable<TSource>, IObservable<TSource>) operator applied to the source sequence and a delayed Throw<TResult>(Exception) sequence. Alternatively, the general-purpose overload of Timeout, Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>) can be used.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TimeoutException | (Asynchronous) If the sequence hasn't terminated before |
Timeout<TSource>(IObservable<TSource>, 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, a TimeoutException is propagated to the observer.
Declaration
public static IObservable<TSource> Timeout<TSource>(this IObservable<TSource> source, TimeSpan dueTime)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
TimeSpan | dueTime | Maximum duration between values before a timeout occurs. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with a TimeoutException in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
In case you only want to timeout on the first element, consider using the Amb<TSource>(IObservable<TSource>, IObservable<TSource>) operator applied to the source sequence and a delayed Throw<TResult>(Exception) sequence. Alternatively, the general-purpose overload of Timeout, Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>) can be used.
Specifying a TimeSpan.Zero value for dueTime
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TimeoutException | (Asynchronous) If no element is produced within |
Timeout<TSource>(IObservable<TSource>, TimeSpan, IObservable<TSource>)
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.
Declaration
public static IObservable<TSource> Timeout<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IObservable<TSource> other)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
TimeSpan | dueTime | Maximum duration between values before a timeout occurs. |
IObservable<TSource> | other | Sequence to return in case of a timeout. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence switching to the other sequence in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and the other sequence used upon a timeout. |
Remarks
In case you only want to timeout on the first element, consider using the Amb<TSource>(IObservable<TSource>, IObservable<TSource>) operator applied to the source sequence and a delayed Throw<TResult>(Exception) sequence. Alternatively, the general-purpose overload of Timeout, Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>) can be used.
Specifying a TimeSpan.Zero value for dueTime
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Timeout<TSource>(IObservable<TSource>, TimeSpan, IObservable<TSource>, 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, the other observable sequence is used to produce future messages from that point on.
Declaration
public static IObservable<TSource> Timeout<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IObservable<TSource> other, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
TimeSpan | dueTime | Maximum duration between values before a timeout occurs. |
IObservable<TSource> | other | Sequence to return in case of a timeout. |
IScheduler | scheduler | Scheduler to run the timeout timers on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence switching to the other sequence in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and the other sequence used upon a timeout. |
Remarks
In case you only want to timeout on the first element, consider using the Amb<TSource>(IObservable<TSource>, IObservable<TSource>) operator applied to the source sequence and a delayed Throw<TResult>(Exception) sequence. Alternatively, the general-purpose overload of Timeout, Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>) can be used.
Specifying a TimeSpan.Zero value for dueTime
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Timeout<TSource>(IObservable<TSource>, TimeSpan, 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.
Declaration
public static IObservable<TSource> Timeout<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
TimeSpan | dueTime | Maximum duration between values before a timeout occurs. |
IScheduler | scheduler | Scheduler to run the timeout timers on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with a TimeoutException in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
In case you only want to timeout on the first element, consider using the Amb<TSource>(IObservable<TSource>, IObservable<TSource>) operator applied to the source sequence and a delayed Throw<TResult>(Exception) sequence. Alternatively, the general-purpose overload of Timeout, Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>) can be used.
Specifying a TimeSpan.Zero value for dueTime
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
TimeoutException | (Asynchronous) If no element is produced within |
Timeout<TSource, TTimeout>(IObservable<TSource>, Func<TSource, IObservable<TTimeout>>)
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.
Declaration
public static IObservable<TSource> Timeout<TSource, TTimeout>(this IObservable<TSource> source, Func<TSource, IObservable<TTimeout>> timeoutDurationSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
Func<TSource, IObservable<TTimeout>> | timeoutDurationSelector | Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with a TimeoutException in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TTimeout | The type of the elements in the timeout sequences used to indicate the timeout duration for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timeout<TSource, TTimeout>(IObservable<TSource>, Func<TSource, IObservable<TTimeout>>, IObservable<TSource>)
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.
Declaration
public static IObservable<TSource> Timeout<TSource, TTimeout>(this IObservable<TSource> source, Func<TSource, IObservable<TTimeout>> timeoutDurationSelector, IObservable<TSource> other)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
Func<TSource, IObservable<TTimeout>> | timeoutDurationSelector | Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. |
IObservable<TSource> | other | Sequence to return in case of a timeout. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence switching to the other sequence in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and the other sequence used upon a timeout. |
TTimeout | The type of the elements in the timeout sequences used to indicate the timeout duration for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>)
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.
Declaration
public static IObservable<TSource> Timeout<TSource, TTimeout>(this IObservable<TSource> source, IObservable<TTimeout> firstTimeout, Func<TSource, IObservable<TTimeout>> timeoutDurationSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
IObservable<TTimeout> | firstTimeout | Observable sequence that represents the timeout for the first element. |
Func<TSource, IObservable<TTimeout>> | timeoutDurationSelector | Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence with a TimeoutException in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TTimeout | The type of the elements in the timeout sequences used to indicate the timeout duration for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timeout<TSource, TTimeout>(IObservable<TSource>, IObservable<TTimeout>, Func<TSource, IObservable<TTimeout>>, IObservable<TSource>)
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.
Declaration
public static IObservable<TSource> Timeout<TSource, TTimeout>(this IObservable<TSource> source, IObservable<TTimeout> firstTimeout, Func<TSource, IObservable<TTimeout>> timeoutDurationSelector, IObservable<TSource> other)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to perform a timeout for. |
IObservable<TTimeout> | firstTimeout | Observable sequence that represents the timeout for the first element. |
Func<TSource, IObservable<TTimeout>> | timeoutDurationSelector | Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. |
IObservable<TSource> | other | Sequence to return in case of a timeout. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The source sequence switching to the other sequence in case of a timeout. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence and the other sequence used upon a timeout. |
TTimeout | The type of the elements in the timeout sequences used to indicate the timeout duration for each element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timer(DateTimeOffset)
Returns an observable sequence that produces a single value at the specified absolute due time.
Declaration
public static IObservable<long> Timer(DateTimeOffset dueTime)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | dueTime | 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. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value at due time. |
Timer(DateTimeOffset, IScheduler)
Returns an observable sequence that produces a single value at the specified absolute due time, using the specified scheduler to run the timer.
Declaration
public static IObservable<long> Timer(DateTimeOffset dueTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | dueTime | 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. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value at due time. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timer(DateTimeOffset, TimeSpan)
Returns an observable sequence that periodically produces a value starting at the specified initial absolute due time.
Declaration
public static IObservable<long> Timer(DateTimeOffset dueTime, TimeSpan period)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | dueTime | 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. |
TimeSpan | period | Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value at due time and then after each period. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Timer(DateTimeOffset, TimeSpan, IScheduler)
Returns an observable sequence that periodically produces a value starting at the specified initial absolute due time, using the specified scheduler to run timers.
Declaration
public static IObservable<long> Timer(DateTimeOffset dueTime, TimeSpan period, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | dueTime | 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. |
TimeSpan | period | Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. |
IScheduler | scheduler | Scheduler to run timers on. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value at due time and then after each period. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
ArgumentNullException |
|
Timer(TimeSpan)
Returns an observable sequence that produces a single value after the specified relative due time has elapsed.
Declaration
public static IObservable<long> Timer(TimeSpan dueTime)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | dueTime | 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. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value after the due time has elapsed. |
Timer(TimeSpan, 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.
Declaration
public static IObservable<long> Timer(TimeSpan dueTime, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | dueTime | 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. |
IScheduler | scheduler | Scheduler to run the timer on. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value after the due time has elapsed. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timer(TimeSpan, TimeSpan)
Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed.
Declaration
public static IObservable<long> Timer(TimeSpan dueTime, TimeSpan period)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | dueTime | 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. |
TimeSpan | period | Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value after due time has elapsed and then after each period. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Timer(TimeSpan, TimeSpan, IScheduler)
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.
Declaration
public static IObservable<long> Timer(TimeSpan dueTime, TimeSpan period, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | dueTime | 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. |
TimeSpan | period | Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. |
IScheduler | scheduler | Scheduler to run timers on. |
Returns
Type | Description |
---|---|
IObservable<Int64> | An observable sequence that produces a value after due time has elapsed and then each period. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
ArgumentNullException |
|
Timestamp<TSource>(IObservable<TSource>)
Timestamps each element in an observable sequence using the local system clock.
Declaration
public static IObservable<Timestamped<TSource>> Timestamp<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to timestamp elements for. |
Returns
Type | Description |
---|---|
IObservable<Timestamped<TSource>> | An observable sequence with timestamp information on elements. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Timestamp<TSource>(IObservable<TSource>, IScheduler)
Timestamp each element in an observable sequence using the clock of the specified scheduler.
Declaration
public static IObservable<Timestamped<TSource>> Timestamp<TSource>(this IObservable<TSource> source, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to timestamp elements for. |
IScheduler | scheduler | Scheduler used to compute timestamps. |
Returns
Type | Description |
---|---|
IObservable<Timestamped<TSource>> | An observable sequence with timestamp information on elements. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToArray<TSource>(IObservable<TSource>)
Creates an array from an observable sequence.
Declaration
public static IObservable<TSource[]> ToArray<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | The source observable sequence to get an array of elements for. |
Returns
Type | Description |
---|---|
IObservable<TSource[]> | An observable sequence containing a single element with an array containing all the elements of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync(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.
Declaration
public static Func<IObservable<Unit>> ToAsync(this Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<IObservable<Unit>> | Asynchronous action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync(Action, 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 specified scheduler.
Declaration
public static Func<IObservable<Unit>> ToAsync(this Action action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<IObservable<Unit>> | Asynchronous action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1>(Action<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.
Declaration
public static Func<TArg1, IObservable<Unit>> ToAsync<TArg1>(this Action<TArg1> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1>(Action<TArg1>, 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 specified scheduler.
Declaration
public static Func<TArg1, IObservable<Unit>> ToAsync<TArg1>(this Action<TArg1> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TResult>(Func<TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<IObservable<TResult>> ToAsync<TResult>(this Func<TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TResult>(Func<TResult>, IScheduler)
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.
Declaration
public static Func<IObservable<TResult>> ToAsync<TResult>(this Func<TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
TArg13 | The type of the thirteenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
TArg13 | The type of the thirteenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
TArg13 | The type of the thirteenth argument passed to the action. |
TArg14 | The type of the fourteenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
TArg13 | The type of the thirteenth argument passed to the action. |
TArg14 | The type of the fourteenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TArg13 | The type of the thirteenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TArg13 | The type of the thirteenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
TArg13 | The type of the thirteenth argument passed to the action. |
TArg14 | The type of the fourteenth argument passed to the action. |
TArg15 | The type of the fifteenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
TArg13 | The type of the thirteenth argument passed to the action. |
TArg14 | The type of the fourteenth argument passed to the action. |
TArg15 | The type of the fifteenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TArg13 | The type of the thirteenth argument passed to the function. |
TArg14 | The type of the fourteenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TArg13 | The type of the thirteenth argument passed to the function. |
TArg14 | The type of the fourteenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, 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 default scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
TArg13 | The type of the thirteenth argument passed to the action. |
TArg14 | The type of the fourteenth argument passed to the action. |
TArg15 | The type of the fifteenth argument passed to the action. |
TArg16 | The type of the sixteenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
TArg10 | The type of the tenth argument passed to the action. |
TArg11 | The type of the eleventh argument passed to the action. |
TArg12 | The type of the twelfth argument passed to the action. |
TArg13 | The type of the thirteenth argument passed to the action. |
TArg14 | The type of the fourteenth argument passed to the action. |
TArg15 | The type of the fifteenth argument passed to the action. |
TArg16 | The type of the sixteenth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TArg13 | The type of the thirteenth argument passed to the function. |
TArg14 | The type of the fourteenth argument passed to the function. |
TArg15 | The type of the fifteenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TArg13 | The type of the thirteenth argument passed to the function. |
TArg14 | The type of the fourteenth argument passed to the function. |
TArg15 | The type of the fifteenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TArg13 | The type of the thirteenth argument passed to the function. |
TArg14 | The type of the fourteenth argument passed to the function. |
TArg15 | The type of the fifteenth argument passed to the function. |
TArg16 | The type of the sixteenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TArg15, TArg16, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TArg9 | The type of the ninth argument passed to the function. |
TArg10 | The type of the tenth argument passed to the function. |
TArg11 | The type of the eleventh argument passed to the function. |
TArg12 | The type of the twelfth argument passed to the function. |
TArg13 | The type of the thirteenth argument passed to the function. |
TArg14 | The type of the fourteenth argument passed to the function. |
TArg15 | The type of the fifteenth argument passed to the function. |
TArg16 | The type of the sixteenth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2>(Action<TArg1, 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.
Declaration
public static Func<TArg1, TArg2, IObservable<Unit>> ToAsync<TArg1, TArg2>(this Action<TArg1, TArg2> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2>(Action<TArg1, TArg2>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, IObservable<Unit>> ToAsync<TArg1, TArg2>(this Action<TArg1, TArg2> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TResult>(Func<TArg1, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, IObservable<TResult>> ToAsync<TArg1, TResult>(this Func<TArg1, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TResult>(Func<TArg1, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, IObservable<TResult>> ToAsync<TArg1, TResult>(this Func<TArg1, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3>(Action<TArg1, TArg2, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3>(this Action<TArg1, TArg2, TArg3> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3>(Action<TArg1, TArg2, TArg3>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3>(this Action<TArg1, TArg2, TArg3> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TResult>(Func<TArg1, TArg2, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, IObservable<TResult>> ToAsync<TArg1, TArg2, TResult>(this Func<TArg1, TArg2, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TResult>(Func<TArg1, TArg2, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, IObservable<TResult>> ToAsync<TArg1, TArg2, TResult>(this Func<TArg1, TArg2, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4>(Action<TArg1, TArg2, TArg3, 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 default scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4>(this Action<TArg1, TArg2, TArg3, TArg4> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4>(Action<TArg1, TArg2, TArg3, TArg4>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4>(this Action<TArg1, TArg2, TArg3, TArg4> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TResult>(Func<TArg1, TArg2, TArg3, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TResult>(this Func<TArg1, TArg2, TArg3, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TResult>(Func<TArg1, TArg2, TArg3, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TResult>(this Func<TArg1, TArg2, TArg3, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5>(Action<TArg1, TArg2, TArg3, TArg4, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5>(Action<TArg1, TArg2, TArg3, TArg4, TArg5>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, 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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9> action)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9> | action | Action to convert to an asynchronous action. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>(Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>, 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 specified scheduler.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<Unit>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>(this Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9> action, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Action<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9> | action | Action to convert to an asynchronous action. |
IScheduler | scheduler | Scheduler to invoke the original action on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<Unit>> | Asynchronous action. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the action. |
TArg2 | The type of the second argument passed to the action. |
TArg3 | The type of the third argument passed to the action. |
TArg4 | The type of the fourth argument passed to the action. |
TArg5 | The type of the fifth argument passed to the action. |
TArg6 | The type of the sixth argument passed to the action. |
TArg7 | The type of the seventh argument passed to the action. |
TArg8 | The type of the eighth argument passed to the action. |
TArg9 | The type of the ninth argument passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>)
Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult> function)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult> | function | Function to convert to an asynchronous function. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>, IScheduler)
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.
Declaration
public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<TResult>> ToAsync<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>(this Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult> function, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult> | function | Function to convert to an asynchronous function. |
IScheduler | scheduler | Scheduler to invoke the original function on. |
Returns
Type | Description |
---|---|
Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<TResult>> | Asynchronous function. |
Type Parameters
Name | Description |
---|---|
TArg1 | The type of the first argument passed to the function. |
TArg2 | The type of the second argument passed to the function. |
TArg3 | The type of the third argument passed to the function. |
TArg4 | The type of the fourth argument passed to the function. |
TArg5 | The type of the fifth argument passed to the function. |
TArg6 | The type of the sixth argument passed to the function. |
TArg7 | The type of the seventh argument passed to the function. |
TArg8 | The type of the eighth argument passed to the function. |
TResult | The type of the result returned by the function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToDictionary<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>)
Creates a dictionary from an observable sequence according to a specified key selector function.
Declaration
public static IObservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to create a dictionary for. |
Func<TSource, TKey> | keySelector | A function to extract a key from each element. |
Returns
Type | Description |
---|---|
IObservable<IDictionary<TKey, TSource>> | An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the dictionary key computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToDictionary<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>)
Creates a dictionary from an observable sequence according to a specified key selector function, and a comparer.
Declaration
public static IObservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to create a dictionary for. |
Func<TSource, TKey> | keySelector | A function to extract a key from each element. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys. |
Returns
Type | Description |
---|---|
IObservable<IDictionary<TKey, TSource>> | An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the dictionary key computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToDictionary<TSource, TKey, TElement>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>)
Creates a dictionary from an observable sequence according to a specified key selector function, and an element selector function.
Declaration
public static IObservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to create a dictionary for. |
Func<TSource, TKey> | keySelector | A function to extract a key from each element. |
Func<TSource, TElement> | elementSelector | A transform function to produce a result element value from each element. |
Returns
Type | Description |
---|---|
IObservable<IDictionary<TKey, TElement>> | An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the dictionary key computed for each element in the source sequence. |
TElement | The type of the dictionary value computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToDictionary<TSource, TKey, TElement>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, IEqualityComparer<TKey>)
Creates a dictionary from an observable sequence according to a specified key selector function, a comparer, and an element selector function.
Declaration
public static IObservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to create a dictionary for. |
Func<TSource, TKey> | keySelector | A function to extract a key from each element. |
Func<TSource, TElement> | elementSelector | A transform function to produce a result element value from each element. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys. |
Returns
Type | Description |
---|---|
IObservable<IDictionary<TKey, TElement>> | An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the dictionary key computed for each element in the source sequence. |
TElement | The type of the dictionary value computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToEnumerable<TSource>(IObservable<TSource>)
Converts an observable sequence to an enumerable sequence.
Declaration
public static IEnumerable<TSource> ToEnumerable<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to convert to an enumerable sequence. |
Returns
Type | Description |
---|---|
IEnumerable<TSource> | The enumerable sequence containing the elements in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToEvent(IObservable<Unit>)
Exposes an observable sequence as an object with an Action-based .NET event.
Declaration
public static IEventSource<Unit> ToEvent(this IObservable<Unit> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<Unit> | source | Observable source sequence. |
Returns
Type | Description |
---|---|
IEventSource<Unit> | The event source object. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToEvent<TSource>(IObservable<TSource>)
Exposes an observable sequence as an object with an Action<TSource>-based .NET event.
Declaration
public static IEventSource<TSource> ToEvent<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Observable source sequence. |
Returns
Type | Description |
---|---|
IEventSource<TSource> | The event source object. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToEventPattern<TEventArgs>(IObservable<EventPattern<TEventArgs>>)
Exposes an observable sequence as an object with a .NET event, conforming to the standard .NET event pattern.
Declaration
public static IEventPatternSource<TEventArgs> ToEventPattern<TEventArgs>(this IObservable<EventPattern<TEventArgs>> source)
where TEventArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
IObservable<EventPattern<TEventArgs>> | source | Observable source sequence. |
Returns
Type | Description |
---|---|
IEventPatternSource<TEventArgs> | The event source object. |
Type Parameters
Name | Description |
---|---|
TEventArgs | The type of the event data generated by the event. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToList<TSource>(IObservable<TSource>)
Creates a list from an observable sequence.
Declaration
public static IObservable<IList<TSource>> ToList<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | The source observable sequence to get a list of elements for. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing a single element with a list containing all the elements of the source sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToLookup<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>)
Creates a lookup from an observable sequence according to a specified key selector function.
Declaration
public static IObservable<ILookup<TKey, TSource>> ToLookup<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to create a lookup for. |
Func<TSource, TKey> | keySelector | A function to extract a key from each element. |
Returns
Type | Description |
---|---|
IObservable<ILookup<TKey, TSource>> | An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the lookup key computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToLookup<TSource, TKey>(IObservable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>)
Creates a lookup from an observable sequence according to a specified key selector function, and a comparer.
Declaration
public static IObservable<ILookup<TKey, TSource>> ToLookup<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to create a lookup for. |
Func<TSource, TKey> | keySelector | A function to extract a key from each element. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys. |
Returns
Type | Description |
---|---|
IObservable<ILookup<TKey, TSource>> | An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the lookup key computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToLookup<TSource, TKey, TElement>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>)
Creates a lookup from an observable sequence according to a specified key selector function, and an element selector function.
Declaration
public static IObservable<ILookup<TKey, TElement>> ToLookup<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to create a lookup for. |
Func<TSource, TKey> | keySelector | A function to extract a key from each element. |
Func<TSource, TElement> | elementSelector | A transform function to produce a result element value from each element. |
Returns
Type | Description |
---|---|
IObservable<ILookup<TKey, TElement>> | An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the lookup key computed for each element in the source sequence. |
TElement | The type of the lookup value computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToLookup<TSource, TKey, TElement>(IObservable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, IEqualityComparer<TKey>)
Creates a lookup from an observable sequence according to a specified key selector function, a comparer, and an element selector function.
Declaration
public static IObservable<ILookup<TKey, TElement>> ToLookup<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence to create a lookup for. |
Func<TSource, TKey> | keySelector | A function to extract a key from each element. |
Func<TSource, TElement> | elementSelector | A transform function to produce a result element value from each element. |
IEqualityComparer<TKey> | comparer | An equality comparer to compare keys. |
Returns
Type | Description |
---|---|
IObservable<ILookup<TKey, TElement>> | An observable sequence containing a single element with a lookup mapping unique key values onto the corresponding source sequence's elements. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the lookup key computed for each element in the source sequence. |
TElement | The type of the lookup value computed for each element in the source sequence. |
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToObservable<TSource>(IEnumerable<TSource>)
Converts an enumerable sequence to an observable sequence.
Declaration
public static IObservable<TSource> ToObservable<TSource>(this IEnumerable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TSource> | source | Enumerable sequence to convert to an observable sequence. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence whose elements are pulled from the given enumerable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToObservable<TSource>(IEnumerable<TSource>, IScheduler)
Converts an enumerable sequence to an observable sequence, using the specified scheduler to run the enumeration loop.
Declaration
public static IObservable<TSource> ToObservable<TSource>(this IEnumerable<TSource> source, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TSource> | source | Enumerable sequence to convert to an observable sequence. |
IScheduler | scheduler | Scheduler to run the enumeration of the input sequence on. |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence whose elements are pulled from the given enumerable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Using<TResult, TResource>(Func<TResource>, Func<TResource, IObservable<TResult>>)
Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
Declaration
public static IObservable<TResult> Using<TResult, TResource>(Func<TResource> resourceFactory, Func<TResource, IObservable<TResult>> observableFactory)
where TResource : IDisposable
Parameters
Type | Name | Description |
---|---|---|
Func<TResource> | resourceFactory | Factory function to obtain a resource object. |
Func<TResource, IObservable<TResult>> | observableFactory | Factory function to obtain an observable sequence that depends on the obtained resource. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose lifetime controls the lifetime of the dependent resource object. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
TResource | The type of the resource used during the generation of the resulting sequence. Needs to implement IDisposable. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Using<TResult, TResource>(Func<CancellationToken, Task<TResource>>, Func<TResource, CancellationToken, Task<IObservable<TResult>>>)
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.
Declaration
public static IObservable<TResult> Using<TResult, TResource>(Func<CancellationToken, Task<TResource>> resourceFactoryAsync, Func<TResource, CancellationToken, Task<IObservable<TResult>>> observableFactoryAsync)
where TResource : IDisposable
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task<TResource>> | resourceFactoryAsync | Asynchronous factory function to obtain a resource object. |
Func<TResource, CancellationToken, Task<IObservable<TResult>>> | observableFactoryAsync | Asynchronous factory function to obtain an observable sequence that depends on the obtained resource. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence whose lifetime controls the lifetime of the dependent resource object. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the produced sequence. |
TResource | The type of the resource used during the generation of the resulting sequence. Needs to implement IDisposable. |
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Wait<TSource>(IObservable<TSource>)
Waits for the observable sequence to complete and returns the last element of the sequence. If the sequence terminates with an OnError notification, the exception is throw.
Declaration
public static TSource Wait<TSource>(this IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source observable sequence. |
Returns
Type | Description |
---|---|
TSource | The last element in the observable sequence. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
InvalidOperationException | The source sequence is empty. |
When<TResult>(IEnumerable<Plan<TResult>>)
Joins together the results from several patterns.
Declaration
public static IObservable<TResult> When<TResult>(this IEnumerable<Plan<TResult>> plans)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Plan<TResult>> | plans | A series of plans created by use of the Then operator on patterns. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence with the results form matching several patterns. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the result sequence, obtained from the specified patterns. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
When<TResult>(Plan<TResult>[])
Joins together the results from several patterns.
Declaration
public static IObservable<TResult> When<TResult>(params Plan<TResult>[] plans)
Parameters
Type | Name | Description |
---|---|---|
Plan<TResult>[] | plans | A series of plans created by use of the Then operator on patterns. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence with the results from matching several patterns. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the elements in the result sequence, obtained from the specified patterns. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Where<TSource>(IObservable<TSource>, Func<TSource, Boolean>)
Filters the elements of an observable sequence based on a predicate.
Declaration
public static IObservable<TSource> Where<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to filter. |
Func<TSource, Boolean> | predicate | A function to test each source element for a condition. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains elements from the input sequence that satisfy the condition. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Where<TSource>(IObservable<TSource>, Func<TSource, Int32, Boolean>)
Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
Declaration
public static IObservable<TSource> Where<TSource>(this IObservable<TSource> source, Func<TSource, int, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | An observable sequence whose elements to filter. |
Func<TSource, Int32, Boolean> | predicate | A function to test each source element for a conditio; the second parameter of the function represents the index of the source element. |
Returns
Type | Description |
---|---|
IObservable<TSource> | An observable sequence that contains elements from the input sequence that satisfy the condition. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
While<TSource>(Func<Boolean>, IObservable<TSource>)
Repeats the given source
as long as the specified condition
holds, where the condition
is evaluated before each repeated source
is subscribed to.
Declaration
public static IObservable<TSource> While<TSource>(Func<bool> condition, IObservable<TSource> source)
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | condition | Condition that will be evaluated before subscription to the |
IObservable<TSource> | source | Source to repeat as long as the |
Returns
Type | Description |
---|---|
IObservable<TSource> | The observable sequence obtained by concatenating the |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Window<TSource>(IObservable<TSource>, Int32)
Projects each element of an observable sequence into consecutive non-overlapping windows which are produced based on element count information.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource>(this IObservable<TSource> source, int count)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
Int32 | count | Length of each window. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Window<TSource>(IObservable<TSource>, Int32, Int32)
Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource>(this IObservable<TSource> source, int count, int skip)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
Int32 | count | Length of each window. |
Int32 | skip | Number of elements to skip between creation of consecutive windows. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Window<TSource>(IObservable<TSource>, TimeSpan)
Projects each element of an observable sequence into consecutive non-overlapping windows which are produced based on timing information.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource>(this IObservable<TSource> source, TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
TimeSpan | timeSpan | Length of each window. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | The sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Window<TSource>(IObservable<TSource>, TimeSpan, Int32)
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.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, int count)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
TimeSpan | timeSpan | Maximum time length of a window. |
Int32 | count | Maximum element count of a window. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Window<TSource>(IObservable<TSource>, TimeSpan, Int32, IScheduler)
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.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, int count, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
TimeSpan | timeSpan | Maximum time length of a window. |
Int32 | count | Maximum element count of a window. |
IScheduler | scheduler | Scheduler to run windowing timers on. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Window<TSource>(IObservable<TSource>, TimeSpan, 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.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
TimeSpan | timeSpan | Length of each window. |
IScheduler | scheduler | Scheduler to run windowing timers on. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Window<TSource>(IObservable<TSource>, TimeSpan, TimeSpan)
Projects each element of an observable sequence into zero or more windows which are produced based on timing information.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, TimeSpan timeShift)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
TimeSpan | timeSpan | Length of each window. |
TimeSpan | timeShift | Interval between creation of consecutive windows. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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 timeShift
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Window<TSource>(IObservable<TSource>, TimeSpan, TimeSpan, IScheduler)
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.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, TimeSpan timeShift, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
TimeSpan | timeSpan | Length of each window. |
TimeSpan | timeShift | Interval between creation of consecutive windows. |
IScheduler | scheduler | Scheduler to run windowing timers on. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
Remarks
Specifying a TimeSpan.Zero value for timeSpan
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 timeShift
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Window<TSource, TWindowClosing>(IObservable<TSource>, Func<IObservable<TWindowClosing>>)
Projects each element of an observable sequence into consecutive non-overlapping windows.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource, TWindowClosing>(this IObservable<TSource> source, Func<IObservable<TWindowClosing>> windowClosingSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
Func<IObservable<TWindowClosing>> | windowClosingSelector | A function invoked to define the boundaries of the produced windows. A new window is started when the previous one is closed. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
TWindowClosing | The type of the elements in the sequences indicating window closing events. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Window<TSource, TWindowBoundary>(IObservable<TSource>, IObservable<TWindowBoundary>)
Projects each element of an observable sequence into consecutive non-overlapping windows.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource, TWindowBoundary>(this IObservable<TSource> source, IObservable<TWindowBoundary> windowBoundaries)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
IObservable<TWindowBoundary> | windowBoundaries | Sequence of window boundary markers. The current window is closed and a new window is opened upon receiving a boundary marker. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
TWindowBoundary | The type of the elements in the sequences indicating window boundary events. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Window<TSource, TWindowOpening, TWindowClosing>(IObservable<TSource>, IObservable<TWindowOpening>, Func<TWindowOpening, IObservable<TWindowClosing>>)
Projects each element of an observable sequence into zero or more windows.
Declaration
public static IObservable<IObservable<TSource>> Window<TSource, TWindowOpening, TWindowClosing>(this IObservable<TSource> source, IObservable<TWindowOpening> windowOpenings, Func<TWindowOpening, IObservable<TWindowClosing>> windowClosingSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource> | source | Source sequence to produce windows over. |
IObservable<TWindowOpening> | windowOpenings | Observable sequence whose elements denote the creation of new windows. |
Func<TWindowOpening, IObservable<TWindowClosing>> | windowClosingSelector | A function invoked to define the closing of each produced window. |
Returns
Type | Description |
---|---|
IObservable<IObservable<TSource>> | An observable sequence of windows. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequence, and in the windows in the result sequence. |
TWindowOpening | 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. |
TWindowClosing | The type of the elements in the sequences indicating window closing events. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource>(IEnumerable<IObservable<TSource>>)
Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
Declaration
public static IObservable<IList<TSource>> Zip<TSource>(this IEnumerable<IObservable<TSource>> sources)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Observable sources. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing lists of elements at corresponding indexes. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences, and in the lists in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource>(IObservable<TSource>[])
Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
Declaration
public static IObservable<IList<TSource>> Zip<TSource>(params IObservable<TSource>[] sources)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource>[] | sources | Observable sources. |
Returns
Type | Description |
---|---|
IObservable<IList<TSource>> | An observable sequence containing lists of elements at corresponding indexes. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences, and in the lists in the result sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, IObservable<TSource13>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, IObservable<TSource13> source13, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
IObservable<TSource13> | source13 | Thirteenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TSource13 | The type of the elements in the thirteenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, IObservable<TSource13>, IObservable<TSource14>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, IObservable<TSource13> source13, IObservable<TSource14> source14, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
IObservable<TSource13> | source13 | Thirteenth observable source. |
IObservable<TSource14> | source14 | Fourteenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TSource13 | The type of the elements in the thirteenth source sequence. |
TSource14 | The type of the elements in the fourteenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, IObservable<TSource13>, IObservable<TSource14>, IObservable<TSource15>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, IObservable<TSource13> source13, IObservable<TSource14> source14, IObservable<TSource15> source15, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
IObservable<TSource13> | source13 | Thirteenth observable source. |
IObservable<TSource14> | source14 | Fourteenth observable source. |
IObservable<TSource15> | source15 | Fifteenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TSource13 | The type of the elements in the thirteenth source sequence. |
TSource14 | The type of the elements in the fourteenth source sequence. |
TSource15 | The type of the elements in the fifteenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, IObservable<TSource9>, IObservable<TSource10>, IObservable<TSource11>, IObservable<TSource12>, IObservable<TSource13>, IObservable<TSource14>, IObservable<TSource15>, IObservable<TSource16>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, IObservable<TSource9> source9, IObservable<TSource10> source10, IObservable<TSource11> source11, IObservable<TSource12> source12, IObservable<TSource13> source13, IObservable<TSource14> source14, IObservable<TSource15> source15, IObservable<TSource16> source16, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
IObservable<TSource9> | source9 | Ninth observable source. |
IObservable<TSource10> | source10 | Tenth observable source. |
IObservable<TSource11> | source11 | Eleventh observable source. |
IObservable<TSource12> | source12 | Twelfth observable source. |
IObservable<TSource13> | source13 | Thirteenth observable source. |
IObservable<TSource14> | source14 | Fourteenth observable source. |
IObservable<TSource15> | source15 | Fifteenth observable source. |
IObservable<TSource16> | source16 | Sixteenth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TSource9, TSource10, TSource11, TSource12, TSource13, TSource14, TSource15, TSource16, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TSource9 | The type of the elements in the ninth source sequence. |
TSource10 | The type of the elements in the tenth source sequence. |
TSource11 | The type of the elements in the eleventh source sequence. |
TSource12 | The type of the elements in the twelfth source sequence. |
TSource13 | The type of the elements in the thirteenth source sequence. |
TSource14 | The type of the elements in the fourteenth source sequence. |
TSource15 | The type of the elements in the fifteenth source sequence. |
TSource16 | The type of the elements in the sixteenth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource, TResult>(IEnumerable<IObservable<TSource>>, Func<IList<TSource>, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource, TResult>(this IEnumerable<IObservable<TSource>> sources, Func<IList<TSource>, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IObservable<TSource>> | sources | Observable sources. |
Func<IList<TSource>, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the elements in the source sequences. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TResult>(IObservable<TSource1>, IEnumerable<TSource2>, Func<TSource1, TSource2, TResult>)
Merges an observable sequence and an enumerable sequence into one observable sequence by using the selector function.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TResult>(this IObservable<TSource1> first, IEnumerable<TSource2> second, Func<TSource1, TSource2, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | first | First observable source. |
IEnumerable<TSource2> | second | Second enumerable source. |
Func<TSource1, TSource2, TResult> | resultSelector | Function to invoke for each consecutive pair of elements from the first and second source. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first observable source sequence. |
TSource2 | The type of the elements in the second enumerable source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TResult>(IObservable<TSource1>, IObservable<TSource2>, Func<TSource1, TSource2, TResult>)
Merges two observable sequences into one observable sequence by combining their elements in a pairwise fashion.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TResult>(this IObservable<TSource1> first, IObservable<TSource2> second, Func<TSource1, TSource2, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | first | First observable source. |
IObservable<TSource2> | second | Second observable source. |
Func<TSource1, TSource2, TResult> | resultSelector | Function to invoke for each consecutive pair of elements from the first and second source. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of pairwise combining the elements of the first and second source using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, Func<TSource1, TSource2, TSource3, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, Func<TSource1, TSource2, TSource3, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
Func<TSource1, TSource2, TSource3, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, Func<TSource1, TSource2, TSource3, TSource4, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, Func<TSource1, TSource2, TSource3, TSource4, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult>(IObservable<TSource1>, IObservable<TSource2>, IObservable<TSource3>, IObservable<TSource4>, IObservable<TSource5>, IObservable<TSource6>, IObservable<TSource7>, IObservable<TSource8>, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult>)
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.
Declaration
public static IObservable<TResult> Zip<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult>(this IObservable<TSource1> source1, IObservable<TSource2> source2, IObservable<TSource3> source3, IObservable<TSource4> source4, IObservable<TSource5> source5, IObservable<TSource6> source6, IObservable<TSource7> source7, IObservable<TSource8> source8, Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IObservable<TSource1> | source1 | First observable source. |
IObservable<TSource2> | source2 | Second observable source. |
IObservable<TSource3> | source3 | Third observable source. |
IObservable<TSource4> | source4 | Fourth observable source. |
IObservable<TSource5> | source5 | Fifth observable source. |
IObservable<TSource6> | source6 | Sixth observable source. |
IObservable<TSource7> | source7 | Seventh observable source. |
IObservable<TSource8> | source8 | Eighth observable source. |
Func<TSource1, TSource2, TSource3, TSource4, TSource5, TSource6, TSource7, TSource8, TResult> | resultSelector | Function to invoke for each series of elements at corresponding indexes in the sources. |
Returns
Type | Description |
---|---|
IObservable<TResult> | An observable sequence containing the result of combining elements of the sources using the specified result selector function. |
Type Parameters
Name | Description |
---|---|
TSource1 | The type of the elements in the first source sequence. |
TSource2 | The type of the elements in the second source sequence. |
TSource3 | The type of the elements in the third source sequence. |
TSource4 | The type of the elements in the fourth source sequence. |
TSource5 | The type of the elements in the fifth source sequence. |
TSource6 | The type of the elements in the sixth source sequence. |
TSource7 | The type of the elements in the seventh source sequence. |
TSource8 | The type of the elements in the eighth source sequence. |
TResult | The type of the elements in the result sequence, returned by the selector function. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|