C# Class IrcDotNet.IrcClient

Inheritance: IDisposable
Exibir arquivo Open project: IrcDotNet/IrcDotNet Class Usage Examples

Public Properties

Property Type Description
DefaultPort int

Protected Properties

Property Type Description
isRegistered bool
isupportPrefix string
localUser IrcLocalUser
motdBuilder StringBuilder
regexChannelName string
regexHostName string
regexMessagePrefix string
regexMessageTarget string
regexNickName string
regexNickNameId string
regexServerName string
regexTargetMask string
regexUserName string
regexUserNameId string

Public Methods

Method Description
Disconnect ( ) : void

Disconnects asynchronously from the server.

This method closes the client connection immediately and forcibly, and does not send a quit message to the server. To disconnect from the IRC server gracefully, call Quit(string) and wait for the connection to be closed.

Dispose ( ) : void

Releases all resources used by the IrcClient object.

GetMessageOfTheDay ( string targetServer = null ) : void

Requests the Message of the Day (MOTD) from the specified server.

GetNetworkInfo ( string serverMask = null, string targetServer = null ) : void

Requests statistics about the connected IRC network. If serverMask is specified, then the server only returns information about the part of the network formed by the servers whose names match the mask; otherwise, the information concerns the whole network

GetServerLinks ( string serverMask = null, string targetServer = null ) : void

Requests a list of all servers known by the target server. If serverMask is specified, then the server only returns information about the part of the network formed by the servers whose names match the mask; otherwise, the information concerns the whole network.

GetServerStatistics ( char query = null, string targetServer = null ) : void

Requests statistics about the specified server.

The server may not accept the command if query is unspecified.

GetServerTime ( string targetServer = null ) : void

Requests the local time on the specified server.

GetServerVersion ( string targetServer = null ) : void

Requests the version of the specified server.

ListChannels ( ) : void
ListChannels ( IEnumerable channelNames = null ) : void

Requests a list of information about the specified (or all) channels on the network.

Ping ( string targetServer = null ) : void

Sends a ping to the specified server.

QueryWho ( string mask = null, bool onlyOperators = false ) : void

Sends a Who query to the server targeting the specified channel or user masks.

QueryWhoIs ( ) : void
QueryWhoIs ( IEnumerable nickNameMasks ) : void

Sends a Who Is query to server targeting the specified nick name masks.

QueryWhoWas ( ) : void
QueryWhoWas ( IEnumerable nickNames, int entriesCount = -1 ) : void

Sends a Who Was query to server targeting the specified nick names.

Quit ( int timeout, string comment = null ) : void

Quits the server, giving the specified comment. Waits the specified duration of time before forcibly disconnecting.

Quit ( string comment = null ) : void

Quits the server, giving the specified comment.

Note that because this message is not sent immediately, calling Disconnect immediately after this will likely disconnect the client before it has a chance to quit the server properly. Quitting the server should automatically disconnect the client.

SendRawMessage ( string message ) : void

Sends the specified raw message to the server.

ToString ( ) : string

Returns a string representation of this instance.

Protected Methods

Method Description
CheckDisposed ( ) : void
CheckRegistrationInfo ( IrcRegistrationInfo registrationInfo, string registrationInfoParamName ) : void
Connect ( IrcRegistrationInfo registrationInfo ) : void
Dispose ( bool disposing ) : void

Releases all resources used by the IrcClient.

GetChannelFromName ( string channelName ) : IrcChannel
GetChannelFromName ( string channelName, bool &createdNew ) : IrcChannel

Gets the channel with the specified name, creating it if necessary.

GetChannelType ( char type ) : IrcChannelType

Gets the type of the channel from the specified character.

GetChannelsFromList ( string namesList ) : IEnumerable

Gets a list of channel objects from the specified comma-separated list of channel names.

GetMessageTarget ( string targetName ) : IIrcMessageTarget

Gets the target of a message from the specified name. A message target may be an IrcUser, IrcChannel, or IrcTargetMask.

GetModeAndParameters ( IEnumerable messageParameters ) : IEnumerable>.Tuple

Gets a collection of mode characters and mode parameters from the specified mode parameters. Combines multiple mode strings into a single mode string.

GetNumericUserMode ( ICollection modes ) : int
GetServerFromHostName ( string hostName ) : IrcServer
GetServerFromHostName ( string hostName, bool &createdNew ) : IrcServer

Gets the server with the specified host name, creating it if necessary.

GetSourceFromPrefix ( string prefix ) : IIrcMessageSource

Gets the source of a message from the specified prefix. A message source may be a IrcUser or IrcServer.

GetUserFromNickName ( string nickName, bool isOnline = true ) : IrcUser
GetUserFromNickName ( string nickName, bool isOnline, bool &createdNew ) : IrcUser

Gets the user with the specified nick name, creating it if necessary.

GetUserFromUserName ( string userName ) : IrcUser
GetUserFromUserName ( string userName, bool &createdNew ) : IrcUser

Gets the user with the specified user name, creating it if necessary.

GetUserModeAndNickName ( string input ) : string>.Tuple

Extracts the the mode and nick name of a user from the specified value.

GetUsersFromList ( string nickNamesList ) : IEnumerable

Gets a list of user objects from the specified comma-separated list of nick names.

HandleClientConnected ( IrcRegistrationInfo regInfo ) : void
HandleClientConnecting ( ) : void
HandleClientDisconnected ( ) : void
HandleISupportParameter ( string paramName, string paramValue ) : bool

Handles the specified parameter value of an ISUPPORT message, received from the server upon registration.

HandleStatsEntryReceived ( int type, IrcMessage message ) : void

Handles the specified statistical entry for the server, received in response to a STATS message.

InitializeMessageProcessors ( ) : void
IsChannelName ( string name ) : bool

Determines whether the specified name refers to a channel.

OnChannelListReceived ( IrcChannelListReceivedEventArgs e ) : void

Raises the ChannelListReceived event.

OnChannelModeChanged ( IrcChannel channel, IrcUser source, string newModes, IEnumerable newModeParameters ) : void
OnClientInfoReceived ( EventArgs e ) : void

Raises the ClientInfoReceived event.

