UIAutomation.GetControlCollectionCmdletBase.GetAutomationElementsWithFindAll C# (CSharp) Method

GetAutomationElementsWithFindAll() private method

private GetAutomationElementsWithFindAll ( IUiElement element, ControlSearcherData data, UIANET::System.Windows.Automation conditions, bool caseSensitiveParam, bool onlyOneResult, bool onlyTopLevel, bool viaWildcardOrRegex ) : List
element IUiElement
data ControlSearcherData
conditions UIANET::System.Windows.Automation
caseSensitiveParam bool
onlyOneResult bool
onlyTopLevel bool
viaWildcardOrRegex bool
return List
        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;
        }
        

Usage Example

Example #1
0
 public static List<IUiElement> GetResultList_ViaWildcards_Legacy(IUiElement element, Condition condition, ControlSearcherData data)
 {
     var cmdletDerived = new GetControlCollectionCmdletBase();
     
     List<IUiElement> resultList =
         cmdletDerived.GetAutomationElementsWithFindAll(
             element,
             data,
             condition,
             false,
             false,
             false,
             true);
     
     return resultList;
 }