SyntaxFactory.ForEachStatement Method

Definition

Overloads

ForEachStatement(VisualBasicSyntaxNode, ExpressionSyntax)

The For Each statement that begins a For Each-Next block. This statement always occurs as the Begin of a ForBlock, and the body of the For Each-Next is the Body of that ForBlock. Most of the time, the End of that ForBlock is the corresponding Next statement. However, multiple nested For statements are ended by a single Next statement with multiple variables, then the inner For statements will have End set to Nothing, and the Next statement is the End of the outermost For statement that is being ended.

ForEachStatement(SyntaxToken, SyntaxToken, VisualBasicSyntaxNode, SyntaxToken, ExpressionSyntax)

The For Each statement that begins a For Each-Next block. This statement always occurs as the Begin of a ForBlock, and the body of the For Each-Next is the Body of that ForBlock. Most of the time, the End of that ForBlock is the corresponding Next statement. However, multiple nested For statements are ended by a single Next statement with multiple variables, then the inner For statements will have End set to Nothing, and the Next statement is the End of the outermost For statement that is being ended.

ForEachStatement(VisualBasicSyntaxNode, ExpressionSyntax)

Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb

The For Each statement that begins a For Each-Next block. This statement always occurs as the Begin of a ForBlock, and the body of the For Each-Next is the Body of that ForBlock. Most of the time, the End of that ForBlock is the corresponding Next statement. However, multiple nested For statements are ended by a single Next statement with multiple variables, then the inner For statements will have End set to Nothing, and the Next statement is the End of the outermost For statement that is being ended.

public:
 static Microsoft::CodeAnalysis::VisualBasic::Syntax::ForEachStatementSyntax ^ ForEachStatement(Microsoft::CodeAnalysis::VisualBasic::VisualBasicSyntaxNode ^ controlVariable, Microsoft::CodeAnalysis::VisualBasic::Syntax::ExpressionSyntax ^ expression);
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.ForEachStatementSyntax ForEachStatement (Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode controlVariable, Microsoft.CodeAnalysis.VisualBasic.Syntax.ExpressionSyntax expression);
static member ForEachStatement : Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode * Microsoft.CodeAnalysis.VisualBasic.Syntax.ExpressionSyntax -> Microsoft.CodeAnalysis.VisualBasic.Syntax.ForEachStatementSyntax
Public Shared Function ForEachStatement (controlVariable As VisualBasicSyntaxNode, expression As ExpressionSyntax) As ForEachStatementSyntax

Parameters

controlVariable
VisualBasicSyntaxNode

If the For or For Each statement is of a form that does not declare a new loop control variable, this is the expression that denotes the loop control variable. If this loop is of a form that does declare a new control variable, this is a VariableDeclarator that has the variable being declared.

expression
ExpressionSyntax

The expression denoting the collection to iterate over.

Returns

Applies to

ForEachStatement(SyntaxToken, SyntaxToken, VisualBasicSyntaxNode, SyntaxToken, ExpressionSyntax)

Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb

The For Each statement that begins a For Each-Next block. This statement always occurs as the Begin of a ForBlock, and the body of the For Each-Next is the Body of that ForBlock. Most of the time, the End of that ForBlock is the corresponding Next statement. However, multiple nested For statements are ended by a single Next statement with multiple variables, then the inner For statements will have End set to Nothing, and the Next statement is the End of the outermost For statement that is being ended.

public:
 static Microsoft::CodeAnalysis::VisualBasic::Syntax::ForEachStatementSyntax ^ ForEachStatement(Microsoft::CodeAnalysis::SyntaxToken forKeyword, Microsoft::CodeAnalysis::SyntaxToken eachKeyword, Microsoft::CodeAnalysis::VisualBasic::VisualBasicSyntaxNode ^ controlVariable, Microsoft::CodeAnalysis::SyntaxToken inKeyword, Microsoft::CodeAnalysis::VisualBasic::Syntax::ExpressionSyntax ^ expression);
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.ForEachStatementSyntax ForEachStatement (Microsoft.CodeAnalysis.SyntaxToken forKeyword, Microsoft.CodeAnalysis.SyntaxToken eachKeyword, Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode controlVariable, Microsoft.CodeAnalysis.SyntaxToken inKeyword, Microsoft.CodeAnalysis.VisualBasic.Syntax.ExpressionSyntax expression);
static member ForEachStatement : Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxNode * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.VisualBasic.Syntax.ExpressionSyntax -> Microsoft.CodeAnalysis.VisualBasic.Syntax.ForEachStatementSyntax
Public Shared Function ForEachStatement (forKeyword As SyntaxToken, eachKeyword As SyntaxToken, controlVariable As VisualBasicSyntaxNode, inKeyword As SyntaxToken, expression As ExpressionSyntax) As ForEachStatementSyntax

Parameters

forKeyword
SyntaxToken

The "For" keyword.

eachKeyword
SyntaxToken

The "Each" keyword.

controlVariable
VisualBasicSyntaxNode

If the For or For Each statement is of a form that does not declare a new loop control variable, this is the expression that denotes the loop control variable. If this loop is of a form that does declare a new control variable, this is a VariableDeclarator that has the variable being declared.

inKeyword
SyntaxToken

The "In" keyword.

expression
ExpressionSyntax

The expression denoting the collection to iterate over.

Returns

Applies to