/// <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> /// 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))); }