rename.2.tfsbot
[tfs.git] / tools / tfsbot / SmartIrc4net / IrcClient / IrcMessageData.cs
blobc0f0d36f2bf02bdd93bd074d8013a7b8e6fc6912
1 /*
2 * $Id: IrcMessageData.cs 198 2005-06-08 16:50:11Z meebey $
3 * $URL: svn://svn.qnetp.net/smartirc/SmartIrc4net/tags/0.4.0/src/IrcClient/IrcMessageData.cs $
4 * $Rev: 198 $
5 * $Author: meebey $
6 * $Date: 2005-06-08 18:50:11 +0200 (Wed, 08 Jun 2005) $
8 * SmartIrc4net - the IRC library for .NET/C# <http://smartirc4net.sf.net>
10 * Copyright (c) 2003-2005 Mirco Bauer <meebey@meebey.net> <http://www.meebey.net>
12 * Full LGPL License: <http://www.gnu.org/licenses/lgpl.txt>
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 namespace Meebey.SmartIrc4net
31 /// <summary>
32 /// This class contains an IRC message in a parsed form
33 /// </summary>
34 /// <threadsafety static="true" instance="true" />
35 public class IrcMessageData
37 private IrcClient _Irc;
38 private string _From;
39 private string _Nick;
40 private string _Ident;
41 private string _Host;
42 private string _Channel;
43 private string _Message;
44 private string[] _MessageArray;
45 private string _RawMessage;
46 private string[] _RawMessageArray;
47 private ReceiveType _Type;
48 private ReplyCode _ReplyCode;
50 /// <summary>
51 /// Gets the IrcClient object the message originated from
52 /// </summary>
53 public IrcClient Irc {
54 get {
55 return _Irc;
59 /// <summary>
60 /// Gets the combined nickname, identity and hostname of the user that sent the message
61 /// </summary>
62 /// <example>
63 /// nick!ident@host
64 /// </example>
65 public string From {
66 get {
67 return _From;
71 /// <summary>
72 /// Gets the nickname of the user that sent the message
73 /// </summary>
74 public string Nick {
75 get {
76 return _Nick;
80 /// <summary>
81 /// Gets the identity (username) of the user that sent the message
82 /// </summary>
83 public string Ident {
84 get {
85 return _Ident;
89 /// <summary>
90 /// Gets the hostname of the user that sent the message
91 /// </summary>
92 public string Host {
93 get {
94 return _Host;
98 /// <summary>
99 /// Gets the channel the message originated from
100 /// </summary>
101 public string Channel {
102 get {
103 return _Channel;
107 /// <summary>
108 /// Gets the message
109 /// </summary>
110 public string Message {
111 get {
112 return _Message;
116 /// <summary>
117 /// Gets the message as an array of strings (splitted by space)
118 /// </summary>
119 public string[] MessageArray {
120 get {
121 return _MessageArray;
125 /// <summary>
126 /// Gets the raw message sent by the server
127 /// </summary>
128 public string RawMessage {
129 get {
130 return _RawMessage;
134 /// <summary>
135 /// Gets the raw message sent by the server as array of strings (splitted by space)
136 /// </summary>
137 public string[] RawMessageArray {
138 get {
139 return _RawMessageArray;
143 /// <summary>
144 /// Gets the message type
145 /// </summary>
146 public ReceiveType Type {
147 get {
148 return _Type;
152 /// <summary>
153 /// Gets the message reply code
154 /// </summary>
155 public ReplyCode ReplyCode {
156 get {
157 return _ReplyCode;
161 /// <summary>
162 /// Constructor to create an instace of IrcMessageData
163 /// </summary>
164 /// <param name="ircclient">IrcClient the message originated from</param>
165 /// <param name="from">combined nickname, identity and host of the user that sent the message (nick!ident@host)</param>
166 /// <param name="nick">nickname of the user that sent the message</param>
167 /// <param name="ident">identity (username) of the userthat sent the message</param>
168 /// <param name="host">hostname of the user that sent the message</param>
169 /// <param name="channel">channel the message originated from</param>
170 /// <param name="message">message</param>
171 /// <param name="rawmessage">raw message sent by the server</param>
172 /// <param name="type">message type</param>
173 /// <param name="replycode">message reply code</param>
174 public IrcMessageData(IrcClient ircclient, string from, string nick, string ident, string host, string channel, string message, string rawmessage, ReceiveType type, ReplyCode replycode)
176 _Irc = ircclient;
177 _RawMessage = rawmessage;
178 _RawMessageArray = rawmessage.Split(new char[] {' '});
179 _Type = type;
180 _ReplyCode = replycode;
181 _From = from;
182 _Nick = nick;
183 _Ident = ident;
184 _Host = host;
185 _Channel = channel;
186 if (message != null) {
187 // message is optional
188 _Message = message;
189 _MessageArray = message.Split(new char[] {' '});