Beispiel #1
0
        internal IReactiveQubscription Subscribe <T>(IReactiveQbservable <T> observable, IReactiveQbserver <T> observer, Uri subscriptionUri, object state)
        {
            var subscribe = Expression.Parameter(typeof(Func <IReactiveQbservable <T>, IReactiveQbserver <T>, IReactiveQubscription>), Constants.SubscribeUri);

            var observableExpression = observable.Expression;

            if (observableExpression.Type != typeof(IReactiveQbservable <T>) && observableExpression.NodeType == ExpressionType.Parameter)
            {
                observableExpression = Expression.Parameter(typeof(IReactiveQbservable <T>), ((ParameterExpression)observableExpression).Name);
            }

            var observerExpression = observer.Expression;

            if (observerExpression.Type != typeof(IReactiveQbserver <T>) && observerExpression.NodeType == ExpressionType.Parameter)
            {
                observerExpression = Expression.Parameter(typeof(IReactiveQbserver <T>), ((ParameterExpression)observerExpression).Name);
            }

            var expression = Expression.Invoke(subscribe, observableExpression, observerExpression);

            var normalized = ExpressionServices.Normalize(expression);

            var subscription = new KnownQubscription(normalized, subscriptionUri, this);

            CreateSubscription(subscription, state);

            return(subscription);
        }
 public static IReactiveQbservable <R> SelectMany <T, R>(this IReactiveQbservable <T> source, Expression <Func <T, IReactiveQbservable <R> > > resultSelector)
 {
     return(source.Provider.CreateQbservable <R>(
                Expression.Call(
                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(T), typeof(R)),
                    source.Expression,
                    resultSelector
                    )
                ));
 }
 public static IReactiveQbservable <T> Where <T>(this IReactiveQbservable <T> source, Expression <Func <T, bool> > predicate)
 {
     return(source.Provider.CreateQbservable <T>(
                Expression.Call(
                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(T)),
                    source.Expression,
                    predicate
                    )
                ));
 }
        /// <summary>
        /// Defines an observable identified by the specified URI.
        /// </summary>
        /// <typeparam name="T">Type of the data produced by the observable.</typeparam>
        /// <param name="uri">URI identifying the observable.</param>
        /// <param name="observable">Observable to be defined.</param>
        /// <param name="state">Additional metadata to associate with the artifact. Implementations can interpret this value, or ignore it.</param>
        public void DefineObservable <T>(Uri uri, IReactiveQbservable <T> observable, object state = null)
        {
            if (uri == null)
            {
                throw new ArgumentNullException(nameof(uri));
            }
            if (observable == null)
            {
                throw new ArgumentNullException(nameof(observable));
            }

            DefineObservableCore <T>(uri, observable, state);
        }
        public static IReactiveQbservable <T> SubscribeOnScheduler <T>(this IReactiveQbservable <T> source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            return(source.Provider.CreateQbservable <T>(
                       Expression.Call(
                           ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(T)),
                           source.Expression
                           )
                       ));
        }
 public static ISubscribable <T> ToSubscribable <T>(this IReactiveQbservable <T> source) => throw new NotImplementedException();
Beispiel #7
0
 public static IReactiveQubscription QuotedSubscribe <T>(this IReactiveQbservable <T> observable, IReactiveQbserver <T> observer)
 {
     throw new NotImplementedException();
 }
Beispiel #8
0
 public static IReactiveQbservable <T> CleanupSubscription <T>(this IReactiveQbservable <T> source)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Defines an observable identified by the specified URI.
 /// </summary>
 /// <typeparam name="T">Type of the data produced by the observable.</typeparam>
 /// <param name="uri">URI identifying the observable.</param>
 /// <param name="observable">Observable to be defined.</param>
 /// <param name="state">Additional metadata to associate with the artifact. Implementations can interpret this value, or ignore it.</param>
 protected abstract void DefineObservableCore <T>(Uri uri, IReactiveQbservable <T> observable, object state = null);
 public static IReactiveQbservable <TSource> SubscribeOnInternalScheduler <TSource>(this IReactiveQbservable <TSource> source)
 {
     throw new NotImplementedException();
 }
 public void DefineObservable <T>(Uri uri, IReactiveQbservable <T> observable, object state)
 {
     throw new NotImplementedException();
 }
Beispiel #12
0
        /// <summary>
        /// Defines an observable identified by the specified URI.
        /// </summary>
        /// <typeparam name="T">Type of the data produced by the observable.</typeparam>
        /// <param name="uri">URI identifying the observable.</param>
        /// <param name="observable">Observable to be defined.</param>
        /// <param name="state">Additional metadata to associate with the artifact. Implementations can interpret this value, or ignore it.</param>
        protected override void DefineObservableCore <T>(Uri uri, IReactiveQbservable <T> observable, object state = null)
        {
            var expression = _expressionServices.Normalize(observable.Expression);

            _provider.DefineObservable(uri, expression, state);
        }
 /// <summary>
 /// Defines an observable identified by the specified URI.
 /// </summary>
 /// <typeparam name="T">Type of the data produced by the observable.</typeparam>
 /// <param name="uri">URI identifying the observable.</param>
 /// <param name="observable">Observable to be defined.</param>
 /// <param name="state">Additional metadata to associate with the artifact. Implementations can interpret this value, or ignore it.</param>
 public void DefineObservable <T>(Uri uri, IReactiveQbservable <T> observable, object state = null) => Definition.DefineObservable(uri, observable, state);