示例#1
0
        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);
        }
示例#2
0
        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);
                }
            }
        }
示例#3
0
		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;
		}
示例#4
0
文件: Element.cs 项目: REALTOBIZ/mono
		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);
				}
			}
		}