# HG changeset patch # User cin # Date 2017-08-22 23:38:02 # Node ID 8222a2ab3ab75bb3f4ddd0505adf5e3e2daf2855 # Parent 1ba2127cfcd8896d2ca877aab1d4c4bfa34e94c6 JSONXmlReaderFixed fixed boolean values handling diff --git a/Implab/Formats/JSON/JSONXmlReader.cs b/Implab/Formats/JSON/JSONXmlReader.cs --- a/Implab/Formats/JSON/JSONXmlReader.cs +++ b/Implab/Formats/JSON/JSONXmlReader.cs @@ -266,9 +266,17 @@ namespace Implab.Formats.JSON { get { if (m_parser.ElementValue == null) return String.Empty; - if (Convert.GetTypeCode(m_parser.ElementValue) == TypeCode.Double) - return ((double)m_parser.ElementValue).ToString(CultureInfo.InvariantCulture); - return m_parser.ElementValue.ToString(); + + switch(Convert.GetTypeCode (m_parser.ElementValue)) { + case TypeCode.Double: + return ((double)m_parser.ElementValue).ToString (CultureInfo.InvariantCulture); + case TypeCode.String: + return (string)m_parser.ElementValue; + case TypeCode.Boolean: + return (bool)m_parser.ElementValue ? "true" : "false"; + default: + return m_parser.ElementValue.ToString (); + } } } diff --git a/Implab/Implab.csproj b/Implab/Implab.csproj --- a/Implab/Implab.csproj +++ b/Implab/Implab.csproj @@ -205,12 +205,14 @@ - - + + - - - + + + + +