コード例 #1
0
 public static UnsubscribeAction Subscribe <TMessage>(this IMessagePipeline pipeline, Action <TMessage> handler, Predicate <TMessage> acceptor)
     where TMessage : class
 {
     return(pipeline.Configure(x => x.Subscribe(handler, acceptor)));
 }
コード例 #2
0
 public static UnsubscribeAction Subscribe <TMessage>(this IMessagePipeline pipeline, Func <TMessage, Action <TMessage> > getHandler)
     where TMessage : class
 {
     return(pipeline.Configure(x => x.Subscribe <TMessage>(getHandler)));
 }
コード例 #3
0
 /// <summary>
 /// Subscribe a component to the pipeline that handles every message
 /// </summary>
 /// <typeparam name="TComponent"></typeparam>
 /// <param name="pipeline">The pipeline to configure</param>
 /// <param name="instance">The instance that will handle the messages</param>
 /// <returns></returns>
 public static UnsubscribeAction Subscribe <TComponent>(this IMessagePipeline pipeline, TComponent instance)
     where TComponent : class
 {
     return(pipeline.Configure(x => x.Subscribe(instance)));
 }