public virtual IUIItem Create(SearchCriteria searchCriteria, IActionListener actionListener) { if (searchCriteria.IsIndexed) { UIItemCollection collection = CreateAll(searchCriteria, actionListener); return(searchCriteria.IndexedItem(collection)); } return(dictionaryMappedItemFactory.Create(Finder.Descendant(searchCriteria.AutomationCondition), actionListener, searchCriteria.CustomItemType)); }
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.Current.BoundingRectangle)) continue; var factory = new DictionaryMappedItemFactory(); collection.Add(factory.Create(automationElement, actionListener)); } return collection; }
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); }