-Increment version to 4.0.7

-Fixed circular reference error when serializing nullable structs
-Fixed JsonReader.ReadAsXXX methods not converting string values
This commit is contained in:
JamesNK
2012-01-24 09:12:32 +00:00
parent b82d26028d
commit 3d43fc9c4f
13 changed files with 590 additions and 128 deletions
+12 -2
View File
@@ -103,6 +103,7 @@ namespace Newtonsoft.Json
internal State _currentState;
private JTokenType _currentTypeContext;
private bool _serializerInArray;
private CultureInfo _culture;
internal void SetSerializeInArray(bool serializerInArray)
{
@@ -181,6 +182,15 @@ namespace Newtonsoft.Json
}
}
/// <summary>
/// Gets or sets the culture used when reading JSON. Defaults to <see cref="CultureInfo.InvariantCulture"/>.
/// </summary>
public CultureInfo Culture
{
get { return _culture ?? CultureInfo.InvariantCulture; }
set { _culture = value; }
}
/// <summary>
/// Initializes a new instance of the <see cref="JsonReader"/> class with the specified <see cref="TextReader"/>.
/// </summary>
@@ -473,7 +483,7 @@ namespace Newtonsoft.Json
int lineNumber;
int linePosition;
if (lineInfo != null)
if (lineInfo != null && lineInfo.HasLineInfo())
{
lineNumber = lineInfo.LineNumber;
linePosition = lineInfo.LinePosition;
@@ -492,7 +502,7 @@ namespace Newtonsoft.Json
if (!message.EndsWith("."))
message += ".";
if (lineInfo != null)
if (lineInfo != null && lineInfo.HasLineInfo())
message += " Line {0}, position {1}.".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);
return message;