Beispiel #1
0
 public Dispatcher(
     IServiceProvider serviceProvider,
     DispatcherContext context
     )
 {
     _serviceProvider = serviceProvider;
     _context         = context;
 }
Beispiel #2
0
 public static DispatcherContext AddHandler(this DispatcherContext context, string topic, Type handlerType)
 {
     if (!context.HandlersByTopic.ContainsKey(topic))
     {
         context.HandlersByTopic.Add(topic, new List <Type>());
     }
     if (!context.HandlersByTopic[topic].Contains(handlerType))
     {
         context.HandlersByTopic[topic].Add(handlerType);
     }
     return(context);
 }