public static AsyncObserverExpression <TSource> Then([NotNull] AsyncObserverExpression <TSource> left, [NotNull] AsyncObserverExpression <TSource> right)
        {
            Contract.NotNull(left, nameof(left));
            Contract.NotNull(right, nameof(right));

            if (left.m_handler != null)
            {
                var f = left.m_handler;
                if (right.m_handler != null)
                {
                    var g = right.m_handler;
                    return(new AsyncObserverExpression <TSource>((x) => { f(x); g(x); }));
                }
                else
                {
                    var g = right.m_asyncHandler;
                    return(new AsyncObserverExpression <TSource>((x, ct) => { f(x); return g(x, ct); }));
                }
            }
            else
            {
                var f = left.m_asyncHandler;
                if (right.m_asyncHandler != null)
                {
                    var g = right.m_asyncHandler;
                    return(new AsyncObserverExpression <TSource>(async(x, ct) => { await f(x, ct).ConfigureAwait(false); await g(x, ct).ConfigureAwait(false); }));
                }
                else
                {
                    var g = right.m_handler;
                    return(new AsyncObserverExpression <TSource>(async(x, ct) => { await f(x, ct).ConfigureAwait(false); g(x); }));
                }
            }
        }
예제 #2
0
 public AsyncObserverExpression <TSource> Then(AsyncObserverExpression <TSource> expr)
 {
     return(Then(this, expr));
 }