reactos/irc/TechBot/TechBot/ServiceThread.cs
Marc Piulachs ac77d9d3a6 - Moved commands outside TechBot.Library to TechBot.Commands.Common and TechBot.Commands.MSDN except for Command base classes
- Made TechBot more configurable through .config files
- Code refactoring
- Removed automatic parameter parsing support to make everyone happy

svn path=/trunk/; revision=33586
2008-05-18 15:54:43 +00:00

44 lines
868 B
C#

using System;
using System.Configuration;
using System.Diagnostics;
using TechBot.Library;
namespace TechBot
{
public class ServiceThread
{
private EventLog m_EventLog;
public ServiceThread(EventLog eventLog)
{
m_EventLog = eventLog;
}
public void Run()
{
System.Console.WriteLine("TechBot irc service...");
IrcTechBotService ircService = new IrcTechBotService(
Settings.Default.IRCServerHostName,
Settings.Default.IRCServerHostPort,
Settings.Default.IRCChannelNames,
Settings.Default.IRCBotName,
Settings.Default.IRCBotPassword);
ircService.Run();
}
public void Start()
{
try
{
Run();
}
catch (Exception ex)
{
m_EventLog.WriteEntry(String.Format("Ex. {0}", ex));
}
}
}
}