C# Class CwIRC.Interface

Class to manage connections to IRC servers, and the sending and receiving of data to them.
显示文件 Open project: MatthewCox/MoronBot Class Usage Examples

Public Methods

Method Description
Assign ( Interface face ) : void
Connect ( string p_server, int p_port ) : bool

Connects to the specified IRC server, on the specified port.

Disconnect ( ) : void

Disconnects from the IRC server that the current instance of this class is connected to.

GetData ( ) : string

Gets a message from the downstream IRC message buffer.

JOIN ( string p_channel ) : void

Sends the JOIN message to the IRC server, with the specified channel to join.

NICK ( string p_name ) : void

Sends the NICK message to the IRC server, with the specified desired nickname.

NOTICE ( string p_message, string p_target ) : void

Sends the NOTICE message to the IRC server, with the specified message and target channel.

PART ( string p_channel, string p_partMessage ) : void

Sends the PART message to the IRC server, to leave the specified channel with the specified leaving message.

PRIVMSG ( string p_message, string p_target ) : void

Sends the PRIVMSG message to the IRC server, with the specified message and target channel.

QUIT ( string p_quitMessage ) : void

Sends the QUIT message to the IRC server, with the specified quit message.

SendData ( string p_string ) : void

Puts a message on the upstream IRC message buffer.

USER ( string p_name, string p_hostname, string p_servername, string p_realname ) : void

Sends the USER message to the IRC server, with the specified name, host name, server name, and real name.

worker_DoWork ( object sender, DoWorkEventArgs e ) : void

Gets new messages from the IRC server.

worker_ProgressChanged ( object sender, ProgressChangedEventArgs e ) : void

Called when a new message is received.

Protected Methods

Method Description
OnMessageReceived ( string message ) : void

Private Methods

Method Description
Interface ( ) : System.ComponentModel

Method Details

Assign() public static method

public static Assign ( Interface face ) : void
face Interface
return void

Connect() public method

Connects to the specified IRC server, on the specified port.
public Connect ( string p_server, int p_port ) : bool
p_server string The IRC server to connect to.
p_port int The port of the IRC server to connect to.
return bool

Disconnect() public method

Disconnects from the IRC server that the current instance of this class is connected to.
public Disconnect ( ) : void
return void

GetData() public method

Gets a message from the downstream IRC message buffer.
public GetData ( ) : string
return string

JOIN() public method

Sends the JOIN message to the IRC server, with the specified channel to join.
public JOIN ( string p_channel ) : void
p_channel string The channel to join.
return void

NICK() public method

Sends the NICK message to the IRC server, with the specified desired nickname.
public NICK ( string p_name ) : void
p_name string The desired nickname.
return void

NOTICE() public method

Sends the NOTICE message to the IRC server, with the specified message and target channel.
public NOTICE ( string p_message, string p_target ) : void
p_message string The message to send.
p_target string The channel (or user) to send the message to.
return void

OnMessageReceived() protected method

protected OnMessageReceived ( string message ) : void
message string
return void

PART() public method

Sends the PART message to the IRC server, to leave the specified channel with the specified leaving message.
public PART ( string p_channel, string p_partMessage ) : void
p_channel string The channel to leave.
p_partMessage string
return void

PRIVMSG() public method

Sends the PRIVMSG message to the IRC server, with the specified message and target channel.
public PRIVMSG ( string p_message, string p_target ) : void
p_message string The message to send.
p_target string The channel (or user) to send the message to.
return void

QUIT() public method

Sends the QUIT message to the IRC server, with the specified quit message.
public QUIT ( string p_quitMessage ) : void
p_quitMessage string The quit message.
return void

SendData() public method

Puts a message on the upstream IRC message buffer.
public SendData ( string p_string ) : void
p_string string The message to put on the upstream IRC message buffer.
return void

USER() public method

Sends the USER message to the IRC server, with the specified name, host name, server name, and real name.
public USER ( string p_name, string p_hostname, string p_servername, string p_realname ) : void
p_name string The name to send.
p_hostname string The host name to send (usually ignored by the server).
p_servername string The server name to send (usually ignored by the server).
p_realname string The 'real' name to send.
return void

worker_DoWork() public method

Gets new messages from the IRC server.
public worker_DoWork ( object sender, DoWorkEventArgs e ) : void
sender object
e System.ComponentModel.DoWorkEventArgs
return void

worker_ProgressChanged() public method

Called when a new message is received.
public worker_ProgressChanged ( object sender, ProgressChangedEventArgs e ) : void
sender object
e System.ComponentModel.ProgressChangedEventArgs
return void