/// <summary> /// Remove a handler. /// </summary> /// <param name="capture">The handler to remove. This must be the same object that was added previously.</param> /// <returns>Returns true if the handler was removed, false if it had not been added.</returns> public bool RemoveHandler(IrcCodeHandler capture) { lock (_captures) { return(_captures.Remove(capture)); } }
/// <summary> /// Add a handler to capture a specific IRC code. This can be called from components that issue a command and are expecting /// some result code to be sent in the future. /// </summary> /// <param name="capture">An object encapsulating the handler and its options.</param> /// <remarks> /// A handler can prevent other components from processing a message. For example, /// a component that retrieves the hostname of a user with the USERHOST command can handle the response to prevent a client /// from displaying the result. /// </remarks> public void AddHandler(IrcCodeHandler capture) { lock (_captures) { _captures.Add(capture); } }