Пример #1
0
        private void FormatXmlElementStartTag(XmlElementStartTagSyntax node, ElementFormatting formatting)
        {
            if (formatting.HasFlag(ElementFormatting.Block))
            {
                Break(BreakMode.LineBreak);
            }

            if (node.HasLeadingTrivia)
            {
                AddTrivia(node.GetLeadingTrivia());
            }

            FormatElementStartTag(node);

            if (formatting.HasFlag(ElementFormatting.Preserve))
            {
                _preserve += 1;
            }

            if (node.HasTrailingTrivia)
            {
                AddTrivia(node.GetTrailingTrivia());
            }

            if (formatting.HasFlag(ElementFormatting.SnugStart))
            {
                Break(BreakMode.SuppressWordBreak);
            }
            else if (formatting.HasFlag(ElementFormatting.Block))
            {
                Break(BreakMode.LineBreak);
            }

            if (formatting.HasFlag(ElementFormatting.Indent))
            {
                _interiorIndent += _indentSize;
            }
        }