コード例 #1
0
 public void setDocNameDesp()
 {
     if (pform == null)
     {
         return;
     }
     IfacesEnumsStructsClasses.IHTMLDocument2 doc = pform.cEXWB1.GetActiveDocument();
     IfacesEnumsStructsClasses.IHTMLElement   bd  = (IfacesEnumsStructsClasses.IHTMLElement)doc.body;
     bd.setAttribute("tname", name, 1);
     bd.setAttribute("tdescription", description, 1);
     bd.setAttribute("ID", ID, 1);
     pform.Text = "模版:" + name;
 }
コード例 #2
0
ファイル: templateBase.cs プロジェクト: send2vinnie/1709
        public void getDocNameDesp()
        {
            if (pform == null)
            {
                return;
            }
            IfacesEnumsStructsClasses.IHTMLDocument2 doc = pform.cEXWB1.GetActiveDocument();
            IfacesEnumsStructsClasses.IHTMLElement   bd  = (IfacesEnumsStructsClasses.IHTMLElement)doc.body;
            object o = bd.getAttribute("tname", 1);

            if (o != null && !o.ToString().Equals(""))
            {
                name = o.ToString();
            }
            else
            {
                bd.setAttribute("tname", name, 1);
            }

            o = bd.getAttribute("tdescription", 1);
            if (o != null && !o.ToString().Equals(""))
            {
                description = o.ToString();
            }
            else
            {
                bd.setAttribute("tdescription", description, 1);
            }

            o = bd.getAttribute("ID", 1);
            if (o != null && !o.ToString().Equals(""))
            {
                ID = o.ToString();
            }
            else
            {
                bd.setAttribute("ID", ID, 1);
            }
        }
コード例 #3
0
        override public IfacesEnumsStructsClasses.IHTMLElement loadInfoFromElement(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            if (e == null)
            {
                return(null);
            }

            submitForm sform = new submitForm(this.pform);

            sform.loadElement(e);
            if (sform.ShowDialog() != DialogResult.OK)
            {
                return(null);
            }
            string listObj = "";

            for (int i = 0; i < sform.listView2.Items.Count; i++)
            {
                listObj += sform.listView2.Items[i].Text + ";";
            }

            IfacesEnumsStructsClasses.IHTMLElement2          e2 = (IfacesEnumsStructsClasses.IHTMLElement2)e;
            IfacesEnumsStructsClasses.IHTMLElementCollection c  = (e2.getElementsByTagName("input")) as IfacesEnumsStructsClasses.IHTMLElementCollection;
            if (c == null)
            {
                return(null);
            }
            foreach (IfacesEnumsStructsClasses.IHTMLElement ce in c)
            {
                e = ce;
                break;
            }

            e.setAttribute("listObj", listObj, 1);
            e.setAttribute("action", sform.textBox1.Text, 1);

            return(e);
        }
