JsonFx.UI.Jbst.JbstWriter.PopTag C# (CSharp) Method

PopTag() private method

private PopTag ( string tagName ) : void
tagName string
return void
        private void PopTag(string tagName)
        {
            if (tagName == null)
            {
                tagName = String.Empty;
            }

            if (this.current == null)
            {
                throw new InvalidOperationException("Push/Pop mismatch? (current tag is null)");
            }

            if (!String.IsNullOrEmpty(tagName) &&
                !tagName.Equals(this.current.RawName, StringComparison.OrdinalIgnoreCase))
            {
                //throw new InvalidOperationException("Push/Pop mismatch? (tag names do not match)");
                return;
            }

            if (JbstWriter.ScriptTagName.Equals(this.current.RawName, StringComparison.OrdinalIgnoreCase))
            {
                // script tags get converted once fully parsed
                this.Declarations.Append(this.current);
            }

            JbstInline inline = this.current as JbstInline;

            this.current = this.current.Parent;

            if (inline != null && inline.IsAnonymous)
            {
                // consolidate anonymous inline templates directly into body
                this.current.ChildControls.Remove(inline);
                if (inline.ChildControlsSpecified)
                {
                    this.current.ChildControls.AddRange(inline.ChildControls);
                }
            }
        }