AddCase(SwitchStatementLabel, IStatementList, bool)
Add a case
switch section. This overload accepts an IStatementList.
Declaration
public void AddCase(SwitchStatementLabel label, IStatementList statements, bool appendBreak = true)
Parameters
Type | Name | Description |
---|---|---|
SwitchStatementLabel | label | The label, i.e. the value to match. |
IStatementList | statements | The statements to execute. |
bool | appendBreak | Value indicating whether a |
AddCase(SwitchStatementLabel, IStatement, bool)
Add a case
switch section. This overload accepts an IStatement.
Declaration
public void AddCase(SwitchStatementLabel label, IStatement statement, bool appendBreak = true)
Parameters
Type | Name | Description |
---|---|---|
SwitchStatementLabel | label | The label, i.e. the value to match. |
IStatement | statement | The statement to execute. To call a template, see FromTemplate(TemplateInvocation, object?). |
bool | appendBreak | Value indicating whether a |
AddCase(SwitchStatementLabel, IExpression?, IStatementList, bool)
Add a case
switch section with a when
expression. This overload accepts an IStatementList.
Declaration
public void AddCase(SwitchStatementLabel label, IExpression? when, IStatementList statements, bool appendBreak = true)
Parameters
Type | Name | Description |
---|---|---|
SwitchStatementLabel | label | The label, i.e. the value to match. |
IExpression | when | The |
IStatementList | statements | The statements to execute. |
bool | appendBreak | Value indicating whether a |
AddCase(SwitchStatementLabel, IExpression?, IStatement, bool)
Add a case
switch section with a when
expression. This overload accepts an IStatement.
Declaration
public void AddCase(SwitchStatementLabel label, IExpression? when, IStatement statement, bool appendBreak = true)
Parameters
Type | Name | Description |
---|---|---|
SwitchStatementLabel | label | The label, i.e. the value to match. |
IExpression | when | The |
IStatement | statement | The statement to execute. To call a template, see FromTemplate(TemplateInvocation, object?). |
bool | appendBreak | Value indicating whether a |