コード例 #4
0
ファイル: radioForm.cs プロジェクト: send2vinnie/1709
        public IfacesEnumsStructsClasses.IHTMLElement updateElement(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            IfacesEnumsStructsClasses.IHTMLElement2 e2 = (IfacesEnumsStructsClasses.IHTMLElement2)e;
            if (e2 == null)
            {
                return(null);
            }

            IfacesEnumsStructsClasses.IHTMLElementCollection c = (e2.getElementsByTagName("table")) as IfacesEnumsStructsClasses.IHTMLElementCollection;

            IfacesEnumsStructsClasses.IHTMLElement contentTbl = null;// (IfacesEnumsStructsClasses.IHTMLElement)(e2.getElementsByTagName("table"));

            foreach (IfacesEnumsStructsClasses.IHTMLElement te in c)
            {
                contentTbl = te;
                break;
            }
            IfacesEnumsStructsClasses.IHTMLDOMNode nod = (IfacesEnumsStructsClasses.IHTMLDOMNode)e;

            if (contentTbl != null)
            {
                nod = (IfacesEnumsStructsClasses.IHTMLDOMNode)(contentTbl.parentElement);
            }

            nod.removeChild(nod.firstChild);



            IfacesEnumsStructsClasses.IHTMLDocument2 doc = (IfacesEnumsStructsClasses.IHTMLDocument2)(e.document);


            IfacesEnumsStructsClasses.IHTMLElement tbl   = doc.createElement("table");
            IfacesEnumsStructsClasses.IHTMLElement tbldy = doc.createElement("tbody");

            IfacesEnumsStructsClasses.IHTMLElement tr = doc.createElement("tr");
            IfacesEnumsStructsClasses.IHTMLElement td = doc.createElement("td");
            //   IfacesEnumsStructsClasses.IHTMLDOMTextNode td = doc.createElement("td");


            td.innerHTML = this.title.Text;

            // appendNewChild((IfacesEnumsStructsClasses.IHTMLElement)nod, tbl);
            appendNewChild(tbl, tr);
            appendNewChild(tr, td);


            tr           = doc.createElement("tr");
            td           = doc.createElement("td");
            td.innerHTML = this.description.Text;
            appendNewChild(tr, td);
            appendNewChild(tbl, tr);


            tr = doc.createElement("tr");
            td = doc.createElement("td");


            string groupname = new Random().Next().ToString();

            for (int i = 0; i < this.listView1.Items.Count; i++)
            {
                IfacesEnumsStructsClasses.IHTMLElement inpute = doc.createElement("input");
                inpute.setAttribute("type", "radio", 1);
                if (this.listView1.Items[i].Tag != null)
                {
                    inpute.setAttribute("name", this.listView1.Items[i].Tag.ToString(), 1);
                    groupname = this.listView1.Items[i].Tag.ToString();
                }

                else
                {
                    inpute.setAttribute("name", groupname, 1);
                }
                inpute.setAttribute("value", this.listView1.Items[i].Text, 1);
                string radioid = groupname + "_" + (i + 1).ToString();
                inpute.setAttribute("id", radioid, 1);
                IfacesEnumsStructsClasses.IHTMLElement br = doc.createElement("br");

                //    inpute.innerText =  this.listView1.Items[i].Text;
                appendNewChild(td, inpute);
                //td.insertAdjacentText("", this.listView1.Items[i].Text);
                td.innerHTML += this.listView1.Items[i].Text;
                appendNewChild(td, br);
            }
            appendNewChild(tr, td);
            appendNewChild(tbl, tr);

            tbl.style.lineHeight = "24px";
            tbl.style.fontSize   = "12px";
            IfacesEnumsStructsClasses.IHTMLElement node = (IfacesEnumsStructsClasses.IHTMLElement)nod;
            string hs = tbl.outerHTML;

            Encoding ec = Encoding.GetEncoding("gb2312");

            hs = ec.GetString(System.Text.Encoding.Default.GetBytes(hs));

            node.innerHTML = hs;
            return(tbl);
        }
