mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-13 20:47:24 +00:00
Fixing issues parsing certain numeric types from xml
This commit is contained in:
parent
291ff6b425
commit
25d8a73a6a
1 changed files with 13 additions and 1 deletions
|
|
@ -401,7 +401,7 @@ namespace ICD.Common.Utils.Xml
|
||||||
/// <param name="childElement"></param>
|
/// <param name="childElement"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
private static float? ReadChildElementContentAsFloat(string xml, string childElement)
|
public static float ReadChildElementContentAsFloat(string xml, string childElement)
|
||||||
{
|
{
|
||||||
string child = GetChildElementAsString(xml, childElement);
|
string child = GetChildElementAsString(xml, childElement);
|
||||||
using (IcdXmlReader reader = new IcdXmlReader(child))
|
using (IcdXmlReader reader = new IcdXmlReader(child))
|
||||||
|
|
@ -518,6 +518,10 @@ namespace ICD.Common.Utils.Xml
|
||||||
{
|
{
|
||||||
return ReadChildElementContentAsLong(xml, childElement);
|
return ReadChildElementContentAsLong(xml, childElement);
|
||||||
}
|
}
|
||||||
|
catch (IcdXmlException)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
catch (FormatException)
|
catch (FormatException)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -556,6 +560,10 @@ namespace ICD.Common.Utils.Xml
|
||||||
{
|
{
|
||||||
return ReadChildElementContentAsFloat(xml, childElement);
|
return ReadChildElementContentAsFloat(xml, childElement);
|
||||||
}
|
}
|
||||||
|
catch (IcdXmlException)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
catch (FormatException)
|
catch (FormatException)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -594,6 +602,10 @@ namespace ICD.Common.Utils.Xml
|
||||||
{
|
{
|
||||||
return ReadChildElementContentAsByte(xml, childElement);
|
return ReadChildElementContentAsByte(xml, childElement);
|
||||||
}
|
}
|
||||||
|
catch (ArgumentOutOfRangeException)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
catch (FormatException)
|
catch (FormatException)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue