internal List <IUiElement> GetAutomationElementsWithFindAll( IUiElement element, ControlSearcherData data, classic.Condition conditions, bool caseSensitiveParam, bool onlyOneResult, bool onlyTopLevel, bool viaWildcardOrRegex) { var resultCollection = new List <IUiElement>(); try { IUiEltCollection results = element.FindAll( classic.TreeScope.Descendants, conditions); resultCollection = WindowSearcher.ReturnOnlyRightElements( results, data, caseSensitiveParam, viaWildcardOrRegex); if (null != results) { // results.Dispose(); // taboo! results = null; } // results = null; } catch { //(Exception eWildCardSearch) { } return(resultCollection); }
public static List<IUiElement> GetResultList_GetWindowCollectionByPid( IUiElement rootElement, WindowSearcherData data) { var windowSearcher = new WindowSearcher(); List<IUiElement> resultList = windowSearcher.GetWindowCollectionByPid( rootElement, data); return resultList; }