コード例 #1
0
        public CSharpSyntaxNode Convert(CaseClause node)
        {
            SwitchSectionSyntax csSwitchSection = SyntaxFactory.SwitchSection();

            csSwitchSection = csSwitchSection.AddLabels(SyntaxFactory.CaseSwitchLabel(node.Expression.ToCsNode <ExpressionSyntax>()));
            csSwitchSection = csSwitchSection.AddStatements(node.Statements.ToCsNodes <StatementSyntax>());

            return(csSwitchSection);
        }
コード例 #2
0
        public CSharpSyntaxNode Convert(DefaultClause node)
        {
            SwitchSectionSyntax csSwitchSection = SyntaxFactory.SwitchSection();

            csSwitchSection = csSwitchSection.AddLabels(SyntaxFactory.DefaultSwitchLabel());
            csSwitchSection = csSwitchSection.AddStatements(node.Statements.ToCsNodes <StatementSyntax>());

            return(csSwitchSection);
        }