public CodeForeachStatement(CodeVariableDeclarationStatement declaration, CodeExpression expression, IEnumerable <CodeStatement> statements)
 {
     Debug.Assert(declaration.InitExpression == null, "foreach variable declaration cannot have initializer");
     Declaration = declaration;
     Expression  = expression;
     Statements.AddRange(statements);
 }
Exemple #2
0
 /// <include file='doc\CodeIterationStatement.uex' path='docs/doc[@for="CodeIterationStatement.CodeIterationStatement1"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Initializes a new instance of <see cref='System.CodeDom.CodeIterationStatement'/>.
 ///    </para>
 /// </devdoc>
 public CodeIterationStatement(CodeStatement initStatement, CodeExpression testExpression, CodeStatement incrementStatement, params CodeStatement[] statements)
 {
     InitStatement      = initStatement;
     TestExpression     = testExpression;
     IncrementStatement = incrementStatement;
     Statements.AddRange(statements);
 }
Exemple #3
0
 public JSForLoop(JSStatement initializer, JSExpression condition, JSStatement increment, params JSStatement[] body)
 {
     _Initializer = initializer;
     _Condition   = condition;
     _Increment   = increment;
     Statements.AddRange(body);
 }
Exemple #4
0
 public CodeForStatement(CodeStatement initStatement, CodeExpression testExpression, CodeExpression incrementExpression, IEnumerable <CodeStatement> statements)
 {
     InitStatement       = initStatement;
     TestExpression      = testExpression;
     IncrementExpression = incrementExpression;
     Statements.AddRange(statements);
 }
 public CodeIterationStatement(ILInstruction inline, CodeStatement initStatement, CodeExpression testExpression, CodeStatement incrementStatement, params CodeStatement[] statements) : base(inline)
 {
     InitStatement      = initStatement;
     TestExpression     = testExpression;
     IncrementStatement = incrementStatement;
     Statements.AddRange(statements);
 }
        public CodeLambdaExpression(IEnumerable <CodeParameterDeclaration> parameters, IEnumerable <CodeStatement> statements)
        {
            Ensure.That(nameof(parameters)).IsNotNull(parameters);
            Ensure.That(nameof(statements)).IsNotNull(statements);

            Parameters = new List <CodeParameterDeclaration>(parameters);
            Statements.AddRange(statements);
        }
Exemple #7
0
 public CodeCatchClause(String localName,
                        CodeTypeReference catchExceptionType,
                        params CodeStatement[] statements)
 {
     this.localName          = localName;
     this.catchExceptionType = catchExceptionType;
     Statements.AddRange(statements);
 }
Exemple #8
0
 public void Add(Block block)
 {
     if (block.HasAnnotations)
     {
         Statements.Add(block);
         return;
     }
     Statements.AddRange(block.Statements);
 }
Exemple #9
0
 public CodeForeachStatement(CodeVariableDeclarationStatement element, CodeExpression iterator, params CodeStatement[] statements)
 {
     if (element.InitExpression != null)
     {
         throw new System.InvalidOperationException($"{nameof(element)} cannot be initialized in foreach loop");
     }
     Element  = element;
     Iterator = iterator;
     if (statements != null)
     {
         Statements.AddRange(statements);
     }
 }
Exemple #10
0
 public Block(params Statement[] statements)
 {
     Statements.AddRange(statements);
 }
Exemple #11
0
 public CodeUsingStatement(CodeStatement initStatement, IEnumerable <CodeStatement> statements)
 {
     InitStatement = initStatement;
     Statements.AddRange(statements);
 }
Exemple #12
0
 public CodeBasicMethodMember(CodeMemberModifiers modifiers, IEnumerable <CodeParameterDeclaration> parameters, IEnumerable <CodeStatement> statements)
     : base(modifiers)
 {
     Parameters.AddRange(parameters);
     Statements.AddRange(statements);
 }
 public CodeDefaultStatement(IEnumerable <CodeStatement> statements)
 {
     Statements.AddRange(statements);
     Fallthrough = false;
 }
 public CodeDoWhileStatement(CodeExpression condition, IEnumerable <CodeStatement> statements)
 {
     Condition = condition;
     Statements.AddRange(statements);
 }
 public CodeBlockStatement(IEnumerable <CodeStatement> statements)
 {
     Statements.AddRange(statements);
 }
Exemple #16
0
 public RunScriptEventArgs(IEnumerable <string> statements, DatabaseConnection databaseConnection)
     : this(databaseConnection)
 {
     Statements.AddRange(statements);
 }
Exemple #17
0
 public CodeCaseStatement(CodeExpression value, IEnumerable <CodeStatement> statements)
 {
     Value = value;
     Statements.AddRange(statements);
     Fallthrough = false;
 }
 public BlockSyntax AddStatements(params StatementSyntax[] items)
 {
     Statements.AddRange(items);
     return(Update(OpenBraceToken, Statements, CloseBraceToken));
 }
 public ConstructorGenerator AddStatements(IEnumerable <StatementSyntax> statements)
 {
     Statements.AddRange(statements);
     return(this);
 }
 public CodeCatchClause(string localName, CodeTypeReference catchExceptionType, IEnumerable <CodeStatement> statements)
 {
     LocalName          = localName;
     CatchExceptionType = catchExceptionType;
     Statements.AddRange(statements);
 }
Exemple #21
0
 public Block(Location startLoc, List <Statement> statements, Location endLoc)
 {
     StartLocation = startLoc;
     Statements.AddRange(statements);
     EndLocation = endLoc;
 }
Exemple #22
0
 public CodeUserPropertyAccessor(CodeMemberModifiers modifiers, IEnumerable <CodeStatement> statements)
     : base(modifiers)
 {
     Statements.AddRange(statements);
 }
Exemple #23
0
 public BlockSyntax(IEnumerable <StatementSyntax> statements)
 {
     Statements.AddRange(statements.EmptyIfNull());
 }
Exemple #24
0
 public void AddRange(List <Statement> stmts)
 {
     Statements.AddRange(stmts);
 }
Exemple #25
0
 /// <summary>
 /// Creates a new <see cref="StatementListInfo"/> with the specified statements added at the end.
 /// </summary>
 /// <param name="statements"></param>
 /// <returns></returns>
 public StatementListInfo AddRange(IEnumerable <StatementSyntax> statements)
 {
     return(WithStatements(Statements.AddRange(statements)));
 }
Exemple #26
0
 public JSDoLoop(JSExpression condition, params JSStatement[] body)
 {
     _Condition = condition;
     Statements.AddRange(body);
 }
 public CodeSwitchStatement(CodeExpression value, IEnumerable <CodeStatement> statements)
 {
     Value = value;
     Statements.AddRange(statements);
 }