OnConnectFailed ( IrcErrorEventArgs e ) : void

Raises the ConnectFailed event.

OnConnected ( EventArgs e ) : void

Raises the Connected event.

OnDisconnected ( EventArgs e ) : void

Raises the Disconnected event.

OnError ( IrcErrorEventArgs e ) : void

Raises the Error event.

OnErrorMessageReceived ( IrcErrorMessageEventArgs e ) : void

Raises the ErrorMessageReceived event.

OnMotdReceived ( EventArgs e ) : void

Raises the MotdReceived event.

OnNetworkInformationReceived ( IrcCommentEventArgs e ) : void

Raises the NetworkInformationReceived event.

OnPingReceived ( IrcPingOrPongReceivedEventArgs e ) : void

Raises the PingReceived event.

OnPongReceived ( IrcPingOrPongReceivedEventArgs e ) : void

Raises the PongReceived event.

OnProtocolError ( IrcProtocolErrorEventArgs e ) : void

Raises the ProtocolError event.

OnRawMessageReceived ( IrcRawMessageEventArgs e ) : void

Raises the RawMessageReceived event.

OnRawMessageSent ( IrcRawMessageEventArgs e ) : void

Raises the RawMessageSent event.

OnRegistered ( EventArgs e ) : void

Raises the Registered event.

OnServerBounce ( IrcServerInfoEventArgs e ) : void

Raises the ServerBounce event.

OnServerLinksListReceived ( IrcServerLinksListReceivedEventArgs e ) : void

Raises the ServerLinksListReceived event.

OnServerStatsReceived ( IrcServerStatsReceivedEventArgs e ) : void

Raises the ServerStatsReceived event.

OnServerSupportedFeaturesReceived ( EventArgs e ) : void

Raises the ServerSupportedFeaturesReceived event.

OnServerTimeReceived ( IrcServerTimeEventArgs e ) : void

Raises the ServerTimeReceived event.

OnServerVersionInfoReceived ( IrcServerVersionInfoEventArgs e ) : void

Raises the ServerVersionInfoReceived event.

OnValidateSslCertificate ( IrcValidateSslCertificateEventArgs e ) : void

Raises the ValidateSslCertificate event.

OnWhoIsReplyReceived ( IrcUserEventArgs e ) : void

Raises the WhoIsReplyReceived event.

OnWhoReplyReceived ( IrcNameEventArgs e ) : void

Raises the WhoReplyReceived event.

OnWhoWasReplyReceived ( IrcUserEventArgs e ) : void

Raises the WhoWasReplyReceived event.

ParseMessage ( string line ) : void
ResetState ( ) : void
SendMessageAdmin ( string targetServer = null ) : void

Sends a request for information about the administrator of the server.

SendMessageAway ( string text = null ) : void

Sends an update to the server indicating that the local user is away.

SendMessageChannelMode ( string channel, string modes = null, IEnumerable modeParameters = null ) : void

Sends an update for the modes of the specified channel.

SendMessageConnect ( string hostName, int port, string targetServer = null ) : void

Sends a request for the server to try to connect to another server.

SendMessageDie ( ) : void

Sends a request to the server telling it to shut down.

SendMessageInfo ( string targetServer = null ) : void

Sends a request for general information about the server program.

SendMessageInvite ( string channel, string nickName ) : void

Sends a request to invite the specified user to the specified channel.

SendMessageIsOn ( IEnumerable nickNames ) : void

Sends a request to check whether the specified users are currently online.

SendMessageJoin ( string>.IEnumerable channels ) : void
SendMessageJoin ( IEnumerable channels ) : void

Sends a request to join the specified channels.

SendMessageKick ( string>.IEnumerable channelsUsers, string comment = null ) : void

Sends a request to kick the specifier users from the specified channel.

SendMessageKick ( string channel, IEnumerable nickNames, string comment = null ) : void
SendMessageKill ( string nickName, string comment ) : void

Sends a request to disconnect the specified user from the server.

SendMessageLUsers ( string serverMask = null, string targetServer = null ) : void

Sends a request to get statistics about the size of the IRC network.

SendMessageLeaveAll ( ) : void

Sends a request to leave all channels in which the user is currently present.

SendMessageLinks ( string serverMask = null, string targetServer = null ) : void

Sends a request to list all other servers linked to the server.

SendMessageList ( IEnumerable channels = null, string targetServer = null ) : void

Sends a request to list channels and their topics.

SendMessageMotd ( string targetServer = null ) : void

Sends a request to receive the Message of the Day (MOTD) from the server.

SendMessageNames ( IEnumerable channels = null, string targetServer = null ) : void

Sends a request to list all names visible to the client.

SendMessageNick ( string nickName ) : void

Sends the nick name of the local user to the server. This command may be used either for intitially setting the nick name or changing it at any point.

SendMessageNotice ( IEnumerable targets, string text ) : void

Sends a notice to the specified targets.

SendMessageOper ( string userName, string password ) : void

Sends a request for server operator privileges.

SendMessagePart ( IEnumerable channels, string comment = null ) : void

Sends a request to leave the specified channels.

SendMessagePassword ( string password ) : void

Sends the password for registering the connection. This message must only be sent before the actual registration, which is done by SendMessageUser (for normal users) or SendMessageService (for services).

SendMessagePing ( string server, string targetServer = null ) : void

Sends a ping request to the server.

SendMessagePong ( string server, string targetServer = null ) : void

Sends a pong response (to a ping) to the server.

SendMessagePrivateMessage ( IEnumerable targets, string text ) : void

Sends a private message to the specified targets.

SendMessageQuit ( string comment = null ) : void

Sends a notification to the server indicating that the client is quitting the network.

SendMessageRehash ( ) : void

Sends a request to the server telling it to reprocess its configuration settings.

SendMessageRestart ( ) : void

Sends a message to the server telling it to restart.

SendMessageService ( string nickName, string distribution, string description = "" ) : void

Sends a request to register the client as a service on the server.

SendMessageServlist ( string mask = null, string type = null ) : void

Sends a request to list services currently connected to the netwrok/

SendMessageSquery ( string serviceName, string text ) : void

Sends a query message to a service.

