System.Xml.DocumentXPathNavigator.MoveToRoot C# (CSharp) Method

MoveToRoot() public method

public MoveToRoot ( ) : void
return void
        public override void MoveToRoot() {
            for (;;) {
                XmlNode parent = source.ParentNode;
                if (parent == null) {
                    XmlAttribute attribute = source as XmlAttribute; 
                    if (attribute == null) {
                        break;
                    }
                    parent = attribute.IsNamespace ? namespaceParent : attribute.OwnerElement;
                    if (parent == null) {
                        break;
                    }
                }
                source = parent;
            }
            namespaceParent = null;
        }