C# Class IrcSharp.IrcClient

Represents a full connection to an irc server with all nesessary members to communicate with it.
With an instance of IrcClient, you can connect to an irc server and receive many events defined by the standard irc protocol. The messages received are automatically parsed to IrcLine objects to be easier accessible.
Inheritance: IIrcObject, IDisposable
显示文件 Open project: hapm/IrcShark Class Usage Examples

Public Methods

Method Description
ChangeNickname ( String newNick ) : void

Sends a request to the server, to change the current nickname used by this connection.

This method creates a NICK irc command and send it to the server. The property CurrentNick will be updated after the client received the acknowledge from server.

Be sure that newNick is conform with the Standard used by this connection. Else the nickname will not be changed.

Connect ( ) : void

Connects to the irc server addressed by ServerAddress.

Dispose ( ) : void
IrcClient ( ) : System

Creates a new instance of an IrcClient.

Join ( String chanName ) : void

Joins a given channel on the irc server.

The given chanName should follow the given Standard of the IrcClient. The IrcClient will wait for the acknowledge of the server.

Part ( String chanName ) : void

Parts a given channel on the irc server.

chanName should follow the given Standard of the IrcClient. The IrcClient will wait for the acknowledge of the server.

Quit ( ) : void

Close the IRC Connection without a Message.

Quit ( String QuitMsg ) : void

Close the IRC Connection with a Message.

SendLine ( String line ) : void

Sends a raw irc line to the irc server.

You can send anything you want. The text is send as is. There is no checking or something.

SendNotice ( String message, String receiver ) : void

Sends a message to a channel, nick (directly).

SendPrivmsg ( String message, String receiver ) : void

Sends a message to a channel, nick (in a querry).

Private Methods

Method Description
HandleLine ( LineReceivedEventArgs e ) : void

Handles a line received from server.

OnError ( ErrorEventArgs args ) : void
ReadLines ( ) : void

Reads lines from server and parses them to an IrcLine.

Method Details

ChangeNickname() public method

Sends a request to the server, to change the current nickname used by this connection.

This method creates a NICK irc command and send it to the server. The property CurrentNick will be updated after the client received the acknowledge from server.

Be sure that newNick is conform with the Standard used by this connection. Else the nickname will not be changed.

public ChangeNickname ( String newNick ) : void
newNick String The new nickname, what should be used.
return void

Connect() public method

Connects to the irc server addressed by ServerAddress.
public Connect ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

IrcClient() public method

Creates a new instance of an IrcClient.
public IrcClient ( ) : System
return System

Join() public method

Joins a given channel on the irc server.
The given chanName should follow the given Standard of the IrcClient. The IrcClient will wait for the acknowledge of the server.
public Join ( String chanName ) : void
chanName String the channel name the client should join
return void

Part() public method

Parts a given channel on the irc server.
chanName should follow the given Standard of the IrcClient. The IrcClient will wait for the acknowledge of the server.
public Part ( String chanName ) : void
chanName String the channel name the client should join
return void

Quit() public method

Close the IRC Connection without a Message.
public Quit ( ) : void
return void

Quit() public method

Close the IRC Connection with a Message.
public Quit ( String QuitMsg ) : void
QuitMsg String
return void

SendLine() public method

Sends a raw irc line to the irc server.
You can send anything you want. The text is send as is. There is no checking or something.
public SendLine ( String line ) : void
line String the raw line to send
return void

SendNotice() public method

Sends a message to a channel, nick (directly).
public SendNotice ( String message, String receiver ) : void
message String the message to send
receiver String the receiver (a channel or a nick)
return void

SendPrivmsg() public method

Sends a message to a channel, nick (in a querry).
public SendPrivmsg ( String message, String receiver ) : void
message String the message to send
receiver String the receiver (a channel or a nick)
return void