/// <inheritdoc />
        protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            int counter = ((int?)context.GetData(this)).GetValueOrDefault();

            context.SetData(this, counter + 1);
            return(counter == index);
        }
Beispiel #2
0
        public override bool Compare(IAttributeBag attributeBag)
        {
            ElementAttributeBag elementAttributeBag = (ElementAttributeBag)attributeBag;
            IHTMLElement        element             = elementAttributeBag.IHTMLElement;

            if (IsTextContainedIn(element.innerText))
            {
                // Get all elements and filter this for TableCells
                IHTMLTableRow          tableRowElement   = (IHTMLTableRow)element;
                IHTMLElementCollection tableCellElements = tableRowElement.cells;

                if (tableCellElements.length - 1 >= columnIndex)
                {
                    IHTMLTableCell  tableCell       = (IHTMLTableCell)tableCellElements.item(columnIndex, null);
                    ICompareElement elementComparer = comparer as ICompareElement;

                    if (elementComparer != null)
                    {
                        return(elementComparer.Compare(new TableCell(elementAttributeBag.DomContainer, tableCell)));
                    }
                    return(base.Compare(new ElementAttributeBag(elementAttributeBag.DomContainer, (IHTMLElement)tableCell)));
                }
            }

            return(false);
        }
        protected override bool DoCompare(IAttributeBag attributeBag)
        {
            bool resultOr;

            bool resultAnd = false;

            resultOr = false;

            if (_andBaseConstraint != null)
            {
                resultAnd = _andBaseConstraint.Compare(attributeBag);
            }

            if (resultAnd || _andBaseConstraint == null)
            {
                counter++;
            }

            if (_orBaseConstraint != null && resultAnd == false)
            {
                resultOr = _orBaseConstraint.Compare(attributeBag);
            }

            return((counter == index) || resultOr);
        }
Beispiel #4
0
        public override bool Compare(IAttributeBag attributeBag)
        {
            base.LockCompare();

            bool resultOr;

            try
            {
                bool resultAnd = false;
                resultOr = false;

                if (andAttribute != null)
                {
                    resultAnd = andAttribute.Compare(attributeBag);
                }

                if (resultAnd || andAttribute == null)
                {
                    counter++;
                }

                if (orAttribute != null && resultAnd == false)
                {
                    resultOr = orAttribute.Compare(attributeBag);
                }
            }
            finally
            {
                base.UnLockCompare();
            }

            return((counter == index) || resultOr);
        }
		public override bool Compare(IAttributeBag attributeBag)
		{
		    ElementAttributeBag elementAttributeBag = (ElementAttributeBag) attributeBag;
		    IHTMLElement element = elementAttributeBag.IHTMLElement;
			
			if (IsTextContainedIn(element.innerText))
			{
				// Get all elements and filter this for TableCells
				IHTMLTableRow tableRowElement = (IHTMLTableRow)element;
				IHTMLElementCollection tableCellElements = tableRowElement.cells;

				if (tableCellElements.length - 1 >= columnIndex)
				{
                    IHTMLTableCell tableCell = (IHTMLTableCell)tableCellElements.item(columnIndex, null);
				    ICompareElement elementComparer = comparer as ICompareElement;
                    
                    if (elementComparer != null)
                    {
                        return elementComparer.Compare(new TableCell(elementAttributeBag.DomContainer, tableCell));
                    }
				    return base.Compare(new ElementAttributeBag(elementAttributeBag.DomContainer, (IHTMLElement) tableCell));
				}
			}

			return false;
		}
Beispiel #6
0
        protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            var regex      = _ignoreCase ? new Regex(_regexAsString, RegexOptions.IgnoreCase) : new Regex(_regexAsString);
            var constraint = _constraintFactory.Invoke(regex);

            return(constraint.Matches(attributeBag, context));
        }
        /// <inheritdoc />
        public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            Element element = attributeBag.GetAdapter<Element>();
            if (element == null)
                throw new WatiNException("This constraint class can only be used to compare against an element");

            return comparer.Compare(element);
		}
