Running a spell checker on the whole solution revealed a couple more
typos. This fixes all of those (although internal // line comments are
mostly left alone).
Additionally, convert a very few string.Format occurrences to the pre-
dominant .FormatWith pattern and fix some incorrect message strings.
Primarily where it means one fewer field-access or simplifies
event delegate invocation, though one or two cases have just the
lesser advantage of allowing an IL stack dup rather than local access.
XML documentation comments for JsonReader, JsonWriter and derived
classes often mention "underlying streams". In most cases however,
these types don't operate directly on Streams, but through other types
such as TextReader and TextWriter.
This commit changes these comments to reflect more accurately what
kind of objects the various JSON reader / writer classes operate on.
Additionally the effect of JsonReader.CloseInput and JsonWriter.Close-
Output is made more explicit in the comments for the Close methods.
* Add references to types where they are missing.
* Fix incorrect references to closed generic types.
* Convert member ID strings to proper references where they can be
converted without breaking the build. The remaining member ID
strings usually mean that the comment would have to be rephrased
for at least one build target / platform.
* Drop namespaces from type names where they are unnecessary.
* Fix the odd typo and add additional <c> markup in a few places.
This fixes several minor issues in the code's documentation comments,
such as spelling errors, missing punctuation and references to other
code elements, and a few other small inconsistencies.
-Added TypeNameAssemblyFormatHandling properties to JsonSerializer and JsonSerializerSettings
-Changed TypeNameAssemblyFormat properties on JsonSerializer and JsonSerializerSettings to obsolete
-Added SerializationBinder properties to JsonSerializer and JsonSerializerSettings
-Changed Binder properties on JsonSerializer and JsonSerializerSettings to obsolete
GetValueOrDefault() is an easily-inlined access to a field as this
will hold the correct value for both HasValue and !HasValue cases.
The Value property in comparison contains a branch on a check that the
Nullable<T> has its internal hasValue flag to decide whether to throw
InvalidOperationException or not.
Hence when a nullable type is known to have a value (not be null) and
one wants the value, rather than to possibly trigger the exception-throw
GetValueOrDefault() has a slight performance benefit over Value.
Accordingly, replace calls to the Value property with calls to
GetValueOrDefault() when previous checks or assignments guarantee the
value is not null.
The term "default settings" did not obviously reference the `JsonConvert.DefaultSettings` global variable (especially to those who were not aware of its existence), and so the actual difference between `Create()` and `CreateDefault()` was unclear. By referencing it explicitly, the code, and therefore its generated documentation, will be clearer.
-Added support for specifying the root type when serialize JSON to use with TypeNameHandling.Auto
-Fixed recursively reading type wrapper objects when deserializing
-Added DateFormatString to JsonWriter/JsonSerializer/JsonSerializerSettings
-Changed StringEnumConverter to convert an empty string to null for nullable enums
-Changed NaN and Infinity floating point values to be serialized as strings by default
-Fixed serializer sometimes not using DateParseHandling setting
-Fixed error in JsonWriter.WriteToken when writing a DateTimeOffset
-Fixed error when serializing emitted classes that have a constructor with null named parameters (really?)
-Added support for DataMemberAttribute's EmitDefaultValue
-Fixed losing decimal precision when writing JValues
-Fixed error when calling ToList on empty JObjects and JArrays
-Fixed bad JSON in an array with error handling creating an infinite loop
-JsonTextReader no longer returns no content after consecutive underlying content read failures
-Added DateTimeZoneHandling to control reading and writing DateTime time zone details
-Added reader/writer specific Formatting, DateFormatHandling and DateTimeZoneHandling to JsonSerializerSettings
-Added feature of reader/writer specific settings to be set on JsonReader/JsonWriter when serializing
-Added ReadAsDate to JsonReader
-Added ReadAsString to JsonReader
-Changed JsonTextReader to automatically read ISO strings as dates
-Refactored ReadAsXXX methods and reduce code redundancy
-Removed unused JsonDateTimeSerializationMode