Export (0) Print
Expand All

Observable.Zip<TFirst, TSecond, TResult> Method (IObservable<TFirst>, IObservable<TSecond>, Func<TFirst, TSecond, TResult>)

Merges two observable sequences into one observable sequence by combining their elements in a pairwise fashion.

Namespace:  System.Reactive.Linq
Assembly:  System.Reactive (in System.Reactive.dll)

public static IObservable<TResult> Zip<TFirst, TSecond, TResult>(
	this IObservable<TFirst> first,
	IObservable<TSecond> second,
	Func<TFirst, TSecond, TResult> resultSelector
)

Type Parameters

TFirst

The first type.

TSecond

The second type.

TResult

The type of result.

Parameters

first
Type: System.IObservable<TFirst>
The first observable source.
second
Type: System.IObservable<TSecond>
The second observable source.
resultSelector
Type: System.Func<TFirst, TSecond, TResult>
The function to invoke for each consecutive pair of elements from the first and second source.

Return Value

Type: System.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.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IObservable<TFirst>. When you use instance method syntax to call this method, omit the first parameter. For more information, see http://msdn.microsoft.com/en-us/library/bb384936.aspx or http://msdn.microsoft.com/en-us/library/bb383977.aspx.
Show:
© 2014 Microsoft