コード例 #1
0
 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));
 }
コード例 #2
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.Current.BoundingRectangle)) continue;

                var factory = new DictionaryMappedItemFactory();
                collection.Add(factory.Create(automationElement, actionListener));
            }
            return collection;
        }
コード例 #3
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);
        }