示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Info"></param>
        /// <returns></returns>
        public XmlElement CreateDiv(HtmlInfos Infos)
        {
            XmlElement div = this.XmlDoc.CreateElement("div");

            if (Infos.ID != null)
            {
                this.CreateAttribute(this.XmlDoc, div, "ID".ToLower(), string.Format("div{0}", Infos.ID));
            }

            if (Infos.BlockID != null)
            {
                this.CreateAttribute(this.XmlDoc, div, "BlockID".ToLower(), Infos.BlockID);
            }

            this.CreateAttribute(this.XmlDoc, div, "SerialNumber".ToLower(), Infos.SerialNumber.ToString());

            if (Infos.Class != null)
            {
                this.CreateAttribute(this.XmlDoc, div, "Class".ToLower(), Infos.Class);
            }

            if (Infos.Style != null)
            {
                this.CreateAttribute(this.XmlDoc, div, "Style".ToLower(), Infos.Style);
            }

            if (Infos.GroupName != null)
            {
                this.CreateAttribute(this.XmlDoc, div, "GroupName".ToLower(), Infos.GroupName);
            }

            return(div);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Info"></param>
        /// <returns></returns>
        public XmlElement CreateSpan(HtmlInfos Infos)
        {
            XmlElement span = this.XmlDoc.CreateElement("span");

            if (Infos.ID != null)
            {
                this.CreateAttribute(this.XmlDoc, span, "ID".ToLower(), Infos.ID);
            }

            if (Infos.OnFocus != null)
            {
                this.CreateAttribute(this.XmlDoc, span, "OnClick".ToLower(), string.Format("window.external.FocusImage({0},1)", String.Join(",", Infos.OnFocus)));
            }

            span.InnerText = Infos.Value;

            return(span);
        }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Info"></param>
        /// <returns></returns>
        public XmlElement CreateCheckBox(HtmlInfos Infos)
        {
            XmlElement input = this.XmlDoc.CreateElement("input");

            this.CreateAttribute(this.XmlDoc, input, "Type".ToLower(), "checkbox");

            if (Infos.ID != null)
            {
                this.CreateAttribute(this.XmlDoc, input, "ID".ToLower(), string.Format("chBox{0}", Infos.ID));
            }

            this.CreateAttribute(this.XmlDoc, input, "BlockID".ToLower(), Infos.BlockID);

            this.CreateAttribute(this.XmlDoc, input, "Name".ToLower(), Infos.Name);

            this.CreateAttribute(this.XmlDoc, input, "Value".ToLower(), !String.IsNullOrEmpty(Infos.Value) ? Infos.Value : string.Empty);

            if (Infos.OnFocus != null)
            {
                this.CreateAttribute(this.XmlDoc, input, "OnFocus".ToLower(), string.Format("window.external.FocusImage({0},1)", String.Join(",", Infos.OnFocus)));
            }

            this.CreateAttribute(this.XmlDoc, input, "OnClick".ToLower(), string.Format("chBoxOnClick(this)"));

            if (Infos.Checked)
            {
                this.CreateAttribute(this.XmlDoc, input, "Checked".ToLower(), Infos.Checked.ToString().ToLower());
            }

            this.CreateAttribute(this.XmlDoc, input, "TabIndex".ToLower(), Infos.TabIndex.ToString());

            this.CreateAttribute(this.XmlDoc, input, "IsControl".ToLower(), "Y");

            this.CreateAttribute(this.XmlDoc, input, "ContorlName".ToLower(), System.Web.HttpUtility.HtmlEncode(Infos.ContorlName.EncryptBase64()));

            this.CreateAttribute(this.XmlDoc, input, "OnBlur".ToLower(), "return onBlur(this)");

            return(input);
        }
示例#4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Info"></param>
        /// <returns></returns>
        public XmlElement CreateTextBox(HtmlInfos Infos)
        {
            XmlElement input = this.XmlDoc.CreateElement("input");

            this.CreateAttribute(this.XmlDoc, input, "Type".ToLower(), "text");

            if (Infos.ID != null)
            {
                this.CreateAttribute(this.XmlDoc, input, "ID".ToLower(), string.Format("txt{0}", Infos.ID));
            }

            this.CreateAttribute(this.XmlDoc, input, "BlockID".ToLower(), Infos.BlockID);

            this.CreateAttribute(this.XmlDoc, input, "Value".ToLower(), !String.IsNullOrEmpty(Infos.Value) ? Infos.Value : string.Empty);

            if (Infos.OnFocus != null)
            {
                this.CreateAttribute(this.XmlDoc, input, "OnFocus".ToLower(), string.Format("window.external.FocusImage({0},1)", String.Join(",", Infos.OnFocus)));
            }

            this.CreateAttribute(this.XmlDoc, input, "TabIndex".ToLower(), Infos.TabIndex.ToString());

            this.CreateAttribute(this.XmlDoc, input, "FieldName".ToLower(), Infos.FieldName);

            this.CreateAttribute(this.XmlDoc, input, "ContorlName".ToLower(), System.Web.HttpUtility.HtmlEncode(Infos.ContorlName.EncryptBase64()));

            this.CreateAttribute(this.XmlDoc, input, "IsControl".ToLower(), "Y");

            this.CreateAttribute(this.XmlDoc, input, "ContentType".ToLower(), Infos.ContentType.ToString());

            this.CreateAttribute(this.XmlDoc, input, "RequiredField".ToLower(), Infos.RequiredField ? "1" : "0");

            this.CreateAttribute(this.XmlDoc, input, "OnKeyPress".ToLower(), "return onKeyPress(event)");

            this.CreateAttribute(this.XmlDoc, input, "OnBlur".ToLower(), "return onBlur(this)");

            return(input);
        }