Ejemplo n.º 1
0
        public bool Inspect <TComponent, TMessage>(SelectedComponentMessageSink <TComponent, TMessage> sink)
            where TMessage : class
            where TComponent : class, Consumes <TMessage> .Selected
        {
            Append(string.Format("Conditionally Consumed by Component {0} ({1})", typeof(TComponent).FullName, typeof(TMessage).Name));

            return(true);
        }
        protected virtual UnsubscribeAction Connect <TComponent, TMessage>(ISubscriberContext context)
            where TMessage : class
            where TComponent : class, Consumes <TMessage> .Selected
        {
            var sink = new SelectedComponentMessageSink <TComponent, TMessage>(context);

            return(context.Pipeline.ConnectToRouter(sink, () => context.SubscribedTo <TMessage>()));
        }