public virtual UIItemCollection ItemsWithin(Rect bounds, IActionListener actionListener) { var collection = new UIItemCollection(); List <AutomationElement> descendants = Finder.Descendants(AutomationSearchCondition.All); foreach (AutomationElement automationElement in descendants) { if (!bounds.Contains(automationElement.BoundingRectangle)) { continue; } var factory = new DictionaryMappedItemFactory(); collection.Add(factory.Create(automationElement, actionListener)); } return(collection); }
public virtual UIItemCollection CreateAll(SearchCriteria searchCriteria, IActionListener actionListener) { return(new UIItemCollection(Finder.Descendants(searchCriteria.AutomationSearchCondition), actionListener, searchCriteria.CustomItemType)); }