Пример #1
0
        public void VisitSwitchSection(SwitchSectionSyntax node)
        {
            if (node == null)
                throw new ArgumentNullException("node");

            node.Validate();

            WriteLeadingTrivia(node);

            bool hadOne = false;

            foreach (var label in node.Labels)
            {
                if (hadOne)
                    _writer.WriteLine();
                else
                    hadOne = true;

                label.Accept(this);
            }

            _writer.PushBraceFormatting(_writer.Configuration.BracesLayout.BlockUnderCaseLabel, false);

            foreach (var statement in node.Statements)
            {
                VisitBlockStatement(statement);
            }

            _writer.PopBraceFormatting();

            WriteTrailingTrivia(node);
        }