private bool SetupReadElementContentAsXxx(string methodName)
{
if (this.NodeType != XmlNodeType.Element)
{
throw CreateReadElementContentAsException(methodName);
}
bool isEmptyElement = this.IsEmptyElement;
// move to content or beyond the empty element
this.Read();
if (isEmptyElement)
{
return false;
}
XmlNodeType nodeType = this.NodeType;
if (nodeType == XmlNodeType.EndElement)
{
this.Read();
return false;
}
else if (nodeType == XmlNodeType.Element)
{
throw new XmlException(SR.Xml_MixedReadElementContentAs, string.Empty, this as IXmlLineInfo);
}
return true;
}