Observable.Generate < TState, TResult > 方法 (TState, Func TState, Boolean > , Func < TState, TState > , Func < TState, TResult > , Func << TState, DateTimeOffset >)
在條件失敗之前,從初始狀態逐一查看狀態,以產生可觀察的序列。
Namespace:System.Reactive.Linq
裝配: System.Reactive.dll) 中的 System.Reactive (
Syntax
'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, DateTimeOffset) _
) 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, DateTimeOffset)
Dim returnValue As IObservable(Of TResult)
returnValue = Observable.Generate(initialState, _
condition, iterate, resultSelector, _
timeSelector)
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
)
public:
generic<typename TState, typename TResult>
static IObservable<TResult>^ Generate(
TState initialState,
Func<TState, bool>^ condition,
Func<TState, TState>^ iterate,
Func<TState, TResult>^ resultSelector,
Func<TState, DateTimeOffset>^ timeSelector
)
static member Generate :
initialState:'TState *
condition:Func<'TState, bool> *
iterate:Func<'TState, 'TState> *
resultSelector:Func<'TState, 'TResult> *
timeSelector:Func<'TState, DateTimeOffset> -> IObservable<'TResult>
JScript does not support generic types and methods.
類型參數
- TState
狀態的類型。
- TResult
結果的類型。
參數
- initialState
類型:TState
初始狀態。
- condition (條件)
類型:System.Func< TState、布林值>
終止產生的條件。
- 逐一查看
類型:System.Func< TState、TState>
反復專案步驟函式。
- resultSelector
類型:System.Func< TState、TResult>
序列中產生結果的選取器函式。
- timeSelector
類型:System.Func< TState、DateTimeOffset>
時間選取器函式,可控制每次反復專案產生值的速度。
傳回值
類型:System.IObservable< TResult>
產生的序列。