Skip to main content

SyntaxExtensions.GetTopmostIf Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.CSharp.dll

Overloads

MethodSummary
GetTopmostIf(ElseClauseSyntax)Returns topmost if statement of the if-else cascade the specified else clause is part of.
GetTopmostIf(IfStatementSyntax)Returns topmost if statement of the if-else cascade the specified if statement is part of.

GetTopmostIf(ElseClauseSyntax)

Returns topmost if statement of the if-else cascade the specified else clause is part of.

public static Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax? GetTopmostIf(this Microsoft.CodeAnalysis.CSharp.Syntax.ElseClauseSyntax elseClause)

Parameters

elseClause ElseClauseSyntax

Returns

IfStatementSyntax

GetTopmostIf(IfStatementSyntax)

Returns topmost if statement of the if-else cascade the specified if statement is part of.

public static Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax GetTopmostIf(this Microsoft.CodeAnalysis.CSharp.Syntax.IfStatementSyntax ifStatement)

Parameters

ifStatement IfStatementSyntax

Returns

IfStatementSyntax