SendMessageSquit ( string targetServer, string comment ) : void

Sends a request to disconnect the specified server from the network. This command is only available to oeprators.

SendMessageStats ( string query = null, string targetServer = null ) : void

Sends a request to query statistics for the server.

SendMessageTime ( string targetServer = null ) : void

Sends a request to query the local time on the server.

SendMessageTopic ( string channel, string topic = null ) : void

Sends an update or request for the topic of the specified channel.

SendMessageTrace ( string targetServer = null ) : void

Sends a query to trace the route to the server.

SendMessageUser ( string userName, int userMode, string realName ) : void

Sends a request to register the client as a user on the server.

SendMessageUserHost ( IEnumerable nickNames ) : void

Sends a request to return the host names of the specified users.

SendMessageUserMode ( string nickName, string modes = null ) : void

Sends an update or request for the current modes of the specified user.

SendMessageUsers ( string targetServer = null ) : void

Sends a request to return a list of information about all users currently registered on the server.

SendMessageVersion ( string targetServer = null ) : void

Sends a request for the version of the server program.

SendMessageWallops ( string text ) : void

Sends a message to all connected users that have the 'w' mode set.

SendMessageWho ( string mask = null, bool onlyOperators = false ) : void

Sends a request to perform a Who query on users.

SendMessageWhoIs ( IEnumerable nickNameMasks, string targetServer = null ) : void

Sends a request to perform a WhoIs query on users.

SendMessageWhoWas ( IEnumerable nickNames, int entriesCount = -1, string targetServer = null ) : void

Sends a request to perform a WhoWas query on users.

WriteMessage ( IrcMessage message ) : void

Writes the specified message (prefix, command, and parameters) to the network stream.

WriteMessage ( string line, object token = null ) : void
WriteMessage ( string prefix, string command ) : void
WriteMessage ( string prefix, string command, IEnumerable parameters ) : void

Private Methods

Method Description
CheckCommand ( string value ) : string
CheckMiddleParameter ( string value ) : string
CheckPrefix ( string value ) : string
CheckTrailingParameter ( string value ) : string
EnsureChannelName ( string c ) : void
GetChannelModes ( IrcChannel channel, string modes = null ) : void
GetLocalUserModes ( IrcLocalUser user ) : void
Invite ( IrcChannel channel, string userNickName ) : void
IrcClient ( ) : System
IsInvalidMessageChar ( char value ) : bool
Join ( string>.IEnumerable channels ) : void
Join ( IEnumerable channels ) : void
Kick ( IEnumerable channelUsers, string comment = null ) : void
Kick ( IrcChannel channel, IEnumerable usersNickNames, string comment = null ) : void
Leave ( IEnumerable channels, string comment = null ) : void
ProcessMessageEndOfStats ( IrcMessage message ) : void
ProcessMessageError ( IrcMessage message ) : void
ProcessMessageInvite ( IrcMessage message ) : void
ProcessMessageJoin ( IrcMessage message ) : void
ProcessMessageKick ( IrcMessage message ) : void
ProcessMessageLUserChannels ( IrcMessage message ) : void
ProcessMessageLUserClient ( IrcMessage message ) : void
ProcessMessageLUserMe ( IrcMessage message ) : void
ProcessMessageLUserOp ( IrcMessage message ) : void
ProcessMessageLUserUnknown ( IrcMessage message ) : void
ProcessMessageMode ( IrcMessage message ) : void
ProcessMessageNick ( IrcMessage message ) : void
ProcessMessageNotice ( IrcMessage message ) : void
ProcessMessageNumericError ( IrcMessage message ) : void
ProcessMessagePart ( IrcMessage message ) : void
ProcessMessagePing ( IrcMessage message ) : void
ProcessMessagePong ( IrcMessage message ) : void
ProcessMessagePrivateMessage ( IrcMessage message ) : void
ProcessMessageQuit ( IrcMessage message ) : void
ProcessMessageReplyAway ( IrcMessage message ) : void
ProcessMessageReplyBounceOrISupport ( IrcMessage message ) : void
ProcessMessageReplyCreated ( IrcMessage message ) : void
ProcessMessageReplyEndOfLinks ( IrcMessage message ) : void
ProcessMessageReplyEndOfNames ( IrcMessage message ) : void
ProcessMessageReplyEndOfWho ( IrcMessage message ) : void
ProcessMessageReplyEndOfWhoIs ( IrcMessage message ) : void
ProcessMessageReplyEndOfWhoWas ( IrcMessage message ) : void
ProcessMessageReplyInviting ( IrcMessage message ) : void
ProcessMessageReplyIsOn ( IrcMessage message ) : void
ProcessMessageReplyLinks ( IrcMessage message ) : void
ProcessMessageReplyList ( IrcMessage message ) : void
ProcessMessageReplyListEnd ( IrcMessage message ) : void
ProcessMessageReplyMotd ( IrcMessage message ) : void
ProcessMessageReplyMotdEnd ( IrcMessage message ) : void
ProcessMessageReplyMotdStart ( IrcMessage message ) : void
ProcessMessageReplyMyInfo ( IrcMessage message ) : void
ProcessMessageReplyNameReply ( IrcMessage message ) : void
ProcessMessageReplyNoTopic ( IrcMessage message ) : void
ProcessMessageReplyNowAway ( IrcMessage message ) : void
ProcessMessageReplyTime ( IrcMessage message ) : void
ProcessMessageReplyTopic ( IrcMessage message ) : void
ProcessMessageReplyUnAway ( IrcMessage message ) : void
ProcessMessageReplyVersion ( IrcMessage message ) : void
ProcessMessageReplyWelcome ( IrcMessage message ) : void
ProcessMessageReplyWhoIsChannels ( IrcMessage message ) : void
ProcessMessageReplyWhoIsIdle ( IrcMessage message ) : void
ProcessMessageReplyWhoIsOperator ( IrcMessage message ) : void
ProcessMessageReplyWhoIsServer ( IrcMessage message ) : void
ProcessMessageReplyWhoIsUser ( IrcMessage message ) : void
ProcessMessageReplyWhoReply ( IrcMessage message ) : void
ProcessMessageReplyWhoWasUser ( IrcMessage message ) : void
ProcessMessageReplyYouAreService ( IrcMessage message ) : void
ProcessMessageReplyYourHost ( IrcMessage message ) : void
ProcessMessageStatsCLine ( IrcMessage message ) : void
ProcessMessageStatsCommands ( IrcMessage message ) : void
ProcessMessageStatsHLine ( IrcMessage message ) : void
ProcessMessageStatsILine ( IrcMessage message ) : void
ProcessMessageStatsKLine ( IrcMessage message ) : void
ProcessMessageStatsLLine ( IrcMessage message ) : void
ProcessMessageStatsLinkInfo ( IrcMessage message ) : void
ProcessMessageStatsNLine ( IrcMessage message ) : void
ProcessMessageStatsOLine ( IrcMessage message ) : void
ProcessMessageStatsUpTime ( IrcMessage message ) : void
ProcessMessageStatsYLine ( IrcMessage message ) : void
ProcessMessageTopic ( IrcMessage message ) : void
ReadMessage ( IrcMessage message, string line ) : void
SendNotice ( IEnumerable targetsNames, string text ) : void
SendPrivateMessage ( IEnumerable targetsNames, string text ) : void
SetAway ( string text ) : void
SetChannelModes ( IrcChannel channel, string modes, IEnumerable modeParameters = null ) : void
SetLocalUserModes ( IrcLocalUser user, string modes ) : void
SetNickName ( string nickName ) : void
SetTopic ( string channel, string topic = null ) : void
UnsetAway ( ) : void

