private void CheckText(JsonNodeType nextNodeType)
{
if (IsClosed)
{
ThrowClosed();
}
if (_depth == 0)
{
throw new InvalidOperationException(SR.XmlIllegalOutsideRoot);
}
if ((nextNodeType == JsonNodeType.StandaloneText) &&
(_nodeType == JsonNodeType.QuotedText))
{
throw new XmlException(SR.JsonCannotWriteStandaloneTextAfterQuotedText);
}
}