b38cffb9268d7333f6e21cbe41909bcb99cc4995
[reactos.git] / irc / TechBot / TechBot.Library / HelpCommand.cs
1 using System;
2 using System.Collections;
3
4 namespace TechBot.Library
5 {
6 public class HelpCommand : BaseCommand, ICommand
7 {
8 private IServiceOutput serviceOutput;
9 private ArrayList commands;
10
11 public HelpCommand(IServiceOutput serviceOutput,
12 ArrayList commands)
13 {
14 this.serviceOutput = serviceOutput;
15 this.commands = commands;
16 }
17
18 public bool CanHandle(string commandName)
19 {
20 return CanHandle(commandName,
21 new string[] { "help" });
22 }
23
24 public void Handle(string commandName,
25 string parameters)
26 {
27 serviceOutput.WriteLine("I support the following commands:");
28 foreach (ICommand command in commands)
29 serviceOutput.WriteLine(command.Help());
30 }
31
32 public string Help()
33 {
34 return "!help";
35 }
36 }
37 }