public void Part(Channel chan, bool confirmation)
 {
     chan.do_part(this, confirmation);
 }
 public void Join(Channel chan)
 {
     chan.do_join(this, true);
     this._channels.Add(chan.Name, chan);
 }
 public void Part(Channel chan)
 {
     chan.do_part(this, true);
 }
 public bool RemoveChannel(Channel channel)
 {
     Console.WriteLine("RemoveChannel <{0}>", channel.Name);
     lock (this._channels)
     {
         if (this._channels.ContainsKey(channel.Name))
         {
             this._channels.Remove(channel.Name);
             return true;
         }
         return false;
     }
     //throw new NotImplementedException();
 }
 /// <summary>
 /// Is User in Channel...
 /// </summary>
 /// <param name="name">Name of Channel</param>
 /// <returns>True if this user in channel "chan".</returns>
 public bool IsInChannel(Channel chan)
 {
     return chan.HasConnection(this);
 }
 public void CreateChannel(string name)
 {
     lock (this._channels)
     {
         if (!this._channels.ContainsKey(name))
         {
             Channel channel = new Channel(name, this, null);
             this._channels.Add(name, channel);
         }
     }
 }
        public virtual void Part(SimpleUser usr, Channel channel, string message)
        {
            if (usr == null)
                throw new ArgumentNullException("usr");

            if (channel == null)
                throw new ArgumentNullException("channel");

            lock (channel)
            {
                if (channel.HasUser(usr))
                {
                    channel.Part(usr, message);
                }
            }
        }
 public virtual void Part(SimpleUser usr, Channel channel)
 {
     this.Part(usr, channel, usr.NickName);
 }
示例#9
0
文件: Client.cs 项目: tamaw/SharpIRC
        public Channel[] CreateChannels(string[] names, string[] keys = null)
        {
            var channels = new Channel[names.Count()];
            if(keys != null && names.Count() != keys.Count())
                throw new ArgumentException("Must have a key for each channel name.");

            for (int i = 0; i < names.Length; i++)
            {
                var channel = keys != null ? new Channel(this, names[i], keys[i])
                                      : new Channel(this, names[i]);

                Channels.Add(names[i], channel);
                //_listener.ReceivedReply += channel.ProcessReply;
            }

            // Multiple channels at once
            //this.Join(names, keys);

            return channels;
        }
示例#10
0
文件: Client.cs 项目: tamaw/SharpIRC
        public Channel CreateChannel(string name, string key = "")
        {
            var channel = new Channel(this, name, key);
            Channels.Add(name, channel);

            return channel;
        }