-Documentation

This commit is contained in:
James Newton-King
2013-01-29 21:02:28 +13:00
parent 1c0e2856c2
commit f98c6a0d8d
22 changed files with 57 additions and 40 deletions
+16 -4
View File
@@ -31,7 +31,7 @@
<para>Convert JSON to and from XML</para>
</listItem>
<listItem>
<para>Supports .NET 2, .NET 3.5, .NET 4, .NET 4.5, Silverlight, Windows Phone and Windows 8 RT</para>
<para>Supports .NET 2, .NET 3.5, .NET 4, .NET 4.5, Silverlight, Windows Phone and Windows 8 Store</para>
</listItem>
</list>
@@ -57,6 +57,11 @@ and write from your objects.</para>
<linkText>LINQ to JSON</linkText>
<linkUri>LINQtoJSON.htm</linkUri>
<linkTarget>_self</linkTarget>
</externalLink></para></listItem>
<listItem><para><externalLink>
<linkText>Samples</linkText>
<linkUri>Samples.htm</linkUri>
<linkTarget>_self</linkTarget>
</externalLink></para></listItem>
</list>
@@ -85,7 +90,7 @@ and write from your objects.</para>
<linkTarget>_blank</linkTarget>
</externalLink>,
a JSON based documentat database; <externalLink>
<linkText>SignalR</linkText>
<linkText>ASP.NET SignalR</linkText>
<linkUri>http://signalr.net/</linkUri>
<linkTarget>_blank</linkTarget>
</externalLink>,
@@ -105,14 +110,16 @@ and write from your objects.</para>
<section>
<title>Donate</title>
<content><para>Json.NET is a personal open source project. Started in 2006, I have put hundreds of hours adding, refining and tuning Json.NET with the goal to make it not just the best JSON serializer for .NET but the best serializer for any computer language. I need your
help to achieve this.</para></content>
</section>
help to achieve this.</para>
<markup>
<p>
<a href="http://www.pledgie.com/campaigns/18941" target="_blank"><img src="http://www.pledgie.com/campaigns/18941.png?skin_name=chrome" alt="Click here to lend your support to: Json.NET and make a donation at www.pledgie.com !" border="0" /></a>
</p>
</markup>
</content>
</section>
<relatedTopics>
<externalLink>
<linkText>Serializing and Deserializing JSON</linkText>
@@ -124,6 +131,11 @@ and write from your objects.</para>
<linkUri>LINQtoJSON.htm</linkUri>
<linkTarget>_self</linkTarget>
</externalLink>
<externalLink>
<linkText>Samples</linkText>
<linkUri>Samples.htm</linkUri>
<linkTarget>_self</linkTarget>
</externalLink>
</relatedTopics>
</developerConceptualDocument>
@@ -3,7 +3,7 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>This sample sets <codeEntityReference>P:Newtonsoft.Json.Bson.BsonReader.ReadRootValueAsArray</codeEntityReference>
to <code>true</code> so the root BSON value is correctly read
to <codeInline>true</codeInline> so the root BSON value is correctly read
as an array instead of an object and deserializes BSON to a collection.</para>
</introduction>
<section>
+1 -1
View File
@@ -3,7 +3,7 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>This sample converts .NET values to LINQ to JSON using
<codeEntityReference>M:Newtonsoft.Json.Linq.JToken.FromObject(System.Object)</codeEntityReference>.</para>
<codeEntityReference qualifyHint="true">M:Newtonsoft.Json.Linq.JToken.FromObject(System.Object)</codeEntityReference>.</para>
</introduction>
<section>
<title>Sample</title>
+1 -1
View File
@@ -3,7 +3,7 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>This sample parses JSON using
<codeEntityReference>M:Newtonsoft.Json.Linq.JToken.Parse(System.String)</codeEntityReference>.</para>
<codeEntityReference qualifyHint="true">M:Newtonsoft.Json.Linq.JToken.Parse(System.String)</codeEntityReference>.</para>
</introduction>
<section>
<title>Sample</title>
+1 -1
View File
@@ -3,7 +3,7 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>This sample parses a JSON array using
<codeEntityReference>M:Newtonsoft.Json.Linq.JArray.Parse(System.String)</codeEntityReference>.</para>
<codeEntityReference qualifyHint="true">M:Newtonsoft.Json.Linq.JArray.Parse(System.String)</codeEntityReference>.</para>
</introduction>
<section>
<title>Sample</title>
+1 -1
View File
@@ -3,7 +3,7 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>This sample parses a JSON object using
<codeEntityReference>M:Newtonsoft.Json.Linq.JObject.Parse(System.String)</codeEntityReference>.</para>
<codeEntityReference qualifyHint="true">M:Newtonsoft.Json.Linq.JObject.Parse(System.String)</codeEntityReference>.</para>
</introduction>
<section>
<title>Sample</title>
@@ -3,7 +3,7 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>This sample creates a new <codeEntityReference>T:Newtonsoft.Json.Schema.JsonSchema</codeEntityReference>
instance manually in code instead of loading an existing schema from JSON.</para>
instance manually in code.</para>
</introduction>
<section>
<title>Sample</title>
+1 -1
View File
@@ -2,7 +2,7 @@
<topic id="JsonSchemaParse" revisionNumber="1">
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>This sample parses a <codeEntityReference>T:Newtonsoft.Json.Schema.JsonSchema</codeEntityReference>.
<para>This sample parses a <codeEntityReference>T:Newtonsoft.Json.Schema.JsonSchema</codeEntityReference>
from JSON</para>
</introduction>
<section>
@@ -11,8 +11,8 @@
<section>
<title>Sample</title>
<content>
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\Samples\Serializer\CustomContractResolver.cs" region="Types" title="Types" />
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\Samples\Serializer\CustomContractResolver.cs" region="Usage" title="Usage" />
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\Samples\Serializer\DataContractAndDataMember.cs" region="Types" title="Types" />
<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\Samples\Serializer\DataContractAndDataMember.cs" region="Usage" title="Usage" />
</content>
</section>
</developerConceptualDocument>
@@ -3,7 +3,7 @@
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>This sample uses <codeEntityReference>T:Newtonsoft.Json.JsonObjectAttribute</codeEntityReference>
to serialize a class that implements <codeEntityReference>I:System.Collections.IEnumerable`1</codeEntityReference> as
to serialize a class that implements <codeEntityReference>T:System.Collections.Generic.IEnumerable`1</codeEntityReference> as
a JSON object instead of a JSON array.</para>
</introduction>
<section>
+1 -1
View File
@@ -235,7 +235,7 @@
<codeEntityReference>T:System.Dynamic.ExpandoObject</codeEntityReference>
is a good example of a dynamic object.</para>
<para>Dynamic objects are serialized as JSON objects. A property is written for every member name returned by
<codeEntityReference>M:System.Dynamic.DynamicMetaObject.GetDynamicMemberNames</codeEntityReference>.</para>
<codeEntityReference qualifyHint="true">M:System.Dynamic.DynamicMetaObject.GetDynamicMemberNames</codeEntityReference>.</para>
<para>When deserializing dynamic objects the serializer first attempts to set JSON property values on a normal .NET
member with the matching name. If no .NET member is found with the property name then the serializer will call
SetMember on the dynamic object. Because there is no type information for dynamic members on a dynamic object the
+2 -2
View File
@@ -83,17 +83,17 @@
</Topic>
<Topic id="68b9fad2-5436-4e35-a734-9b9d751cc3e5" visible="True" noFile="true" isExpanded="true" title="LINQ to JSON">
<Topic id="CreateJsonManually" visible="True" title="Create JSON manually" />
<Topic id="CreateJsonAnonymousObject" visible="True" isSelected="true" title="Create JSON from an Anonymous Type" />
<Topic id="CreateJsonCollectionInitializer" visible="True" title="Create JSON using Collection Initializers" />
<Topic id="CreateJsonDeclaratively" visible="True" title="Create JSON declaratively with LINQ" />
<Topic id="CreateJsonDynamic" visible="True" title="Create JSON with dynamic" />
<Topic id="CreateJsonJTokenWriter" visible="True" title="Create JSON with JTokenWriter" />
<Topic id="FromObject" visible="True" title="Create JSON from an Object" />
<Topic id="CreateJsonAnonymousObject" visible="True" title="Create JSON from an Anonymous Type" />
<Topic id="ParseJsonArray" visible="True" title="Parsing JSON Array using JArray.Parse" />
<Topic id="ParseJsonObject" visible="True" title="Parsing JSON Object using JObject.Parse" />
<Topic id="ParseJsonAny" visible="True" title="Parsing all JSON using JToken.Parse" />
<Topic id="DeserializeWithLinq" visible="True" title="Deserializing from JSON with LINQ" />
<Topic id="SerializeWithLinq" visible="True" title="Serializing to JSON with LINQ" />
<Topic id="SerializeWithLinq" visible="True" isSelected="true" title="Serializing to JSON with LINQ" />
<Topic id="ModifyJson" visible="True" title="Modifying JSON" />
<Topic id="QueryJson" visible="True" title="Querying JSON" />
<Topic id="QueryJsonDynamic" visible="True" title="Querying JSON with dynamic" />
@@ -164,7 +164,7 @@ namespace Newtonsoft.Json.Tests.Documentation
// "item": [
// {
// "title": "Json.NET 1.3 + New license + Now on CodePlex",
// "description": "Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex",
// "description": "Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex",
// "link": "http://james.newtonking.com/projects/json-net.aspx",
// "category": [
// "Json.NET",
@@ -58,7 +58,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
// "item": [
// {
// "title": "Json.NET 1.3 + New license + Now on CodePlex",
// "description": "Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex",
// "description": "Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex",
// "link": "http://james.newtonking.com/projects/json-net.aspx",
// "category": [
// "Json.NET",
@@ -12,11 +12,8 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{
#region Usage
JArray array = new JArray();
JValue text = new JValue("Manual text");
JValue date = new JValue(new DateTime(2000, 5, 23));
array.Add(text);
array.Add(date);
array.Add("Manual text");
array.Add(new DateTime(2000, 5, 23));
JObject o = new JObject();
o["MyArray"] = array;
@@ -12,7 +12,10 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
public void Example()
{
#region Usage
JsonSchema schema = JsonSchema.Parse(@"{'type': 'object'}");
JsonSchema schema = new JsonSchema
{
Type = JsonSchemaType.Object
};
// serialize JsonSchema to a string and then write string to a file
File.WriteAllText(@"c:\schema.json", schema.ToString());
@@ -8,7 +8,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
{
public class DataContractAndDataMember
{
#region Usage
#region Types
[DataContract]
public class File
{
@@ -10,14 +10,19 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
public void Example()
{
#region Usage
string json = @"{'Name':'James'}";
var definition = new {Name = ""};
var customerDefinition = new {Name = ""};
string json1 = @"{'Name':'James'}";
var customer1 = JsonConvert.DeserializeAnonymousType(json1, definition);
var customer = JsonConvert.DeserializeAnonymousType(json, customerDefinition);
Console.WriteLine(customer.Name);
Console.WriteLine(customer1.Name);
// James
string json2 = @"{'Name':'Mike'}";
var customer2 = JsonConvert.DeserializeAnonymousType(json2, definition);
Console.WriteLine(customer2.Name);
// Mike
#endregion
}
}
@@ -396,7 +396,7 @@ keyword such as type of business.""
new Post()
{
Title = "Json.NET 1.3 + New license + Now on CodePlex",
Description = "Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex",
Description = "Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex",
Link = "http://james.newtonking.com/projects/json-net.aspx",
Categories = new List<string>() { "Json.NET", "CodePlex" }
}
@@ -438,7 +438,7 @@ keyword such as type of business.""
// "item": [
// {
// "title": "Json.NET 1.3 + New license + Now on CodePlex",
// "description": "Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex",
// "description": "Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex",
// "link": "http://james.newtonking.com/projects/json-net.aspx",
// "category": [
// "Json.NET",
@@ -497,7 +497,7 @@ keyword such as type of business.""
""item"": [
{
""title"": ""Json.NET 1.3 + New license + Now on CodePlex"",
""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex"",
""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex"",
""link"": ""http://james.newtonking.com/projects/json-net.aspx"",
""category"": [
""Json.NET"",
@@ -744,7 +744,7 @@ keyword such as type of business.""
""item"": [
{
""title"": ""Json.NET 1.3 + New license + Now on CodePlex"",
""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex"",
""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex"",
""link"": ""http://james.newtonking.com/projects/json-net.aspx"",
""category"": [
""Json.NET"",
@@ -769,7 +769,7 @@ keyword such as type of business.""
""item"": [
{
""title"": ""Json.NET 1.3 + New license + Now on CodePlex"",
""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex"",
""description"": ""Annoucing the release of Json.NET 1.3, the MIT license and being available on CodePlex"",
""link"": ""http://james.newtonking.com/projects/json-net.aspx"",
""category"": [
""Json.NET"",
@@ -76,5 +76,5 @@ using System.Security;
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")]
#if !PocketPC
[assembly: AssemblyFileVersion("4.5.11.15728")]
[assembly: AssemblyFileVersion("4.5.11.15729")]
#endif
+2 -2
View File
@@ -382,7 +382,7 @@ namespace Newtonsoft.Json.Linq
/// Gets the <see cref="Newtonsoft.Json.Linq.JToken"/> with the specified property name.
/// </summary>
/// <param name="propertyName">Name of the property.</param>
/// <value>The <see cref="Newtonsoft.Json.Linq.JToken"/> with the specified property name.</value>
/// <returns>The <see cref="Newtonsoft.Json.Linq.JToken"/> with the specified property name.</returns>
public JToken GetValue(string propertyName)
{
return GetValue(propertyName, StringComparison.Ordinal);
@@ -395,7 +395,7 @@ namespace Newtonsoft.Json.Linq
/// </summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="comparison">One of the enumeration values that specifies how the strings will be compared.</param>
/// <value>The <see cref="Newtonsoft.Json.Linq.JToken"/> with the specified property name.</value>
/// <returns>The <see cref="Newtonsoft.Json.Linq.JToken"/> with the specified property name.</returns>
public JToken GetValue(string propertyName, StringComparison comparison)
{
if (propertyName == null)
@@ -90,7 +90,7 @@ using System.Security;
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")]
#if !PocketPC
[assembly: AssemblyFileVersion("4.5.11.15728")]
[assembly: AssemblyFileVersion("4.5.11.15729")]
#endif
[assembly: CLSCompliant(true)]