void ServerConnect(Server aServer)
{
if (!aServer.Enabled)
{
_log.Error("ServerConnect(" + aServer + ") is not enabled");
return;
}
IrcConnection connection = _connections.SingleOrDefault(c => c.Server == aServer);
if (connection == null)
{
connection = new IrcConnection
{
Server = aServer,
Parser = _parser,
Scheduler = Scheduler
};
_connections.Add(connection);
connection.OnDisconnected += ServerDisconnected;
connection.OnNotificationAdded += AddNotification;
connection.Start(aServer.ToString());
}
else
{
_log.Error("ConnectServer(" + aServer + ") is already in the list");
}
}