System.Xml.XmlBaseReader.EnterScope C# (CSharp) Méthode

EnterScope() protected méthode

protected EnterScope ( ) : XmlElementNode
Résultat XmlElementNode
        protected XmlElementNode EnterScope()
        {
            if (_depth == 0)
            {
                if (_rootElement)
                    XmlExceptionHelper.ThrowMultipleRootElements(this);
                _rootElement = true;
            }
            _nsMgr.EnterScope();
            _depth++;
            if (_depth > _quotas.MaxDepth)
                XmlExceptionHelper.ThrowMaxDepthExceeded(this, _quotas.MaxDepth);
            if (_elementNodes == null)
            {
                _elementNodes = new XmlElementNode[4];
            }
            else if (_elementNodes.Length == _depth)
            {
                XmlElementNode[] newElementNodes = new XmlElementNode[_depth * 2];
                Array.Copy(_elementNodes, 0, newElementNodes, 0, _depth);
                _elementNodes = newElementNodes;
            }
            XmlElementNode elementNode = _elementNodes[_depth];
            if (elementNode == null)
            {
                elementNode = new XmlElementNode(_bufferReader);
                _elementNodes[_depth] = elementNode;
            }
            _attributeCount = 0;
            _attributeStart = -1;
            _attributeIndex = -1;
            MoveToNode(elementNode);
            return elementNode;
        }