public virtual UIItemCollection UIItems(ActionListener actionListener) { if (uiItemCollection != null) { return(uiItemCollection); } uiItemCollection = new UIItemCollection(); foreach (AutomationElement automationElement in list) { uiItemCollection.Add(dictionaryMappedItemFactory.Create(automationElement, actionListener)); } return(uiItemCollection); }
public virtual UIItemCollection ItemsWithin(Rect bounds, ActionListener 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, ActionListener 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); }