Beispiel #1
0
        public static IAsyncObservable <TResult> Generate <TState, TResult>(TState initialState, Func <TState, Task <bool> > condition, Func <TState, Task <TState> > iterate, Func <TState, Task <TResult> > resultSelector, Func <TState, Task <DateTimeOffset> > timeSelector, IAsyncScheduler scheduler)
        {
            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }
            if (iterate == null)
            {
                throw new ArgumentNullException(nameof(iterate));
            }
            if (resultSelector == null)
            {
                throw new ArgumentNullException(nameof(resultSelector));
            }
            if (timeSelector == null)
            {
                throw new ArgumentNullException(nameof(timeSelector));
            }
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }

            return(Create <TResult>(observer => AsyncObserver.Generate(observer, initialState, condition, iterate, resultSelector, timeSelector, scheduler)));
        }
Beispiel #2
0
        public static IAsyncObservable <TResult> Generate <TState, TResult>(TState initialState, Func <TState, bool> condition, Func <TState, TState> iterate, Func <TState, TResult> resultSelector)
        {
            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }
            if (iterate == null)
            {
                throw new ArgumentNullException(nameof(iterate));
            }
            if (resultSelector == null)
            {
                throw new ArgumentNullException(nameof(resultSelector));
            }

            return(Create <TResult>(observer => AsyncObserver.Generate(observer, initialState, condition, iterate, resultSelector)));
        }