Method Details

CheckDisposed() protected method

protected CheckDisposed ( ) : void
return void

CheckRegistrationInfo() protected method

protected CheckRegistrationInfo ( IrcRegistrationInfo registrationInfo, string registrationInfoParamName ) : void
registrationInfo IrcRegistrationInfo
registrationInfoParamName string
return void

Connect() protected method

protected Connect ( IrcRegistrationInfo registrationInfo ) : void
registrationInfo IrcRegistrationInfo
return void

Disconnect() public method

Disconnects asynchronously from the server.
This method closes the client connection immediately and forcibly, and does not send a quit message to the server. To disconnect from the IRC server gracefully, call Quit(string) and wait for the connection to be closed.
The current instance has already been disposed.
public Disconnect ( ) : void
return void

Dispose() public method

Releases all resources used by the IrcClient object.
public Dispose ( ) : void
return void

Dispose() protected method

Releases all resources used by the IrcClient.
protected Dispose ( bool disposing ) : void
disposing bool /// if the consumer is actively disposing the object; /// if the garbage collector is finalizing the object. ///
return void

GetChannelFromName() protected method

protected GetChannelFromName ( string channelName ) : IrcChannel
channelName string
return IrcChannel

GetChannelFromName() protected method

Gets the channel with the specified name, creating it if necessary.
protected GetChannelFromName ( string channelName, bool &createdNew ) : IrcChannel
channelName string The name of the channel.
createdNew bool /// if the channel object was created during the call; /// , otherwise. ///
return IrcChannel

GetChannelType() protected method

Gets the type of the channel from the specified character.
/// does not correspond to any known channel type. ///
protected GetChannelType ( char type ) : IrcChannelType
type char /// A character that represents the type of the channel. /// The character may be one of the following: /// /// /// Character /// Channel type /// /// /// = /// Public channel /// /// /// * /// Private channel /// /// /// @ /// Secret channel /// /// ///
return IrcChannelType

GetChannelsFromList() protected method

Gets a list of channel objects from the specified comma-separated list of channel names.
protected GetChannelsFromList ( string namesList ) : IEnumerable
namesList string A value that contains a comma-separated list of names of channels.
return IEnumerable

GetMessageOfTheDay() public method

Requests the Message of the Day (MOTD) from the specified server.
The current instance has already been disposed.
public GetMessageOfTheDay ( string targetServer = null ) : void
targetServer string /// The name of the server from which to request the MOTD, or /// for the current server. ///
return void

GetMessageTarget() protected method

Gets the target of a message from the specified name. A message target may be an IrcUser, IrcChannel, or IrcTargetMask.
/// does not represent a valid message target. ///
protected GetMessageTarget ( string targetName ) : IIrcMessageTarget
targetName string The name of the target.
return IIrcMessageTarget

GetModeAndParameters() protected method

Gets a collection of mode characters and mode parameters from the specified mode parameters. Combines multiple mode strings into a single mode string.
protected GetModeAndParameters ( IEnumerable messageParameters ) : IEnumerable>.Tuple
messageParameters IEnumerable /// A collection of message parameters, which consists of mode strings and mode /// parameters. A mode string is of the form `( "+" / "-" ) *( mode character )`, and specifies mode changes. /// A mode parameter is arbitrary text associated with a certain mode. ///
return IEnumerable>.Tuple

GetNetworkInfo() public method

Requests statistics about the connected IRC network. If serverMask is specified, then the server only returns information about the part of the network formed by the servers whose names match the mask; otherwise, the information concerns the whole network
The current instance has already been disposed.
public GetNetworkInfo ( string serverMask = null, string targetServer = null ) : void
serverMask string /// A wildcard expression for matching against server names, or /// to match the entire network. ///
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

GetNumericUserMode() protected method

protected GetNumericUserMode ( ICollection modes ) : int
modes ICollection
return int

GetServerFromHostName() protected method

protected GetServerFromHostName ( string hostName ) : IrcServer
hostName string
return IrcServer

GetServerFromHostName() protected method

Gets the server with the specified host name, creating it if necessary.
protected GetServerFromHostName ( string hostName, bool &createdNew ) : IrcServer
hostName string The host name of the server.
createdNew bool /// if the server object was created during the call; /// , otherwise. ///
return IrcServer

GetServerLinks() public method

Requests a list of all servers known by the target server. If serverMask is specified, then the server only returns information about the part of the network formed by the servers whose names match the mask; otherwise, the information concerns the whole network.
The current instance has already been disposed.
public GetServerLinks ( string serverMask = null, string targetServer = null ) : void
serverMask string /// A wildcard expression for matching against server names, or /// to match the entire network. ///
targetServer string /// The name of the server to which to forward the request, or /// for the current server. ///
return void

