public IElement GetElement(int x, int y) { nsIDOMNodeList nodes; this.node.getChildNodes(out nodes); HTMLElementCollection col = new HTMLElementCollection(control, nodes); IElement ret = null; foreach (Element el in col) { if (el.Left <= x && el.Top <= y && el.Left + el.Width >= x && el.Top + el.Height >= y) { ret = el; break; } } return(ret); }
private void Recurse(HTMLElementCollection col, nsIDOMNode parent) { nsIDOMNodeList children; parent.getChildNodes(out children); uint count; children.getLength(out count); for (int i = 0; i < count; i++) { nsIDOMNode node; children.item((uint)i, out node); ushort type; node.getNodeType(out type); if (type == (ushort)NodeType.Element) { col.Add(new HTMLElement(control, (nsIDOMHTMLElement)node)); Recurse(col, node); } } }
public IElement GetElement (int x, int y) { nsIDOMNodeList nodes; this.node.getChildNodes (out nodes); HTMLElementCollection col = new HTMLElementCollection(control, nodes); IElement ret = null; foreach (Element el in col) { if (el.Left <= x && el.Top <= y && el.Left + el.Width >= x && el.Top + el.Height >= y) { ret = el; break; } } return ret; }
private void Recurse (HTMLElementCollection col, nsIDOMNode parent) { nsIDOMNodeList children; parent.getChildNodes (out children); uint count; children.getLength (out count); for (int i = 0; i < count;i++) { nsIDOMNode node; children.item ((uint)i, out node); ushort type; node.getNodeType (out type); if (type == (ushort)NodeType.Element) { col.Add (new HTMLElement (control, (nsIDOMHTMLElement)node)); Recurse (col, node); } } }