Example #1
0
        protected virtual void Close(XElement element, IParseContext context, TextLocation location)
        {
            //have already checked that element is not null, i.e. top of stack is our element
            if (element.IsClosed)
            {
                context.Nodes.Pop();
            }

            element.End(location);
            if (context.BuildTree)
            {
                XContainer container = element.IsClosed?
                                       (XContainer)context.Nodes.Peek()
                                        : (XContainer)context.Nodes.Peek(1);

                container.AddChildNode(element);
            }
        }