Example #1
0
 public virtual void VisitIterationStatement(IterationStatement iterationStatement)
 {
     VisitStatement(iterationStatement);
     Visit(iterationStatement.Initialization);
     Visit(iterationStatement.Condition);
     Visit(iterationStatement.IncrementStatement);
     Visit(iterationStatement.Body);
 }
Example #2
0
 protected virtual void Write(IndentedTextWriter writer, IterationStatement statement, WriteStatementOptions options)
 {
     writer.Write("for (");
     if (statement.Initialization != null)
     {
         Write(writer, statement.Initialization, _inlineStatementWriteStatementOptions);
     }
     writer.Write("; ");
     if (statement.Condition != null)
     {
         Write(writer, statement.Condition);
     }
     writer.Write("; ");
     if (statement.IncrementStatement != null)
     {
         Write(writer, statement.IncrementStatement, _inlineStatementWriteStatementOptions);
     }
     writer.Write(")");
     writer.WriteLine();
     Write(writer, statement.Body);
 }