コード例 #1
0
        protected override Expression <Func <IReactiveProxy, Task> > VisitObserverOnCompletedCore <T>(ObserverOnCompleted <T> operation)
        {
            var binder            = new IdentityAwareBinder();
            var boundParameter    = binder.Bind(Expression.Parameter(typeof(IAsyncReactiveQbserver <T>), operation.TargetObjectUri.ToCanonicalString()));
            var thisParameter     = FreeVariableScanner.Scan(boundParameter).Single();
            var onCompletedMethod = boundParameter.Type.GetMethod("OnCompletedAsync");

            return(Expression.Lambda <Func <IReactiveProxy, Task> >(
                       Expression.Call(
                           boundParameter,
                           onCompletedMethod,
                           Expression.Constant(CancellationToken.None)),
                       thisParameter));
        }
コード例 #2
0
        protected override Expression <Func <IReactiveProxy, Task> > VisitCreateStream(CreateStream operation)
        {
            var binder      = new IdentityAwareBinder();
            var boundStream = (LambdaExpression)binder.BindStream(operation.Expression, operation.TargetObjectUri, operation.State, CancellationToken.None);
            var parameter   = boundStream.Parameters[0];

            return(Reduce(
                       Expression.Lambda <Func <IReactiveProxy, Task> >(
                           Expression.Convert(
                               boundStream.Body,
                               typeof(Task)
                               ),
                           parameter
                           )
                       ));
        }
コード例 #3
0
        protected override Expression <Func <IReactiveProxy, Task> > VisitDefineObserver(DefineObserver operation)
        {
            var binder = new IdentityAwareBinder();

            return(Reduce((Expression <Func <IReactiveProxy, Task> >)binder.BindObserver(operation.Expression, operation.TargetObjectUri, operation.State, CancellationToken.None)));
        }