示例#1
0
        /// <summary>
        /// A generic Arrow transforming incoming messages into outgoing messages.
        /// </summary>
        /// <param name="ArrowSender">The sender of the messages/objects.</param>
        /// <param name="Func">A generic transformation of incoming messages into outgoing messages.</param>
        /// <param name="Recipient">A recipient of the processed messages.</param>
        /// <param name="Recipients">Further recipients of the processed messages.</param>
        public static FuncArrow <TIn, TOutput> FuncArrow <TIn, TOutput>(this IArrowSender <TIn> ArrowSender, Func <TIn, TOutput> Func, IArrowReceiver <TOutput> Recipient, params IArrowReceiver <TOutput>[] Recipients)
        {
            var _FuncArrow = new FuncArrow <TIn, TOutput>(Func, Recipient, Recipients);

            ArrowSender.OnMessageAvailable += _FuncArrow.ReceiveMessage;
            return(_FuncArrow);
        }
示例#2
0
        /// <summary>
        /// A generic Arrow transforming incoming messages into outgoing messages.
        /// </summary>
        /// <param name="ArrowSender">The sender of the messages/objects.</param>
        /// <param name="Func">A generic transformation of incoming messages into outgoing messages.</param>
        public static FuncArrow <TIn, TOutput> FuncArrow <TIn, TOutput>(this IArrowSender <TIn> ArrowSender, Func <TIn, TOutput> Func)
        {
            var _FuncArrow = new FuncArrow <TIn, TOutput>(Func);

            ArrowSender.OnMessageAvailable += _FuncArrow.ReceiveMessage;
            return(_FuncArrow);
        }