Exemplo n.º 1
0
        public void InviteTests()
        {
            User user = new User("user");
            Channel channel = new Channel("channel");

            Messages.Send.Invite invite = user.Invite(channel);

            string output = TestHelpers.GetSendMessageOutput(invite);

            Assert.AreEqual("INVITE user #channel", output);
        }
Exemplo n.º 2
0
        public Channel FromName(string name)
        {
            if (this._store.ContainsKey(name))
            {
                return this._store[name];
            }

            Channel channel = new Channel(name) {Client = this._client};
            this._store[name] = channel;

            return channel;
        }
Exemplo n.º 3
0
        public Channel FromFullName(string name)
        {
            if (this._store.ContainsKey(name))
            {
                return this._store[name];
            }

            if (!Channel.TypeChars.Values.Contains(name[0]))
                throw new ArgumentException("name");

            Channel channel = new Channel(name) { Client = this._client };
            this._store[name.Substring(1)] = channel;

            return channel;
        }
Exemplo n.º 4
0
 internal void TriggerOnChannelLeave(Channel channel)
 {
     if (this.OnChannelLeave != null)
     {
         this.OnChannelLeave(this, channel);
     }
 }
Exemplo n.º 5
0
 internal void TriggerOnChannelJoin(Channel channel)
 {
     if (this.OnChannelJoin != null)
     {
         this.OnChannelJoin(this, channel);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Leave a specified channel based on the given Channel object.
 /// </summary>
 /// <param name="channel"></param>
 public void LeaveChannel(Channel channel)
 {
     this.Send(channel.Part());
 }
Exemplo n.º 7
0
 /// <summary>
 /// Join a specified channel based on the given Channel object.
 /// </summary>
 /// <param name="channel">The Channel to be used for connecting.</param>
 public void JoinChannel(Channel channel)
 {
     this.Send(channel.Join());
     this.Send(channel.GetTopic());
 }
Exemplo n.º 8
0
 public Messages.Send.Invite Invite(Channel channel)
 {
     return channel.Invite(this);
 }
Exemplo n.º 9
0
 internal virtual void TriggerOnRank(Channel source, User user, UserRank rank)
 {
     OnRankHandler handler = this.OnRank;
     if (handler != null) handler(source, user, rank);
 }
Exemplo n.º 10
0
 internal virtual void TriggerOnChannelOperatorNeeded(Channel source, string reason)
 {
     OnChannelOperatorNeededHandler handler = this.OnChannelOperatorNeeded;
     if (handler != null) handler(source, reason);
 }
Exemplo n.º 11
0
 internal virtual void TriggerOnCannotSendToChannel(Channel source, string reason)
 {
     OnCannotSendToChannelHandler handler = this.OnCannotSendToChannel;
     if (handler != null) handler(source, reason);
 }