C# Класс 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.
Наследование: IIrcObject, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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).

Приватные методы

Метод Описание
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.

Описание методов

ChangeNickname() публичный Метод

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.
Результат void

Connect() публичный Метод

Connects to the irc server addressed by ServerAddress.
public Connect ( ) : void
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

IrcClient() публичный Метод

Creates a new instance of an IrcClient.
public IrcClient ( ) : System
Результат System

Join() публичный Метод

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
Результат void

Part() публичный Метод

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
Результат void

Quit() публичный Метод

Close the IRC Connection without a Message.
public Quit ( ) : void
Результат void

Quit() публичный Метод

Close the IRC Connection with a Message.
public Quit ( String QuitMsg ) : void
QuitMsg String
Результат void

SendLine() публичный Метод

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
Результат void

SendNotice() публичный Метод

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)
Результат void

SendPrivmsg() публичный Метод

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)
Результат void