public ChannelBase() { Services = ServiceLocatorBuilder.CreateServiceLocator(); Context = Services.Get <IChannelMethodContextProvider>().GetDefaultContext(); ChannelMessageWriter = Services.Get <IChannelMessageOutputWriter>(); _events = Services.Get <IChannelRedirectionEvents>(); }
public ChannelMethodInvoker() { _services = ServiceLocatorBuilder.CreateServiceLocator(); _channelMessageService = _services.Get <IChannelMessageService>(); _channelMessageWriter = _services.Get <IChannelMessageOutputWriter>(); _eventService = _services.Get <IChannelRedirectionEvents>(); _channelGenerator = _services.Get <IChannelGenerator>(); _heurCtx = _services.Get <IChannelHeuristicContext>(); Debug.Assert(_services != null); Debug.Assert(_channelMessageService != null); Debug.Assert(_channelMessageWriter != null); Debug.Assert(_eventService != null); Debug.Assert(_channelGenerator != null); Debug.Assert(_heurCtx != null); _channelMessageWriter.OnPostMessageServiceInvoked += _channelMessageWriter_OnPostMessageServiceInvoked; _eventService.OnRedirectionInvoked += _eventService_OnRedirectionInvoked; }