Esempio n. 1
0
        private static bool EvaluateComparePropertyRestriction(Restriction.ComparePropertyRestriction restriction, IRuleEvaluationContext context)
        {
            RestrictionEvaluator.ValidateComparePropertyRestriction(restriction);
            object obj  = context[restriction.TagLeft];
            object obj2 = context[restriction.TagRight];

            context.TraceFunction <PropTag, Restriction.RelOp, PropTag>("ComparePropertyRestriction [{0}] {1} [{2}]", restriction.TagLeft, restriction.Op, restriction.TagRight);
            bool flag = false;

            if (obj != null && obj2 != null)
            {
                flag = context.CompareSingleValue(restriction.TagLeft, restriction.Op, obj, obj2);
            }
            context.TraceFunction <object, Restriction.RelOp, object, bool>("[{0}] {1} [{2}] evaluated to {3}", obj, restriction.Op, obj2, flag);
            return(flag);
        }