2008-05-07 14:59:28 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
using TechBot.Library;
|
|
|
|
|
|
|
|
namespace TechBot.Console
|
|
|
|
{
|
|
|
|
public class ConsoleServiceOutput : IServiceOutput
|
|
|
|
{
|
|
|
|
public void WriteLine(MessageContext context,
|
|
|
|
string message)
|
|
|
|
{
|
|
|
|
System.Console.WriteLine(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public class ConsoleTechBotService : TechBotService
|
|
|
|
{
|
2008-05-18 15:54:43 +00:00
|
|
|
public ConsoleTechBotService()
|
|
|
|
: base(new ConsoleServiceOutput())
|
2008-05-07 14:59:28 +00:00
|
|
|
{
|
2008-05-18 15:54:43 +00:00
|
|
|
System.Console.WriteLine("TechBot running console service...");
|
2008-05-07 14:59:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public override void Run()
|
|
|
|
{
|
|
|
|
//Call the base class
|
|
|
|
base.Run();
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
{
|
2008-05-18 15:54:43 +00:00
|
|
|
InjectMessage(System.Console.ReadLine());
|
2008-05-07 14:59:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|