public override SyntaxNode VisitXmlElementEndTag(XmlElementEndTagSyntax node)
        {
            bool anyChanges            = false;
            var  newLessThanSlashToken = ((PunctuationSyntax)Visit(node.LessThanSlashToken));

            if (node.LessThanSlashToken != newLessThanSlashToken)
            {
                anyChanges = true;
            }

            var newName = ((XmlNameSyntax)Visit(node.NameNode));

            if (node.NameNode != newName)
            {
                anyChanges = true;
            }

            var newGreaterThanToken = ((PunctuationSyntax)Visit(node.GreaterThanToken));

            if (node.GreaterThanToken != newGreaterThanToken)
            {
                anyChanges = true;
            }

            if (anyChanges)
            {
                return(new XmlElementEndTagSyntax(node.Kind, newLessThanSlashToken, newName, newGreaterThanToken));
            }
            else
            {
                return(node);
            }
        }
 public XmlNodeSyntax CreateElement(XmlElementEndTagSyntax endElement)
 {
     Debug.Assert(endElement != null);
     var contentList = _content.ToList();
     _pool.Free(_content);
     return SyntaxFactory.XmlElement(_start, contentList, endElement);
 }
 public XmlElementSyntax(XmlElementStartTagSyntax start, SyntaxNode content, XmlElementEndTagSyntax end) : base(SyntaxKind.XmlElement)
 {
     StartTag = start;
     Content = content;
     EndTag = end;
     SlotCount = 3;
 }
示例#4
0
 public XmlElementSyntax(XmlElementStartTagSyntax start, SyntaxNode content, XmlElementEndTagSyntax end) : base(SyntaxKind.XmlElement)
 {
     StartTag  = start;
     Content   = content;
     EndTag    = end;
     SlotCount = 3;
 }
示例#5
0
        public static XmlElementEndTagSyntax XmlElementEndTag(PunctuationSyntax lessThanSlashToken, XmlNameSyntax name, PunctuationSyntax greaterThanToken)
        {
            Debug.Assert(lessThanSlashToken != null && lessThanSlashToken.Kind == SyntaxKind.LessThanSlashToken);
            Debug.Assert(greaterThanToken != null && greaterThanToken.Kind == SyntaxKind.GreaterThanToken);
            var result = new XmlElementEndTagSyntax(SyntaxKind.XmlElementEndTag, lessThanSlashToken, name, greaterThanToken);

            return(result);
        }
示例#6
0
        public XmlNodeSyntax CreateElement(XmlElementEndTagSyntax endElement)
        {
            Debug.Assert(endElement != null);
            var contentList = _content.ToList();

            _pool.Free(_content);
            return(SyntaxFactory.XmlElement(_start, contentList, endElement));
        }
示例#7
0
 public XmlElementSyntax WithEndTag(XmlElementEndTagSyntax endTag)
 {
     return(this.Update(this.StartTag, this.Content, endTag));
 }
示例#8
0
        public XmlElementSyntax Update(XmlElementStartTagSyntax startTag, SyntaxList <SyntaxNode> content, XmlElementEndTagSyntax endTag)
        {
            if (startTag != this.StartTag || content != this.Content || endTag != this.EndTag)
            {
                var newNode     = SyntaxFactory.XmlElement(startTag, content, endTag);
                var annotations = this.GetAnnotations();
                if (annotations != null && annotations.Length > 0)
                {
                    return(newNode.WithAnnotations(annotations));
                }
                return(newNode);
            }

            return(this);
        }
示例#9
0
 public static XmlElementSyntax XmlElement(XmlElementStartTagSyntax startElement, SyntaxNode content, XmlElementEndTagSyntax endElement)
 {
     return((XmlElementSyntax) new XmlElementSyntax.Green(startElement?.GreenNode, content?.GreenNode, endElement?.GreenNode).CreateRed());
 }
示例#10
0
 public static XmlElementSyntax XmlElement(XmlElementStartTagSyntax startElement, SyntaxList <SyntaxNode> contentList, XmlElementEndTagSyntax endElement)
 {
     return(XmlElement(startElement, contentList.Node, endElement));
 }
示例#11
0
 public virtual SyntaxNode VisitXmlElementEndTag(XmlElementEndTagSyntax node)
 {
     return(VisitXmlNode(node));
 }
示例#12
0
 internal XmlNodeSyntax CreateElement(XmlElementEndTagSyntax missingEndElement, object v)
 {
     return(CreateElement(missingEndElement));
 }
 public virtual SyntaxNode VisitXmlElementEndTag(XmlElementEndTagSyntax node)
 {
     return VisitXmlNode(node);
 }
 internal XmlNodeSyntax CreateElement(XmlElementEndTagSyntax missingEndElement, object v)
 {
     return CreateElement(missingEndElement);
 }
        internal static XmlElementEndTagSyntax XmlElementEndTag(PunctuationSyntax lessThanSlashToken, XmlNameSyntax name, PunctuationSyntax greaterThanToken)
        {
            Debug.Assert(lessThanSlashToken != null && lessThanSlashToken.Kind == SyntaxKind.LessThanSlashToken);
            Debug.Assert(greaterThanToken != null && greaterThanToken.Kind == SyntaxKind.GreaterThanToken);
            var result = new XmlElementEndTagSyntax(SyntaxKind.XmlElementEndTag, lessThanSlashToken, name, greaterThanToken);

            return result;
        }
 public static XmlNodeSyntax XmlElement(XmlElementStartTagSyntax startElement, SyntaxList<SyntaxNode> contentList, XmlElementEndTagSyntax endElement)
 {
     return new XmlElementSyntax(startElement, contentList.Node, endElement);
 }