System.Data.XmlDataLoader.AttachRows C# (CSharp) Метод

AttachRows() приватный Метод

private AttachRows ( DataRow parentRow, XmlNode parentElement ) : void
parentRow DataRow
parentElement System.Xml.XmlNode
Результат void
        private void AttachRows(DataRow parentRow, XmlNode parentElement)
        {
            if (parentElement == null)
                return;

            for (XmlNode n = parentElement.FirstChild; n != null; n = n.NextSibling)
            {
                if (n.NodeType == XmlNodeType.Element)
                {
                    XmlElement e = (XmlElement)n;
                    DataRow r = GetRowFromElement(e);
                    if (r != null && r.RowState == DataRowState.Detached)
                    {
                        if (parentRow != null)
                            r.SetNestedParentRow(parentRow, /*setNonNested*/ false);

                        r.Table.Rows.Add(r);
                    }
                    else if (r == null)
                    {
                        // n is a 'sugar element'
                        AttachRows(parentRow, n);
                    }

                    // attach all detached rows
                    AttachRows(r, n);
                }
            }
        }