/// <summary> /// Returns the mask that matches the given user. /// </summary> public Mask GetMatch(IrcUser user) { var match = Masks.FirstOrDefault(m => user.Match(m.Value)); if (match == null) { throw new KeyNotFoundException("No mask matches the specified user."); } return(match); }
/// <summary> /// True if any mask matches the given user. /// </summary> public bool ContainsMatch(IrcUser user) { return(Masks.Any(m => user.Match(m.Value))); }