コード例 #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);
        }
コード例 #2
0
 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
                    )
                ));
 }
コード例 #3
0
 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
                    )
                ));
 }
コード例 #4
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>
        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);
        }
コード例 #5
0
        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
                           )
                       ));
        }
コード例 #6
0
 public static ISubscribable <T> ToSubscribable <T>(this IReactiveQbservable <T> source) => throw new NotImplementedException();
コード例 #7
0
ファイル: HostOperators.cs プロジェクト: tamirdresher/reaqtor
 public static IReactiveQubscription QuotedSubscribe <T>(this IReactiveQbservable <T> observable, IReactiveQbserver <T> observer)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
ファイル: HostOperators.cs プロジェクト: tamirdresher/reaqtor
 public static IReactiveQbservable <T> CleanupSubscription <T>(this IReactiveQbservable <T> source)
 {
     throw new NotImplementedException();
 }
コード例 #9
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 abstract void DefineObservableCore <T>(Uri uri, IReactiveQbservable <T> observable, object state = null);
コード例 #10
0
 public static IReactiveQbservable <TSource> SubscribeOnInternalScheduler <TSource>(this IReactiveQbservable <TSource> source)
 {
     throw new NotImplementedException();
 }
コード例 #11
0
 public void DefineObservable <T>(Uri uri, IReactiveQbservable <T> observable, object state)
 {
     throw new NotImplementedException();
 }
コード例 #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);
        }
コード例 #13
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>
 public void DefineObservable <T>(Uri uri, IReactiveQbservable <T> observable, object state = null) => Definition.DefineObservable(uri, observable, state);