/// <summary> /// Adds a channel to automatically join after connecting to a network. /// </summary> /// <param name="channelName">The name of the channel to join.</param> public void AddChannel(IrcChannelName channelName) { if (!_channels.Contains(channelName)) { _channels.Add(channelName); } }
/// <summary> /// Initializes a new instance of the <see cref="Irc.ChannelCreatorEventArgs"/> class. /// </summary> /// <param name="channelName">The name of a channel in an IRC network's global channel list.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName is null.</exception> public ChannelListEventArgs(IrcChannelName channelName) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } ChannelName = channelName; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.TopicEventArgs"/> class. /// </summary> /// <param name="channelName">The name of the channel on which the topic is set.</param> /// <param name="author">The nickname of the user that set the topic.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName or author are null.</exception> public TopicChangeEventArgs(IrcChannelName channelName, IrcNickname author) : base(channelName) { if (author == null) { throw new ArgumentNullException(nameof(author)); } Nickname = author; }
/// <summary> /// Initializes a new instance of the Irc.JoinEventArgs class. /// </summary> /// <param name="channelName">The name of the channel that has been joined.</param> /// <param name="newUserName">The nickname of the new user that has joined.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName or nickname are null.</exception> public JoinEventArgs(IrcChannelName channelName, IrcNickname newUserName) : base(newUserName) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } ChannelName = channelName; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.NameListEventArgs"/> class. /// </summary> /// <param name="channelName">The name of the channel the user list belongs to.</param> /// <param name="nameList">A list of <see cref="Irc.NameListItem"/>s.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName is null.</exception> public NameListEventArgs(IrcChannelName channelName, IList <NameListItem> nameList) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } ChannelName = channelName; Users = new ReadOnlyCollection <NameListItem>(nameList); }
/// <summary> /// Initializes a new instance of the <see cref="Irc.ChannelCreationEventArgs"/> class. /// </summary> /// <param name="channelName">The name of a channel that is the source of the event being raised.</param> /// <param name="creationTime">The date and time when the channel was created.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName is null.</exception> public ChannelCreationEventArgs(IrcChannelName channelName, DateTime creationTime) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } ; ChannelName = channelName; CreationTime = creationTime; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.ChannelModeEventArgs"/> class. /// </summary> /// <param name="channelName">The channel that is the source of the mode change.</param> /// <param name="modeChanger">The nickname of the user that changed the channel modes, or null if none exists.</param> /// <param name="modeString">The mode string containing a list of added and removed channel modes.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName is null.</exception> public ChannelModeEventArgs(IrcChannelName channelName, IrcNickname modeChanger, ChannelModeString modeString) : base(modeChanger) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } ChannelName = channelName; ModeString = modeString; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.ChannelManagementListEventArgs"/> class. /// </summary> /// <param name="channelName">The name of the channel that is the source of the event.</param> /// <param name="mask">A nickname or mask that was added or removed.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName is null, or mask is null or empty.</exception> public ChannelManagementListEventArgs(IrcChannelName channelName, string mask) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } if (string.IsNullOrEmpty(mask)) { throw new ArgumentNullException(nameof(mask)); } ChannelName = channelName; Mask = mask; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.PartEventArgs"/> class. /// </summary> /// <param name="channelParted">The name of the channel that a user has left.</param> /// <param name="partingUser">The nickname of a user that has left the channel.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelParted or partingUser are null.</exception> public PartEventArgs(IrcChannelName channelParted, IrcNickname partingUser) : base(partingUser) { if (channelParted == null) { throw new ArgumentNullException(nameof(channelParted)); } if (partingUser == null) { throw new ArgumentNullException(nameof(partingUser)); } ChannelName = channelParted; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.KickEventArgs"/> class. /// </summary> /// <param name="channelName">The name of the channel a user was kicked from.</param> /// <param name="kicker">The nickname of the user that performed the kick.</param> /// <param name="userKicked">The nickname of the user that was kicked.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName, kicker, or userKicked is null.</exception> public KickEventArgs(IrcChannelName channelName, IrcNickname kicker, IrcNickname userKicked) : base(kicker) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } if (userKicked == null) { throw new ArgumentNullException(nameof(userKicked)); } ChannelName = channelName; UserKicked = userKicked; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.TopicAuthorEventArgs"/> class. /// </summary> /// <param name="channelName">The channel on which the topic was set.</param> /// <param name="author">The nickname of the user that set the topic.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName or author are null.</exception> public TopicAuthorEventArgs(IrcChannelName channelName, IrcNickname author) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } if (author == null) { throw new ArgumentNullException(nameof(author)); } ChannelName = channelName; Author = author; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.ChannelCreatorEventArgs"/> class. /// </summary> /// <param name="channelName">The name of a channel that was queried.</param> /// <param name="creator">The nickname of the user that created the channel.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName or creator are null.</exception> public ChannelCreatorEventArgs(IrcChannelName channelName, IrcNickname creator) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } if (creator == null) { throw new ArgumentNullException(nameof(creator)); } Nickname = creator; ChannelName = channelName; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.InviteEventArgs"/> class. /// </summary> /// <param name="channelName">The channel the user is being invited to.</param> /// <param name="sender">The nickname of the user sending the invitation.</param> /// <param name="recipient">The nickname of the recipient of the invitation.</param> /// <exception cref="System.ArgumentNullException">Thrown if channelName, sender, or recipient are null.</exception> public InviteEventArgs(IrcChannelName channelName, IrcNickname sender, IrcNickname recipient) : base(sender) { if (channelName == null) { throw new ArgumentNullException(nameof(channelName)); } if (sender == null) { throw new ArgumentNullException(nameof(sender)); } if (recipient == null) { throw new ArgumentNullException(nameof(recipient)); } ChannelName = channelName; RecipientName = recipient; }
/// <summary> /// Initializes a new instance of the <see cref="Irc.ChannelUrlEventArgs"/> class. /// </summary> /// <param name="channelName">The name of the channel.</param> /// <param name="url">The URL of the channel homepage.</param> public ChannelUrlEventArgs(IrcChannelName channelName, string url) { ChannelName = channelName; Url = url; }
/// <summary> /// Removes a channel to automatically join from this profile. /// </summary> /// <param name="channelName">The name of the channel to remove.</param> public void RemoveChannel(IrcChannelName channelName) { _channels.Remove(channelName); }