C# Class Squishy.Irc.Commands.IrcCommandHandler

显示文件 Open project: jaddie/WCell-Utility-Bot Class Usage Examples

Public Properties

Property Type Description
CommandsByAlias Command>.IDictionary
RemoteCommandPrefix string

Public Methods

Method Description
Add ( Command cmd ) : void

Adds a Command to the CommandsByAlias.

Add ( Type cmdType ) : void

Adds a command of the specific type to the CommandsByAlias.

Ban ( IrcChannel Channel ) : void
Ban ( IrcChannel Channel, System.TimeSpan Time ) : void
Ban ( string Channel ) : void
Ban ( string Channel, System.TimeSpan Time ) : void
CtcpReply ( string Target, string Request, string argFormat ) : void
CtcpRequest ( string Target, string Request, string argFormat ) : void
DccRequest ( string Target, string requestFormat ) : void
Describe ( ChatTarget Target, string format ) : void
Describe ( string Target, string format ) : void
Get ( string alias ) : Command
Initialize ( ) : void

Removes all Commands of the specific Type from the CommandsByAlias.

Clears the CommandsByAlias, invokes an instance of every Class that is inherited from Command and adds it to the CommandsByAlias and the List. Is automatically called when an instance of IrcClient is created in order to find all Commands.

Invite ( IrcUser User, IrcChannel Channel ) : void
Invite ( IrcUser User, string Channel ) : void
Invite ( string Nick, IrcChannel Channel ) : void
Invite ( string Nick, string Channel ) : void
IrcCommandHandler ( IrcClient connection ) : System
Join ( string target ) : void
Join ( string target, string key ) : void
Kick ( IrcChannel channel, IrcUser user ) : void
Kick ( IrcChannel Channel, IrcUser User, string reasonFormat ) : void
Kick ( string channel, string user ) : void
Kick ( string Channel, string User, string reasonFormat ) : void
KickBan ( IrcChannel channel ) : void
KickBan ( IrcChannel channel, System.TimeSpan time ) : void
KickBan ( IrcChannel channel, System.TimeSpan time, string reason ) : void
KickBan ( IrcChannel channel, string reason ) : void
KickBan ( string channel ) : void
KickBan ( string channel, System.TimeSpan time ) : void
KickBan ( string channel, System.TimeSpan time, string reason ) : void
KickBan ( string channel, string reason ) : void
Mode ( IrcChannel Channel, string flags ) : void
Mode ( IrcChannel Channel, string flags, string Targets ) : void
Mode ( string flags ) : void
Mode ( string flags, string Targets ) : void
Mode ( string Channel, string flags, string Targets ) : void
Msg ( ChatTarget Target, object format ) : void
Msg ( string Target, object format ) : void
Nick ( string newNick ) : void
Notice ( ChatTarget Target, string format ) : void
Notice ( string Target, string format ) : void
Part ( IrcChannel chan, string reason ) : void
Part ( string chan, string reason ) : void
ReactTo ( CmdTrigger trigger ) : bool

Executes a specific Command with parameters. Interprets the first word as alias, takes all enabled Commands with the specific alias out of the CommandsByAlias-map and triggers the specific Process() method on all of them. If the processing of the command raises an Exception, the fail events are triggered.

ReactTo ( StringStream text ) : bool

Calls return ReactTo(new CmdTrigger(text));.

Remove ( Command cmd ) : void

Removes a Command.

RetrieveBanList ( string Channel ) : void
SetTopic ( string chan, string topic ) : void
Unban ( IrcChannel Channel ) : void
Unban ( IrcChannel Channel, string Masks ) : void
Unban ( string Channel ) : void
Unban ( string Channel, string Masks ) : void
Whois ( string nick ) : void
WhoisSimple ( string nick ) : void
this ( string alias ) : Command

Private Methods

Method Description
AddWaitingTrigger ( string reply, CmdTrigger trigger ) : void

Add a trigger that awaits a server-response;

NotifyServResponse ( string sender, string action, string remainder ) : void

Method Details

Add() public static method

Adds a Command to the CommandsByAlias.
public static Add ( Command cmd ) : void
cmd Command
return void

Add() public static method

Adds a command of the specific type to the CommandsByAlias.
public static Add ( Type cmdType ) : void
cmdType System.Type
return void

Ban() public method

public Ban ( IrcChannel Channel ) : void
Channel IrcChannel
return void

Ban() public method

public Ban ( IrcChannel Channel, System.TimeSpan Time ) : void
Channel IrcChannel
Time System.TimeSpan
return void

Ban() public method

public Ban ( string Channel ) : void
Channel string
return void

Ban() public method

public Ban ( string Channel, System.TimeSpan Time ) : void
Channel string
Time System.TimeSpan
return void

CtcpReply() public method

public CtcpReply ( string Target, string Request, string argFormat ) : void
Target string
Request string
argFormat string
return void

CtcpRequest() public method

public CtcpRequest ( string Target, string Request, string argFormat ) : void
Target string
Request string
argFormat string
return void

DccRequest() public method

public DccRequest ( string Target, string requestFormat ) : void
Target string
requestFormat string
return void

Describe() public method

public Describe ( ChatTarget Target, string format ) : void
Target ChatTarget
format string
return void

Describe() public method

public Describe ( string Target, string format ) : void
Target string
format string
return void

Get() public static method

public static Get ( string alias ) : Command
alias string
return Command

Initialize() public static method

Removes all Commands of the specific Type from the CommandsByAlias. Clears the CommandsByAlias, invokes an instance of every Class that is inherited from Command and adds it to the CommandsByAlias and the List. Is automatically called when an instance of IrcClient is created in order to find all Commands.
public static Initialize ( ) : void
return void

