Open sandboxFocus

Class SwitchStatementBuilder

Builds a switch statement.

Inheritance
SwitchStatementBuilder
Implements
Namespace: Metalama.Framework.Code.SyntaxBuilders
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public sealed class SwitchStatementBuilder : IStatementBuilder

Constructors

Name Description
SwitchStatementBuilder(IExpression)

Initializes a new instance of the SwitchStatementBuilder class.

Properties

Name Description
SectionCount

Gets the number of sections in the switch.

Methods

Name Description
AddCase(SwitchStatementLabel, IExpression?, IStatement, bool)

Add a case switch section with a when expression. This overload accepts an IStatement.

AddCase(SwitchStatementLabel, IExpression?, IStatementList, bool)

Add a case switch section with a when expression. This overload accepts an IStatementList.

AddCase(SwitchStatementLabel, IStatement, bool)

Add a case switch section. This overload accepts an IStatement.

AddCase(SwitchStatementLabel, IStatementList, bool)

Add a case switch section. This overload accepts an IStatementList.

AddDefault(IStatement, bool)

Add a default switch section. This overload accepts an IStatement.

AddDefault(IStatementList, bool)

Add a default switch section. This overload accepts an IStatementList.

ToStatement()

Builds an IStatement from the current object.

Extension Methods