mirror of
https://github.com/reactos/reactos.git
synced 2024-09-11 05:12:43 +00:00
29 lines
545 B
C#
29 lines
545 B
C#
![]() |
using System;
|
||
|
|
||
|
namespace TechBot.Library
|
||
|
{
|
||
|
public interface ICommand
|
||
|
{
|
||
|
bool CanHandle(string commandName);
|
||
|
void Handle(string commandName,
|
||
|
string parameters);
|
||
|
string Help();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
public class BaseCommand
|
||
|
{
|
||
|
protected bool CanHandle(string commandName,
|
||
|
string[] availableCommands)
|
||
|
{
|
||
|
foreach (string availableCommand in availableCommands)
|
||
|
{
|
||
|
if (String.Compare(availableCommand, commandName, true) == 0)
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|