private String PartToString(ExpressionTreeNode node, Int32 currentPrecedence) { Debug.Assert(node != null, "node != null"); String part = node.ToString(); if (node.Token.IsOperator) { switch (node.Token.OperatorDescriptor.PrimitiveOperator) { case PrimitiveOperator.Add: case PrimitiveOperator.Sub: case PrimitiveOperator.Mul: case PrimitiveOperator.Div: { if (currentPrecedence > LeftNode.Token.OperatorPrecedence) { part = String.Format(CultureInfo.CurrentCulture, "({0})", part); } break; } } } return part; }
private String PartToString(ExpressionTreeNode node, Int32 currentPrecedence) { Debug.Assert(node != null, "node != null"); String part = node.ToString(); if (node.Token.IsOperator) { switch (node.Token.OperatorDescriptor.PrimitiveOperator) { case PrimitiveOperator.Add: case PrimitiveOperator.Sub: case PrimitiveOperator.Mul: case PrimitiveOperator.Div: { if (currentPrecedence > LeftNode.Token.OperatorPrecedence) { part = String.Format(CultureInfo.CurrentCulture, "({0})", part); } break; } } } return(part); }