-Added auto outlines to many documentation pages

This commit is contained in:
James Newton-King
2016-10-24 16:12:52 +13:00
parent 0721bd4dec
commit b7e77700ac
25 changed files with 93 additions and 179 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
$packageId = "Newtonsoft.Json"
$signAssemblies = $false
$signKeyPath = "C:\Development\Releases\newtonsoft.snk"
$buildDocumentation = $false
$buildDocumentation = $true
$buildNuGet = $true
$treatWarningsAsErrors = $false
$workingName = if ($workingName) {$workingName} else {"Working"}
+3 -2
View File
@@ -8,8 +8,9 @@
<linkUri>http://msdn.microsoft.com/en-us/library/53b8022e.aspx</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink>.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<section>
<section address="ShouldSerialize">
<title>ShouldSerialize</title>
<content>
<para>To conditionally serialize a property, add a method that returns boolean with the same name as the property and then prefix the method name
@@ -21,7 +22,7 @@
</content>
</section>
<section>
<section address="IContractResolver">
<title>IContractResolver</title>
<content>
<para>ShouldSerialize can also be set using an <codeEntityReference>T:Newtonsoft.Json.Serialization.IContractResolver</codeEntityReference>.
+4 -3
View File
@@ -13,11 +13,12 @@
</para>
<para>Anything that can be set on an object, collection, property, etc, using attributes or methods to control serialization
can also be set using an IContractResolver.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<!-- Add one or more top-level section elements. These are collapsible.
If using <autoOutline />, add an address attribute to identify it
and specify a title so that it can be jumped to with a hyperlink. -->
<section>
<section address="DefaultContractResolver">
<title>DefaultContractResolver</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -28,7 +29,7 @@
virtual methods that can be overridden.</para>
</content>
</section>
<section>
<section address="CamelCasePropertyNamesContractResolver">
<title>CamelCasePropertyNamesContractResolver</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -44,7 +45,7 @@
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="ContractResolver" title="ContractResolver" />
</content>
</section>
<section>
<section address="CustomIContractResolverExamples">
<title>Custom IContractResolver Examples</title>
<content>
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\PerformanceTests.cs" region="JsonConverterContractResolver" title="Use JsonConverter with IContractResolver" />
+4 -3
View File
@@ -3,9 +3,10 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>As well as parsing JSON from existing JSON strings, LINQ to JSON objects can be created from scratch to create new JSON structures.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<section>
<section address="CreatingManually">
<title>Manually Creating JSON</title>
<content>
<para>Setting values and creating objects and arrays one at a time gives you
@@ -15,7 +16,7 @@
</content>
</section>
<section>
<section address="CreatingLINQ">
<title>Creating JSON with LINQ</title>
<content>
<para>Declaratively creating JSON objects using LINQ is a fast way to create JSON from collections of values.</para>
@@ -24,7 +25,7 @@
</content>
</section>
<section>
<section address="CreatingFromObject">
<title>Creating JSON from an object</title>
<content>
<para>The last option is to create a JSON object from a non-JSON type using the
+5 -4
View File
@@ -15,11 +15,12 @@
</externalLink> itself: there is no literal
syntax for dates in JSON. The spec has objects, arrays, strings, integers,
and floats, but it defines no standard for what a date looks like.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<!-- Add one or more top-level section elements. These are collapsible.
If using <autoOutline />, add an address attribute to identify it
and specify a title so that it can be jumped to with a hyperlink. -->
<section>
<section address="DatesAndJsonNET">
<title>Dates and Json.NET</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -46,7 +47,7 @@
</externalLink>.</para>
</content>
</section>
<section>
<section address="DateTimeJsonConverters">
<title>DateTime JsonConverters</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -63,7 +64,7 @@
serializer.</para>
</content>
</section>
<section>
<section address="JavaScriptDateTimeConverter">
<title>JavaScriptDateTimeConverter</title>
<content>
<para>The JavaScriptDateTimeConverter class is one of the two DateTime
@@ -77,7 +78,7 @@
browsers and some JSON frameworks, including Json.NET, support it.</para>
</content>
</section>
<section>
<section address="IsoDateTimeConverter">
<title>IsoDateTimeConverter</title>
<content>
<alert class="note">
+3 -2
View File
@@ -3,8 +3,9 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>Json.NET offers many features not found in the JavaScriptSerializer and DataContractSerializer that come with .NET.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<section>
<section address="FeatureComparison">
<title>Feature Comparison</title>
<content>
<table>
@@ -487,7 +488,7 @@
</table>
</content>
</section>
<section>
<section address="Benchmarks">
<title>Benchmarks</title>
<content>
-101
View File
@@ -1,101 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<topic id="JsonNetVsWindowsDataJson" revisionNumber="1">
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>Windows 8 introduced a new way to work with JSON via the <externalLink>
<linkText>Windows.Data.Json</linkText>
<linkUri>http://msdn.microsoft.com/en-us/library/windows/apps/xaml/br240639.aspx</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink> namespace. Similar to LINQ to JSON in Json.NET,
it defines classes that can be used to parse values, strings, objects, and arrays from
JSON text or serialize value types into JSON text.</para>
<para>Below is a comparison of Json.NET&apos;s LINQ to JSON to Window 8&apos;s Windows.Data.Json.</para>
</introduction>
<section>
<title>Exclusive Json.NET Features</title>
<content>
<list class="bullet">
<listItem>
<para>
Runs on .NET 2, .NET 3, .NET 4, Silverlight, and Windows Phone 7
</para>
</listItem>
<listItem>
<para>
Dynamic programming
</para>
</listItem>
<listItem>
<para>
Write indented JSON
</para>
</listItem>
<listItem>
<para>
Customize reading and writing JSON with JsonConverters
</para>
</listItem>
<listItem>
<para>
Read and write ISO8601 dates
</para>
</listItem>
<listItem>
<para>
Better LINQ support
</para>
</listItem>
</list>
</content>
</section>
<section>
<title>Creating JSON</title>
<content>
<para>The big difference between the two libraries when creating JSON is Windows.Data.Json requires
string/integer/double values to be explicitly converted to JsonValue objects.</para>
<para>Note that there is a weird limitation to creating JSON with Windows.Data.Json: it doesn&apos;t
allow you to set properties to null or put null values in an array.</para>
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\JsonNetVsWindowsDataJsonTests.cs" region="CreatingJSON" title="Creating JSON with Json.NET and Windows.Data.Json" />
</content>
</section>
<section>
<title>Querying JSON</title>
<content>
<para>Windows.Data.Json requires a value to be cast to its exact type with the GetObject/GetArray methods
before it can be used, making Windows.Data.Json&apos;s code verbose compared to LINQ to JSON.</para>
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\JsonNetVsWindowsDataJsonTests.cs" region="QueryingJSON" title="Querying JSON with Json.NET and Windows.Data.Json" />
</content>
</section>
<section>
<title>Benchmarks</title>
<content>
<para>Json.NET is slightly slower at writing JSON than Windows.Data.Json but considerably faster at parsing JSON.</para>
<mediaLink>
<image class="image" xlink:href="jsonnetwindowsdatajson" mimeType="image/png" width="592" height="356" />
<summary>Json.NET and Windows.Data.Json Performance</summary>
</mediaLink>
</content>
</section>
<section>
<title>Converting Between LINQ to JSON and Windows.Data.Json</title>
<content>
<para>Json.NET supports converting between the types of the two libraries.
This feature is useful if you are working with another API that uses Windows.Data.Json types but you want to use Json.NET inside your own code.</para>
<para>Use <codeEntityReference>Overload:Newtonsoft.Json.Linq.JToken.FromObject</codeEntityReference> to convert a Windows.Data.Json
value to LINQ to JSON and use <codeEntityReference>Overload:Newtonsoft.Json.Linq.JToken.ToObject</codeEntityReference> to convert LINQ to JSON to Windows.Data.Json.</para>
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\JsonNetVsWindowsDataJsonTests.cs" region="Converting" title="Converting between Json.NET and Windows.Data.Json" />
</content>
</section>
<relatedTopics>
<codeEntityReference>N:Newtonsoft.Json.Linq</codeEntityReference>
</relatedTopics>
</developerConceptualDocument>
</topic>
+3 -2
View File
@@ -3,9 +3,10 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>LINQ to JSON has methods available for parsing JSON from a string or loading JSON directly from a file.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<section>
<section address="ParsingJSON">
<title>Parsing JSON text</title>
<content>
<para>JSON values can be read from a string using
@@ -16,7 +17,7 @@
</content>
</section>
<section>
<section address="LoadingJSON">
<title>Loading JSON from a file</title>
<content>
<para>JSON can also be loaded directly from a file using <codeEntityReference>M:Newtonsoft.Json.Linq.JToken.ReadFrom(Newtonsoft.Json.JsonReader)</codeEntityReference>.</para>
+5 -4
View File
@@ -4,8 +4,9 @@
<introduction>
<para>Out of the box Json.NET is faster than DataContractJsonSerializer and JavaScriptSerializer.
Here are some tips to make it go even faster.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<section>
<section address="MemoryUsage">
<title>Optimize Memory Usage</title>
<content>
<para>To keep an application consistently fast, it is important to minimize the
@@ -31,7 +32,7 @@
</content>
</section>
<section>
<section address="JsonConverters">
<title>JsonConverters</title>
<content>
<para>Passing a <codeEntityReference>T:Newtonsoft.Json.JsonConverter</codeEntityReference> to SerializeObject or DeserializeObject provides a simple way to completely
@@ -51,7 +52,7 @@
<para>The IContractResolver in the example above will set all DateTimes to use the JavaScriptDateConverter.</para>
</content>
</section>
<section>
<section address="ManuallySerialize">
<title>Manually Serialize</title>
<content>
<para>The absolute fastest way to read and write JSON is to use JsonTextReader/JsonTextWriter directly to manually serialize types.
@@ -64,7 +65,7 @@
</para>
</content>
</section>
<section>
<section address="Benchmarks">
<title>Benchmarks</title>
<content>
+4 -3
View File
@@ -20,11 +20,12 @@
contain two completely separate Person objects with the same values. Writing
references by value will also cause problems on objects where a circular
reference occurs.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<!-- Add one or more top-level section elements. These are collapsible.
If using <autoOutline />, add an address attribute to identify it
and specify a title so that it can be jumped to with a hyperlink. -->
<section>
<section address="PreserveReferencesHandling">
<title>PreserveReferencesHandling</title>
<content>
<para>Setting <codeEntityReference>T:Newtonsoft.Json.PreserveReferencesHandling</codeEntityReference> will track object references
@@ -47,7 +48,7 @@
</content>
</section>
<section>
<section address="IsReference">
<title>IsReference</title>
<content>
<para>The PreserveReferencesHandling setting on the JsonSerializer will
@@ -66,7 +67,7 @@
</content>
</section>
<section>
<section address="IReferenceResolver">
<title>IReferenceResolver</title>
<content>
<para>To customize how references are generated and resolved the
+3 -2
View File
@@ -5,9 +5,10 @@
<para>LINQ to JSON provides a number of methods for getting data from its objects. The index methods on JObject/JArray let you quickly get data by its property name
on an object or index in a collection, while <codeEntityReference>M:Newtonsoft.Json.Linq.JToken.Children</codeEntityReference> lets you get ranges
of data as <codeInline>IEnumerable&lt;JToken&gt;</codeInline> to then query using LINQ.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<section>
<section address="Index">
<title>Getting values by Property Name or Collection Index</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -21,7 +22,7 @@
</content>
</section>
<section>
<section address="QueryingLINQ">
<title>Querying with LINQ</title>
<content>
<para>JObject/JArray can also be queried using LINQ. <codeEntityReference>M:Newtonsoft.Json.Linq.JToken.Children</codeEntityReference>
+3 -2
View File
@@ -6,9 +6,10 @@
<codeEntityReference>T:Newtonsoft.Json.JsonReader</codeEntityReference>
and
<codeEntityReference>T:Newtonsoft.Json.JsonWriter</codeEntityReference> classes.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<section>
<section address="TextReaderWriter">
<title>JsonTextReader and JsonTextWriter</title>
<content>
@@ -32,7 +33,7 @@
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ReadingAndWritingJsonTests.cs" region="ReadingJsonText" title="Reading JSON with JsonTextReader" />
</content>
</section>
<section>
<section address="JTokenReaderWriter">
<title>JTokenReader and JTokenWriter</title>
<content>
<para><codeEntityReference>T:Newtonsoft.Json.Linq.JTokenReader</codeEntityReference>
+6 -5
View File
@@ -18,11 +18,12 @@
means more bandwidth and a slower website.</para>
<para>To solve the issue of unwanted JSON, Json.NET has a range of built-in
options to fine-tune what gets written from a serialized object.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<!-- Add one or more top-level section elements. These are collapsible.
If using <autoOutline />, add an address attribute to identify it
and specify a title so that it can be jumped to with a hyperlink. -->
<section>
<section address="JsonIgnoreAttributeAndDataMemberAttribute">
<title>JsonIgnoreAttribute and DataMemberAttribute</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -47,7 +48,7 @@
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="ReducingSerializedJsonSizeOptIn" title="Opt-in Serialization Example" />
</content>
</section>
<section>
<section address="Formatting">
<title>Formatting</title>
<content>
<para>JSON written by the serializer with an option of
@@ -59,7 +60,7 @@
JSON possible.</para>
</content>
</section>
<section>
<section address="NullValueHandling">
<title>NullValueHandling</title>
<content>
<para><codeEntityReference>T:Newtonsoft.Json.NullValueHandling</codeEntityReference>
@@ -79,7 +80,7 @@
property.</para>
</content>
</section>
<section>
<section address="DefaultValueHandling">
<title>DefaultValueHandling</title>
<content>
<para><codeEntityReference>T:Newtonsoft.Json.DefaultValueHandling</codeEntityReference>
@@ -108,7 +109,7 @@
will override the setting on the JsonSerializer for that property.</para>
</content>
</section>
<section>
<section address="IContractResolver">
<title>IContractResolver</title>
<content>
<para>For more flexibility, the
+4 -3
View File
@@ -7,8 +7,9 @@
provides a method to query LINQ to JSON using a single string path to a desired
<codeEntityReference>T:Newtonsoft.Json.Linq.JToken</codeEntityReference>.
SelectToken makes dynamic queries easy because the entire query is defined in a string.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<section>
<section address="SelectToken">
<title>SelectToken</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -22,7 +23,7 @@
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\LinqToJsonTests.cs" region="SelectTokenComplex" title="SelectToken Example" />
</content>
</section>
<section>
<section address="SelectTokenJSONPath">
<title>SelectToken with JSONPath</title>
<content>
<para>SelectToken supports JSONPath queries. Find out more about JSONPath <externalLink>
@@ -34,7 +35,7 @@
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\Samples\Linq\QueryJsonSelectTokenJsonPath.cs" region="Usage" title="SelectToken With JSONPath" />
</content>
</section>
<section>
<section address="SelectTokenLINQ">
<title>SelectToken with LINQ</title>
<content>
<!-- Uncomment this to create a sub-section outline
+10 -7
View File
@@ -40,8 +40,11 @@
<section>
<title>Json.NET Serialization Attributes</title>
<content>
<autoOutline />
</content>
<sections>
<section>
<section address="JsonObjectAttribute">
<title>JsonObjectAttribute</title>
<content>
<para>The MemberSerialization flag on this attribute specifies whether member serialization is opt-in
@@ -59,7 +62,7 @@
</content>
</section>
<section>
<section address="JsonArrayAttributeJsonDictionaryAttribute">
<title>JsonArrayAttribute/JsonDictionaryAttribute</title>
<content>
<para>The <codeEntityReference>T:Newtonsoft.Json.JsonArrayAttribute</codeEntityReference> and
@@ -69,7 +72,7 @@
</content>
</section>
<section>
<section address="JsonPropertyAttribute">
<title>JsonPropertyAttribute</title>
<content>
<para>JsonPropertyAttribute has a number of uses:</para>
@@ -88,7 +91,7 @@
</content>
</section>
<section>
<section address="JsonIgnoreAttribute">
<title>JsonIgnoreAttribute</title>
<content>
<para>Excludes a field or property from serialization.</para>
@@ -96,7 +99,7 @@
</content>
</section>
<section>
<section address="JsonConverterAttribute">
<title>JsonConverterAttribute</title>
<content>
<para>The <codeEntityReference>T:Newtonsoft.Json.JsonConverterAttribute</codeEntityReference> specifies which
@@ -118,7 +121,7 @@
</content>
</section>
<section>
<section address="JsonExtensionDataAttribute">
<title>JsonExtensionDataAttribute</title>
<content>
<para>The <codeEntityReference>T:Newtonsoft.Json.JsonExtensionDataAttribute</codeEntityReference> instructs the
@@ -134,7 +137,7 @@
</content>
</section>
<section>
<section address="JsonConstructorAttribute">
<title>JsonConstructorAttribute</title>
<content>
<para>The <codeEntityReference>T:Newtonsoft.Json.JsonConstructorAttribute</codeEntityReference> instructs the
+3 -2
View File
@@ -18,11 +18,12 @@
let the error bubble up and be thrown in your application.</para>
<para>Error handling is defined through two methods: the <codeEntityReference>E:Newtonsoft.Json.JsonSerializer.Error</codeEntityReference> event on
JsonSerializer and the <codeEntityReference>T:Newtonsoft.Json.Serialization.OnErrorAttribute</codeEntityReference>.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<!-- Add one or more top-level section elements. These are collapsible.
If using <autoOutline />, add an address attribute to identify it
and specify a title so that it can be jumped to with a hyperlink. -->
<section>
<section address="ErrorEvent">
<title>Error Event</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -67,7 +68,7 @@
</content>
</section>
<section>
<section address="OnErrorAttribute">
<title>OnErrorAttribute</title>
<content>
<!-- Uncomment this to create a sub-section outline
+5 -4
View File
@@ -8,11 +8,12 @@
-->
<introduction>
<para>The Json.NET serializer can serialize a wide variety of .NET objects. This guide looks at how it works, first at a high level and then in more detail.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<!-- Add one or more top-level section elements. These are collapsible.
If using <autoOutline />, add an address attribute to identify it
and specify a title so that it can be jumped to with a hyperlink. -->
<section>
<section address="Summary">
<title>Summary</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -24,7 +25,7 @@
a collection, then an error will be thrown, and vice-versa.</para>
</content>
</section>
<section>
<section address="ComplexTypes">
<title>Complex Types</title>
<content>
<table>
@@ -49,7 +50,7 @@
</table>
</content>
</section>
<section>
<section address="PrimitiveTypes">
<title>Primitive Types</title>
<content>
<table>
@@ -122,7 +123,7 @@
</content>
</section>
<section>
<section address="Breakdown">
<title>Breakdown of Type Serialization</title>
<content>
<autoOutline />
+15 -16
View File
@@ -9,9 +9,9 @@
<introduction>
<para>JsonSerializer has a number of properties on it to customize how it serializes JSON. These can also be used
with the methods on JsonConvert via the <codeEntityReference>T:Newtonsoft.Json.JsonSerializerSettings</codeEntityReference> overloads.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<sections>
<section>
<section address="DateFormatHandling">
<title>DateFormatHandling</title>
<content><para><codeEntityReference>T:Newtonsoft.Json.DateFormatHandling</codeEntityReference> controls how dates are serialized.</para>
@@ -35,7 +35,7 @@
</content>
</section>
<section>
<section address="MissingMemberHandling">
<title>MissingMemberHandling</title>
<content><para><codeEntityReference>T:Newtonsoft.Json.MissingMemberHandling</codeEntityReference> controls how missing members, e.g. JSON contains a property that isn't a member on the object, are handled during deserialization.</para>
@@ -59,7 +59,7 @@
</content>
</section>
<section>
<section address="ReferenceLoopHandling">
<title>ReferenceLoopHandling</title>
<content>
<para><codeEntityReference>T:Newtonsoft.Json.ReferenceLoopHandling</codeEntityReference> controls how circular referencing objects,
@@ -95,7 +95,7 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="NullValueHandling">
<title>NullValueHandling</title>
<content><para><codeEntityReference>T:Newtonsoft.Json.NullValueHandling</codeEntityReference> controls how null values on .NET objects are handled during serialization and how null values in JSON are handled during deserialization.</para>
@@ -120,7 +120,7 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="DefaultValueHandling">
<title>DefaultValueHandling</title>
<content><para><codeEntityReference>T:Newtonsoft.Json.DefaultValueHandling</codeEntityReference> controls how Json.NET uses default values set using the .NET <codeEntityReference>T:System.ComponentModel.DefaultValueAttribute</codeEntityReference> when serializing and deserializing.</para>
@@ -148,7 +148,7 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="ObjectCreationHandling">
<title>ObjectCreationHandling</title>
<content><para><codeEntityReference>T:Newtonsoft.Json.ObjectCreationHandling</codeEntityReference> controls how objects are created and deserialized to during deserialization.</para>
@@ -177,7 +177,7 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="TypeNameHandling">
<title>TypeNameHandling</title>
<content>
<alert class="caution">
@@ -235,7 +235,7 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="TypeNameAssemblyFormat">
<title>TypeNameAssemblyFormat</title>
<content><para><codeEntityReference>T:System.Runtime.Serialization.Formatters.FormatterAssemblyStyle</codeEntityReference> controls how type names are written during serialization.</para>
@@ -260,14 +260,14 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="Binder">
<title>Binder</title>
<content><para>The <codeEntityReference>T:System.Runtime.Serialization.SerializationBinder</codeEntityReference> is used to resolve type names to a .NET type.</para>
<para>Read more about the serialization binder here: <codeEntityReference>T:System.Runtime.Serialization.SerializationBinder</codeEntityReference></para>
</content>
</section>
<section>
<section address="ConstructorHandling">
<title>ConstructorHandling</title>
<content><para><codeEntityReference>T:Newtonsoft.Json.ConstructorHandling</codeEntityReference> controls how constructors are used when initializing objects during deserialization.</para>
@@ -294,7 +294,7 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="Converters">
<title>Converters</title>
<content><para>This is the collection of JsonConverters that will be used during serialization and deserialization.</para>
<para>A <codeEntityReference>T:Newtonsoft.Json.JsonConverter</codeEntityReference> allows JSON to be manually written during serialization and read during deserialization.
@@ -322,7 +322,7 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="ContractResolver">
<title>ContractResolver</title>
<content><para>Internally for every .NET type the JsonSerializer will create a contract of how the type should be serialized and deserialized,
based on type metadata and attributes applied to the class. Specifying a custom <codeEntityReference>T:Newtonsoft.Json.Serialization.IContractResolver</codeEntityReference>
@@ -331,7 +331,7 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="TraceWriter">
<title>TraceWriter</title>
<content><para>The Json.NET serializer supports logging and debugging using the
<codeEntityReference>T:Newtonsoft.Json.Serialization.ITraceWriter</codeEntityReference> interface.
@@ -340,14 +340,13 @@ or a property's object properties or collection items using
</content>
</section>
<section>
<section address="Error">
<title>Error</title>
<content><para>The <codeEntityReference>E:Newtonsoft.Json.JsonSerializer.Error</codeEntityReference> event can catch errors during serialization and either handle the event and continue with
serialization or let the error bubble up and be thrown to the application.</para>
<para>Read more about error handling here: <link xlink:href="SerializationErrorHandling" /></para>
</content>
</section>
</sections>
<relatedTopics>
<link xlink:href="SerializationGuide" />
<link xlink:href="SerializationAttributes" />
+3 -2
View File
@@ -6,8 +6,9 @@
<codeEntityReference>T:Newtonsoft.Json.Serialization.ITraceWriter</codeEntityReference> interface.
By assigning a trace writer you can capture serialization messages and errors and debug what happens inside the
Json.NET serializer when serializing and deserializing JSON.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<section>
<section address="ITraceWriter">
<title>ITraceWriter</title>
<content>
<para>A trace writer can be assigned using properties on JsonSerializerSettings or JsonSerializer.</para>
@@ -20,7 +21,7 @@
System.Diagnostics.TraceListeners your application is using.</para>
</content>
</section>
<section>
<section address="CustomITraceWriter">
<title>Custom ITraceWriter</title>
<content>
<para>To write messages using your existing logging framework, just implement a custom version of ITraceWriter.</para>
+4 -3
View File
@@ -14,11 +14,12 @@
<!-- <autoOutline /> -->
<para>Json.NET has excellent support for serializing and deserializing
collections of objects.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<!-- Add one or more top-level section elements. These are collapsible.
If using <autoOutline />, add an address attribute to identify it
and specify a title so that it can be jumped to with a hyperlink. -->
<section>
<section address="SerializingCollections">
<title>Serializing Collections</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -31,7 +32,7 @@
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="SerializingCollectionsSerializing" title="Serializing Collections" />
</content>
</section>
<section>
<section address="DeserializingCollections">
<title>Deserializing Collections</title>
<content>
<!-- Uncomment this to create a sub-section outline
@@ -42,7 +43,7 @@
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="SerializingCollectionsDeserializing" title="Deserializing Collections" />
</content>
</section>
<section>
<section address="DeserializingDictionaries">
<title>Deserializing Dictionaries</title>
<content>
<!-- Uncomment this to create a sub-section outline
+3 -2
View File
@@ -11,10 +11,11 @@
<codeEntityReference>T:Newtonsoft.Json.JsonSerializer</codeEntityReference>.
The JsonSerializer converts .NET objects into their JSON equivalent and back again by mapping the .NET object property names to the JSON property names
and copies the values for you.</para>
<autoOutline lead="none" excludeRelatedTopics="true" />
</introduction>
<!-- Optional procedures followed by optional code example but must have
at least one procedure or code example -->
<section>
<section address="JsonConvert">
<title>JsonConvert</title>
<content><para>For simple scenarios where you want to convert to and from a JSON string, the
<codeEntityReference>Overload:Newtonsoft.Json.JsonConvert.SerializeObject</codeEntityReference> and
@@ -28,7 +29,7 @@
</content>
</section>
<section>
<section address="JsonSerializer">
<title>JsonSerializer</title>
<content><para>For more control over how an object is serialized, the <codeEntityReference>T:Newtonsoft.Json.JsonSerializer</codeEntityReference> can be used directly.
The JsonSerializer is able to read and write JSON text directly to a stream via <codeEntityReference>T:Newtonsoft.Json.JsonTextReader</codeEntityReference>
-1
View File
@@ -28,7 +28,6 @@
<Topic id="ReadingWritingJSON" visible="True" title="Basic Reading and Writing JSON" />
<Topic id="ConvertingJSONandXML" visible="True" title="Converting between JSON and XML" />
<Topic id="JsonNetVsDotNetSerializers" visible="True" title="Json.NET vs .NET Serializers" />
<Topic id="JsonNetVsWindowsDataJson" visible="True" title="Json.NET vs Windows.Data.Json" />
<Topic id="Samples" visible="True" isExpanded="true" title="Samples">
<Topic id="d6e185d5-c992-44fc-8d8f-d9acc2bbec2f" visible="True" noFile="true" isExpanded="true" title="Serializing JSON">
<Topic id="SerializeObject" visible="True" title="Serialize an Object" />
-4
View File
@@ -264,10 +264,6 @@
<ImageId>cross</ImageId>
<AlternateText>cross</AlternateText>
</Content>
<Image Include="jsonnetwindowsdatajson.png">
<ImageId>jsonnetwindowsdatajson</ImageId>
<AlternateText>jsonnetwindowsdatajson</AlternateText>
</Image>
<Image Include="performance.png">
<ImageId>performance</ImageId>
<AlternateText>performance</AlternateText>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

@@ -1013,7 +1013,8 @@ namespace Newtonsoft.Json.Tests.Documentation
IList<SearchResult> searchResults = new List<SearchResult>();
foreach (JToken result in results)
{
SearchResult searchResult = JsonConvert.DeserializeObject<SearchResult>(result.ToString());
// JToken.ToObject is a helper method that uses JsonSerializer internally
SearchResult searchResult = result.ToObject<SearchResult>();
searchResults.Add(searchResult);
}