Esempio n. 1
0
		/// <summary>
		/// Matches the specified target.
		/// </summary>
		/// <param name="target">The target.</param>
		/// <returns><c>true</c> if target matches filter; otherwise, <c>false</c>.</returns>
		public bool Match(IPropertyFilterTarget target)
		{
			if (target == null) throw new ArgumentNullException("target");
			if (IsEmpty) return true;

			for (int i = 0; i < _predicates.Count; i++)
				if (target.MatchesPredicate(_predicates[i]))
					return true;

			return false;
		}
        /// <summary>
        /// Matches this filter against a particular filter target. The
        /// filter returns true if there are no predicates or if one or more 
        /// predicates match the filter target.
        /// </summary>
        /// <param name="target">Target to attempt matching</param>
        /// <returns>True if there are no predicates or if one or more 
        /// predicates match the filter target, false otherwise</returns>
        /// <exception cref="ArgumentNullException">If target is null.</exception>
        public bool Match(IPropertyFilterTarget target)
        {
            if (target == null)
                throw FxTrace.Exception.ArgumentNull("target");

            if (this.IsEmpty)
                return true;

            // Perform an OR over all predicates
            for (int i = 0; i < this._predicates.Count; i++)
            {
                if (target.MatchesPredicate(_predicates[i]))
                    return true;
            }

            return false;
        }
        /// <summary>
        /// Matches the specified target.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <returns><c>true</c> if target matches filter; otherwise, <c>false</c>.</returns>
        public bool Match(IPropertyFilterTarget target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            if (IsEmpty)
            {
                return(true);
            }

            for (int i = 0; i < _predicates.Count; i++)
            {
                if (target.MatchesPredicate(_predicates[i]))
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 4
0
        public bool Match(IPropertyFilterTarget target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            if (this.IsEmpty)
            {
                return(true);
            }
            bool flag = false;

            for (int index = 0; index < this._predicates.Count; ++index)
            {
                if (!target.MatchesPredicate(this._predicates[index]))
                {
                    return(false);
                }
                flag = true;
            }
            return(flag);
        }
Esempio n. 5
0
        /// <summary>
        /// Matches this filter against a particular filter target. The
        /// filter returns true if there are no predicates or if one or more
        /// predicates match the filter target.
        /// </summary>
        /// <param name="target">Target to attempt matching</param>
        /// <returns>True if there are no predicates or if one or more
        /// predicates match the filter target, false otherwise</returns>
        /// <exception cref="ArgumentNullException">If target is null.</exception>
        public bool Match(IPropertyFilterTarget target)
        {
            if (target == null)
            {
                throw FxTrace.Exception.ArgumentNull("target");
            }

            if (this.IsEmpty)
            {
                return(true);
            }

            // Perform an OR over all predicates
            for (int i = 0; i < this._predicates.Count; i++)
            {
                if (target.MatchesPredicate(_predicates[i]))
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 6
0
 /// <summary>
 /// Matches the specified target.
 /// </summary>
 /// <param name="target">The target.</param>
 /// <returns><c>true</c> if target matches filter; otherwise, <c>false</c>.</returns>
 public bool Match(IPropertyFilterTarget target)
 {
     if (target == null) throw new ArgumentNullException("target");
     return IsEmpty || predicates.Any(target.MatchesPredicate);
 }