Beispiel #8
0
        /// <inheritdoc />
        protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            Component component = attributeBag.GetAdapter<Component>();
            if (component == null)
                throw new WatiNException("This constraint class can only be used to compare against a component");

            return comparer.Compare(component);
		}
Beispiel #9
0
        /// <inheritdoc />
        public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            Component component = attributeBag.GetAdapter <Component>();

            if (component == null)
            {
                throw new WatiNException("This constraint class can only be used to compare against a component");
            }

            return(comparer.Compare(component));
        }
Beispiel #10
0
        /// <inheritdoc />
        protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            T value = attributeBag.GetAdapter <T>();

            if (value == null)
            {
                throw new WatiNException(string.Format("This constraint class can only be used to compare against values adaptable to {0}.", typeof(T)));
            }

            return(predicate(value));
        }
        protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            string classValue = attributeBag.GetAttributeValue("class");

            if (classValue == null)
                classValue = attributeBag.GetAttributeValue("ClassName");

            if (classValue == null)
                return false;

            return _comparer.Compare(classValue);
        }
        /// <inheritdoc />
        protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            var element = attributeBag.GetAdapter<Element>();
            if (element == null)
                throw new WatiNException("This constraint class can only be used to compare against an element");

            var cache = (LabelCache)context.GetData(this);
            if (cache == null)
            {
                cache = new LabelCache(labelText);
                context.SetData(this, cache);
            }

            return cache.IsMatch(element);
        }
        protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            string classValue = attributeBag.GetAttributeValue("class");

            if (classValue == null)
            {
                classValue = attributeBag.GetAttributeValue("ClassName");
            }

            if (classValue == null)
            {
                return(false);
            }

            return(_comparer.Compare(classValue));
        }
Beispiel #14
0
        /// <summary>
        /// This methode implements an exact match comparison. If you want
        /// different behaviour, inherit this class or one of its subclasses and
        /// override Compare with a specific implementation.
        /// <seealso cref="LockCompare"/>
        /// <seealso cref="UnLockCompare"/>
        /// </summary>
        /// <param name="attributeBag">Value to compare with</param>
        /// <returns><c>true</c> if the searched for value equals the given value</returns>
        /// <example>
        /// The following example shows the use of the LockCompare and UnlockCompare methods.
        /// <code>
        ///   public override bool Compare(IAttributeBag attributeBag)
        ///    {
        ///      bool result = false;
        ///
        ///      // Call LockCompare if you don't call base.compare.
        ///      base.LockCompare();
        ///
        ///      try
        ///      {
        ///         // Your compare code goes here.
        ///
        ///         // Don't call base.compare here because that will throw
        ///         // a ReEntryException since you already locked the compare
        ///         // method for recursive calls.
        ///      }
        ///      finally
        ///      {
        ///      // Call UnLockCompare if you called LockCompare.
        ///        base.UnLockCompare();
        ///      }
        ///
        ///      return result;
        ///    }
        /// </code>
        /// </example>
        public virtual bool Compare(IAttributeBag attributeBag)
        {
            LockCompare();
            bool returnValue;

            try
            {
                returnValue = DoCompare(attributeBag);
            }
            finally
            {
                UnLockCompare();
            }

            return(returnValue);
        }
Beispiel #15
0
        /// <summary>
        /// Evaluates the and or attributes.
        /// </summary>
        /// <param name="attributeBag">The attribute bag.</param>
        /// <param name="initialReturnValue">if set to <c>false</c> it will skip the And evaluation.</param>
        /// <returns></returns>
        protected bool EvaluateAndOrAttributes(IAttributeBag attributeBag, bool initialReturnValue)
        {
            bool returnValue = initialReturnValue;

            if (returnValue && andAttribute != null)
            {
                returnValue = andAttribute.Compare(attributeBag);
            }

            if (returnValue == false && orAttribute != null)
            {
                returnValue = orAttribute.Compare(attributeBag);
            }

            return(returnValue);
        }
