Exemplo n.º 1
0
 public UIItemList(List <AutomationElement> collection, IUIItemFactory factory, IActionListener actionListener)
 {
     foreach (AutomationElement element in collection)
     {
         Add((T)factory.Create(element, actionListener));
     }
 }
Exemplo n.º 2
0
 public UIItemCollection(IEnumerable automationElements, IUIItemFactory uiItemFactory, IActionListener actionListener)
 {
     foreach (AutomationElement automationElement in automationElements)
     {
         IUIItem uiItem = uiItemFactory.Create(automationElement, actionListener);
         if (uiItem != null)
         {
             Add(uiItem);
         }
     }
 }
Exemplo n.º 3
0
        public virtual IUIItem Get(SearchCriteria searchCriteria, IActionListener actionListener, IUIItemFactory factory)
        {
            List <AutomationElement> automationElements = searchCriteria.Filter(list);

            if (automationElements.Count == 0)
            {
                return(null);
            }
            return(factory.Create(automationElements[0], actionListener));
        }
Exemplo n.º 4
0
        public virtual UIItemCollection GetAll(Predicate <AutomationElement> predicate, IUIItemFactory factory, IActionListener actionListener)
        {
            List <AutomationElement> foundElements = list.FindAll(predicate);

            return(new UIItemCollection(foundElements, factory, actionListener));
        }
Exemplo n.º 5
0
        private UIItemCollection GetAll(SearchCriteria searchCriteria, IActionListener actionListener, IUIItemFactory factory)
        {
            List <AutomationElement> automationElements = searchCriteria.Filter(list);

            return(new UIItemCollection(automationElements.ToArray(), factory, actionListener));
        }
Exemplo n.º 6
0
 public virtual T Get <T>(SearchCriteria searchCriteria, IActionListener actionListener, IUIItemFactory factory) where T : UIItem
 {
     return((T)Get(searchCriteria.AndControlType(typeof(T), WindowsFramework.None), actionListener, factory));
 }