Internal representation of a JBST placholder
Inheritance: JbstCommandBase
Beispiel #1
0
        private void PushTag(string rawName)
        {
            string tagName;
            string prefix = JbstWriter.SplitPrefix(rawName, out tagName);

            JbstContainerControl control;

            if (JbstCommandBase.JbstPrefix.Equals(prefix, StringComparison.OrdinalIgnoreCase))
            {
                if (StringComparer.OrdinalIgnoreCase.Equals(JbstControlReference.ControlCommand, tagName))
                {
                    control = new JbstControlReference();
                }
                else if (StringComparer.OrdinalIgnoreCase.Equals(JbstPlaceholder.PlaceholderCommand, tagName))
                {
                    control = new JbstPlaceholder();
                }
                else if (StringComparer.OrdinalIgnoreCase.Equals(JbstInline.InlineCommand, tagName))
                {
                    control = new JbstInline();
                }
                else
                {
                    throw new InvalidOperationException("Unknown JBST command ('" + rawName + "')");
                }
            }
            else
            {
                control = new JbstContainerControl(prefix, tagName);
            }

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

            this.current.ChildControls.Add(control);
            this.current = control;
        }
Beispiel #2
0
        private void PushTag(string rawName)
        {
            string tagName;
            string prefix = JbstWriter.SplitPrefix(rawName, out tagName);

            JbstContainerControl control;
            if (JbstCommandBase.JbstPrefix.Equals(prefix, StringComparison.OrdinalIgnoreCase))
            {
                if (StringComparer.OrdinalIgnoreCase.Equals(JbstControlReference.ControlCommand, tagName))
                {
                    control = new JbstControlReference();
                }
                else if (StringComparer.OrdinalIgnoreCase.Equals(JbstPlaceholder.PlaceholderCommand, tagName))
                {
                    control = new JbstPlaceholder();
                }
                else if (StringComparer.OrdinalIgnoreCase.Equals(JbstInline.InlineCommand, tagName))
                {
                    control = new JbstInline();
                }
                else
                {
                    throw new InvalidOperationException("Unknown JBST command ('"+rawName+"')");
                }
            }
            else
            {
                control = new JbstContainerControl(prefix, tagName);
            }

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

            this.current.ChildControls.Add(control);
            this.current = control;
        }