Exemple #1
0
        /// <summary>
        /// Determines whether the endpoint passed matches one or more of the
        /// endpoints in the set.
        /// </summary>
        /// <param name="logicalEP">The logical <see cref="MsgEP" /> to be tested.</param>
        /// <returns><c>true</c> if there's a match.</returns>
        /// <remarks>
        /// <note>Logical endpoints with wildcards can be passed.</note>
        /// </remarks>
        /// <exception cref="ArgumentException">Thrown if the endpoint passed is not logical.</exception>
        public bool Match(MsgEP logicalEP)
        {
            if (!logicalEP.IsLogical)
            {
                throw new ArgumentException("Logical endpoint expected.", "logicalEP");
            }

            for (int i = 0; i < endpoints.Count; i++)
            {
                if (logicalEP.LogicalMatch(logicalEP))
                {
                    return(true);
                }
            }

            return(false);
        }