コード例 #1
0
        protected virtual Expression VisitStatementList(SqlStatementListExpression statementListExpression)
        {
            List <Expression> newStatements = null;

            for (var i = 0; i < statementListExpression.Statements.Count; i++)
            {
                var expression = this.Visit(statementListExpression.Statements[i]);

                if (expression != statementListExpression.Statements[i])
                {
                    if (newStatements == null)
                    {
                        newStatements = new List <Expression>();

                        for (var j = 0; j < i; j++)
                        {
                            newStatements.Add(statementListExpression.Statements[j]);
                        }
                    }
                }

                if (newStatements != null)
                {
                    newStatements.Add(expression);
                }
            }

            return(newStatements == null ? statementListExpression : new SqlStatementListExpression(newStatements));
        }
コード例 #2
0
        protected override Expression VisitStatementList(SqlStatementListExpression statementListExpression)
        {
            var localFoundStatementList = this.foundStatementList;

            this.foundStatementList = true;

            var retval = (SqlStatementListExpression)base.VisitStatementList(statementListExpression);

            if (!localFoundStatementList)
            {
                if (ammendments.Count > 0)
                {
                    var newList = new List<Expression>(retval.Statements);

                    newList.AddRange(ammendments);
                    retval = new SqlStatementListExpression(newList);
                }
            }

            return retval;
        }
コード例 #3
0
        protected override Expression VisitStatementList(SqlStatementListExpression expression)
        {
            SqlStatementListExpression current;
            if (!TryGetCurrent(expression, out current))
            {
                return expression;
            }

            if (!(this.result &= current.NodeType == expression.NodeType))
            {
                return expression;
            }

            if (!(this.result &= current.Type == expression.Type))
            {
                return expression;
            }

            this.currentObject = current.Statements;
            this.VisitExpressionList(expression.Statements);
            if (!this.result)
            {
                return expression;
            }

            this.currentObject = current;
            return expression;
        }
コード例 #4
0
ファイル: Sql92QueryFormatter.cs プロジェクト: ciker/Shaolinq
        protected override Expression VisitStatementList(SqlStatementListExpression statementListExpression)
        {
            var i = 0;

            foreach (var statement in statementListExpression.Statements)
            {
                this.Visit(statement);

                if (i != statementListExpression.Statements.Count - 1)
                {
                    this.WriteLine();
                }
            }

            return statementListExpression;
        }
コード例 #5
0
		protected virtual Expression VisitStatementList(SqlStatementListExpression statementListExpression)
		{
			List<Expression> newStatements = null;

			for (var i = 0; i < statementListExpression.Statements.Count; i++)
			{
				var expression = this.Visit(statementListExpression.Statements[i]);

				if (expression != statementListExpression.Statements[i])
				{
					if (newStatements == null)
					{
						newStatements = new List<Expression>();

						for (var j = 0; j < i; j++)
						{
							newStatements.Add(statementListExpression.Statements[j]);
						}
					}
				}

				if (newStatements != null)
				{
					newStatements.Add(expression);
				}
			}

			return newStatements == null ? statementListExpression : new SqlStatementListExpression(newStatements);
		}