/// <summary> /// Find all the UIItems which belongs to a window and are within (bounds of) another UIItem. /// </summary> /// <param name="containingItem">Containing item</param> /// <returns>List of all the items.</returns> public virtual List <UIItem> ItemsWithin(UIItem containingItem) { UIItemCollection itemsWithin = factory.ItemsWithin(containingItem.Bounds, this); var items = new List <UIItem>(); foreach (var item in itemsWithin) { if (!item.Equals(containingItem)) { items.Add((UIItem)item); } } return(items); }
/// <summary> /// Find all the UIItems which belongs to a window and are within (bounds of) another UIItem. /// </summary> /// <param name="containingItem">Containing item</param> /// <returns>List of all the items.</returns> public virtual List <UIItem> ItemsWithin(UIItem containingItem) { UIItemCollection itemsWithin = factory.ItemsWithin(containingItem.Bounds, this); return(itemsWithin.Where(item => !item.Equals(containingItem)).Cast <UIItem>().ToList()); }