Exemplo n.º 1
0
        public void RegisterConversationHandler <TEvent>(IConversationHandler <TEvent> handler) where TEvent : IEvent
        {
            var eventDataType = typeof(TEvent);

            Action <IEvent> act = (evnt) => handler.Handle((TEvent)evnt);

            RegisterHandler(eventDataType, act);
        }
Exemplo n.º 2
0
 public AppStarter(
     IWelcomeMessageCreator welcomeMessageCreator,
     IConversationHandler conversationHandler,
     IRoboFactory roboFactory,
     IRoboService roboService)
 {
     this.welcomeMessageCreator = welcomeMessageCreator ?? throw new ArgumentNullException(nameof(welcomeMessageCreator));
     this.conversationHandler   = conversationHandler ?? throw new ArgumentNullException(nameof(conversationHandler));
     this.roboFactory           = roboFactory ?? throw new ArgumentNullException(nameof(roboFactory));
     this.roboService           = roboService ?? throw new ArgumentNullException(nameof(roboService));
 }
 public RoboService(IConversationHandler conversationHandler)
 {
     this.conversationHandler = conversationHandler ?? throw new ArgumentNullException(nameof(conversationHandler));
 }
Exemplo n.º 4
0
 public WelcomeMessageCreator(IConversationHandler conversationHandler)
 {
     this.conversationHandler = conversationHandler ?? throw new ArgumentNullException(nameof(conversationHandler));
 }