-Documentation

-Fixed potential casting error when writing JSON using a JsonReader
This commit is contained in:
JamesNK
2011-10-01 11:32:48 +00:00
parent b5f5db5624
commit 4f947d9207
3 changed files with 402 additions and 375 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
<h3>Conversion Rules</h3> <h3>Conversion Rules</h3>
<ul> <ul>
<li>Elements remain unchanged. </li> <li>Elements remain unchanged. </li>
<li>Attributes are prefixed with an @. </li> <li>Attributes are prefixed with an @ and should be at the start of the object. </li>
<li>Single child text nodes are a value directly against an element, otherwise they <li>Single child text nodes are a value directly against an element, otherwise they
are accessed via #text. </li> are accessed via #text. </li>
<li>The XML declaration and processing instructions are prefixed with ?. </li> <li>The XML declaration and processing instructions are prefixed with ?. </li>
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -353,16 +353,16 @@ namespace Newtonsoft.Json
WriteComment(reader.Value.ToString()); WriteComment(reader.Value.ToString());
break; break;
case JsonToken.Integer: case JsonToken.Integer:
WriteValue((long)reader.Value); WriteValue(Convert.ToInt64(reader.Value));
break; break;
case JsonToken.Float: case JsonToken.Float:
WriteValue((double)reader.Value); WriteValue(Convert.ToDouble(reader.Value));
break; break;
case JsonToken.String: case JsonToken.String:
WriteValue(reader.Value.ToString()); WriteValue(reader.Value.ToString());
break; break;
case JsonToken.Boolean: case JsonToken.Boolean:
WriteValue((bool)reader.Value); WriteValue(Convert.ToBoolean(reader.Value));
break; break;
case JsonToken.Null: case JsonToken.Null:
WriteNull(); WriteNull();