Пример #1
0
        protected override void Parse(XmlNode node)
        {
            base.Parse(node);
            HtmlSerializeHelper <HtmlLabel> .ReadRootElementAttributes(node, this);

            Control.Text = node.InnerXml.HttpDecode().Replace("<br />", Environment.NewLine);
        }
Пример #2
0
        protected override void Parse(XmlNode node)
        {
            base.Parse(node);
            HtmlSerializeHelper <HtmlCodeSnippet> .ReadRootElementAttributes(node, this);

            ((CodeSnippet)Control).HtmlCode = node.InnerXml;
        }
Пример #3
0
        protected override void Parse(XmlNode node)
        {
            base.Parse(node);
            HtmlSerializeHelper <HtmlCompiledTest> .ReadRootElementAttributes(node, this);

            Control.Text = node.InnerText.HttpDecode();
        }
Пример #4
0
        protected override void Parse(XmlNode node)
        {
            base.Parse(node);
            HtmlSerializeHelper <HtmlButton> .ReadRootElementAttributes(node, this);

            Control.Text = HtmlUtility.QuotesDecode(node.Attributes["value"].Value);
        }
Пример #5
0
        public override void WriteHtml(HtmlWriter w)
        {
            base.WriteHtml(w);
            HtmlSerializeHelper <HtmlSimpleQuestion> .WriteRootElementAttributes(w, this);

            w.AddAttribute(HtmlAttribute.Name, Control.SingleCase ? "gen:single" : "gen:multy");
            w.RenderBeginTag(HtmlTag.Div);
            w.RenderBeginTag(HtmlTag.P);
            w.Write(Control.Question.HttpEncode());
            w.RenderEndTag();

            foreach (var tb in Control.textBoxesList)
            {
                w.AddAttribute(HtmlAttribute.Type, Control.SingleCase ? "radio" : "checkbox");
                if (Control.SingleCase)
                {
                    w.AddAttribute(HtmlAttribute.Name, Name);
                }
                w.RenderBeginTag(HtmlTag.Input);
                w.RenderEndTag();

                w.RenderBeginTag(HtmlTag.Span);
                w.Write(tb.Text.HttpEncode());
                w.RenderEndTag();

                w.RenderBeginTag(HtmlTag.Br);
                w.RenderEndTag();
            }
            w.RenderEndTag();
        }
Пример #6
0
        public override void WriteHtml(HtmlWriter w)
        {
            base.WriteHtml(w);
            HtmlSerializeHelper <HtmlLabel> .WriteRootElementAttributes(w, this);

            w.RenderBeginTag(HtmlTag.Span);
            w.Write((Control.Text).HttpEncode().Replace(Environment.NewLine, "<br />"));
            w.RenderEndTag();
        }
Пример #7
0
        protected override void Parse([NotNull] XmlNode node)
        {
            base.Parse(node);
            HtmlSerializeHelper <HtmlTextBox> .ReadRootElementAttributes(node, this);

            var at = node.Attributes["value"];

            Control.Text = HtmlUtility.QuotesDecode(at != null ? at.Value : node.InnerText);
        }
Пример #8
0
        protected override void Parse([NotNull] XmlNode node)
        {
            base.Parse(node);
            HtmlSerializeHelper <HtmlComboBox> .ReadRootElementAttributes(node, this);

            foreach (XmlNode sub in node.ChildNodes)
            {
                Control.Items.Add(sub.InnerText.HttpDecode());
            }
        }
Пример #9
0
        public override void WriteHtml(HtmlWriter w)
        {
            base.WriteHtml(w);
            HtmlSerializeHelper <HtmlCodeSnippet> .WriteRootElementAttributes(w, this);

            w.AddAttribute(HtmlAttribute.Name, "snippet");
            w.AddStyleAttribute(HtmlStyleAttribute.Overflow, "auto");
            w.RenderBeginTag(HtmlTag.Div);
            w.Write(((CodeSnippet)Control).HtmlCode);
            w.RenderEndTag();
        }
Пример #10
0
        public override void WriteHtml(HtmlWriter w)
        {
            base.WriteHtml(w);
            HtmlSerializeHelper <HtmlButton> .WriteRootElementAttributes(w, this);

            w.AddAttribute(HtmlAttribute.Type, "button");
            w.AddAttribute(HtmlAttribute.Value, HtmlUtility.QuotesEncode(Control.Text));
            w.AddAttribute(HtmlAttribute.Onclick, "scoObj.Commit()");
            w.RenderBeginTag(HtmlTag.Input);
            w.RenderEndTag();
        }
Пример #11
0
        public override void WriteHtml(HtmlTextWriter w)
        {
            base.WriteHtml(w);
            HtmlSerializeHelper <HtmlCompiledTest> .WriteRootElementAttributes(w, this);

            w.RenderBeginTag(HtmlTextWriterTag.Textarea);
            if (Control.Text.IsNotNull())
            {
                w.Write(Control.Text.HttpEncode());
            }
            w.RenderEndTag();
        }
Пример #12
0
        protected override void Parse(XmlNode node)
        {
            base.Parse(node);
            HtmlSerializeHelper <HtmlSimpleQuestion> .ReadRootElementAttributes(node, this);

            Control.SingleCase = node.Attributes["name"].Value.EndsWith("single");
            Control.Question   = node.SelectSingleNode("p").InnerText.HttpDecode();
            var spans = node.SelectNodes("span");

            Control.EnsureCount(spans.Count);
            var i = 0;

            foreach (XmlNode s in spans)
            {
                Control.textBoxesList[i++].Text = s.InnerText.HttpDecode();
            }
        }
Пример #13
0
        public override void WriteHtml([NotNull] HtmlWriter w)
        {
            base.WriteHtml(w);
            HtmlSerializeHelper <HtmlTextBox> .WriteRootElementAttributes(w, this);

            if (Control.Text.IsNotNull())
            {
                w.AddAttribute(HtmlAttribute.Value, HtmlUtility.QuotesEncode(Control.Text));
            }
            if (EmptyText.IsNotNull())
            {
                w.AddAttribute("onfocus", "textBoxFocus(this)");
                w.AddAttribute("onblur", "textBoxBlur(this)");
            }

            w.AddAttribute(HtmlAttribute.Type, "text");
            w.RenderBeginTag(HtmlTag.Input);
            w.RenderEndTag();
        }
Пример #14
0
        public override void WriteHtml([NotNull] HtmlWriter w)
        {
            base.WriteHtml(w);
            HtmlSerializeHelper <HtmlComboBox> .WriteRootElementAttributes(w, this);

            w.RenderBeginTag(HtmlTag.Select);

            var count = Control.Items.Count;

            if (count > 0)
            {
                w.AddAttribute(HtmlAttribute.Selected, "true");
            }
            for (var i = 0; i < count; i++)
            {
                w.AddAttribute(HtmlAttribute.Value, i.ToString());
                w.RenderBeginTag(HtmlTag.Option);
                w.Write(Control.Items[i].ToString().HttpEncode());
                w.RenderEndTag();
            }

            w.RenderEndTag();
        }