Exemplo n.º 1
0
        public ClauseListElement Add(ClauseValue value)
        {
            Contract.Requires(value != null);
            Values.Add(value);

            return(this);
        }
Exemplo n.º 2
0
        public Condition <T> Value(string value)
        {
            Contract.Requires(!String.IsNullOrWhiteSpace(value));
            ClauseValue val = new ClauseValue();

            val.Value = value;

            return(AddClause(val));
        }
Exemplo n.º 3
0
        public void AddValue(ClauseValue value)
        {
            Contract.Requires(value != null);

            if (RightElement == null)
            {
                RightElement = new ClauseListElement();
            }
            ClauseListElement elem = (ClauseListElement)RightElement;

            elem.Values.Add(value);
        }
Exemplo n.º 4
0
        public Condition <T> FieldOperation(string field, EMathOperator oper, string value)
        {
            Contract.Requires(!String.IsNullOrWhiteSpace(field));
            Contract.Requires(oper != EMathOperator.None);
            Contract.Requires(!String.IsNullOrWhiteSpace(value));

            ClauseOperationElement elem = new ClauseOperationElement();

            ClauseVariable var = new ClauseVariable();

            var.Name         = field;
            elem.LeftElement = var;

            elem.Operator = oper;

            ClauseValue val = new ClauseValue();

            val.Value = value;

            return(AddClause(elem));
        }
Exemplo n.º 5
0
        public Condition <T> Compare(string field, EBasicOperator oper, string value)
        {
            Contract.Requires(!String.IsNullOrWhiteSpace(field));
            Contract.Requires(oper != EBasicOperator.None);
            CheckRoot();

            BasicCondition <T> condition = new BasicCondition <T>();

            ClauseVariable var = new ClauseVariable();

            var.Name = field;
            condition.LeftElement = var;

            condition.Operator = oper;

            ClauseValue val = new ClauseValue();

            val.Value = value;
            condition.RightElement = val;

            AddCondition(condition);
            return(condition);
        }