The Labs \ Source Viewer \ SSCLI \ System.CodeDom \ CodeIterationStatement

  1. //------------------------------------------------------------------------------
  2. // <copyright file="CodeIterationStatement.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.CodeDom
  16. {
  17.    
  18.     using System.Diagnostics;
  19.     using System;
  20.     using Microsoft.Win32;
  21.     using System.Collections;
  22.     using System.Runtime.InteropServices;
  23.    
  24.     /// <devdoc>
  25.     /// <para>
  26.     /// Represents a simple for loop.
  27.     /// </para>
  28.     /// </devdoc>
  29.     [ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable()]
  30.     public class CodeIterationStatement : CodeStatement
  31.     {
  32.         private CodeStatement initStatement;
  33.         private CodeExpression testExpression;
  34.         private CodeStatement incrementStatement;
  35.         private CodeStatementCollection statements = new CodeStatementCollection();
  36.        
  37.         /// <devdoc>
  38.         /// <para>
  39.         /// Initializes a new instance of <see cref='System.CodeDom.CodeIterationStatement'/>.
  40.         /// </para>
  41.         /// </devdoc>
  42.         public CodeIterationStatement()
  43.         {
  44.         }
  45.        
  46.         /// <devdoc>
  47.         /// <para>
  48.         /// Initializes a new instance of <see cref='System.CodeDom.CodeIterationStatement'/>.
  49.         /// </para>
  50.         /// </devdoc>
  51.         public CodeIterationStatement(CodeStatement initStatement, CodeExpression testExpression, CodeStatement incrementStatement, params CodeStatement[] statements)
  52.         {
  53.             InitStatement = initStatement;
  54.             TestExpression = testExpression;
  55.             IncrementStatement = incrementStatement;
  56.             Statements.AddRange(statements);
  57.         }
  58.        
  59.         /// <devdoc>
  60.         /// <para>
  61.         /// Gets or sets
  62.         /// the loop initialization statement.
  63.         /// </para>
  64.         /// </devdoc>
  65.         public CodeStatement InitStatement {
  66.             get { return initStatement; }
  67.             set { initStatement = value; }
  68.         }
  69.        
  70.         /// <devdoc>
  71.         /// <para>
  72.         /// Gets or sets
  73.         /// the expression to test for.
  74.         /// </para>
  75.         /// </devdoc>
  76.         public CodeExpression TestExpression {
  77.             get { return testExpression; }
  78.             set { testExpression = value; }
  79.         }
  80.        
  81.         /// <devdoc>
  82.         /// <para>
  83.         /// Gets or sets
  84.         /// the per loop cycle increment statement.
  85.         /// </para>
  86.         /// </devdoc>
  87.         public CodeStatement IncrementStatement {
  88.             get { return incrementStatement; }
  89.             set { incrementStatement = value; }
  90.         }
  91.        
  92.         /// <devdoc>
  93.         /// <para>
  94.         /// Gets or sets
  95.         /// the statements to be executed within the loop.
  96.         /// </para>
  97.         /// </devdoc>
  98.         public CodeStatementCollection Statements {
  99.             get { return statements; }
  100.         }
  101.     }
  102. }

Developer Fusion