GetServerStatistics() public method

Requests statistics about the specified server.
The server may not accept the command if query is unspecified.
The current instance has already been disposed.
public GetServerStatistics ( char query = null, string targetServer = null ) : void
query char /// The query character that indicates which server statistics to return. /// The set of valid query characters is dependent on the implementation of the particular IRC server. ///
targetServer string The name of the server whose statistics to request.
return void

GetServerTime() public method

Requests the local time on the specified server.
The current instance has already been disposed.
public GetServerTime ( string targetServer = null ) : void
targetServer string The name of the server whose local time to request.
return void

GetServerVersion() public method

Requests the version of the specified server.
The current instance has already been disposed.
public GetServerVersion ( string targetServer = null ) : void
targetServer string The name of the server whose version to request.
return void

GetSourceFromPrefix() protected method

Gets the source of a message from the specified prefix. A message source may be a IrcUser or IrcServer.
/// does not represent a valid message source. ///
protected GetSourceFromPrefix ( string prefix ) : IIrcMessageSource
prefix string The raw prefix of the message.
return IIrcMessageSource

GetUserFromNickName() protected method

protected GetUserFromNickName ( string nickName, bool isOnline = true ) : IrcUser
nickName string
isOnline bool
return IrcUser

GetUserFromNickName() protected method

Gets the user with the specified nick name, creating it if necessary.
protected GetUserFromNickName ( string nickName, bool isOnline, bool &createdNew ) : IrcUser
nickName string The nick name of the user.
isOnline bool /// if the user is currently online; /// , if the user is currently offline. /// The property of the user object is set to this value. ///
createdNew bool /// if the user object was created during the call; /// , otherwise. ///
return IrcUser

GetUserFromUserName() protected method

protected GetUserFromUserName ( string userName ) : IrcUser
userName string
return IrcUser

GetUserFromUserName() protected method

Gets the user with the specified user name, creating it if necessary.
protected GetUserFromUserName ( string userName, bool &createdNew ) : IrcUser
userName string The user name of the user.
createdNew bool /// if the user object was created during the call; /// , otherwise. ///
return IrcUser

GetUserModeAndNickName() protected method

Extracts the the mode and nick name of a user from the specified value.
protected GetUserModeAndNickName ( string input ) : string>.Tuple
input string The input value, containing a nick name optionally prefixed by a mode character.
return string>.Tuple

GetUsersFromList() protected method

Gets a list of user objects from the specified comma-separated list of nick names.
protected GetUsersFromList ( string nickNamesList ) : IEnumerable
nickNamesList string A value that contains a comma-separated list of nick names of users.
return IEnumerable

HandleClientConnected() protected method

protected HandleClientConnected ( IrcRegistrationInfo regInfo ) : void
regInfo IrcRegistrationInfo
return void

HandleClientConnecting() protected method

protected HandleClientConnecting ( ) : void
return void

HandleClientDisconnected() protected method

protected HandleClientDisconnected ( ) : void
return void

HandleISupportParameter() protected method

Handles the specified parameter value of an ISUPPORT message, received from the server upon registration.
protected HandleISupportParameter ( string paramName, string paramValue ) : bool
paramName string The name of the parameter.
paramValue string /// The value of the parameter, or if it does not have a value. ///
return bool

HandleStatsEntryReceived() protected method

Handles the specified statistical entry for the server, received in response to a STATS message.
protected HandleStatsEntryReceived ( int type, IrcMessage message ) : void
type int The type of the statistical entry for the server.
message IrcMessage The message that contains the statistical entry.
return void

InitializeMessageProcessors() protected method

protected InitializeMessageProcessors ( ) : void
return void

IsChannelName() protected method

Determines whether the specified name refers to a channel.
protected IsChannelName ( string name ) : bool
name string The name to check.
return bool

ListChannels() public method

public ListChannels ( ) : void
return void

ListChannels() public method

Requests a list of information about the specified (or all) channels on the network.
public ListChannels ( IEnumerable channelNames = null ) : void
channelNames IEnumerable /// The names of the channels to list, or to list all channels /// on the network. ///
return void

OnChannelListReceived() protected method

Raises the ChannelListReceived event.
protected OnChannelListReceived ( IrcChannelListReceivedEventArgs e ) : void
e IrcChannelListReceivedEventArgs /// The instance containing the event data. ///
return void

OnChannelModeChanged() protected method

protected OnChannelModeChanged ( IrcChannel channel, IrcUser source, string newModes, IEnumerable newModeParameters ) : void
channel IrcChannel
source IrcUser
newModes string
newModeParameters IEnumerable
return void

OnClientInfoReceived() protected method

Raises the ClientInfoReceived event.
protected OnClientInfoReceived ( EventArgs e ) : void
e System.EventArgs The instance containing the event data.
return void

OnConnectFailed() protected method

Raises the ConnectFailed event.
protected OnConnectFailed ( IrcErrorEventArgs e ) : void
e IrcErrorEventArgs The instance containing the event data.
return void

OnConnected() protected method

Raises the Connected event.
protected OnConnected ( EventArgs e ) : void
e System.EventArgs The instance containing the event data.
return void

OnDisconnected() protected method

Raises the Disconnected event.
protected OnDisconnected ( EventArgs e ) : void
e System.EventArgs The instance containing the event data.
return void

OnError() protected method

Raises the Error event.
protected OnError ( IrcErrorEventArgs e ) : void
e IrcErrorEventArgs The instance containing the event data.
return void

OnErrorMessageReceived() protected method

Raises the ErrorMessageReceived event.
protected OnErrorMessageReceived ( IrcErrorMessageEventArgs e ) : void
e IrcErrorMessageEventArgs The instance containing the event data.
return void

OnMotdReceived() protected method

Raises the MotdReceived event.
protected OnMotdReceived ( EventArgs e ) : void
e System.EventArgs The instance containing the event data.
return void

OnNetworkInformationReceived() protected method

Raises the NetworkInformationReceived event.
protected OnNetworkInformationReceived ( IrcCommentEventArgs e ) : void
e IrcCommentEventArgs The instance containing the event data.
return void

