private IGuard readCompoundGuard(XPathNodeIterator it, BinaryGuardOperator op)
        {
            IGuard g = readSelectedGuard(it.Current);

            if (it.MoveNext())
            {
                return(new CompoundGuard(op, g, readCompoundGuard(it, op)));
            }
            else
            {
                return(g);
            }
        }
        private IGuard GetGuard(IGuard[] guardOperands, BinaryGuardOperator op)
        {
            var guard = default(IGuard);

            if (guardOperands.Length == 1)
            {
                guard = guardOperands[0];
            }
            else
            {
                var compoundGuard = new CompoundGuard(op, guardOperands[1], guardOperands[0]);

                foreach (var guardOperand in guardOperands.Skip(2))
                {
                    compoundGuard = new CompoundGuard(op, guardOperand, compoundGuard);
                }

                guard = compoundGuard;
            }

            return(guard);
        }
Esempio n. 3
0
 public CompoundGuard(BinaryGuardOperator op, IGuard operand1, IGuard operand2)
 {
     Lhs      = operand1;
     Rhs      = operand2;
     Operator = op;
 }