internal void ResetState()
{
Debug.Assert(_v1Compat, "XmlTextReaderImpl.ResetState cannot be called on reader created via XmlReader.Create.");
if (_fragment)
{
Throw(new InvalidOperationException(SR.Xml_InvalidResetStateCall));
}
if (_readState == ReadState.Initial)
{
return;
}
// Clear
ResetAttributes();
while (_namespaceManager.PopScope()) ;
while (InEntity)
{
HandleEntityEnd(true);
}
// Init
_readState = ReadState.Initial;
_parsingFunction = ParsingFunction.SwitchToInteractiveXmlDecl;
_nextParsingFunction = ParsingFunction.DocumentContent;
_curNode = _nodes[0];
_curNode.Clear(XmlNodeType.None);
_curNode.SetLineInfo(0, 0);
_index = 0;
_rootElementParsed = false;
_charactersInDocument = 0;
_charactersFromEntities = 0;
_afterResetState = true;
}