- code refactoring
[reactos.git] / irc / TechBot / TechBot.Console / ConsoleTechBotService.cs
diff --git a/irc/TechBot/TechBot.Console/ConsoleTechBotService.cs b/irc/TechBot/TechBot.Console/ConsoleTechBotService.cs
new file mode 100644 (file)
index 0000000..14c3c84
--- /dev/null
@@ -0,0 +1,39 @@
+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
+    {
+        public ConsoleTechBotService(
+                          string chmPath,
+                          string mainChm)
+            : base(new ConsoleServiceOutput(), chmPath, mainChm)
+        {
+        }
+
+        public override void Run()
+        {
+            //Call the base class
+            base.Run();
+
+            while (true)
+            {
+                string s = System.Console.ReadLine();
+                InjectMessage(null, s);
+            }
+        }
+    }
+}