public virtual int ReadContentAsInt()
{
if (!CanReadContentAs())
{
throw CreateReadContentAsException(nameof(ReadContentAsInt));
}
try
{
return XmlConvert.ToInt32(InternalReadContentAsString());
}
catch (FormatException e)
{
throw new XmlException(SR.Xml_ReadContentAsFormatException, "Int", e, this as IXmlLineInfo);
}
}