public IRCChannel(IRCConnection pConnection, string pChannelName) { connection = pConnection; channelName = pChannelName; // plug into connection's events connectionGotMessage = new IRCConnection.MessageEventHandler(ConnectionGotMessage); connection.GotMessage += connectionGotMessage; connectionSentMessage = new IRCConnection.MessageEventHandler(ConnectionSentMessage); connection.SentMessage += connectionSentMessage; }
public IRCManager(IRCConnection pConnection, IRCServer pServer, IRCLogInDetails pLogIn) { connection = pConnection; server = pServer; logininfo = pLogIn; // plug into IRCConnection's events connectionMade = new EventHandler(ConnectionMade); connection.Connected += connectionMade; connectionClosed = new EventHandler(ConnectionClosed); connection.ConnectionClosed += connectionClosed; connectionGotMessage = new IRCConnection.MessageEventHandler(ConnectionGotMessage); connection.GotMessage += connectionGotMessage; connectionSentMessage = new IRCConnection.MessageEventHandler(ConnectionSentMessage); }
private void SetChannel(IRCChannel pChannel) { this.channel = pChannel; this.connection = channel.Connection; // setup user list fChannelUsers.Items.Clear(); foreach (DictionaryEntry d in channel.Users) { fChannelUsers.Items.Add(d.Value); } // set window title this.Text = channel.ChannelName + " - " + channel.Topic; // setup event-handlers channelUserStatusChanged = new IRCChannel.UserStatusChangeEventHandler(ChannelUserStatusChanged); channelGotMessage = new IRCConnection.MessageEventHandler(ChannelGotMessage); channelSentMessage = new IRCConnection.MessageEventHandler(ChannelSentMessage); channelTopicChanged = new IRCConnection.MessageEventHandler(ChannelTopicChanged); channelModesChanged = new IRCConnection.MessageEventHandler(ChannelModesChanged); channelNamesChanged = new IRCConnection.MessageEventHandler(ChannelNamesChanged); channelLocalUserLeft = new IRCConnection.MessageEventHandler(ChannelLocalUserLeft); // plug-in to channel via event-handlers channel.UserStatusChanged += channelUserStatusChanged; channel.GotMessage += channelGotMessage; channel.SentMessage += channelGotMessage; channel.TopicChanged += channelTopicChanged; channel.ModesChanged += channelModesChanged; channel.NamesChanged += channelNamesChanged; channel.LocalUserLeftChannel += channelLocalUserLeft; }