VisualUIAVerify.Controls.AutomationElementTreeNode.FindChildNodeForAutomationElementInternal C# (CSharp) Method

FindChildNodeForAutomationElementInternal() private method

private FindChildNodeForAutomationElementInternal ( AutomationElement element ) : AutomationElementTreeNode
element System.Windows.Automation.AutomationElement
return AutomationElementTreeNode
        internal AutomationElementTreeNode FindChildNodeForAutomationElementInternal(AutomationElement element)
        {
            //go thru the childern collection and compare them
            foreach (AutomationElementTreeNode childNode in new AutomationElementTreeNodeCollection(this))
            {
                if (childNode.AutomationElement == element)
                    return childNode; //yes! we found it
            }

            //currentTestTypeRootNode was not founded
            return null;
        }