1 //------------------------------------------------------------------------------
2 // <copyright file="CodeIterationStatement.cs" company="Microsoft">
4 // <OWNER>Microsoft</OWNER>
5 // Copyright (c) Microsoft Corporation. All rights reserved.
7 //------------------------------------------------------------------------------
9 namespace System.CodeDom {
11 using System.Diagnostics;
13 using Microsoft.Win32;
14 using System.Collections;
15 using System.Runtime.InteropServices;
19 /// Represents a simple for loop.
23 ClassInterface(ClassInterfaceType.AutoDispatch),
27 public class CodeIterationStatement : CodeStatement {
28 private CodeStatement initStatement;
29 private CodeExpression testExpression;
30 private CodeStatement incrementStatement;
31 private CodeStatementCollection statements = new CodeStatementCollection();
35 /// Initializes a new instance of <see cref='System.CodeDom.CodeIterationStatement'/>.
38 public CodeIterationStatement() {
43 /// Initializes a new instance of <see cref='System.CodeDom.CodeIterationStatement'/>.
46 public CodeIterationStatement(CodeStatement initStatement, CodeExpression testExpression, CodeStatement incrementStatement, params CodeStatement[] statements) {
47 InitStatement = initStatement;
48 TestExpression = testExpression;
49 IncrementStatement = incrementStatement;
50 Statements.AddRange(statements);
56 /// the loop initialization statement.
59 public CodeStatement InitStatement {
64 initStatement = value;
71 /// the expression to test for.
74 public CodeExpression TestExpression {
76 return testExpression;
79 testExpression = value;
86 /// the per loop cycle increment statement.
89 public CodeStatement IncrementStatement {
91 return incrementStatement;
94 incrementStatement = value;
101 /// the statements to be executed within the loop.
104 public CodeStatementCollection Statements {