AuScGen.WhiteFramework.BaseControl.GetChildren C# (CSharp) Method

GetChildren() private method

private GetChildren ( AutomationElement element_in ) : List
element_in System.Windows.Automation.AutomationElement
return List
        internal List<BaseControl> GetChildren(AutomationElement element_in)
        {
            //Trace.TraceInformation(String.Format("{0}: Try to get MSUIA children from AutomationElement...", ""));
            if (null == element_in)
            {
                throw new ArgumentNullException("element_in");
            }
            List<AutomationElement> aList = new List<AutomationElement>(0);
            AutomationElement aChild = TreeWalker.RawViewWalker.GetFirstChild(element_in);

            while (null != aChild)
            {
                aList.Add(aChild);
                aChild = TreeWalker.RawViewWalker.GetNextSibling(aChild);
            }
            //Trace.TraceInformation(String.Format("{0}: MSUIA children from AutomationElement found.", ""));
            //return aList;

            List<BaseControl> controls = new List<BaseControl>();
            aList.ForEach(auto => 
            {
                controls.Add(new BaseControl(auto, myControlAccess));
            });

            return controls;
        }