System.Data.XmlToDatasetMap.GetSelfAndDescendants C# (CSharp) Method

GetSelfAndDescendants() private method

private GetSelfAndDescendants ( DataTable dt ) : ArrayList
dt DataTable
return System.Collections.ArrayList
        private ArrayList GetSelfAndDescendants(DataTable dt)
        { // breadth-first
            ArrayList tableList = new ArrayList();
            tableList.Add(dt);
            int nCounter = 0;

            while (nCounter < tableList.Count)
            {
                foreach (DataRelation childRelations in ((DataTable)tableList[nCounter]).ChildRelations)
                {
                    if (!tableList.Contains(childRelations.ChildTable))
                        tableList.Add(childRelations.ChildTable);
                }
                nCounter++;
            }

            return tableList;
        }
        // Used to infer schema and top most node