BooleanExpressionType() public static method

public static BooleanExpressionType ( BooleanBinaryExpressionType btype ) : string
btype BooleanBinaryExpressionType
return string
Exemplo n.º 1
0
        // WBooleanExpression
        public override void Visit(WBooleanBinaryExpression node)
        {
            node.FirstExpr.Accept(this);
            string left = this.dfsStack.Pop();

            node.SecondExpr.Accept(this);
            string right = this.dfsStack.Pop();

            string nodeStr = $"{left} {TsqlFragmentToString.BooleanExpressionType(node.BooleanExpressionType)} {right}";

            this.dfsStack.Push(nodeStr);
        }
        internal override string ToString(string indent)
        {
            var sb = new StringBuilder(512);

            sb.Append(FirstExpr.ToString(indent));

            sb.AppendFormat(" {0} ", TsqlFragmentToString.BooleanExpressionType(BooleanExpressionType));

            if (SecondExpr.OneLine())
            {
                sb.Append(SecondExpr.ToString(""));
            }
            else
            {
                sb.Append("\r\n");
                sb.Append(SecondExpr.ToString(indent));
            }

            return(sb.ToString());
        }