UIAutomation.GetControlCollectionCmdletBase.GetAutomationElementsChildren C# (CSharp) Method

GetAutomationElementsChildren() protected method

protected GetAutomationElementsChildren ( IUiElement inputObject, bool firstChild ) : void
inputObject IUiElement
firstChild bool
return void
        protected void GetAutomationElementsChildren(IUiElement inputObject, bool firstChild)
        {
            if (!CheckAndPrepareInput(this)) { return; }
            
            var walker = 
                new classic.TreeWalker(
                    classic.Condition.TrueCondition);
            
            IUiElement sibling =
                firstChild ?
                    AutomationFactory.GetUiElement(walker.GetFirstChild(inputObject.GetSourceElement() as classic.AutomationElement)) :
                        AutomationFactory.GetUiElement(walker.GetLastChild(inputObject.GetSourceElement() as classic.AutomationElement));
            
            WriteObject(this, sibling);
        }