public UIItemList(List <AutomationElement> collection, IUIItemFactory factory, IActionListener actionListener) { foreach (AutomationElement element in collection) { Add((T)factory.Create(element, actionListener)); } }
public UIItemCollection(IEnumerable automationElements, IUIItemFactory uiItemFactory, IActionListener actionListener) { foreach (AutomationElement automationElement in automationElements) { IUIItem uiItem = uiItemFactory.Create(automationElement, actionListener); if (uiItem != null) { Add(uiItem); } } }
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)); }
public virtual UIItemCollection GetAll(Predicate <AutomationElement> predicate, IUIItemFactory factory, IActionListener actionListener) { List <AutomationElement> foundElements = list.FindAll(predicate); return(new UIItemCollection(foundElements, factory, actionListener)); }
private UIItemCollection GetAll(SearchCriteria searchCriteria, IActionListener actionListener, IUIItemFactory factory) { List <AutomationElement> automationElements = searchCriteria.Filter(list); return(new UIItemCollection(automationElements.ToArray(), factory, actionListener)); }
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)); }