예제 #1
0
        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);
        }
예제 #2
0
 public virtual UIItemCollection CreateAll(SearchCriteria searchCriteria, IActionListener actionListener)
 {
     return(new UIItemCollection(Finder.Descendants(searchCriteria.AutomationSearchCondition), actionListener, searchCriteria.CustomItemType));
 }