예제 #1
0
 public Dispatcher(
     IServiceProvider serviceProvider,
     DispatcherContext context
     )
 {
     _serviceProvider = serviceProvider;
     _context         = context;
 }
예제 #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);
 }