/// <summary> /// Adds a message provider to the listener and hooks up the MessageRaised event. /// </summary> /// <param name="provider"></param> public void AddProvider(IUserMessageGenerator provider) { if (m_generators.Contains(provider)) { return; } m_generators.Add(provider); provider.MessageRaised += provider_MessageRaised; }
/// <summary> /// Constructor /// </summary> /// <param name="outputHost">The output host the will process the message.</param> /// <param name="provider">The provider of the message to be processed</param> public MessageListener(IUserMessageOutputHost outputHost, IUserMessageGenerator generator) : this(outputHost) { AddProvider(generator); }