OnPingReceived() protected method

Raises the PingReceived event.
protected OnPingReceived ( IrcPingOrPongReceivedEventArgs e ) : void
e IrcPingOrPongReceivedEventArgs The instance containing the event data.
return void

OnPongReceived() protected method

Raises the PongReceived event.
protected OnPongReceived ( IrcPingOrPongReceivedEventArgs e ) : void
e IrcPingOrPongReceivedEventArgs The instance containing the event data.
return void

OnProtocolError() protected method

Raises the ProtocolError event.
protected OnProtocolError ( IrcProtocolErrorEventArgs e ) : void
e IrcProtocolErrorEventArgs The instance containing the event data.
return void

OnRawMessageReceived() protected method

Raises the RawMessageReceived event.
protected OnRawMessageReceived ( IrcRawMessageEventArgs e ) : void
e IrcRawMessageEventArgs The instance containing the event data.
return void

OnRawMessageSent() protected method

Raises the RawMessageSent event.
protected OnRawMessageSent ( IrcRawMessageEventArgs e ) : void
e IrcRawMessageEventArgs The instance containing the event data.
return void

OnRegistered() protected method

Raises the Registered event.
protected OnRegistered ( EventArgs e ) : void
e System.EventArgs The instance containing the event data.
return void

OnServerBounce() protected method

Raises the ServerBounce event.
protected OnServerBounce ( IrcServerInfoEventArgs e ) : void
e IrcServerInfoEventArgs The instance containing the event data.
return void

OnServerLinksListReceived() protected method

Raises the ServerLinksListReceived event.
protected OnServerLinksListReceived ( IrcServerLinksListReceivedEventArgs e ) : void
e IrcServerLinksListReceivedEventArgs /// The instance containing the event data. ///
return void

OnServerStatsReceived() protected method

Raises the ServerStatsReceived event.
protected OnServerStatsReceived ( IrcServerStatsReceivedEventArgs e ) : void
e IrcServerStatsReceivedEventArgs /// The instance containing the event data. ///
return void

OnServerSupportedFeaturesReceived() protected method

Raises the ServerSupportedFeaturesReceived event.
protected OnServerSupportedFeaturesReceived ( EventArgs e ) : void
e System.EventArgs The instance containing the event data.
return void

OnServerTimeReceived() protected method

Raises the ServerTimeReceived event.
protected OnServerTimeReceived ( IrcServerTimeEventArgs e ) : void
e IrcServerTimeEventArgs The instance containing the event data.
return void

OnServerVersionInfoReceived() protected method

Raises the ServerVersionInfoReceived event.
protected OnServerVersionInfoReceived ( IrcServerVersionInfoEventArgs e ) : void
e IrcServerVersionInfoEventArgs The instance containing the event data.
return void

OnValidateSslCertificate() protected method

Raises the ValidateSslCertificate event.
protected OnValidateSslCertificate ( IrcValidateSslCertificateEventArgs e ) : void
e IrcValidateSslCertificateEventArgs /// The instance containing the event data. ///
return void

OnWhoIsReplyReceived() protected method

Raises the WhoIsReplyReceived event.
protected OnWhoIsReplyReceived ( IrcUserEventArgs e ) : void
e IrcUserEventArgs The instance containing the event data.
return void

OnWhoReplyReceived() protected method

Raises the WhoReplyReceived event.
protected OnWhoReplyReceived ( IrcNameEventArgs e ) : void
e IrcNameEventArgs The instance containing the event data.
return void

OnWhoWasReplyReceived() protected method

Raises the WhoWasReplyReceived event.
protected OnWhoWasReplyReceived ( IrcUserEventArgs e ) : void
e IrcUserEventArgs The instance containing the event data.
return void

ParseMessage() protected method

protected ParseMessage ( string line ) : void
line string
return void

Ping() public method

Sends a ping to the specified server.
The current instance has already been disposed.
public Ping ( string targetServer = null ) : void
targetServer string The name of the server to ping.
return void

QueryWho() public method

Sends a Who query to the server targeting the specified channel or user masks.
The current instance has already been disposed.
public QueryWho ( string mask = null, bool onlyOperators = false ) : void
mask string /// A wildcard expression for matching against channel names; or if none can be found, /// host names, server names, real names, and nick names of users. If the value is , /// all users are matched. ///
onlyOperators bool /// to match only server operators; /// to match all users. ///
return void

QueryWhoIs() public method

public QueryWhoIs ( ) : void
return void

QueryWhoIs() public method

Sends a Who Is query to server targeting the specified nick name masks.
The current instance has already been disposed. is .
public QueryWhoIs ( IEnumerable nickNameMasks ) : void
nickNameMasks IEnumerable /// A collection of wildcard expressions for matching against nick names of users. ///
return void

QueryWhoWas() public method

public QueryWhoWas ( ) : void
return void

QueryWhoWas() public method

Sends a Who Was query to server targeting the specified nick names.
The current instance has already been disposed. is .
public QueryWhoWas ( IEnumerable nickNames, int entriesCount = -1 ) : void
nickNames IEnumerable The nick names of the users to query.
entriesCount int /// The maximum number of entries to return from the query. A negative value /// specifies to return an unlimited number of entries. ///
return void

Quit() public method

Quits the server, giving the specified comment. Waits the specified duration of time before forcibly disconnecting.
The current instance has already been disposed.
public Quit ( int timeout, string comment = null ) : void
timeout int The number of milliseconds to wait before forcibly disconnecting.
comment string
return void

Quit() public method

Quits the server, giving the specified comment.
Note that because this message is not sent immediately, calling Disconnect immediately after this will likely disconnect the client before it has a chance to quit the server properly. Quitting the server should automatically disconnect the client.
The current instance has already been disposed.
public Quit ( string comment = null ) : void
comment string The comment to send to the server.
return void

ResetState() protected method

protected ResetState ( ) : void
return void

SendMessageAdmin() protected method

Sends a request for information about the administrator of the server.
protected SendMessageAdmin ( string targetServer = null ) : void
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageAway() protected method

