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)); }
private UIItemCollection GetAll(SearchCriteria searchCriteria, ActionListener actionListener, UIItemFactory factory) { List <AutomationElement> automationElements = searchCriteria.Filter(list); return(new UIItemCollection(automationElements.ToArray(), factory, actionListener)); }