public void Connect(string channel) { Channel = channel; MessageCount = 0; IRC_Client?.Dispose(); IRC_Client = new IRC_Client.IRC(channel); IRC_Client.ConnectionComplete += IRC_Client_ConnectionComplete; IRC_Client.ConnectAsync(); }
public void Dispose() { Channel = ""; if (IRC_Client != null) { IRC_Client.Dispose(); IRC_Client.ConnectionComplete -= IRC_Client_ConnectionComplete; IRC_Client.RawMessageRecieved -= Irc_RawMessageRecieved; IRC_Client.NetworkError -= Irc_NetworkError; IRC_Client = null; } }