public void loadInfo(IfacesEnumsStructsClasses.IHTMLElement e) { if (e == null) { return; } e = getContent(e); if (e == null) { return; } IfacesEnumsStructsClasses.IHTMLElement2 n = (IfacesEnumsStructsClasses.IHTMLElement2)e; IfacesEnumsStructsClasses.IHTMLElementCollection c = n.getElementsByTagName("TD") as IfacesEnumsStructsClasses.IHTMLElementCollection; if (c != null) { if (c.length >= 2) { int i = 0; foreach (object obj in c) { IfacesEnumsStructsClasses.IHTMLElement r = (IfacesEnumsStructsClasses.IHTMLElement)obj; if (i == 0) { title.Text = "题目:" + r.innerText; i++; } else { description.Text = "描述:" + r.innerText; break; } } // title.Text = ((c.)) as IfacesEnumsStructsClasses.IHTMLElement).innerText; // description.Text = ((c.item(1)) as IfacesEnumsStructsClasses.IHTMLElement).innerText; } } c = n.getElementsByTagName("INPUT") as IfacesEnumsStructsClasses.IHTMLElementCollection; if (c != null) { foreach (object obj in c) { IfacesEnumsStructsClasses.IHTMLElement input = (IfacesEnumsStructsClasses.IHTMLElement)obj; if (input != null) { if (input.getAttribute("TYPE", 1).ToString().Equals("RADIO") || input.getAttribute("type", 1).ToString().Equals("radio")) { ListViewItem item = new ListViewItem(input.getAttribute("value", 1).ToString()); item.Tag = input.getAttribute("name", 1).ToString(); this.listView1.Items.Add(item); } } } } }
public void addObj(IfacesEnumsStructsClasses.IHTMLElement e) { if (e == null) { return; } if (e.getAttribute("id", 1) == null) { return; } string objName = e.getAttribute("id", 1).ToString(); string type = e.getAttribute("type", 1).ToString(); for (int i = 0; i < listView1.Items.Count; i++) { ListViewItem item = listView1.Items[i]; if (item.Text.Equals(objName)) { return; } if (type.Equals("radio")) { string gname = e.getAttribute("name", 1).ToString(); if (gname == null || gname.Equals("")) { continue; } if (item.Text.Equals(gname)) { return; } } } if (type.Equals("submit")) { return; } if (type.Equals("radio")) { string gname = e.getAttribute("name", 1).ToString(); if (gname == null || gname.Equals("")) { return; } ListViewItem item = new ListViewItem(gname); item.Tag = objName; listView1.Items.Add(item); } else { ListViewItem item = new ListViewItem(objName); item.Tag = objName; listView1.Items.Add(item); } }
public void resizeObj(IfacesEnumsStructsClasses.IHTMLElement e) { if (e.tagName.Equals("DIV")) { if (e.getAttribute("ltype", 1) != null && e.getAttribute("ltype", 1) != "_containerDIV") { layouts.table t = new DemoApp.eq_controls.layouts.table(); t.resize(e); } } }
public override void deletMeRelation(IfacesEnumsStructsClasses.IHTMLElement e, DemoApp.frmHTMLeditor pform) { IfacesEnumsStructsClasses.IHTMLElement2 e2 = (IfacesEnumsStructsClasses.IHTMLElement2)e; IfacesEnumsStructsClasses.IHTMLElementCollection c = (e2.getElementsByTagName("input")) as IfacesEnumsStructsClasses.IHTMLElementCollection; if (c == null) { return; } e = null; foreach (IfacesEnumsStructsClasses.IHTMLElement ce in c) { e = ce; break; } if (e == null) { return; } if (e.getAttribute("id", 1) == null) { return; } string id = e.getAttribute("id", 1).ToString(); int idx = id.LastIndexOf("_"); id = id.Substring(0, idx); IfacesEnumsStructsClasses.IHTMLElement2 bd = pform.cEXWB1.GetActiveDocument().body as IfacesEnumsStructsClasses.IHTMLElement2; c = (bd.getElementsByTagName("input")) as IfacesEnumsStructsClasses.IHTMLElementCollection; foreach (IfacesEnumsStructsClasses.IHTMLElement ce in c) { object o = ce.getAttribute("type", 1); if (o == null) { continue; } string type = o.ToString(); if (!type.Equals("submit")) { continue; } o = ce.getAttribute("listObj", 1); if (o == null) { return; } string sp = o.ToString(); sp = sp.Replace(id + ";", ""); ce.setAttribute("listObj", sp, 1); } }
public void deletRelations(IfacesEnumsStructsClasses.IHTMLElement e) { if (e.getAttribute("cType", 1).ToString().Equals("eq_ctrl")) { controlBase.deleteRelation(this.parentForm, e); } }
public void doDoubleClick(IfacesEnumsStructsClasses.IHTMLElement e) { if (e == null) { return; } if (e.getAttribute("cType", 1).ToString().Equals("eq_ctrl")) { controlBase.doDoubleClick(e, this.parentForm); /* if (parentForm.deleteObj()) * { * string dlk = e.getAttribute("dblink", 1).ToString(); * if (e.getAttribute("dblink", 1) == null) * return; * controlBase.controlTypes ct = (controlBase.controlTypes)Enum.Parse(typeof(controlBase.controlTypes), dlk); * if (ct == controlBase.controlTypes.CUS_CTRL_RADIO) ; * { * * controls.radioSelection ctrl = new DemoApp.eq_controls.controls.radioSelection(ct); * * * string html = ctrl.createHtmlView(); * parentForm.addControl(html); * } * * * * } */ } }
public void loadElement(IfacesEnumsStructsClasses.IHTMLElement e) { if (e == null) { return; } IfacesEnumsStructsClasses.IHTMLElement2 e2 = (IfacesEnumsStructsClasses.IHTMLElement2)e; IfacesEnumsStructsClasses.IHTMLElementCollection c = (e2.getElementsByTagName("input")) as IfacesEnumsStructsClasses.IHTMLElementCollection; if (c == null) { return; } foreach (IfacesEnumsStructsClasses.IHTMLElement ce in c) { e = ce; break; } if (e.getAttribute("listObj", 1) == null) { c = null; return; } string s = e.getAttribute("listObj", 1).ToString(); List <string> ss = utility.parseStrings(s, ";"); listView2.Items.Clear(); for (int i = 0; i < ss.Count; i++) { ListViewItem item2 = new ListViewItem(ss[i]); item2.Tag = ss[i]; listView2.Items.Add(item2); } if (e.getAttribute("action", 1) == null) { return; } this.textBox1.Text = e.getAttribute("action", 1).ToString(); }
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); } }
public string ActiveElementAttribute(IHTMLElement element, string attributeName) { if (element == null) { return(""); } string strValue = ""; try { strValue = element.getAttribute(attributeName, 0) as string ?? ""; } // ReSharper disable EmptyGeneralCatchClause catch // ReSharper restore EmptyGeneralCatchClause { } return(strValue); }
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 }