- code refactoring
[reactos.git] / irc / TechBot / TechBot.Console / ConsoleTechBotService.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 using TechBot.Library;
6
7 namespace TechBot.Console
8 {
9 public class ConsoleServiceOutput : IServiceOutput
10 {
11 public void WriteLine(MessageContext context,
12 string message)
13 {
14 System.Console.WriteLine(message);
15 }
16 }
17
18 public class ConsoleTechBotService : TechBotService
19 {
20 public ConsoleTechBotService(
21 string chmPath,
22 string mainChm)
23 : base(new ConsoleServiceOutput(), chmPath, mainChm)
24 {
25 }
26
27 public override void Run()
28 {
29 //Call the base class
30 base.Run();
31
32 while (true)
33 {
34 string s = System.Console.ReadLine();
35 InjectMessage(null, s);
36 }
37 }
38 }
39 }