コード例 #5
0
ファイル: radioForm.cs プロジェクト: send2vinnie/1709
        public IfacesEnumsStructsClasses.IHTMLElement updateElement(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            IfacesEnumsStructsClasses.IHTMLElement2 e2 = (IfacesEnumsStructsClasses.IHTMLElement2)e;
            if (e2 == null)
            {
                return(null);
            }

            IfacesEnumsStructsClasses.IHTMLElementCollection c = (e2.getElementsByTagName("table")) as IfacesEnumsStructsClasses.IHTMLElementCollection;

            IfacesEnumsStructsClasses.IHTMLElement contentTbl = null;// (IfacesEnumsStructsClasses.IHTMLElement)(e2.getElementsByTagName("table"));

            foreach (IfacesEnumsStructsClasses.IHTMLElement te in c)
            {
                contentTbl = te;
                break;
            }
            IfacesEnumsStructsClasses.IHTMLDOMNode nod = (IfacesEnumsStructsClasses.IHTMLDOMNode)e;

            if (contentTbl != null)
            {
                nod = (IfacesEnumsStructsClasses.IHTMLDOMNode)(contentTbl.parentElement);
            }

            nod.removeChild(nod.firstChild);



            IfacesEnumsStructsClasses.IHTMLDocument2 doc = (IfacesEnumsStructsClasses.IHTMLDocument2)(e.document);


            IfacesEnumsStructsClasses.IHTMLElement tbl   = doc.createElement("table");
            IfacesEnumsStructsClasses.IHTMLElement tbldy = doc.createElement("tbody");

            IfacesEnumsStructsClasses.IHTMLElement tr = doc.createElement("tr");
            IfacesEnumsStructsClasses.IHTMLElement td = doc.createElement("td");
            //   IfacesEnumsStructsClasses.IHTMLDOMTextNode td = doc.createElement("td");


            td.innerHTML = this.title.Text;

            appendNewChild((IfacesEnumsStructsClasses.IHTMLElement)nod, tbl);
            appendNewChild(tbl, tr);
            appendNewChild(tr, td);


            tr           = doc.createElement("tr");
            td           = doc.createElement("td");
            td.innerHTML = this.description.Text;
            appendNewChild(tr, td);
            appendNewChild(tbl, tr);


            tr = doc.createElement("tr");
            td = doc.createElement("td");


            string groupname = new Random().Next().ToString();

            for (int i = 0; i < this.listView1.Items.Count; i++)
            {
                IfacesEnumsStructsClasses.IHTMLElement inpute = doc.createElement("input");
                inpute.setAttribute("type", "radio", 1);
                if (this.listView1.Items[i].Tag != null)
                {
                    inpute.setAttribute("name", this.listView1.Items[i].Tag.ToString(), 1);
                    groupname = this.listView1.Items[i].Tag.ToString();
                }

                else
                {
                    inpute.setAttribute("name", groupname, 1);
                }
                inpute.setAttribute("value", this.listView1.Items[i].Text, 1);
                IfacesEnumsStructsClasses.IHTMLElement br = doc.createElement("br");

                //    inpute.innerText =  this.listView1.Items[i].Text;
                appendNewChild(td, inpute);
                //td.insertAdjacentText("", this.listView1.Items[i].Text);
                td.innerHTML += this.listView1.Items[i].Text;
                appendNewChild(td, br);
            }
            appendNewChild(tr, td);
            appendNewChild(tbl, tr);


            return(tbl);
        }
コード例 #6
0
ファイル: eframe.cs プロジェクト: send2vinnie/1709
        override public IfacesEnumsStructsClasses.IHTMLElement loadInfoFromElement(IfacesEnumsStructsClasses.IHTMLElement e)
        {
            if (e == null)
            {
                return(null);
            }


            IfacesEnumsStructsClasses.IHTMLElement2          e2 = (IfacesEnumsStructsClasses.IHTMLElement2)e;
            IfacesEnumsStructsClasses.IHTMLElementCollection c  = (e2.getElementsByTagName("label")) as IfacesEnumsStructsClasses.IHTMLElementCollection;
            if (c == null)
            {
                return(null);
            }
            foreach (IfacesEnumsStructsClasses.IHTMLElement ce in c)
            {
                e = ce;
                break;
            }

            IfacesEnumsStructsClasses.IHTMLElement titlee = (IfacesEnumsStructsClasses.IHTMLElement)e;
            iframeForm form = new iframeForm();

            form.textBox1.Text = e.innerText;


            c = (e2.getElementsByTagName("iframe")) as IfacesEnumsStructsClasses.IHTMLElementCollection;
            if (c == null)
            {
                return(null);
            }
            foreach (IfacesEnumsStructsClasses.IHTMLElement ce in c)
            {
                e = ce;
                break;
            }
            if (e.getAttribute("src", 1) != null)
            {
                string http = e.getAttribute("src", 1).ToString();;
                http = http.Replace("http://", "");
                form.textBox2.Text = http;
            }
            if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return(null);
            }
            string url = form.textBox2.Text;

            if (!url.StartsWith("http://"))
            {
                url = "http://" + url;
            }
            string title = form.textBox1.Text;

            if (title.Equals(""))
            {
                title = url;
            }

            e.setAttribute("src", url, 1);
            titlee.innerText = title;
            return(e);

            //IfacesEnumsStructsClasses.IHTMLDocument2 doc = (IfacesEnumsStructsClasses.IHTMLDocument2)e.document;
            // doc.foc
        }