Export (0) Print
Expand All

Observable.Generate(Of TState, TResult) Method (TState, Func(Of TState, Boolean), Func(Of TState, TState), Func(Of TState, TResult), Func(Of TState, TimeSpan))

Generates an observable sequence by iterating a state from an initial state until the condition fails.

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

'Declaration
Public Shared Function Generate(Of TState, TResult) ( _
	initialState As TState, _
	condition As Func(Of TState, Boolean), _
	iterate As Func(Of TState, TState), _
	resultSelector As Func(Of TState, TResult), _
	timeSelector As Func(Of TState, TimeSpan) _
) As IObservable(Of TResult)
'Usage
Dim initialState As TState
Dim condition As Func(Of TState, Boolean)
Dim iterate As Func(Of TState, TState)
Dim resultSelector As Func(Of TState, TResult)
Dim timeSelector As Func(Of TState, TimeSpan)
Dim returnValue As IObservable(Of TResult)

returnValue = Observable.Generate(initialState, _
	condition, iterate, resultSelector, _
	timeSelector)

Type Parameters

TState

The type of state.

TResult

The type of result.

Parameters

initialState
Type: TState
The initial state.
condition
Type: System.Func(Of TState, Boolean)
The condition to terminate generation.
iterate
Type: System.Func(Of TState, TState)
The iteration step function.
resultSelector
Type: System.Func(Of TState, TResult)
The selector function for results produced in the sequence.
timeSelector
Type: System.Func(Of TState, TimeSpan)
The time selector function to control the speed of values being produced each iteration.

Return Value

Type: System.IObservable(Of TResult)
The generated sequence.
Show:
© 2014 Microsoft