Ejemplo n.º 1
0
        /// <summary>
        /// Filters the consuming objects by calling a Func&lt;S, Boolean&gt;.
        /// </summary>
        /// <param name="ArrowSender">The sender of the messages/objects.</param>
        /// <param name="FilterFunc">A Func&lt;S, Boolean&gt; filtering the consuming objects. True means filter (ignore).</param>
        /// <param name="Recipient">A recipient of the processed messages.</param>
        /// <param name="Recipients">Further recipients of the processed messages.</param>
        public static FuncFilterArrow <TMessage> FuncFilter <TMessage>(this IArrowSender <TMessage> ArrowSender, Func <TMessage, Boolean> FilterFunc, IArrowReceiver <TMessage> Recipient, params IArrowReceiver <TMessage>[] Recipients)
        {
            var _FuncFilterArrow = new FuncFilterArrow <TMessage>(FilterFunc, Recipient, Recipients);

            ArrowSender.OnMessageAvailable += _FuncFilterArrow.ReceiveMessage;
            return(_FuncFilterArrow);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Filters the consuming objects by calling a Func&lt;S, Boolean&gt;.
        /// </summary>
        /// <param name="ArrowSender">The sender of the messages/objects.</param>
        /// <param name="FilterFunc">A Func&lt;S, Boolean&gt; filtering the consuming objects. True means filter (ignore).</param>
        public static FuncFilterArrow <TMessage> FuncFilter <TMessage>(this IArrowSender <TMessage> ArrowSender, Func <TMessage, Boolean> FilterFunc)
        {
            var _FuncFilterArrow = new FuncFilterArrow <TMessage>(FilterFunc);

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