public static Rectangle[] WrapDomClientRectList( nsIDOMClientRectList list )
		{
			uint count = list.GetLengthAttribute();
			Rectangle[] rects = new Rectangle[count];
			for (uint i = 0; i < count; i++)
			{
				nsIDOMClientRect domRect = list.Item(i);
				rects[i] = WrapDomClientRect(domRect);
				// TODO - check code for memory leaks
				//	Marshal.ReleaseComObject( domRect );
			}
			return rects;
		}
Example #2
0
        /// <summary>
        /// Returns an array containing all bounding rectangles within the element.
        /// </summary>
        /// <returns></returns>
        public RectangleF [] GetClientRects()
        {
            nsIDOMNSElement      ns    = (nsIDOMNSElement)DomElement;
            nsIDOMClientRectList rects = ns.GetClientRects();

            RectangleF [] result = new RectangleF[rects.GetLength()];
            for (int i = 0; i < result.Length; i++)
            {
                nsIDOMClientRect rect = rects.Item(i);
                result[i] = RectangleF.FromLTRB(rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom());
            }
            return(result);
        }