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
Afficher le fichier Open project: hapm/IrcShark Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat void

Connect() public méthode

Connects to the irc server addressed by ServerAddress.
public Connect ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

IrcClient() public méthode

Creates a new instance of an IrcClient.
public IrcClient ( ) : System
Résultat System

Join() public méthode

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
Résultat void

Part() public méthode

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
Résultat void

Quit() public méthode

Close the IRC Connection without a Message.
public Quit ( ) : void
Résultat void

Quit() public méthode

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

SendLine() public méthode

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
Résultat void

SendNotice() public méthode

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)
Résultat void

SendPrivmsg() public méthode

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)
Résultat void