Beispiel #16
0
        /// <summary>
        /// Evaluates the and or attributes.
        /// </summary>
        /// <param name="attributeBag">The attribute bag.</param>
        /// <param name="initialReturnValue">if set to <c>false</c> it will skip the And evaluation.</param>
        /// <returns></returns>
        protected bool EvaluateAndOrAttributes(IAttributeBag attributeBag, bool initialReturnValue)
        {
            bool returnValue = initialReturnValue;

            if (returnValue && _andBaseConstraint != null)
            {
                returnValue = _andBaseConstraint.Compare(attributeBag);
            }

            if (returnValue == false && _orBaseConstraint != null)
            {
                returnValue = _orBaseConstraint.Compare(attributeBag);
            }

            return(returnValue);
        }
        /// <summary>
        /// Returns true if the constraint matches an object described by an attribute bag.
        /// </summary>
        /// <param name="attributeBag">The attribute bag</param>
        /// <param name="context">The constraint matching context</param>
        /// <returns>True if the constraint matches</returns>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="attributeBag"/> or <paramref name="context"/> is null</exception>
        public bool Matches(IAttributeBag attributeBag, ConstraintContext context)
        {
            if (attributeBag == null)
                throw new ArgumentNullException("attributeBag");
            if (context == null)
                throw new ArgumentNullException("context");

            try
            {
                EnterMatch();
                return MatchesImpl(attributeBag, context);
            }
            finally
            {
                ExitMatch();
            }
        }
Beispiel #18
0
        public override bool Compare(IAttributeBag attributeBag)
        {
            bool result;

            LockCompare();

            try
            {
                result = !(attribute.Compare(attributeBag));
            }
            finally
            {
                UnLockCompare();
            }

            return(result);
        }
Beispiel #19
0
        /// <inheritdoc />
        protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            var element = attributeBag.GetAdapter <Element>();

            if (element == null)
            {
                throw new WatiNException("This constraint class can only be used to compare against an element");
            }

            var cache = (LabelCache)context.GetData(this);

            if (cache == null)
            {
                cache = new LabelCache(labelText);
                context.SetData(this, cache);
            }

            return(cache.IsMatch(element));
        }
Beispiel #20
0
        /// <summary>
        /// Returns true if the constraint matches an object described by an attribute bag.
        /// </summary>
        /// <param name="attributeBag">The attribute bag</param>
        /// <param name="context">The constraint matching context</param>
        /// <returns>True if the constraint matches</returns>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="attributeBag"/> or <paramref name="context"/> is null</exception>
        public bool Matches(IAttributeBag attributeBag, ConstraintContext context)
        {
            if (attributeBag == null)
            {
                throw new ArgumentNullException("attributeBag");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            try
            {
                EnterMatch();
                return(MatchesImpl(attributeBag, context));
            }
            finally
            {
                ExitMatch();
            }
        }
Beispiel #21
0
		protected override bool DoCompare(IAttributeBag attributeBag)
		{
            Element element = null;

            ElementAttributeBag elementAttributeBag = attributeBag as ElementAttributeBag;
            if (elementAttributeBag != null)
			{
				element = elementAttributeBag.ElementTyped;
			}

            if (element == null)
			{
                element = attributeBag as Element;
			}

            if (element != null)
            {
                return EvaluateAndOrAttributes(attributeBag, _comparer.Compare(element));
            }

            throw new Exceptions.WatiNException("This constraint class can only be used to compare against an element");
		}
        protected override bool DoCompare(IAttributeBag attributeBag)
        {
            Element element = null;

            ElementAttributeBag elementAttributeBag = attributeBag as ElementAttributeBag;

            if (elementAttributeBag != null)
            {
                element = elementAttributeBag.ElementTyped;
            }

            if (element == null)
            {
                element = attributeBag as Element;
            }

            if (element != null)
            {
                return(EvaluateAndOrAttributes(attributeBag, _comparer.Compare(element)));
            }

            throw new Exceptions.WatiNException("This constraint class can only be used to compare against an element");
        }
        /// <inheritdoc />
        public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            var typeToConvertTo = typeof(T);

            if (typeToConvertTo.IsSubclassOf(typeof(Control)))
            {
                if (attributeBag.GetType().IsSubclassOf(typeof(Element)))
                {
                    T control = Control.CreateControl(typeToConvertTo, (Element)attributeBag) as T;
                    return(predicate(control));
                }
            }
            else
            {
                T value = attributeBag.GetAdapter <T>();
                if (value == null)
                {
                    throw new WatiNException(string.Format("The PredicateConstraint class can only be used to compare against values adaptable to {0}.", typeToConvertTo));
                }

                return(predicate(value));
            }
            return(false);
        }