Sends an update to the server indicating that the local user is away.
protected SendMessageAway ( string text = null ) : void
text string /// The text of the away message. The away message is sent to any user that tries to contact /// the local user while it is away. ///
return void

SendMessageChannelMode() protected method

Sends an update for the modes of the specified channel.
protected SendMessageChannelMode ( string channel, string modes = null, IEnumerable modeParameters = null ) : void
channel string The channel whose modes to update.
modes string The mode string that indicates the channel modes to change.
modeParameters IEnumerable A collection of parameters to the specified .
return void

SendMessageConnect() protected method

Sends a request for the server to try to connect to another server.
protected SendMessageConnect ( string hostName, int port, string targetServer = null ) : void
hostName string The host name of the other server to which the server should connect.
port int The port on the other server to which the server should connect.
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageDie() protected method

Sends a request to the server telling it to shut down.
protected SendMessageDie ( ) : void
return void

SendMessageInfo() protected method

Sends a request for general information about the server program.
protected SendMessageInfo ( string targetServer = null ) : void
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageInvite() protected method

Sends a request to invite the specified user to the specified channel.
protected SendMessageInvite ( string channel, string nickName ) : void
channel string The name of the channel to which to invite the user.
nickName string The nick name of the user to invite.
return void

SendMessageIsOn() protected method

Sends a request to check whether the specified users are currently online.
protected SendMessageIsOn ( IEnumerable nickNames ) : void
nickNames IEnumerable A collection of the nick names of the users to query.
return void

SendMessageJoin() protected method

protected SendMessageJoin ( string>.IEnumerable channels ) : void
channels string>.IEnumerable A collection of 2-tuples of the names and keys of the channels to join.
return void

SendMessageJoin() protected method

Sends a request to join the specified channels.
protected SendMessageJoin ( IEnumerable channels ) : void
channels IEnumerable A collection of the names of the channels to join.
return void

SendMessageKick() protected method

Sends a request to kick the specifier users from the specified channel.
protected SendMessageKick ( string>.IEnumerable channelsUsers, string comment = null ) : void
channelsUsers string>.IEnumerable /// A collection of 2-tuples of channel names and the nick names of the users to /// kick from the channel. ///
comment string The comment to send the server, or for none.
return void

SendMessageKick() protected method

protected SendMessageKick ( string channel, IEnumerable nickNames, string comment = null ) : void
channel string The name of the channel from which to kick the users.
nickNames IEnumerable A collection of the nick names of the users to kick from the channel.
comment string
return void

SendMessageKill() protected method

Sends a request to disconnect the specified user from the server.
protected SendMessageKill ( string nickName, string comment ) : void
nickName string The nick name of the user to disconnect.
comment string The comment to send the server.
return void

SendMessageLUsers() protected method

Sends a request to get statistics about the size of the IRC network.
protected SendMessageLUsers ( string serverMask = null, string targetServer = null ) : void
serverMask string /// A wildcard expression for matching against the names of servers, or /// to match the entire network. ///
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageLeaveAll() protected method

Sends a request to leave all channels in which the user is currently present.
protected SendMessageLeaveAll ( ) : void
return void

SendMessageLinks() protected method

Sends a request to list all other servers linked to the server.
protected SendMessageLinks ( string serverMask = null, string targetServer = null ) : void
serverMask string A wildcard expression for matching the names of servers to list.
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageList() protected method

Sends a request to list channels and their topics.
protected SendMessageList ( IEnumerable channels = null, string targetServer = null ) : void
channels IEnumerable /// A collection of the names of channels to list, or for all /// channels. ///
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageMotd() protected method

Sends a request to receive the Message of the Day (MOTD) from the server.
protected SendMessageMotd ( string targetServer = null ) : void
targetServer string /// The name of the server to which to forward the message, or for /// the current server. ///
return void

SendMessageNames() protected method

Sends a request to list all names visible to the client.
protected SendMessageNames ( IEnumerable channels = null, string targetServer = null ) : void
channels IEnumerable /// A collection of the names of channels for which to list users, or /// for all channels. ///
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageNick() protected method

Sends the nick name of the local user to the server. This command may be used either for intitially setting the nick name or changing it at any point.
protected SendMessageNick ( string nickName ) : void
nickName string The nick name to set.
return void

SendMessageNotice() protected method

Sends a notice to the specified targets.
protected SendMessageNotice ( IEnumerable targets, string text ) : void
targets IEnumerable A collection of the targets to which to send the message.
text string The text of the message to send.
return void

SendMessageOper() protected method

Sends a request for server operator privileges.
protected SendMessageOper ( string userName, string password ) : void
userName string The user name with which to register.
password string The password with which to register.
return void

SendMessagePart() protected method

Sends a request to leave the specified channels.
protected SendMessagePart ( IEnumerable channels, string comment = null ) : void
channels IEnumerable A collection of the names of the channels to leave.
comment string The comment to send the server, or for none.
return void

SendMessagePassword() protected method

Sends the password for registering the connection. This message must only be sent before the actual registration, which is done by SendMessageUser (for normal users) or SendMessageService (for services).
protected SendMessagePassword ( string password ) : void
password string The connection password.
return void

SendMessagePing() protected method

Sends a ping request to the server.
protected SendMessagePing ( string server, string targetServer = null ) : void
server string The name of the server to which to send the request.
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessagePong() protected method

Sends a pong response (to a ping) to the server.
protected SendMessagePong ( string server, string targetServer = null ) : void
server string The name of the server to which to send the response.
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessagePrivateMessage() protected method

Sends a private message to the specified targets.
protected SendMessagePrivateMessage ( IEnumerable targets, string text ) : void
targets IEnumerable A collection of the targets to which to send the message.
text string The text of the message to send.
return void

SendMessageQuit() protected method

Sends a notification to the server indicating that the client is quitting the network.
protected SendMessageQuit ( string comment = null ) : void
comment string The comment to send the server, or for none.
return void

SendMessageRehash() protected method

Sends a request to the server telling it to reprocess its configuration settings.
protected SendMessageRehash ( ) : void
return void

SendMessageRestart() protected method

Sends a message to the server telling it to restart.
protected SendMessageRestart ( ) : void
return void

SendMessageService() protected method

