Class EventHub
Hub for all events on IRC client that can be subscribed to
Inheritance
System.Object
EventHub
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GravyIrc
Assembly: GravyIrc.dll
Syntax
public class EventHub
Methods
| Improve this Doc View SourceSubscribe<TMessage>(IrcMessageEventHandler<TMessage>)
Subscribe to incoming messages
Declaration
public void Subscribe<TMessage>(IrcMessageEventHandler<TMessage> handler)
where TMessage : IrcMessage, IServerMessage
Parameters
Type | Name | Description |
---|---|---|
IrcMessageEventHandler<TMessage> | handler | Action to take when message is received |
Type Parameters
Name | Description |
---|---|
TMessage | Type of message to subscribe to |
Trigger(IServerMessage)
Trigger event handlers for an incoming message
Declaration
public void Trigger(IServerMessage message)
Parameters
Type | Name | Description |
---|---|---|
IServerMessage | message | Incoming message from IRC server |
Remarks
Automatically determines types using reflection
Trigger<TMessage>(TMessage)
Trigger event handlers for an incoming message
Declaration
public void Trigger<TMessage>(TMessage message)
where TMessage : IrcMessage, IServerMessage
Parameters
Type | Name | Description |
---|---|---|
TMessage | message | Incoming message |
Type Parameters
Name | Description |
---|---|
TMessage | Type of message |
Trigger<TMessage>(IrcMessageEventArgs<TMessage>)
Trigger event handlers for an incoming message
Declaration
public void Trigger<TMessage>(IrcMessageEventArgs<TMessage> args)
where TMessage : IrcMessage, IServerMessage
Parameters
Type | Name | Description |
---|---|---|
IrcMessageEventArgs<TMessage> | args | Information about incoming message |
Type Parameters
Name | Description |
---|---|
TMessage | Type of message |
Unsubscribe<TMessage>(IrcMessageEventHandler<TMessage>)
Unsubscribe from incoming messages
Declaration
public void Unsubscribe<TMessage>(IrcMessageEventHandler<TMessage> handler)
where TMessage : IrcMessage, IServerMessage
Parameters
Type | Name | Description |
---|---|---|
IrcMessageEventHandler<TMessage> | handler | Action to remove |
Type Parameters
Name | Description |
---|---|
TMessage | Type of message to remove subscription on |