Example #1
0
        public Node Operate(Operation op, Node other)
        {
            var otherField = other as CartoFieldNode;

            if (otherField == null)
            {
                Quoted otherQuoted = other as Quoted;

                return(new Quoted(this.Value + op.Operator + ConvertUtility.QuoteValue(otherQuoted.Value), otherQuoted.Escaped));
            }
            else
            {
                return(new CartoFieldNode(this.Value + otherField.Value));
            }
        }
        public Node Operate(Operation op, Node other)
        {
            Quoted otherQuoted = other as Quoted;

            if (otherQuoted != null)
            {
                return(new Quoted(ConvertUtility.QuoteValue(this.Value) + op.Operator + ConvertUtility.QuoteValue(otherQuoted.Value), this.Escaped));
            }
            else
            {
                CartoFieldNode fieldNode = other as CartoFieldNode;

                if (fieldNode != null)
                {
                    return(new Quoted(ConvertUtility.QuoteValue(this.Value) + op.Operator + fieldNode.Value, this.Escaped));
                }
                else
                {
                    throw new Exception();
                }
            }
        }