Exemplo n.º 1
0
        /// <summary>Completes element. Called by tree builder when element is complete:
        /// start tag is self-closed or implicitly closed or element is closed by
        /// a well-formed end tag or by another tag that is being opened.</summary>
        internal virtual void CompleteElement(
            ITextRange closingSequence,
            bool isClosed,
            ReadOnlyCollection <ElementNode> children,
            ReadOnlyCollection <AttributeNode> startTagAtributes,
            ReadOnlyCollection <AttributeNode> endTagAttributes)
        {
            Debug.Assert(children != null);
            Debug.Assert(startTagAtributes != null);
            Debug.Assert(endTagAttributes != null);

            if (!StartTag.IsComplete)
            {
                StartTag.Complete(startTagAtributes, closingSequence, isClosed, false, false);
            }
            else if (EndTag != null && !EndTag.IsComplete)
            {
                EndTag.Complete(endTagAttributes, closingSequence, isClosed, false, false);
            }

            Children   = children;
            VirtualEnd = closingSequence.End;
        }