예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <summary>
 /// True if any mask matches the given user.
 /// </summary>
 public bool ContainsMatch(IrcUser user)
 {
     return(Masks.Any(m => user.Match(m.Value)));
 }