Beispiel #24
0
		protected override bool DoCompare(IAttributeBag attributeBag)
		{
			bool resultOr;

			bool resultAnd = false;
			resultOr = false;

			if (_andBaseConstraint != null)
			{
				resultAnd = _andBaseConstraint.Compare(attributeBag);
			}

			if (resultAnd || _andBaseConstraint == null)
			{
				counter++;
			}

			if (_orBaseConstraint != null && resultAnd == false)
			{
				resultOr = _orBaseConstraint.Compare(attributeBag);
			}

			return (counter == index) || resultOr;
		}
Beispiel #25
0
 /// <inheritdoc />
 protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return first.Matches(attributeBag, context)
         && second.Matches(attributeBag, context);
 }
Beispiel #26
0
 /// <inheritdoc />
 protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return(false);
 }
 /// <inheritdoc />
 public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     var attributeValue = attributeBag.GetAttributeValue(attributeName);
     return comparer.Compare(attributeValue);
 }
 /// <summary>
 /// Returns true if the constraint matches an object described by an attribute bag.
 /// </summary>
 /// <param name="attributeBag">The attribute bag, not null</param>
 /// <param name="context">The constraint matching context, not null</param>
 /// <returns>True if the constraint matches</returns>
 protected abstract bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context);
Beispiel #29
0
	    /// <summary>
		/// This methode implements an exact match comparison. If you want
		/// different behaviour, inherit this class or one of its subclasses and 
		/// override Compare with a specific implementation. 
		/// <seealso cref="LockCompare"/>
		/// <seealso cref="UnLockCompare"/>
		/// </summary>
		/// <param name="attributeBag">Value to compare with</param>
		/// <returns><c>true</c> if the searched for value equals the given value</returns>
		/// <example>
		/// The following example shows the use of the LockCompare and UnlockCompare methods.
		/// <code>
		///   public override bool Compare(IAttributeBag attributeBag)
		///    {
		///      bool result = false;
		/// 
		///      // Call LockCompare if you don't call base.compare.
		///      base.LockCompare();
		///
		///      try
		///      {
		///         // Your compare code goes here.
		/// 
		///         // Don't call base.compare here because that will throw
		///         // a ReEntryException since you already locked the compare
		///         // method for recursive calls.
		///      }
		///      finally
		///      {
		///      // Call UnLockCompare if you called LockCompare.
		///        base.UnLockCompare();
		///      }      
		///
		///      return result;
		///    }
		/// </code>
		/// </example>
		public virtual bool Compare(IAttributeBag attributeBag)
		{
			LockCompare();
			bool returnValue;

			try
			{
				returnValue = DoCompare(attributeBag);
			}
			finally
			{
				UnLockCompare();
			}

			return returnValue;
		}
Beispiel #30
0
		/// <summary>
		/// Does the compare without calling <see cref="BaseConstraint.LockCompare"/> and <see cref="BaseConstraint.UnLockCompare"/>.
		/// </summary>
		/// <param name="attributeBag">The attribute bag.</param>
		protected abstract bool DoCompare(IAttributeBag attributeBag);
Beispiel #31
0
        public override bool Compare(IAttributeBag attributeBag)
        {
            bool result;
            LockCompare();

            try
            {
                result = !(attribute.Compare(attributeBag));
            }
            finally
            {
                UnLockCompare();
            }

            return result;
        }
 /// <inheritdoc />
 public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return first.Matches(attributeBag, context)
         || second.Matches(attributeBag, context);
 }