Invite() public method

public Invite ( IrcUser User, IrcChannel Channel ) : void
User IrcUser
Channel IrcChannel
return void

Invite() public method

public Invite ( IrcUser User, string Channel ) : void
User IrcUser
Channel string
return void

Invite() public method

public Invite ( string Nick, IrcChannel Channel ) : void
Nick string
Channel IrcChannel
return void

Invite() public method

public Invite ( string Nick, string Channel ) : void
Nick string
Channel string
return void

IrcCommandHandler() public method

public IrcCommandHandler ( IrcClient connection ) : System
connection IrcClient
return System

Join() public method

public Join ( string target ) : void
target string
return void

Join() public method

public Join ( string target, string key ) : void
target string
key string
return void

Kick() public method

public Kick ( IrcChannel channel, IrcUser user ) : void
channel IrcChannel
user IrcUser
return void

Kick() public method

public Kick ( IrcChannel Channel, IrcUser User, string reasonFormat ) : void
Channel IrcChannel
User IrcUser
reasonFormat string
return void

Kick() public method

public Kick ( string channel, string user ) : void
channel string
user string
return void

Kick() public method

public Kick ( string Channel, string User, string reasonFormat ) : void
Channel string
User string
reasonFormat string
return void

KickBan() public method

public KickBan ( IrcChannel channel ) : void
channel IrcChannel
return void

KickBan() public method

public KickBan ( IrcChannel channel, System.TimeSpan time ) : void
channel IrcChannel
time System.TimeSpan
return void

KickBan() public method

public KickBan ( IrcChannel channel, System.TimeSpan time, string reason ) : void
channel IrcChannel
time System.TimeSpan
reason string
return void

KickBan() public method

public KickBan ( IrcChannel channel, string reason ) : void
channel IrcChannel
reason string
return void

KickBan() public method

public KickBan ( string channel ) : void
channel string
return void

KickBan() public method

public KickBan ( string channel, System.TimeSpan time ) : void
channel string
time System.TimeSpan
return void

KickBan() public method

public KickBan ( string channel, System.TimeSpan time, string reason ) : void
channel string
time System.TimeSpan
reason string
return void

KickBan() public method

public KickBan ( string channel, string reason ) : void
channel string
reason string
return void

Mode() public method

public Mode ( IrcChannel Channel, string flags ) : void
Channel IrcChannel
flags string
return void

Mode() public method

public Mode ( IrcChannel Channel, string flags, string Targets ) : void
Channel IrcChannel
flags string
Targets string
return void

Mode() public method

public Mode ( string flags ) : void
flags string
return void

Mode() public method

public Mode ( string flags, string Targets ) : void
flags string
Targets string
return void

Mode() public method

public Mode ( string Channel, string flags, string Targets ) : void
Channel string
flags string
Targets string
return void

Msg() public method

public Msg ( ChatTarget Target, object format ) : void
Target ChatTarget
format object
return void

Msg() public method

public Msg ( string Target, object format ) : void
Target string
format object
return void

Nick() public method

public Nick ( string newNick ) : void
newNick string
return void

Notice() public method

public Notice ( ChatTarget Target, string format ) : void
Target ChatTarget
format string
return void

Notice() public method

public Notice ( string Target, string format ) : void
Target string
format string
return void

Part() public method

public Part ( IrcChannel chan, string reason ) : void
chan IrcChannel
reason string
return void

Part() public method

public Part ( string chan, string reason ) : void
chan string
reason string
return void

ReactTo() public method

Executes a specific Command with parameters. Interprets the first word as alias, takes all enabled Commands with the specific alias out of the CommandsByAlias-map and triggers the specific Process() method on all of them. If the processing of the command raises an Exception, the fail events are triggered.
public ReactTo ( CmdTrigger trigger ) : bool
trigger CmdTrigger
return bool

ReactTo() public method

Calls return ReactTo(new CmdTrigger(text));.
public ReactTo ( StringStream text ) : bool
text StringStream
return bool

Remove() public static method

Removes a Command.
public static Remove ( Command cmd ) : void
cmd Command
return void

RetrieveBanList() public method

public RetrieveBanList ( string Channel ) : void
Channel string
return void

SetTopic() public method

public SetTopic ( string chan, string topic ) : void
chan string
topic string
return void

Unban() public method

public Unban ( IrcChannel Channel ) : void
Channel IrcChannel
return void

Unban() public method

public Unban ( IrcChannel Channel, string Masks ) : void
Channel IrcChannel
Masks string
return void

Unban() public method

public Unban ( string Channel ) : void
Channel string
return void

Unban() public method

public Unban ( string Channel, string Masks ) : void
Channel string
Masks string
return void

Whois() public method

public Whois ( string nick ) : void
nick string
return void

WhoisSimple() public method

public WhoisSimple ( string nick ) : void
nick string
return void

this() public method

public this ( string alias ) : Command
alias string
return Command

Property Details

CommandsByAlias public_oe static_oe property

The Table of all Commands which exists for the use of the ReactTo() method (Filled by the Initialize() method). The keys are all possible aliases of all commands and the values are ArrayLists of Commands which are associated with the specific alias. The aliases are stored case-insensitively. Use the Remove(Command) and Add(Command) methods to manipulate this CommandsByAlias.
public static IDictionary CommandsByAlias
return Command>.IDictionary

RemoteCommandPrefix public_oe property

Sets the default command-prefix to trigger this client'str commands. Set this to 0 if this client is not supposed to act like a bot.
public string RemoteCommandPrefix
return string