Share via


SyntaxFactory.IfStatement Method

Definition

Overloads

IfStatement(ExpressionSyntax, StatementSyntax)

Creates a new IfStatementSyntax instance.

IfStatement(ExpressionSyntax, StatementSyntax, ElseClauseSyntax)

Creates a new IfStatementSyntax instance.

IfStatement(SyntaxList<AttributeListSyntax>, ExpressionSyntax, StatementSyntax, ElseClauseSyntax)

Creates a new IfStatementSyntax instance.

IfStatement(SyntaxToken, SyntaxToken, ExpressionSyntax, SyntaxToken, StatementSyntax, ElseClauseSyntax)

Creates a new IfStatementSyntax instance.

IfStatement(SyntaxList<AttributeListSyntax>, SyntaxToken, SyntaxToken, ExpressionSyntax, SyntaxToken, StatementSyntax, ElseClauseSyntax)

Creates a new IfStatementSyntax instance.

IfStatement(ExpressionSyntax, StatementSyntax)

Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs

Creates a new IfStatementSyntax instance.

public:
 static Microsoft::CodeAnalysis::CSharp::Syntax::IfStatementSyntax ^ IfStatement(Microsoft::CodeAnalysis::CSharp::Syntax::ExpressionSyntax ^ condition, Microsoft::CodeAnalysis::CSharp::Syntax::StatementSyntax ^ statement);
public static Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax IfStatement (Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement);
static member IfStatement : Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax * Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax -> Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax
Public Shared Function IfStatement (condition As ExpressionSyntax, statement As StatementSyntax) As IfStatementSyntax

Parameters

condition
ExpressionSyntax
statement
StatementSyntax

Returns

Applies to

IfStatement(ExpressionSyntax, StatementSyntax, ElseClauseSyntax)

Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs

Creates a new IfStatementSyntax instance.

public:
 static Microsoft::CodeAnalysis::CSharp::Syntax::IfStatementSyntax ^ IfStatement(Microsoft::CodeAnalysis::CSharp::Syntax::ExpressionSyntax ^ condition, Microsoft::CodeAnalysis::CSharp::Syntax::StatementSyntax ^ statement, Microsoft::CodeAnalysis::CSharp::Syntax::ElseClauseSyntax ^ else);
public static Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax IfStatement (Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement, Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax else);
public static Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax IfStatement (Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement, Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax? else);
static member IfStatement : Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax * Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax * Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax -> Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax
Public Shared Function IfStatement (condition As ExpressionSyntax, statement As StatementSyntax, else As ElseClauseSyntax) As IfStatementSyntax

Parameters

condition
ExpressionSyntax
statement
StatementSyntax

Returns

Applies to

IfStatement(SyntaxList<AttributeListSyntax>, ExpressionSyntax, StatementSyntax, ElseClauseSyntax)

Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs

Creates a new IfStatementSyntax instance.

public static Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax IfStatement (Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement, Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax? else);
static member IfStatement : Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> * Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax * Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax * Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax -> Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax
Public Shared Function IfStatement (attributeLists As SyntaxList(Of AttributeListSyntax), condition As ExpressionSyntax, statement As StatementSyntax, else As ElseClauseSyntax) As IfStatementSyntax

Parameters

condition
ExpressionSyntax
statement
StatementSyntax

Returns

Applies to

IfStatement(SyntaxToken, SyntaxToken, ExpressionSyntax, SyntaxToken, StatementSyntax, ElseClauseSyntax)

Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs
Source:
IfStatementSyntax.cs

Creates a new IfStatementSyntax instance.

public:
 static Microsoft::CodeAnalysis::CSharp::Syntax::IfStatementSyntax ^ IfStatement(Microsoft::CodeAnalysis::SyntaxToken ifKeyword, Microsoft::CodeAnalysis::SyntaxToken openParenToken, Microsoft::CodeAnalysis::CSharp::Syntax::ExpressionSyntax ^ condition, Microsoft::CodeAnalysis::SyntaxToken closeParenToken, Microsoft::CodeAnalysis::CSharp::Syntax::StatementSyntax ^ statement, Microsoft::CodeAnalysis::CSharp::Syntax::ElseClauseSyntax ^ else);
public static Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax IfStatement (Microsoft.CodeAnalysis.SyntaxToken ifKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement, Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax else);
public static Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax IfStatement (Microsoft.CodeAnalysis.SyntaxToken ifKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement, Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax? else);
static member IfStatement : Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax * Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax -> Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax
Public Shared Function IfStatement (ifKeyword As SyntaxToken, openParenToken As SyntaxToken, condition As ExpressionSyntax, closeParenToken As SyntaxToken, statement As StatementSyntax, else As ElseClauseSyntax) As IfStatementSyntax

Parameters

ifKeyword
SyntaxToken
openParenToken
SyntaxToken
condition
ExpressionSyntax
closeParenToken
SyntaxToken
statement
StatementSyntax

Returns

Applies to

IfStatement(SyntaxList<AttributeListSyntax>, SyntaxToken, SyntaxToken, ExpressionSyntax, SyntaxToken, StatementSyntax, ElseClauseSyntax)

Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs
Source:
Syntax.xml.Main.Generated.cs

Creates a new IfStatementSyntax instance.

public static Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax IfStatement (Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxToken ifKeyword, Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax condition, Microsoft.CodeAnalysis.SyntaxToken closeParenToken, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement, Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax? else);
static member IfStatement : Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.AttributeListSyntax> * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax * Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax -> Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax
Public Shared Function IfStatement (attributeLists As SyntaxList(Of AttributeListSyntax), ifKeyword As SyntaxToken, openParenToken As SyntaxToken, condition As ExpressionSyntax, closeParenToken As SyntaxToken, statement As StatementSyntax, else As ElseClauseSyntax) As IfStatementSyntax

Parameters

ifKeyword
SyntaxToken
openParenToken
SyntaxToken
condition
ExpressionSyntax
closeParenToken
SyntaxToken
statement
StatementSyntax

Returns

Applies to