Beispiel #33
0
 /// <summary>
 /// Does the compare without calling <see cref="BaseConstraint.LockCompare"/> and <see cref="BaseConstraint.UnLockCompare"/>.
 /// </summary>
 /// <param name="attributeBag">The attribute bag.</param>
 protected override bool DoCompare(IAttributeBag attributeBag)
 {
     return(EvaluateAndOrAttributes(attributeBag, comparer.Compare(attributeBag.GetValue(attributeName))));
 }
 /// <inheritdoc />
 public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     int counter = ((int?)context.GetData(this)).GetValueOrDefault();
     context.SetData(this, counter + 1);
     return counter == index;
 }
Beispiel #35
0
 /// <inheritdoc />
 public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return(first.Matches(attributeBag, context) &&
            second.Matches(attributeBag, context));
 }
Beispiel #36
0
 /// <summary>
 /// Does the compare without calling <see cref="BaseConstraint.LockCompare"/> and <see cref="BaseConstraint.UnLockCompare"/>.
 /// </summary>
 /// <param name="attributeBag">The attribute bag.</param>
 /// <returns>Will always return <c>true</c></returns>
 protected override bool DoCompare(IAttributeBag attributeBag)
 {
     return(true);
 }
Beispiel #37
0
 /// <summary>
 /// Does the compare without calling <see cref="BaseConstraint.LockCompare"/> and <see cref="BaseConstraint.UnLockCompare"/>.
 /// </summary>
 /// <param name="attributeBag">The attribute bag.</param>
 protected abstract bool DoCompare(IAttributeBag attributeBag);
Beispiel #38
0
        /// <summary>
        /// Evaluates the and or attributes.
        /// </summary>
        /// <param name="attributeBag">The attribute bag.</param>
        /// <param name="initialReturnValue">if set to <c>false</c> it will skip the And evaluation.</param>
        /// <returns></returns>
        protected bool EvaluateAndOrAttributes(IAttributeBag attributeBag, bool initialReturnValue)
        {
            bool returnValue = initialReturnValue;

            if (returnValue && andAttribute != null)
            {
                returnValue = andAttribute.Compare(attributeBag);
            }

            if (returnValue == false && orAttribute != null)
            {
                returnValue = orAttribute.Compare(attributeBag);
            }

            return returnValue;
        }
Beispiel #39
0
		/// <summary>
		/// Does the compare without calling <see cref="BaseConstraint.LockCompare"/> and <see cref="BaseConstraint.UnLockCompare"/>.
		/// </summary>
		/// <param name="attributeBag">The attribute bag.</param>
		protected override bool DoCompare(IAttributeBag attributeBag)
		{
			return !(_baseConstraint.Compare(attributeBag));
		}
Beispiel #40
0
        /// <inheritdoc />
        public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            var attributeValue = attributeBag.GetAttributeValue(attributeName);

            return(comparer.Compare(attributeValue));
        }
Beispiel #41
0
 /// <inheritdoc />
 protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return(first.Matches(attributeBag, context) ||
            second.Matches(attributeBag, context));
 }
 protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return true;
 }
Beispiel #43
0
		/// <summary>
		/// Evaluates the and or attributes.
		/// </summary>
		/// <param name="attributeBag">The attribute bag.</param>
		/// <param name="initialReturnValue">if set to <c>false</c> it will skip the And evaluation.</param>
		/// <returns></returns>
		protected bool EvaluateAndOrAttributes(IAttributeBag attributeBag, bool initialReturnValue)
		{
			bool returnValue = initialReturnValue;

			if (returnValue && _andBaseConstraint != null)
			{
				returnValue = _andBaseConstraint.Compare(attributeBag);
			}

			if (returnValue == false && _orBaseConstraint != null)
			{
				returnValue = _orBaseConstraint.Compare(attributeBag);
			}

			return returnValue;
		}
 protected bool doCompare(IAttributeBag attributeBag)
 {
     return DoCompare(attributeBag);
 }
