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

DuplicateNS() private method

private DuplicateNS ( XmlBoundElement endElem, string lname ) : bool
endElem XmlBoundElement
lname string
return bool
        private bool DuplicateNS(XmlBoundElement endElem, string lname)
        {
            if (_parentOfNS == null || endElem == null)
                return false;
            XmlBoundElement be = _parentOfNS;
            XmlNode node = null;
            while (be != null && be != endElem)
            {
                if (GetNamespace(be, lname) != null)
                    return true;
                node = be;
                do
                {
                    node = node.ParentNode;
                } while (node != null && node.NodeType != XmlNodeType.Element);
                be = node as XmlBoundElement;
            }
            return false;
        }