,System.Func{--0,--0},System.Func{--0,--1})} ,System.Func{--0,--0},System.Func{--0,--1},System.Reactive.Concurrency.IScheduler)} ,System.Func{--0,--0},System.Func{--0,--1},System.Func{--0,System.TimeSpan})} ,System.Func{--0,--0},System.Func{--0,--1},System.Func{--0,System.TimeSpan},System.Reactive.Concurrency.IScheduler)} ,System.Func{--0,--0},System.Func{--0,--1},System.Func{--0,System.DateTimeOffset})} ,System.Func{--0,--0},System.Func{--0,--1},System.Func{--0,System.DateTimeOffset},System.Reactive.Concurrency.IScheduler)}
Observable.Generate(TState, Func, Func, Func) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector) - 2.
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector, IScheduler scheduler) - 3.
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) - 4.
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) - 5.
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) - 6.
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)
1. Overload¶
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector)
Summary: Generates an observable sequence by running a state-driven loop producing the sequence's elements.
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. |
Parameters
| Name | Type | Description |
|---|---|---|
initialState | TState | Initial state. |
condition | Func | Condition to terminate generation (upon returning false). |
iterate | Func | Iteration step function. |
resultSelector | Func | Selector function for results produced in the sequence. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or iterate or resultSelector is null. |
2. Overload¶
public static IObservable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector, IScheduler scheduler)
Summary: Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
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. |
Parameters
| Name | Type | Description |
|---|---|---|
initialState | TState | Initial state. |
condition | Func | Condition to terminate generation (upon returning false). |
iterate | Func | Iteration step function. |
resultSelector | Func | Selector function for results produced in the sequence. |
scheduler | [IScheduler](# | Scheduler on which to run the generator loop. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or iterate or resultSelector or scheduler is null. |
3. Overload¶
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)
Summary: Generates an observable sequence by running a state-driven and temporal loop producing the sequence's elements.
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. |
Parameters
| Name | Type | Description |
|---|---|---|
initialState | TState | Initial state. |
condition | Func | Condition to terminate generation (upon returning false). |
iterate | Func | Iteration step function. |
resultSelector | Func | Selector function for results produced in the sequence. |
timeSelector | Func | Time selector function to control the speed of values being produced each iteration. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or iterate or resultSelector or timeSelector is null. |
4. Overload¶
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)
Summary: 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.
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. |
Parameters
| Name | Type | Description |
|---|---|---|
initialState | TState | Initial state. |
condition | Func | Condition to terminate generation (upon returning false). |
iterate | Func | Iteration step function. |
resultSelector | Func | Selector function for results produced in the sequence. |
timeSelector | Func | Time selector function to control the speed of values being produced each iteration. |
scheduler | [IScheduler](# | Scheduler on which to run the generator loop. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or iterate or resultSelector or timeSelector or scheduler is null. |
5. Overload¶
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)
Summary: Generates an observable sequence by running a state-driven and temporal loop producing the sequence's elements.
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. |
Parameters
| Name | Type | Description |
|---|---|---|
initialState | TState | Initial state. |
condition | Func | Condition to terminate generation (upon returning false). |
iterate | Func | Iteration step function. |
resultSelector | Func | Selector function for results produced in the sequence. |
timeSelector | Func | Time selector function to control the speed of values being produced each iteration. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or iterate or resultSelector or timeSelector is null. |
6. Overload¶
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)
Summary: 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.
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. |
Parameters
| Name | Type | Description |
|---|---|---|
initialState | TState | Initial state. |
condition | Func | Condition to terminate generation (upon returning false). |
iterate | Func | Iteration step function. |
resultSelector | Func | Selector function for results produced in the sequence. |
timeSelector | Func | Time selector function to control the speed of values being produced each iteration. |
scheduler | [IScheduler](# | Scheduler on which to run the generator loop. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | condition or iterate or resultSelector or timeSelector or scheduler is null. |