Beispiel #45
0
        public override bool Compare(IAttributeBag attributeBag)
        {
            base.LockCompare();

            bool resultOr;

            try
            {
                bool resultAnd = false;
                resultOr = false;

                if (andAttribute != null)
                {
                    resultAnd = andAttribute.Compare(attributeBag);
                }

                if (resultAnd || andAttribute == null)
                {
                    counter++;
                }

                if (orAttribute != null && resultAnd == false)
                {
                    resultOr = orAttribute.Compare(attributeBag);
                }
            }
            finally
            {
                base.UnLockCompare();
            }

            return (counter == index) || resultOr;
        }
Beispiel #46
0
 /// <summary>
 /// Returns true if the constraint matches an object described by an attribute bag.
 /// </summary>
 /// <param name="attributeBag">The attribute bag, not null</param>
 /// <param name="context">The constraint matching context, not null</param>
 /// <returns>True if the constraint matches</returns>
 public abstract bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context);
Beispiel #47
0
 public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return(ActualConstraint.MatchesImpl(attributeBag, context));
 }
Beispiel #48
0
        /// <summary>
        /// Does the compare without calling <see cref="BaseConstraint.LockCompare"/> and <see cref="BaseConstraint.UnLockCompare"/>.
        /// </summary>
        /// <param name="attributeBag">The attribute bag.</param>
        /// <returns>Will always return <c>true</c></returns>
		protected override bool DoCompare(IAttributeBag attributeBag)
		{
			return true;
		}
 protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     var element = attributeBag.GetAdapter<Element>();
     return element != null && Comparer.Compare(IsVisible(element).ToString());
 }
Beispiel #50
0
        protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
        {
            var element = attributeBag.GetAdapter <Element>();

            return(element != null && Comparer.Compare(IsVisible(element).ToString()));
        }
Beispiel #51
0
 /// <inheritdoc />
 protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return ! inner.Matches(attributeBag, context);
 }
 public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return ActualConstraint.MatchesImpl(attributeBag, context);
 }
Beispiel #53
0
 public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return(true);
 }
 /// <summary>
 /// Does the compare without calling <see cref="BaseConstraint.LockCompare"/> and <see cref="BaseConstraint.UnLockCompare"/>.
 /// </summary>
 /// <param name="attributeBag">The attribute bag.</param>
 protected override bool DoCompare(IAttributeBag attributeBag)
 {
     return EvaluateAndOrAttributes(attributeBag, comparer.Compare(attributeBag.GetValue(attributeName)));
 }
 /// <summary>
 /// Returns true if the constraint matches an object described by an attribute bag.
 /// </summary>
 /// <param name="attributeBag">The attribute bag, not null</param>
 /// <param name="context">The constraint matching context, not null</param>
 /// <returns>True if the constraint matches</returns>
 public abstract bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context);
Beispiel #56
0
 /// <summary>
 /// Returns true if the constraint matches an object described by an attribute bag.
 /// </summary>
 /// <param name="attributeBag">The attribute bag, not null</param>
 /// <param name="context">The constraint matching context, not null</param>
 /// <returns>True if the constraint matches</returns>
 protected abstract bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context);
Beispiel #57
0
 /// <inheritdoc />
 protected override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return(!inner.Matches(attributeBag, context));
 }
 /// <inheritdoc />
 public override bool MatchesImpl(IAttributeBag attributeBag, ConstraintContext context)
 {
     return false;
 }
Beispiel #59
0
 protected bool doCompare(IAttributeBag attributeBag)
 {
     return(DoCompare(attributeBag));
 }
Beispiel #60
0
 /// <summary>
 /// Does the compare without calling <see cref="LockCompare"/> and <see cref="UnLockCompare"/>.
 /// </summary>
 /// <param name="attributeBag">The attribute bag.</param>
 protected virtual bool doCompare(IAttributeBag attributeBag)
 {
     return EvaluateAndOrAttributes(attributeBag, comparer.Compare(attributeBag.GetValue(attributeName)));
 }