Sends a request to register the client as a service on the server.
protected SendMessageService ( string nickName, string distribution, string description = "" ) : void
nickName string The nick name of the service.
distribution string /// A wildcard expression for matching against server names, which determines where /// the service is visible. ///
description string A description of the service.
return void

SendMessageServlist() protected method

Sends a request to list services currently connected to the netwrok/
protected SendMessageServlist ( string mask = null, string type = null ) : void
mask string A wildcard expression for matching against the names of services.
type string The type of services to list.
return void

SendMessageSquery() protected method

Sends a query message to a service.
protected SendMessageSquery ( string serviceName, string text ) : void
serviceName string The name of the service.
text string The text of the message to send.
return void

SendMessageSquit() protected method

Sends a request to disconnect the specified server from the network. This command is only available to oeprators.
protected SendMessageSquit ( string targetServer, string comment ) : void
targetServer string The name of the server to disconnected from the network.
comment string The comment to send the server.
return void

SendMessageStats() protected method

Sends a request to query statistics for the server.
protected SendMessageStats ( string query = null, string targetServer = null ) : void
query string The query to send the server.
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageTime() protected method

Sends a request to query the local time on the server.
protected SendMessageTime ( string targetServer = null ) : void
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageTopic() protected method

Sends an update or request for the topic of the specified channel.
protected SendMessageTopic ( string channel, string topic = null ) : void
channel string The name of the channel whose topic to change.
topic string The new topic to set, or to request the current topic.
return void

SendMessageTrace() protected method

Sends a query to trace the route to the server.
protected SendMessageTrace ( string targetServer = null ) : void
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageUser() protected method

Sends a request to register the client as a user on the server.
protected SendMessageUser ( string userName, int userMode, string realName ) : void
userName string The user name of the user.
userMode int The initial mode of the user.
realName string The real name of the user.
return void

SendMessageUserHost() protected method

Sends a request to return the host names of the specified users.
protected SendMessageUserHost ( IEnumerable nickNames ) : void
nickNames IEnumerable A collection of the nick names of the users to query.
return void

SendMessageUserMode() protected method

Sends an update or request for the current modes of the specified user.
protected SendMessageUserMode ( string nickName, string modes = null ) : void
nickName string The nick name of the user whose modes to update/request.
modes string The mode string that indicates the user modes to change.
return void

SendMessageUsers() protected method

Sends a request to return a list of information about all users currently registered on the server.
protected SendMessageUsers ( string targetServer = null ) : void
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageVersion() protected method

Sends a request for the version of the server program.
protected SendMessageVersion ( string targetServer = null ) : void
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageWallops() protected method

Sends a message to all connected users that have the 'w' mode set.
protected SendMessageWallops ( string text ) : void
text string The text of the message to send.
return void

SendMessageWho() protected method

Sends a request to perform a Who query on users.
protected SendMessageWho ( string mask = null, bool onlyOperators = false ) : void
mask string /// A wildcard expression for matching against channel names; or if none can be found, /// host names, server names, real names, and nick names of users. If the value is , /// all users are matched. ///
onlyOperators bool /// to match only server operators; /// to match all users. ///
return void

SendMessageWhoIs() protected method

Sends a request to perform a WhoIs query on users.
protected SendMessageWhoIs ( IEnumerable nickNameMasks, string targetServer = null ) : void
nickNameMasks IEnumerable /// A collection of wildcard expressions for matching against the nick names of /// users. ///
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendMessageWhoWas() protected method

Sends a request to perform a WhoWas query on users.
protected SendMessageWhoWas ( IEnumerable nickNames, int entriesCount = -1, string targetServer = null ) : void
nickNames IEnumerable /// A collection of wildcard expressions for matching against the nick names of /// users. ///
entriesCount int The maximum number of (most recent) entries to return.
targetServer string /// The name of the server to which to forward the message, or /// for the current server. ///
return void

SendRawMessage() public method

Sends the specified raw message to the server.
The current instance has already been disposed. is .
public SendRawMessage ( string message ) : void
message string The text (single line) of the message to send the server.
return void

ToString() public method

Returns a string representation of this instance.
public ToString ( ) : string
return string

WriteMessage() protected method

Writes the specified message (prefix, command, and parameters) to the network stream.
/// contains more than 15 many parameters. /// /// The value of of /// is invalid. /// /// The value of one of the items of of /// is invalid. /// The current instance has already been disposed.
protected WriteMessage ( IrcMessage message ) : void
message IrcMessage The message to write.
return void

WriteMessage() protected method

protected WriteMessage ( string line, object token = null ) : void
line string
token object
return void

WriteMessage() protected method

The current instance has already been disposed.
protected WriteMessage ( string prefix, string command ) : void
prefix string The message prefix that represents the source of the message.
command string The name of the command.
return void

WriteMessage() protected method

The current instance has already been disposed.
protected WriteMessage ( string prefix, string command, IEnumerable parameters ) : void
prefix string
command string
parameters IEnumerable
return void

Property Details

DefaultPort public_oe static_oe property

public static int DefaultPort
return int

isRegistered protected_oe property

protected bool isRegistered
return bool

isupportPrefix protected_oe static_oe property

protected static string isupportPrefix
return string

localUser protected_oe property

protected IrcLocalUser localUser
return IrcLocalUser

motdBuilder protected_oe property

protected StringBuilder motdBuilder
return StringBuilder

regexChannelName protected_oe static_oe property

protected static string regexChannelName
return string

regexHostName protected_oe static_oe property

protected static string regexHostName
return string

regexMessagePrefix protected_oe static_oe property

protected static string regexMessagePrefix
return string

regexMessageTarget protected_oe static_oe property

protected static string regexMessageTarget
return string

regexNickName protected_oe static_oe property

protected static string regexNickName
return string

regexNickNameId protected_oe static_oe property

protected static string regexNickNameId
return string

regexServerName protected_oe static_oe property

protected static string regexServerName
return string

regexTargetMask protected_oe static_oe property

protected static string regexTargetMask
return string

regexUserName protected_oe static_oe property

protected static string regexUserName
return string

regexUserNameId protected_oe static_oe property

protected static string regexUserNameId
return string