CaseBlockSyntax ConvertSwitchSection(CSS.SwitchSectionSyntax section) { if (IsDefaultSwitchStatement(section)) { return(SyntaxFactory.CaseElseBlock(SyntaxFactory.CaseElseStatement(SyntaxFactory.ElseCaseClause()), ConvertSwitchSectionBlock(section))); } return(SyntaxFactory.CaseBlock(SyntaxFactory.CaseStatement(SyntaxFactory.SeparatedList(section.Labels.OfType <CSS.CaseSwitchLabelSyntax>().Select(ConvertSwitchLabel))), ConvertSwitchSectionBlock(section))); }
CaseBlockSyntax ConvertSwitchSection(CSS.SwitchSectionSyntax section) { if (IsDefaultSwitchStatement(section)) { return(SyntaxFactory.CaseElseBlock(SyntaxFactory.CaseElseStatement(SyntaxFactory.ElseCaseClause()), ConvertSwitchSectionBlock(section))); } var caseClauseSyntaxes = section.Labels.Select(l => l.Accept(_nodesVisitor)); var caseStatementSyntax = SyntaxFactory.CaseStatement(SyntaxFactory.SeparatedList(caseClauseSyntaxes.Cast <CaseClauseSyntax>())); return(SyntaxFactory.CaseBlock(caseStatementSyntax, ConvertSwitchSectionBlock(section))); }