better.doc
[tfs.git] / tools / tfsnd / SmartIrc4net / IrcClient / Channel.cs
blobbf2f3a8d0709486a3b5079a9ea89eb4a69bf35d5
1 /*
2 * $Id: Channel.cs 207 2006-01-11 10:08:56Z meebey $
3 * $URL: svn://svn.qnetp.net/smartirc/SmartIrc4net/tags/0.4.0/src/IrcClient/Channel.cs $
4 * $Rev: 207 $
5 * $Author: meebey $
6 * $Date: 2006-01-11 11:08:56 +0100 (Wed, 11 Jan 2006) $
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 using System;
30 using System.Collections;
31 using System.Collections.Specialized;
33 namespace Meebey.SmartIrc4net
35 /// <summary>
36 ///
37 /// </summary>
38 /// <threadsafety static="true" instance="true" />
39 public class Channel
41 private string _Name;
42 private string _Key = String.Empty;
43 private Hashtable _Users = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer()));
44 private Hashtable _Ops = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer()));
45 private Hashtable _Voices = Hashtable.Synchronized(new Hashtable(new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer()));
46 private StringCollection _Bans = new StringCollection();
47 private string _Topic = String.Empty;
48 private int _UserLimit;
49 private string _Mode = String.Empty;
50 private DateTime _ActiveSyncStart;
51 private DateTime _ActiveSyncStop;
52 private TimeSpan _ActiveSyncTime;
54 /// <summary>
55 ///
56 /// </summary>
57 /// <param name="name"> </param>
58 internal Channel(string name)
60 _Name = name;
61 _ActiveSyncStart = DateTime.Now;
64 #if LOG4NET
65 ~Channel()
67 Logger.ChannelSyncing.Debug("Channel ("+Name+") destroyed");
69 #endif
71 /// <summary>
72 ///
73 /// </summary>
74 /// <value> </value>
75 public string Name {
76 get {
77 return _Name;
81 /// <summary>
82 ///
83 /// </summary>
84 /// <value> </value>
85 public string Key {
86 get {
87 return _Key;
89 set {
90 _Key = value;
94 /// <summary>
95 ///
96 /// </summary>
97 /// <value> </value>
98 public Hashtable Users {
99 get {
100 return (Hashtable)_Users.Clone();
104 /// <summary>
105 ///
106 /// </summary>
107 /// <value> </value>
108 internal Hashtable UnsafeUsers {
109 get {
110 return _Users;
114 /// <summary>
115 ///
116 /// </summary>
117 /// <value> </value>
118 public Hashtable Ops {
119 get {
120 return (Hashtable)_Ops.Clone();
124 /// <summary>
125 ///
126 /// </summary>
127 /// <value> </value>
128 internal Hashtable UnsafeOps {
129 get {
130 return _Ops;
134 /// <summary>
135 ///
136 /// </summary>
137 /// <value> </value>
138 public Hashtable Voices {
139 get {
140 return (Hashtable)_Voices.Clone();
144 /// <summary>
145 ///
146 /// </summary>
147 /// <value> </value>
148 internal Hashtable UnsafeVoices {
149 get {
150 return _Voices;
154 /// <summary>
155 ///
156 /// </summary>
157 /// <value> </value>
158 public StringCollection Bans {
159 get {
160 return _Bans;
164 /// <summary>
165 ///
166 /// </summary>
167 /// <value> </value>
168 public string Topic {
169 get {
170 return _Topic;
172 set {
173 _Topic = value;
177 /// <summary>
178 ///
179 /// </summary>
180 /// <value> </value>
181 public int UserLimit {
182 get {
183 return _UserLimit;
185 set {
186 _UserLimit = value;
190 /// <summary>
191 ///
192 /// </summary>
193 /// <value> </value>
194 public string Mode {
195 get {
196 return _Mode;
198 set {
199 _Mode = value;
203 /// <summary>
204 ///
205 /// </summary>
206 /// <value> </value>
207 public DateTime ActiveSyncStart {
208 get {
209 return _ActiveSyncStart;
213 /// <summary>
214 ///
215 /// </summary>
216 /// <value> </value>
217 public DateTime ActiveSyncStop {
218 get {
219 return _ActiveSyncStop;
221 set {
222 _ActiveSyncStop = value;
223 _ActiveSyncTime = _ActiveSyncStop.Subtract(_ActiveSyncStart);
227 /// <summary>
228 ///
229 /// </summary>
230 /// <value> </value>
231 public TimeSpan ActiveSyncTime {
232 get {
233 return _ActiveSyncTime;