System.Xml.XPathNodePointer.MoveToNextNamespace C# (CSharp) Method

MoveToNextNamespace() private method

private MoveToNextNamespace ( XmlBoundElement be, DataColumn col, XmlAttribute curAttr ) : bool
be XmlBoundElement
col System.Data.DataColumn
curAttr XmlAttribute
return bool
        private bool MoveToNextNamespace(XmlBoundElement be, DataColumn col, XmlAttribute curAttr)
        {
            if (be != null)
            {
                if (be.IsFoliated)
                {
                    XmlAttributeCollection attrs = be.Attributes;
                    XmlAttribute attr = null;
                    bool bFound = false;
                    if (curAttr == null)
                        bFound = true; //the first namespace will be the one
#if DEBUG
                    if (curAttr != null)
                        Debug.Assert(curAttr.NamespaceURI == StrReservedXmlns);
#endif
                    Debug.Assert(attrs != null);
                    int attrInd = attrs.Count;
                    while (attrInd > 0)
                    {
                        attrInd--;
                        attr = attrs[attrInd];
                        if (bFound && attr.NamespaceURI == StrReservedXmlns && !DuplicateNS(be, attr.LocalName))
                        {
                            MoveTo(attr);
                            return true;
                        }
                        if (attr == curAttr)
                            bFound = true;
                    }
                }
                else
                {//defoliated so that we need to search through its column 
                    DataRow curRow = be.Row;
                    if (curRow == null)
                        return false;
                    //going through its attribute columns
                    DataColumn curCol = PreviousColumn(curRow, col, true);
                    while (curCol != null)
                    {
                        if (curCol.Namespace == StrReservedXmlns && !DuplicateNS(be, curCol.ColumnName))
                        {
                            MoveTo(be, curCol, false);
                            return true;
                        }
                        curCol = PreviousColumn(curRow, curCol, true);
                    }
                }
            }
            return false;
        }

Same methods

XPathNodePointer::MoveToNextNamespace ( XPathNamespaceScope namespaceScope ) : bool