Represents literal text in a JBST document
Наследование: JbstControl, IJsonSerializable
Пример #1
0
        public void Add(JbstControl item)
        {
            if (item is JbstLiteral)
            {
                // combine contiguous literals into single for reduced space and processing
                JbstLiteral literal = this.Last as JbstLiteral;
                if (literal != null)
                {
                    literal.Text += ((JbstLiteral)item).Text;
                }
                else
                {
                    this.controls.Add(item);
                }
            }
            else if (item is JbstInline)
            {
                this.InlineTemplates.Add((JbstInline)item);
            }
            else
            {
                this.controls.Add(item);
            }

            item.Parent = this.Owner;
        }
Пример #2
0
        private void AppendChild(string text)
        {
            if (String.IsNullOrEmpty(text))
            {
                return;
            }

            if (this.current == null)
            {
                this.current = this.document;
            }

            // this allows HTML entities to be encoded as unicode
            text = HtmlDistiller.DecodeHtmlEntities(text);

            JbstLiteral literal = new JbstLiteral(text, true);

            this.current.ChildControls.Add(literal);
        }
Пример #3
0
        private void AppendChild(string text)
        {
            if (String.IsNullOrEmpty(text))
            {
                return;
            }

            if (this.current == null)
            {
                this.current = this.document;
            }

            // this allows HTML entities to be encoded as unicode
            text = HtmlDistiller.DecodeHtmlEntities(text);

            JbstLiteral literal = new JbstLiteral(text, true);
            this.current.ChildControls.Add(literal);
        }