示例#1
0
        /// <summary>
        /// Monitors many streams (like window).
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="instance">The instance.</param>
        /// <param name="name">The name.</param>
        /// <param name="orderingBaseIndex">Index of the ordering base.</param>
        /// <param name="surrogateAction">The surrogate action.</param>
        /// <param name="serializationStrategy">The serialization strategy.</param>
        /// <param name="keywords">The keywords.</param>
        /// <returns></returns>
        public static IObservable <IObservable <T> > MonitorMany <T>(
            this IObservable <IObservable <T> > instance,
            string name,
            double orderingBaseIndex,
            Func <T, MarbleCandidate, object> surrogateAction,
            MarbleSerializationOptions serializationStrategy = MarbleSerializationOptions.ToString,
            params string[] keywords)
        {
            IMonitorSurrogate <T> surrogate = new FuncSurrogate <T>(surrogateAction, serializationStrategy);

            return(MonitorMany(instance, name, orderingBaseIndex, surrogate, keywords));
        }
示例#2
0
        /// <summary>
        /// Monitor ISubject stream
        /// </summary>
        /// <typeparam name="TIn">The type of the in.</typeparam>
        /// <typeparam name="TOut">The type of the out.</typeparam>
        /// <param name="instance">The instance.</param>
        /// <param name="name">The name.</param>
        /// <param name="orderingIndex">Index of the ordering.</param>
        /// <param name="surrogateAction">The surrogate action.</param>
        /// <param name="serializationStrategy">The serialization strategy.</param>
        /// <param name="keywords">The keywords.</param>
        /// <returns></returns>
        public static ISubject <TIn, TOut> Monitor <TIn, TOut>(
            this ISubject <TIn, TOut> instance,
            string name,
            double orderingIndex,
            Func <TOut, MarbleCandidate, object> surrogateAction,
            MarbleSerializationOptions serializationStrategy = MarbleSerializationOptions.ToString,
            params string[] keywords)
        {
            IMonitorSurrogate <TOut> surrogate = new FuncSurrogate <TOut>(surrogateAction, serializationStrategy);

            return(Monitor <TIn, TOut>(instance, name, orderingIndex, surrogate, keywords));
        }