Esempio n. 1
0
        public static IQbservable <TResult> ForkJoin <TSource1, TSource2, TResult>(this IQbservable <TSource1> first, IObservable <TSource2> second, Expression <Func <TSource1, TSource2, TResult> > resultSelector)
        {
            if (first == null)
            {
                throw new ArgumentNullException(nameof(first));
            }
            if (second == null)
            {
                throw new ArgumentNullException(nameof(second));
            }
            if (resultSelector == null)
            {
                throw new ArgumentNullException(nameof(resultSelector));
            }

            return(first.Provider.CreateQuery <TResult>(
                       Expression.Call(
                           null,
#if CRIPPLED_REFLECTION
                           InfoOf(() => QbservableEx.ForkJoin <TSource1, TSource2, TResult>(default(IQbservable <TSource1>), default(IObservable <TSource2>), default(Expression <Func <TSource1, TSource2, TResult> >))),
#else
                           ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)),
#endif
                           first.Expression,
                           GetSourceExpression(second),
                           resultSelector
                           )
                       ));
        }
Esempio n. 2
0
        public static IQbservable <TSource[]> ForkJoin <TSource>(this IQbservableProvider provider, IEnumerable <IObservable <TSource> > sources)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }
            if (sources == null)
            {
                throw new ArgumentNullException(nameof(sources));
            }

            return(provider.CreateQuery <TSource[]>(
                       Expression.Call(
                           null,
#if CRIPPLED_REFLECTION
                           InfoOf(() => QbservableEx.ForkJoin <TSource>(default(IQbservableProvider), default(IEnumerable <IObservable <TSource> >))),
#else
                           ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
                           Expression.Constant(provider, typeof(IQbservableProvider)),
                           GetSourceExpression(sources)
                           )
                       ));
        }