/// <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; }
/// <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; }
internal void HandleLeftChannel(IrcChannel channel) { OnLeftChannel(new IrcChannelEventArgs(channel, null)); }
internal void HandleJoinedChannel(IrcChannel channel) { OnJoinedChannel(new IrcChannelEventArgs(channel, null)); }
internal IrcChannelUserCollection(IrcChannel channel, IList <IrcChannelUser> list) : base(list) { this.channel = channel; }
internal void HandleInviteReceived(IrcUser inviter, IrcChannel channel) { OnInviteReceived(new IrcChannelInvitationEventArgs(channel, inviter)); }
internal void Invite(IrcChannel channel, string userNickName) { SendMessageInvite(channel.Name, userNickName); }
internal void Kick(IrcChannel channel, IEnumerable<string> usersNickNames, string comment = null) { SendMessageKick(channel.Name, usersNickNames, comment); }
internal void SetChannelModes(IrcChannel channel, string modes, IEnumerable<string> modeParameters = null) { SendMessageChannelMode(channel.Name, modes, modeParameters); }
internal void GetChannelModes(IrcChannel channel, string modes = null) { SendMessageChannelMode(channel.Name, modes); }
/// <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; } }
/// <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; }
/// <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; }