mirror of
https://github.com/reactos/reactos.git
synced 2025-06-22 16:03:30 +00:00
- code refactoring
- made more and more easily extensible: * commands automatically loaded from plugins dlls * declarative and automatic command parameter parsing * common code moved to base classes - other fixes svn path=/trunk/; revision=33344
This commit is contained in:
parent
e3407fdd9c
commit
d7b2077ed8
42 changed files with 2263 additions and 1689 deletions
41
irc/TechBot/TechBot.Library/Commands/BugCommand.cs
Normal file
41
irc/TechBot/TechBot.Library/Commands/BugCommand.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
|
||||
namespace TechBot.Library
|
||||
{
|
||||
public abstract class BugCommand : Command
|
||||
{
|
||||
private string m_BugID = null;
|
||||
|
||||
public BugCommand()
|
||||
{
|
||||
}
|
||||
|
||||
[CommandParameter("id", "The bug ID")]
|
||||
public string BugID
|
||||
{
|
||||
get { return m_BugID; }
|
||||
set { m_BugID = value; }
|
||||
}
|
||||
|
||||
public override void ExecuteCommand()
|
||||
{
|
||||
if (BugID == null)
|
||||
{
|
||||
Say("Please provide a valid bug number.");
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
Say(BugUrl, Int32.Parse(BugID));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Say("{0} is not a valid bug number.", BugID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract string BugUrl { get; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue