mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +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>
|
||||
/// <returns></returns>
|
||||
[PublicAPI]
|
||||
private static float? ReadChildElementContentAsFloat(string xml, string childElement)
|
||||
public static float ReadChildElementContentAsFloat(string xml, string childElement)
|
||||
{
|
||||
string child = GetChildElementAsString(xml, childElement);
|
||||
using (IcdXmlReader reader = new IcdXmlReader(child))
|
||||
|
|
@ -518,6 +518,10 @@ namespace ICD.Common.Utils.Xml
|
|||
{
|
||||
return ReadChildElementContentAsLong(xml, childElement);
|
||||
}
|
||||
catch (IcdXmlException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
return null;
|
||||
|
|
@ -556,6 +560,10 @@ namespace ICD.Common.Utils.Xml
|
|||
{
|
||||
return ReadChildElementContentAsFloat(xml, childElement);
|
||||
}
|
||||
catch (IcdXmlException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
return null;
|
||||
|
|
@ -594,6 +602,10 @@ namespace ICD.Common.Utils.Xml
|
|||
{
|
||||
return ReadChildElementContentAsByte(xml, childElement);
|
||||
}
|
||||
catch (ArgumentOutOfRangeException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue