コード例 #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;
        }
コード例 #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;
        }
コード例 #3
0
 internal void HandleLeftChannel(IrcChannel channel)
 {
     OnLeftChannel(new IrcChannelEventArgs(channel, null));
 }
コード例 #4
0
 internal void HandleJoinedChannel(IrcChannel channel)
 {
     OnJoinedChannel(new IrcChannelEventArgs(channel, null));
 }
コード例 #5
0
 internal IrcChannelUserCollection(IrcChannel channel, IList <IrcChannelUser> list)
     : base(list)
 {
     this.channel = channel;
 }
コード例 #6
0
ファイル: IrcLocalUser.cs プロジェクト: jfarre20/Ubiquitous
 internal void HandleLeftChannel(IrcChannel channel)
 {
     OnLeftChannel(new IrcChannelEventArgs(channel, null));
 }
コード例 #7
0
 internal void HandleInviteReceived(IrcUser inviter, IrcChannel channel)
 {
     OnInviteReceived(new IrcChannelInvitationEventArgs(channel, inviter));
 }
コード例 #8
0
ファイル: IrcUser.cs プロジェクト: ByteSempai/Ubiquitous
 internal void HandleInviteReceived(IrcUser inviter, IrcChannel channel)
 {
     OnInviteReceived(new IrcChannelInvitationEventArgs(channel, inviter));
 }
コード例 #9
0
ファイル: IrcLocalUser.cs プロジェクト: jfarre20/Ubiquitous
 internal void HandleJoinedChannel(IrcChannel channel)
 {
     OnJoinedChannel(new IrcChannelEventArgs(channel, null));
 }
コード例 #10
0
ファイル: IrcClient.cs プロジェクト: jfarre20/Ubiquitous
 internal void Invite(IrcChannel channel, string userNickName)
 {
     SendMessageInvite(channel.Name, userNickName);
 }
コード例 #11
0
ファイル: IrcClient.cs プロジェクト: jfarre20/Ubiquitous
 internal void Kick(IrcChannel channel, IEnumerable<string> usersNickNames, string comment = null)
 {
     SendMessageKick(channel.Name, usersNickNames, comment);
 }
コード例 #12
0
ファイル: IrcClient.cs プロジェクト: jfarre20/Ubiquitous
 internal void SetChannelModes(IrcChannel channel, string modes, IEnumerable<string> modeParameters = null)
 {
     SendMessageChannelMode(channel.Name, modes, modeParameters);
 }
コード例 #13
0
ファイル: IrcClient.cs プロジェクト: jfarre20/Ubiquitous
 internal void GetChannelModes(IrcChannel channel, string modes = null)
 {
     SendMessageChannelMode(channel.Name, modes);
 }
コード例 #14
0
ファイル: IrcClient.cs プロジェクト: jfarre20/Ubiquitous
        /// <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;
            }
        }
コード例 #15
0
ファイル: IrcEventArgs.cs プロジェクト: ByteSempai/Ubiquitous
        /// <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;
        }
コード例 #16
0
ファイル: IrcEventArgs.cs プロジェクト: ByteSempai/Ubiquitous
        /// <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;
        }