public UIItemList(List <AutomationElement> collection, UIItemFactory factory, ActionListener actionListener)
 {
     foreach (AutomationElement element in collection)
     {
         Add((T)factory.Create(element, actionListener));
     }
 }
예제 #2
0
        public static T GetParent <T>(this IUIItem thisItem) where T : IUIItem
        {
            var parent = TreeWalker.ControlViewWalker.GetParent(thisItem.AutomationElement);
            var uiItem = ItemFactory.Create(parent, thisItem.ActionListener);

            return((T)UIItemProxyFactory.Create(uiItem, uiItem.ActionListener));
        }
예제 #3
0
        public virtual IUIItem Get(SearchCriteria searchCriteria, ActionListener actionListener, UIItemFactory factory)
        {
            List <AutomationElement> automationElements = searchCriteria.Filter(list);

            if (automationElements.Count == 0)
            {
                return(null);
            }
            return(factory.Create(automationElements[0], actionListener));
        }
예제 #4
0
 public UIItemCollection(IEnumerable automationElements, UIItemFactory uiItemFactory, ActionListener actionListener)
 {
     foreach (AutomationElement automationElement in automationElements)
     {
         IUIItem uiItem = uiItemFactory.Create(automationElement, actionListener);
         if (uiItem != null)
         {
             Add(uiItem);
         }
     }
 }