public UIItemList(List <AutomationElement> collection, UIItemFactory factory, ActionListener actionListener)
 {
     foreach (AutomationElement element in collection)
     {
         Add((T)factory.Create(element, actionListener));
     }
 }
Пример #2
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);
         }
     }
 }
Пример #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 virtual UIItemCollection GetAll(Predicate <AutomationElement> predicate, UIItemFactory factory, ActionListener actionListener)
        {
            List <AutomationElement> foundElements = list.FindAll(predicate);

            return(new UIItemCollection(foundElements, factory, actionListener));
        }
Пример #5
0
        private UIItemCollection GetAll(SearchCriteria searchCriteria, ActionListener actionListener, UIItemFactory factory)
        {
            List <AutomationElement> automationElements = searchCriteria.Filter(list);

            return(new UIItemCollection(automationElements.ToArray(), factory, actionListener));
        }
Пример #6
0
 public virtual T Get <T>(SearchCriteria searchCriteria, ActionListener actionListener, UIItemFactory factory) where T : UIItem
 {
     return((T)Get(searchCriteria.AndControlType(typeof(T)), actionListener, factory));
 }
Пример #7
0
 public virtual T Get <T>(SearchCriteria searchCriteria, ActionListener actionListener, UIItemFactory factory) where T : UIItem
 {
     return((T)Get(searchCriteria.AndControlType(typeof(T), new WindowsFramework(Constants.MissingFrameworkId)), actionListener, factory));
 }