Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IrcChannelInvitationEventArgs"/> class.
        /// </summary>
        /// <param name="channel">The channel to which the recipient user is invited.</param>
        /// <param name="inviter">The user inviting the recipient user to the channel.</param>
        public IrcChannelInvitationEventArgs(IrcChannel channel, IrcUser inviter)
            : base(channel)
        {
            if (inviter == null)
            {
                throw new ArgumentNullException("inviter");
            }

            this.Inviter = inviter;
        }
Esempio n. 2
0
        /// <inheritdoc/>
        /// <summary>
        /// Initializes a new instance of the <see cref="IrcChannelEventArgs"/> class.
        /// </summary>
        /// <param name="channel">The channel that the event concerns.</param>
        public IrcChannelEventArgs(IrcChannel channel, string comment = null)
            : base(comment)
        {
            if (channel == null)
            {
                throw new ArgumentNullException("channel");
            }

            this.Channel = channel;
        }
Esempio n. 3
0
 internal void HandleLeftChannel(IrcChannel channel)
 {
     OnLeftChannel(new IrcChannelEventArgs(channel, null));
 }
Esempio n. 4
0
 internal void HandleJoinedChannel(IrcChannel channel)
 {
     OnJoinedChannel(new IrcChannelEventArgs(channel, null));
 }
 internal IrcChannelUserCollection(IrcChannel channel, IList <IrcChannelUser> list)
     : base(list)
 {
     this.channel = channel;
 }
Esempio n. 6
0
 internal void HandleLeftChannel(IrcChannel channel)
 {
     OnLeftChannel(new IrcChannelEventArgs(channel, null));
 }
Esempio n. 7
0
 internal void HandleInviteReceived(IrcUser inviter, IrcChannel channel)
 {
     OnInviteReceived(new IrcChannelInvitationEventArgs(channel, inviter));
 }
Esempio n. 8
0
 internal void HandleInviteReceived(IrcUser inviter, IrcChannel channel)
 {
     OnInviteReceived(new IrcChannelInvitationEventArgs(channel, inviter));
 }
Esempio n. 9
0
 internal void HandleJoinedChannel(IrcChannel channel)
 {
     OnJoinedChannel(new IrcChannelEventArgs(channel, null));
 }
Esempio n. 10
0
 internal void Invite(IrcChannel channel, string userNickName)
 {
     SendMessageInvite(channel.Name, userNickName);
 }
Esempio n. 11
0
 internal void Kick(IrcChannel channel, IEnumerable<string> usersNickNames, string comment = null)
 {
     SendMessageKick(channel.Name, usersNickNames, comment);
 }
Esempio n. 12
0
 internal void SetChannelModes(IrcChannel channel, string modes, IEnumerable<string> modeParameters = null)
 {
     SendMessageChannelMode(channel.Name, modes, modeParameters);
 }
Esempio n. 13
0
 internal void GetChannelModes(IrcChannel channel, string modes = null)
 {
     SendMessageChannelMode(channel.Name, modes);
 }
Esempio n. 14
0
        /// <summary>
        /// Gets the channel with the specified name, creating it if necessary.
        /// </summary>
        /// <param name="channelName">The name of the channel.</param>
        /// <param name="createdNew"><see langword="true"/> if the channel object was created during the call;
        /// <see langword="false"/>, otherwise.</param>
        /// <returns>The channel object that corresponds to the specified name.</returns>
        protected IrcChannel GetChannelFromName(string channelName, out bool createdNew)
        {
            if (channelName == null)
                throw new ArgumentNullException("channelName");
            if (channelName.Length == 0)
                throw new ArgumentException(Properties.Resources.MessageValueCannotBeEmptyString, "channelName");

            // Search for channel with given name in list of known channel. If it does not exist, add it.
            lock (((ICollection)this.channelsReadOnly).SyncRoot)
            {
                var channel = this.channels.SingleOrDefault(c => c.Name == channelName);
                if (channel == null)
                {
                    channel = new IrcChannel(channelName);
                    channel.Client = this;
                    this.channels.Add(channel);

                    createdNew = true;
                }
                else
                {
                    createdNew = false;
                }

                return channel;
            }
        }
Esempio n. 15
0
        /// <inheritdoc/>
        /// <summary>
        /// Initializes a new instance of the <see cref="IrcChannelEventArgs"/> class.
        /// </summary>
        /// <param name="channel">The channel that the event concerns.</param>
        public IrcChannelEventArgs(IrcChannel channel, string comment = null)
            : base(comment)
        {
            if (channel == null)
                throw new ArgumentNullException("channel");

            this.Channel = channel;
        }
Esempio n. 16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IrcChannelInvitationEventArgs"/> class.
        /// </summary>
        /// <param name="channel">The channel to which the recipient user is invited.</param>
        /// <param name="inviter">The user inviting the recipient user to the channel.</param>
        public IrcChannelInvitationEventArgs(IrcChannel channel, IrcUser inviter)
            : base(channel)
        {
            if (inviter == null)
                throw new ArgumentNullException("inviter");

            this.Inviter = inviter;
        }