Skip to main content

StatementListSelection.TryCreate Method

Containing Type: StatementListSelection

Assembly: Roslynator.CSharp.dll

Overloads

MethodSummary
TryCreate(BlockSyntax, TextSpan, StatementListSelection)Creates a new StatementListSelection based on the specified block and span.
TryCreate(SwitchSectionSyntax, TextSpan, StatementListSelection)Creates a new StatementListSelection based on the specified switch section and span.

TryCreate(BlockSyntax, TextSpan, StatementListSelection)

Creates a new StatementListSelection based on the specified block and span.

public static bool TryCreate(Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax block, Microsoft.CodeAnalysis.Text.TextSpan span, out Roslynator.CSharp.StatementListSelection? selectedStatements)

Parameters

block BlockSyntax

span TextSpan

selectedStatements StatementListSelection

Returns

Boolean

True if the specified span contains at least one statement; otherwise, false.

TryCreate(SwitchSectionSyntax, TextSpan, StatementListSelection)

Creates a new StatementListSelection based on the specified switch section and span.

public static bool TryCreate(Microsoft.CodeAnalysis.CSharp.Syntax.SwitchSectionSyntax switchSection, Microsoft.CodeAnalysis.Text.TextSpan span, out Roslynator.CSharp.StatementListSelection? selectedStatements)

Parameters

switchSection SwitchSectionSyntax

span TextSpan

selectedStatements StatementListSelection

Returns

Boolean

True if the specified span contains at least one statement; otherwise, false.