diff --git a/Doc/Examples/Bson/DeserializeFromBson.aml b/Doc/Examples/Bson/DeserializeFromBson.aml
new file mode 100644
index 00000000..de7d87be
--- /dev/null
+++ b/Doc/Examples/Bson/DeserializeFromBson.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example deserializes BSON to an object.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Bson/DeserializeFromBsonCollection.aml b/Doc/Examples/Bson/DeserializeFromBsonCollection.aml
new file mode 100644
index 00000000..85da2763
--- /dev/null
+++ b/Doc/Examples/Bson/DeserializeFromBsonCollection.aml
@@ -0,0 +1,17 @@
+
+
+
+
+ This example sets P:Newtonsoft.Json.Bson.BsonReader.ReadRootValueAsArray
+ to true so the root BSON value is correctly read
+ as an array instead of an object and deserializes BSON to a collection.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Bson/SerializeToBson.aml b/Doc/Examples/Bson/SerializeToBson.aml
new file mode 100644
index 00000000..224fbe6d
--- /dev/null
+++ b/Doc/Examples/Bson/SerializeToBson.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example serializes an object to BSON.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Examples.aml b/Doc/Examples/Examples.aml
index 8d8c5375..1b97cdd2 100644
--- a/Doc/Examples/Examples.aml
+++ b/Doc/Examples/Examples.aml
@@ -2,40 +2,34 @@
- Json.NET has the ability to conditionally serialize properties by placing a ShouldSerialize method on a class.
- This funtionality is similar to the
-XmlSerializer ShouldSerialize feature
-http://msdn.microsoft.com/en-us/library/53b8022e.aspx
-_blank
-.
+ These are examples of Json.NET being used with JSON and .NET.
- ShouldSerialize
+ Examples
- To conditionally serialize a property add a boolean method with the same name as the property and then prefixed the method name
- with ShouldSerialize. The result of the method determines whether the property is serialized. If the method returns true then the
- property will be serialized, if it returns false and the property will be skipped.
-
-
-
+
+
+ Serializing JSON - Serializing and deserializing JSON, serializer settings and serialization attributes
+
+
+ LINQ to JSON - Parsing, querying, modifying and writing JSON
+
+
+ JSON Schema - Parsing schemas and validating JSON
+
+
+ Converting XML - Converting JSON to XML and XML to JSON
+
+
+ BSON - Serializing and deserializing BSON
+
+
+ Reading and Writing JSON - Reading JSON with JsonTextReader, writing JSON with JsonTextWriter
+
+
+
-
- IContractResolver
-
- ShouldSerialize can also be set using an T:Newtonsoft.Json.Serialization.IContractResolver.
- Conditionally serializing a property using an IContractResolver is useful if you don't want to place a ShouldSerialize method on a class
- or you didn't declare the class and are unable to.
-
-
-
-
-
-
- T:Newtonsoft.Json.JsonSerializer
- T:Newtonsoft.Json.Serialization.IContractResolver
- P:Newtonsoft.Json.Serialization.JsonProperty.ShouldSerialize
-
\ No newline at end of file
diff --git a/Doc/Examples/Json/ReadJsonWithJsonTextReader.aml b/Doc/Examples/Json/ReadJsonWithJsonTextReader.aml
new file mode 100644
index 00000000..d4de0738
--- /dev/null
+++ b/Doc/Examples/Json/ReadJsonWithJsonTextReader.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example reads JSON using the T:Newtonsoft.Json.JsonTextReader.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Json/WriteJsonWithJsonTextWriter.aml b/Doc/Examples/Json/WriteJsonWithJsonTextWriter.aml
new file mode 100644
index 00000000..755e3e36
--- /dev/null
+++ b/Doc/Examples/Json/WriteJsonWithJsonTextWriter.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example writes JSON using the T:Newtonsoft.Json.JsonTextWriter.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/Clone.aml b/Doc/Examples/Linq/Clone.aml
new file mode 100644
index 00000000..d4fe82a0
--- /dev/null
+++ b/Doc/Examples/Linq/Clone.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example clones LINQ to JSON objects and all the cloned object's child values.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/CreateJsonAnonymousObject.aml b/Doc/Examples/Linq/CreateJsonAnonymousObject.aml
new file mode 100644
index 00000000..b33c2518
--- /dev/null
+++ b/Doc/Examples/Linq/CreateJsonAnonymousObject.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example creates a T:Newtonsoft.Json.Linq.JObject
+ from an anonymous type.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/CreateJsonCollectionInitializer.aml b/Doc/Examples/Linq/CreateJsonCollectionInitializer.aml
new file mode 100644
index 00000000..0bfb5a85
--- /dev/null
+++ b/Doc/Examples/Linq/CreateJsonCollectionInitializer.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example creates T:Newtonsoft.Json.Linq.JObject
+ and T:Newtonsoft.Json.Linq.JArray instances using
+ the C# collection initializer syntax.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/CreateJsonDeclaratively.aml b/Doc/Examples/Linq/CreateJsonDeclaratively.aml
new file mode 100644
index 00000000..0dd3889b
--- /dev/null
+++ b/Doc/Examples/Linq/CreateJsonDeclaratively.aml
@@ -0,0 +1,17 @@
+
+
+
+
+ This example creates T:Newtonsoft.Json.Linq.JObject
+ and T:Newtonsoft.Json.Linq.JArray instances declaratively
+ using LINQ.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/CreateJsonDynamic.aml b/Doc/Examples/Linq/CreateJsonDynamic.aml
new file mode 100644
index 00000000..d73a6446
--- /dev/null
+++ b/Doc/Examples/Linq/CreateJsonDynamic.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example creates T:Newtonsoft.Json.Linq.JObject
+ and T:Newtonsoft.Json.Linq.JArray instances using
+ the C# dynamic functionality.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/CreateJsonJTokenWriter.aml b/Doc/Examples/Linq/CreateJsonJTokenWriter.aml
new file mode 100644
index 00000000..9bf6a14e
--- /dev/null
+++ b/Doc/Examples/Linq/CreateJsonJTokenWriter.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example creates T:Newtonsoft.Json.Linq.JObject
+ and T:Newtonsoft.Json.Linq.JArray instances using
+ a T:Newtonsoft.Json.Linq.JTokenWriter.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/CreateJsonManually.aml b/Doc/Examples/Linq/CreateJsonManually.aml
new file mode 100644
index 00000000..3d292f23
--- /dev/null
+++ b/Doc/Examples/Linq/CreateJsonManually.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example creates T:Newtonsoft.Json.Linq.JObject
+ and T:Newtonsoft.Json.Linq.JArray instances one at a time
+ programatically.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/CreateReader.aml b/Doc/Examples/Linq/CreateReader.aml
new file mode 100644
index 00000000..20721b96
--- /dev/null
+++ b/Doc/Examples/Linq/CreateReader.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example creates a T:Newtonsoft.Json.Linq.JTokenReader
+ from a T:Newtonsoft.Json.Linq.JToken.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/CreateWriter.aml b/Doc/Examples/Linq/CreateWriter.aml
new file mode 100644
index 00000000..ea800ae2
--- /dev/null
+++ b/Doc/Examples/Linq/CreateWriter.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example creates a T:Newtonsoft.Json.Linq.JTokenWriter
+ from a T:Newtonsoft.Json.Linq.JToken.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/DeepEquals.aml b/Doc/Examples/Linq/DeepEquals.aml
new file mode 100644
index 00000000..c80b99be
--- /dev/null
+++ b/Doc/Examples/Linq/DeepEquals.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example compares T:Newtonsoft.Json.Linq.JToken
+ instances using M:Newtonsoft.Json.Linq.JToken.DeepEquals,
+ comparing the token and all child tokens.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/DeserializeWithLinq.aml b/Doc/Examples/Linq/DeserializeWithLinq.aml
new file mode 100644
index 00000000..b201e94a
--- /dev/null
+++ b/Doc/Examples/Linq/DeserializeWithLinq.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example uses LINQ to JSON to manually convert JSON to a .NET type.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/FromObject.aml b/Doc/Examples/Linq/FromObject.aml
new file mode 100644
index 00000000..5dfaf9a1
--- /dev/null
+++ b/Doc/Examples/Linq/FromObject.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example converts .NET values to LINQ to JSON using
+ M:Newtonsoft.Json.Linq.JToken.FromObject(System.Object).
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/JObjectProperties.aml b/Doc/Examples/Linq/JObjectProperties.aml
new file mode 100644
index 00000000..c20578e7
--- /dev/null
+++ b/Doc/Examples/Linq/JObjectProperties.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example gets an object's T:Newtonsoft.Json.Linq.JProperty
+ collection using M:Newtonsoft.Json.Linq.JObject.Properties.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/JValueCast.aml b/Doc/Examples/Linq/JValueCast.aml
new file mode 100644
index 00000000..9b4a27e6
--- /dev/null
+++ b/Doc/Examples/Linq/JValueCast.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example casts T:Newtonsoft.Json.Linq.JValue
+ instances to .NET values.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/JValueValue.aml b/Doc/Examples/Linq/JValueValue.aml
new file mode 100644
index 00000000..40603730
--- /dev/null
+++ b/Doc/Examples/Linq/JValueValue.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example gets T:Newtonsoft.Json.Linq.JValue
+ internal values using P:Newtonsoft.Json.Linq.JValue.Value.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ModifyJson.aml b/Doc/Examples/Linq/ModifyJson.aml
new file mode 100644
index 00000000..19ce7c21
--- /dev/null
+++ b/Doc/Examples/Linq/ModifyJson.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example loads JSON, modifies T:Newtonsoft.Json.Linq.JObject
+ and T:Newtonsoft.Json.Linq.JArray
+ instances and then writes the JSON back out again.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ParseJsonAny.aml b/Doc/Examples/Linq/ParseJsonAny.aml
new file mode 100644
index 00000000..548d386b
--- /dev/null
+++ b/Doc/Examples/Linq/ParseJsonAny.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example parses JSON using
+ M:Newtonsoft.Json.Linq.JToken.Parse.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ParseJsonArray.aml b/Doc/Examples/Linq/ParseJsonArray.aml
new file mode 100644
index 00000000..57dcc72f
--- /dev/null
+++ b/Doc/Examples/Linq/ParseJsonArray.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example parses a JSON array using
+ M:Newtonsoft.Json.Linq.JArray.Parse.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ParseJsonObject.aml b/Doc/Examples/Linq/ParseJsonObject.aml
new file mode 100644
index 00000000..64fc6b12
--- /dev/null
+++ b/Doc/Examples/Linq/ParseJsonObject.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example parses a JSON object using
+ M:Newtonsoft.Json.Linq.JObject.Parse.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/QueryJson.aml b/Doc/Examples/Linq/QueryJson.aml
new file mode 100644
index 00000000..1e015fc3
--- /dev/null
+++ b/Doc/Examples/Linq/QueryJson.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example loads JSON and then queries values from it using
+ T:Newtonsoft.Json.Linq.JToken.Items(System.Object) indexer
+ and then casts the returned tokens to .NET values.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/QueryJsonDynamic.aml b/Doc/Examples/Linq/QueryJsonDynamic.aml
new file mode 100644
index 00000000..8a9594ef
--- /dev/null
+++ b/Doc/Examples/Linq/QueryJsonDynamic.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example loads JSON and then queries values from it using
+ C# dynamic functionality.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/QueryJsonLinq.aml b/Doc/Examples/Linq/QueryJsonLinq.aml
new file mode 100644
index 00000000..f7251c37
--- /dev/null
+++ b/Doc/Examples/Linq/QueryJsonLinq.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example loads JSON and then queries values from it using LINQ operators.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/QueryJsonSelectToken.aml b/Doc/Examples/Linq/QueryJsonSelectToken.aml
new file mode 100644
index 00000000..3b7f9dd3
--- /dev/null
+++ b/Doc/Examples/Linq/QueryJsonSelectToken.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example loads JSON and then queries values from it using T:Newtonsoft.Json.Linq.JToken.SelectToken(System.String).
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/QueryJsonSelectTokenWithLinq.aml b/Doc/Examples/Linq/QueryJsonSelectTokenWithLinq.aml
new file mode 100644
index 00000000..57457175
--- /dev/null
+++ b/Doc/Examples/Linq/QueryJsonSelectTokenWithLinq.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example loads JSON and then queries values from it using a combination of T:Newtonsoft.Json.Linq.JToken.SelectToken(System.String)
+ and LINQ operators.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ReadJTokenFromBson.aml b/Doc/Examples/Linq/ReadJTokenFromBson.aml
new file mode 100644
index 00000000..cd9659cc
--- /dev/null
+++ b/Doc/Examples/Linq/ReadJTokenFromBson.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example reads a T:Newtonsoft.Json.Linq.JObject
+ from BSON using T:Newtonsoft.Json.Bson.BsonReader.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ReadJson.aml b/Doc/Examples/Linq/ReadJson.aml
new file mode 100644
index 00000000..6b418dc9
--- /dev/null
+++ b/Doc/Examples/Linq/ReadJson.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example reads JSON from a file into a T:Newtonsoft.Json.Linq.JObject.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/SerializeWithLinq.aml b/Doc/Examples/Linq/SerializeWithLinq.aml
new file mode 100644
index 00000000..ba3fb55f
--- /dev/null
+++ b/Doc/Examples/Linq/SerializeWithLinq.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example uses LINQ to JSON to manually convert a .NET type to JSON.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ToObjectComplex.aml b/Doc/Examples/Linq/ToObjectComplex.aml
new file mode 100644
index 00000000..d1aa6531
--- /dev/null
+++ b/Doc/Examples/Linq/ToObjectComplex.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example converts LINQ to JSON objects to .NET types using
+ T:Newtonsoft.Json.Linq.JToken.ToObject`1.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ToObjectGeneric.aml b/Doc/Examples/Linq/ToObjectGeneric.aml
new file mode 100644
index 00000000..f945dc1c
--- /dev/null
+++ b/Doc/Examples/Linq/ToObjectGeneric.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example converts LINQ to JSON objects to .NET types using
+ T:Newtonsoft.Json.Linq.JToken.ToObject`1.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ToObjectType.aml b/Doc/Examples/Linq/ToObjectType.aml
new file mode 100644
index 00000000..6515a1bb
--- /dev/null
+++ b/Doc/Examples/Linq/ToObjectType.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example converts LINQ to JSON objects to .NET types using
+ M:Newtonsoft.Json.Linq.JToken.ToObject(System.Type).
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ToString.aml b/Doc/Examples/Linq/ToString.aml
new file mode 100644
index 00000000..d7ec447f
--- /dev/null
+++ b/Doc/Examples/Linq/ToString.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example converts LINQ to JSON objects to JSON.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/ToStringJsonConverter.aml b/Doc/Examples/Linq/ToStringJsonConverter.aml
new file mode 100644
index 00000000..5dcdf64c
--- /dev/null
+++ b/Doc/Examples/Linq/ToStringJsonConverter.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example uses a T:Newtonsoft.Json.JsonConverter
+ to customize converting LINQ to JSON objects to JSON.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/WriteJTokenToBson.aml b/Doc/Examples/Linq/WriteJTokenToBson.aml
new file mode 100644
index 00000000..8449dbd9
--- /dev/null
+++ b/Doc/Examples/Linq/WriteJTokenToBson.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example writes a T:Newtonsoft.Json.Linq.JObject
+ to BSON using T:Newtonsoft.Json.Bson.BsonWriter.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Linq/WriteToJsonFile.aml b/Doc/Examples/Linq/WriteToJsonFile.aml
new file mode 100644
index 00000000..de70c73b
--- /dev/null
+++ b/Doc/Examples/Linq/WriteToJsonFile.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example writes LINQ to JSON objects to a file.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Schema/CreateJsonSchemaManually.aml b/Doc/Examples/Schema/CreateJsonSchemaManually.aml
new file mode 100644
index 00000000..dcef71b0
--- /dev/null
+++ b/Doc/Examples/Schema/CreateJsonSchemaManually.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example creates a T:Newtonsoft.Json.Schema.JsonSchema
+ instance programmatically instead of loading a schema from JSON.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Schema/JTokenIsValid.aml b/Doc/Examples/Schema/JTokenIsValid.aml
new file mode 100644
index 00000000..878ed695
--- /dev/null
+++ b/Doc/Examples/Schema/JTokenIsValid.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example validates a T:Newtonsoft.Json.Linq.JObject
+ using the M:Newtonsoft.Json.Schema.Extensions.IsValid(Newtonsoft.Json.Linq.JToken,Newtonsoft.Json.Schema.JsonSchema)
+ extension method.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Schema/JTokenIsValidWithMessages.aml b/Doc/Examples/Schema/JTokenIsValidWithMessages.aml
new file mode 100644
index 00000000..140532d0
--- /dev/null
+++ b/Doc/Examples/Schema/JTokenIsValidWithMessages.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example validates a T:Newtonsoft.Json.Linq.JObject
+ using the M:Newtonsoft.Json.Schema.Extensions.IsValid(Newtonsoft.Json.Linq.JToken,Newtonsoft.Json.Schema.JsonSchema)
+ extension method and returns error messages.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Schema/JTokenValidateWithEvent.aml b/Doc/Examples/Schema/JTokenValidateWithEvent.aml
new file mode 100644
index 00000000..6940a2b6
--- /dev/null
+++ b/Doc/Examples/Schema/JTokenValidateWithEvent.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example validates a T:Newtonsoft.Json.Linq.JObject
+ using the M:Newtonsoft.Json.Schema.Extensions.IsValid(Newtonsoft.Json.Linq.JToken,Newtonsoft.Json.Schema.JsonSchema)
+ extension method and raises an event for each validation error.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Schema/JsonSchemaParse.aml b/Doc/Examples/Schema/JsonSchemaParse.aml
new file mode 100644
index 00000000..ff2d3893
--- /dev/null
+++ b/Doc/Examples/Schema/JsonSchemaParse.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example parses a T:Newtonsoft.Json.Schema.JsonSchema
+ from JSON
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Schema/JsonValidatingReaderAndSerializer.aml b/Doc/Examples/Schema/JsonValidatingReaderAndSerializer.aml
new file mode 100644
index 00000000..4df70692
--- /dev/null
+++ b/Doc/Examples/Schema/JsonValidatingReaderAndSerializer.aml
@@ -0,0 +1,16 @@
+
+
+
+
+ This example validates JSON when deserializing an object using
+ T:Newtonsoft.Json.JsonValidatingReader.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Schema/LoadJsonSchemaFromFile.aml b/Doc/Examples/Schema/LoadJsonSchemaFromFile.aml
new file mode 100644
index 00000000..1b2c5bd8
--- /dev/null
+++ b/Doc/Examples/Schema/LoadJsonSchemaFromFile.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example loads a T:Newtonsoft.Json.Schema.JsonSchema
+ from a file.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Schema/RefJsonSchemaResolver.aml b/Doc/Examples/Schema/RefJsonSchemaResolver.aml
new file mode 100644
index 00000000..b56f5039
--- /dev/null
+++ b/Doc/Examples/Schema/RefJsonSchemaResolver.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example uses a T:Newtonsoft.Json.Schema.JsonSchemaResolver
+ to resolve schema references from different JSON documents.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Schema/SaveJsonSchemaToFile.aml b/Doc/Examples/Schema/SaveJsonSchemaToFile.aml
new file mode 100644
index 00000000..865157cd
--- /dev/null
+++ b/Doc/Examples/Schema/SaveJsonSchemaToFile.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example saves a T:Newtonsoft.Json.Schema.JsonSchema
+ to a file.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Serializer.aml b/Doc/Examples/Serializer.aml
deleted file mode 100644
index 29ae4f06..00000000
--- a/Doc/Examples/Serializer.aml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
- The T:Newtonsoft.Json.Serialization.IContractResolver
- interface provides a way to customize how the
- JsonSerializer serializes and deserializes .NET objects to JSON without placing attributes on your classes.
-
- 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.
-
-
-
- DefaultContractResolver
-
-
- The T:Newtonsoft.Json.Serialization.DefaultContractResolver
- is the default resolver used by the
- serializer. It provides many avenues of extensibility in the form of
- virtual methods that can be overriden.
-
-
-
- CamelCasePropertyNamesContractResolver
-
-
- T:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver
- inherits from DefaultContractResolver and simply overrides the JSON
- property name to be written in
-camelcase
-http://en.wikipedia.org/wiki/CamelCase
-_blank
-.
-
-
-
-
-
- Custom IContractResolver Examples
-
-
-
- This example sets a T:Newtonsoft.Json.JsonConverter for a type
- using an IContractResolver. Using a contract resolver here is useful because DateTime is not your own type and it is not possible to place a JsonConverterAttribute on it.
-
-
-
- This example sets up
- conditional serialization for a property
- ConditionalProperties.htm
- _self
- using an IContractResolver. This is useful if you want to conditionally serialize a property but don't want to add additional methods to your type.
-
-
-
- T:Newtonsoft.Json.Serialization.IContractResolver
- T:Newtonsoft.Json.Serialization.DefaultContractResolver
- T:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver
-
-
-
\ No newline at end of file
diff --git a/Doc/Examples/Serializer/DeserializeCustomCreationConverter.aml b/Doc/Examples/Serializer/DeserializeCustomCreationConverter.aml
index 844cd14d..efb88f8d 100644
--- a/Doc/Examples/Serializer/DeserializeCustomCreationConverter.aml
+++ b/Doc/Examples/Serializer/DeserializeCustomCreationConverter.aml
@@ -2,7 +2,7 @@
- This example creates a class that inherits from T:Newtonsoft.Json.CustomCreationConverter`1
+ This example creates a class that inherits from T:Newtonsoft.Json.Converters.CustomCreationConverter`1
that instantiates Employee instances for the Person type.
diff --git a/Doc/Examples/Serializer/JsonObjectAttributeOverrideIEnumerable.aml b/Doc/Examples/Serializer/JsonObjectAttributeOverrideIEnumerable.aml
index c4f33a52..36dd7826 100644
--- a/Doc/Examples/Serializer/JsonObjectAttributeOverrideIEnumerable.aml
+++ b/Doc/Examples/Serializer/JsonObjectAttributeOverrideIEnumerable.aml
@@ -3,7 +3,7 @@
This example uses T:Newtonsoft.Json.JsonObjectAttribute
- to serialize a class that implements T:System.IEnumerable`1 as
+ to serialize a class that implements T:System.Collections.IEnumerable`1 as
a JSON object instead of a JSON array.
diff --git a/Doc/Examples/Serializer/SerializeDataSet.aml b/Doc/Examples/Serializer/SerializeDataSet.aml
index 4101f56b..75228494 100644
--- a/Doc/Examples/Serializer/SerializeDataSet.aml
+++ b/Doc/Examples/Serializer/SerializeDataSet.aml
@@ -2,7 +2,7 @@
- This example serializes a DataSet to JSON.
+ This example serializes a T:System.Data.DataSet to JSON.
Example
diff --git a/Doc/Examples/Xml/ConvertJsonToXml.aml b/Doc/Examples/Xml/ConvertJsonToXml.aml
new file mode 100644
index 00000000..924b07c0
--- /dev/null
+++ b/Doc/Examples/Xml/ConvertJsonToXml.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example converts JSON to XML.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Xml/ConvertXmlToJson.aml b/Doc/Examples/Xml/ConvertXmlToJson.aml
new file mode 100644
index 00000000..89af3dd9
--- /dev/null
+++ b/Doc/Examples/Xml/ConvertXmlToJson.aml
@@ -0,0 +1,14 @@
+
+
+
+
+ This example converts XML to JSON.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/Examples/Xml/ConvertXmlToJsonForceArray.aml b/Doc/Examples/Xml/ConvertXmlToJsonForceArray.aml
new file mode 100644
index 00000000..bcb953c9
--- /dev/null
+++ b/Doc/Examples/Xml/ConvertXmlToJsonForceArray.aml
@@ -0,0 +1,15 @@
+
+
+
+
+ This example reads the json:Array="true" attribute in the XML and places its value in an array
+ when converting the XML to JSON.
+
+
+
+
\ No newline at end of file
diff --git a/Doc/doc.content b/Doc/doc.content
index 145f0542..bf8b24cb 100644
--- a/Doc/doc.content
+++ b/Doc/doc.content
@@ -23,63 +23,124 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Doc/doc.shfbproj b/Doc/doc.shfbproj
index f16fd37a..19fbd4c1 100644
--- a/Doc/doc.shfbproj
+++ b/Doc/doc.shfbproj
@@ -137,6 +137,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -243,6 +294,11 @@
+
+
+
+
+
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/DeserializeFromBson.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/DeserializeFromBson.cs
index be0fcbe3..1ac9483e 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/DeserializeFromBson.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/DeserializeFromBson.cs
@@ -9,14 +9,17 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Bson
{
public class DeserializeFromBson
{
+ #region Types
public class Event
{
public string Name { get; set; }
public DateTime StartDate { get; set; }
}
+ #endregion
public void Example()
{
+ #region Usage
byte[] data = Convert.FromBase64String("MQAAAAJOYW1lAA8AAABNb3ZpZSBQcmVtaWVyZQAJU3RhcnREYXRlAMDgKWE8AQAAAA==");
MemoryStream ms = new MemoryStream(data);
@@ -29,6 +32,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Bson
Console.WriteLine(e.Name);
// Movie Premiere
}
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/DeserializeFromBsonCollection.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/DeserializeFromBsonCollection.cs
index 107675cd..77b2dabe 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/DeserializeFromBsonCollection.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/DeserializeFromBsonCollection.cs
@@ -9,14 +9,17 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Bson
{
public class DeserializeFromBsonCollection
{
+ #region Types
public class Event
{
public string Name { get; set; }
public DateTime StartDate { get; set; }
}
+ #endregion
public void Example()
{
+ #region Usage
byte[] data = Convert.FromBase64String("awAAAAMwADAAAAACTmFtZQAOAAAATW92aWUgcHJlbWllcgAJU3RhcnREYXRlAMDgKWE8AQAAAAMxADAAAAACTmFtZQAOAAAATW92aWUgcHJlbWllcgAJU3RhcnREYXRlAMDgKWE8AQAAAAA=");
MemoryStream ms = new MemoryStream(data);
@@ -31,6 +34,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Bson
Console.WriteLine(events.Count);
// 2
}
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/SerializeToBson.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/SerializeToBson.cs
index 9fe0faca..9882d486 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/SerializeToBson.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Bson/SerializeToBson.cs
@@ -10,14 +10,17 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Bson
{
public class SerializeToBson
{
+ #region Types
public class Event
{
public string Name { get; set; }
public DateTime StartDate { get; set; }
}
+ #endregion
public void Example()
{
+ #region Usage
Event e = new Event
{
Name = "Movie Premiere",
@@ -35,6 +38,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Bson
Console.WriteLine(data);
// MQAAAAJOYW1lAA8AAABNb3ZpZSBQcmVtaWVyZQAJU3RhcnREYXRlAMDgKWE8AQAAAA==
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Json/ReadJsonWithJsonTextReader.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Json/ReadJsonWithJsonTextReader.cs
index 7ee22f40..726f7569 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Json/ReadJsonWithJsonTextReader.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Json/ReadJsonWithJsonTextReader.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Json
{
public void Example()
{
+ #region Usage
string json = @"{
'CPU': 'Intel',
'PSU': '500W',
@@ -43,6 +44,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Json
// Token: String, Value: 200 gigabype hard drive
// Token: EndArray
// Token: EndObject
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Json/WriteJsonWithJsonTextWriter.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Json/WriteJsonWithJsonTextWriter.cs
index 45ec4a01..fecd7497 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Json/WriteJsonWithJsonTextWriter.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Json/WriteJsonWithJsonTextWriter.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Json
{
public void Example()
{
+ #region Usage
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
@@ -43,6 +44,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Json
// "200 gigabype hard drive"
// ]
// }
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/Clone.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/Clone.cs
index 859d068b..28179029 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/Clone.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/Clone.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o1 = new JObject
{
{"String", "A string!"},
@@ -41,6 +42,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(Object.ReferenceEquals(o1, o2));
// false
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonAnonymousObject.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonAnonymousObject.cs
index d98fa25f..6781617e 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonAnonymousObject.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonAnonymousObject.cs
@@ -8,6 +8,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public class CreateJsonAnonymousObject
{
+ #region Types
public class Post
{
public string Title { get; set; }
@@ -15,9 +16,11 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
public string Link { get; set; }
public IList Categories { get; set; }
}
+ #endregion
public void Example()
{
+ #region Usage
List posts = new List
{
new Post
@@ -72,6 +75,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// ]
// }
// }
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonCollectionInitializer.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonCollectionInitializer.cs
index efbd8a68..94cc4f91 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonCollectionInitializer.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonCollectionInitializer.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o = new JObject
{
{"Cpu", "Intel"},
@@ -32,6 +33,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// "SSD"
// ]
// }
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonDeclaratively.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonDeclaratively.cs
index 3a89641e..739c9c70 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonDeclaratively.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonDeclaratively.cs
@@ -8,6 +8,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public class CreateJsonDeclaratively
{
+ #region Types
public class Post
{
public string Title { get; set; }
@@ -15,13 +16,16 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
public string Link { get; set; }
public IList Categories { get; set; }
}
+ #endregion
private List GetPosts()
{
return null;
}
+
public void Example()
{
+ #region Usage
List posts = GetPosts();
JObject rss =
@@ -73,6 +77,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// ]
// }
// }
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonDynamic.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonDynamic.cs
index 3c27d888..bb2ccd3d 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonDynamic.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonDynamic.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
dynamic product = new JObject();
product.ProductName = "Elbow Grease";
product.Enabled = true;
@@ -30,6 +31,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// "OnSale"
// ]
// }
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonJTokenWriter.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonJTokenWriter.cs
index 50e7bc3e..d1b0ddb3 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonJTokenWriter.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonJTokenWriter.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JTokenWriter writer = new JTokenWriter();
writer.WriteStartObject();
writer.WritePropertyName("name1");
@@ -31,6 +32,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// 2
// ]
// }
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonManually.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonManually.cs
index 1d177fa8..77228a92 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonManually.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateJsonManually.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JArray array = new JArray();
JValue text = new JValue("Manual text");
JValue date = new JValue(new DateTime(2000, 5, 23));
@@ -17,13 +18,19 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
array.Add(text);
array.Add(date);
- string json = array.ToString();
+ JObject o = new JObject();
+ o["MyArray"] = array;
+
+ string json = o.ToString();
Console.WriteLine(json);
- // [
- // "Manual text",
- // "2000-05-23T00:00:00"
- // ]
+ // {
+ // "MyArray": [
+ // "Manual text",
+ // "2000-05-23T00:00:00"
+ // ]
+ // }
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateReader.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateReader.cs
index b5102bc6..ded9a041 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateReader.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateReader.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o = new JObject
{
{"Cpu", "Intel"},
@@ -44,6 +45,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// String - SSD
// EndArray
// EndObject
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateWriter.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateWriter.cs
index 13966d43..0bc0646c 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateWriter.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/CreateWriter.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o = new JObject
{
{"name1", "value1"},
@@ -32,6 +33,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// 2
// ]
// }
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/DeepEquals.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/DeepEquals.cs
index 9d3385d5..532f471d 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/DeepEquals.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/DeepEquals.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JValue s1 = new JValue("A string");
JValue s2 = new JValue("A string");
JValue s3 = new JValue("A STRING");
@@ -39,6 +40,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(JToken.DeepEquals(s1, o1["String"]));
// true
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/DeserializeWithLinq.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/DeserializeWithLinq.cs
index 43dd2d9d..acaace62 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/DeserializeWithLinq.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/DeserializeWithLinq.cs
@@ -9,6 +9,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public class DeserializeWithLinq
{
+ #region Types
public class BlogPost
{
public string Title { get; set; }
@@ -17,9 +18,11 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
public string Body { get; set; }
public DateTime PostedDate { get; set; }
}
+ #endregion
public void Example()
{
+ #region Usage
string json = @"[
{
'Title': 'Json.NET is awesome!',
@@ -47,6 +50,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(blogPosts[0].Body);
// Title!
// Content!
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/FromObject.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/FromObject.cs
index 003c39e7..387dea4e 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/FromObject.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/FromObject.cs
@@ -8,15 +8,18 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public class FromObject
{
+ #region Types
public class Computer
{
public string Cpu { get; set; }
public int Memory { get; set; }
public IList Drives { get; set; }
}
+ #endregion
public void Example()
{
+ #region Usage
JValue i = (JValue)JToken.FromObject(12345);
Console.WriteLine(i.Type);
@@ -61,6 +64,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// "DVD",
// "SSD"
// ]
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JObjectProperties.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JObjectProperties.cs
index f02ecae8..d176a8c1 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JObjectProperties.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JObjectProperties.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o = new JObject
{
{ "name1", "value1" },
@@ -29,6 +30,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
}
// name1 - value1
// name2 - value2
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JValueCast.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JValueCast.cs
index bc4ac4a2..33f917f9 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JValueCast.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JValueCast.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JValue v1 = new JValue("1");
int i = (int)v1;
@@ -50,6 +51,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine((dt != null) ? dt.ToString() : "{null}");
// {null}
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JValueValue.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JValueValue.cs
index e4581336..a9ba55c6 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JValueValue.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/JValueValue.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JValue s = new JValue("A string value");
Console.WriteLine(s.Value.GetType().Name);
@@ -23,6 +24,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// Uri
Console.WriteLine(u.Value);
// http://www.google.com/
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ModifyJson.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ModifyJson.cs
index 61473218..549fa633 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ModifyJson.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ModifyJson.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
string json = @"{
'channel': {
'title': 'Star Wars',
@@ -48,6 +49,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// ]
// }
// }
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonAny.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonAny.cs
index 47a6cf6b..85978ae8 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonAny.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonAny.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JToken t1 = JToken.Parse("{}");
Console.WriteLine(t1.Type);
@@ -29,6 +30,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(t4.Type);
// String
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonArray.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonArray.cs
index aafed9a2..0192c134 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonArray.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonArray.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
string json = @"[
'Small',
'Medium',
@@ -24,6 +25,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// "Medium",
// "Large"
// ]
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonObject.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonObject.cs
index 241d9ecc..700ca320 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonObject.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ParseJsonObject.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
string json = @"{
CPU: 'Intel',
Drives: [
@@ -28,6 +29,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// "500 gigabyte hard drive"
// ]
// }
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJson.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJson.cs
index 9f416104..abe6d4b2 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJson.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJson.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
string json = @"{
'channel': {
'title': 'James Newton-King',
@@ -62,6 +63,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(string.Join(", ", categoriesText));
// Json.NET, CodePlex
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonDynamic.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonDynamic.cs
index 7ddd6f47..f01a2cf6 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonDynamic.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonDynamic.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
string json = @"[
{
'Title': 'Json.NET is awesome!',
@@ -29,16 +30,20 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
dynamic blogPost = blogPosts[0];
string title = blogPost.Title;
+
Console.WriteLine(title);
// Json.NET is awesome!
string author = blogPost.Author.Name;
+
Console.WriteLine(author);
// James Newton-King
DateTime postDate = blogPost.Date;
+
Console.WriteLine(postDate);
// 23/01/2013 7:30:00 p.m.
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonLinq.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonLinq.cs
index 20e34e85..9fc7d0ba 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonLinq.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonLinq.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
string json = @"{
'channel': {
'title': 'James Newton-King',
@@ -48,7 +49,6 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
Console.WriteLine(item);
}
-
//LINQ to JSON beta
//Json.NET 1.3 + New license + Now on CodePlex
@@ -62,10 +62,10 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
Console.WriteLine(c.Category + " - Count: " + c.Count);
}
-
//Json.NET - Count: 2
//LINQ - Count: 1
//CodePlex - Count: 1
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonSelectToken.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonSelectToken.cs
index d911f6ef..dca0177f 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonSelectToken.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonSelectToken.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o = JObject.Parse(@"{
'Stores': [
'Lambton Quay',
@@ -55,6 +56,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(productName);
// Elbow Grease
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonSelectTokenWithLinq.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonSelectTokenWithLinq.cs
index 784e68d1..f38b7945 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonSelectTokenWithLinq.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/QueryJsonSelectTokenWithLinq.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o = JObject.Parse(@"{
'Stores': [
'Lambton Quay',
@@ -55,6 +56,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(totalPrice);
// 149.95
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ReadJTokenFromBson.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ReadJTokenFromBson.cs
index c3bc42d6..6fac35d1 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ReadJTokenFromBson.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ReadJTokenFromBson.cs
@@ -12,6 +12,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
byte[] data = Convert.FromBase64String("KQAAAAJuYW1lMQAHAAAAdmFsdWUxAAJuYW1lMgAHAAAAdmFsdWUyAAA=");
MemoryStream ms = new MemoryStream(data);
@@ -25,6 +26,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(value);
// value1
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ReadJson.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ReadJson.cs
index 7f4cf294..11fa43b0 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ReadJson.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ReadJson.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o1 = JObject.Parse(File.ReadAllText(@"c:\videogames.json"));
// read JSON directly from a file
@@ -19,6 +20,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
JObject o2 = (JObject) JToken.ReadFrom(reader);
}
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/SerializeWithLinq.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/SerializeWithLinq.cs
index 88cc4323..d94c5626 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/SerializeWithLinq.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/SerializeWithLinq.cs
@@ -9,6 +9,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public class SerializeWithLinq
{
+ #region Types
public class BlogPost
{
public string Title { get; set; }
@@ -17,9 +18,11 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
public string Body { get; set; }
public DateTime PostedDate { get; set; }
}
+ #endregion
public void Example()
{
+ #region Usage
IList blogPosts = new List
{
new BlogPost
@@ -29,7 +32,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
AuthorTwitter = "JamesNK",
PostedDate = new DateTime(2013, 1, 23, 19, 30, 0),
Body = @"Title!
-Content!
"
+ Content!
"
}
};
@@ -61,6 +64,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
// "BodyHtml": "<h3>Title!</h3>\r\n<p>Content!</p>"
// }
// ]
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectComplex.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectComplex.cs
index ef3b7309..79850cd7 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectComplex.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectComplex.cs
@@ -8,13 +8,16 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public class ToObjectComplex
{
+ #region Types
public class Person
{
public string Name { get; set; }
}
+ #endregion
public void Example()
{
+ #region Usage
string json = @"{
'd': [
{
@@ -37,6 +40,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(person[1].Name);
// Mike Smith
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectGeneric.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectGeneric.cs
index 5390a829..3689c627 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectGeneric.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectGeneric.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JValue v1 = new JValue(true);
bool b = v1.ToObject();
@@ -26,6 +27,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(s);
// "True"
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectType.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectType.cs
index 8f7c0f4e..6643f86a 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectType.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToObjectType.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JValue v1 = new JValue(true);
bool b = (bool)v1.ToObject(typeof(bool));
@@ -26,6 +27,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(s);
// "True"
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToString.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToString.cs
index 932a1c63..a0e3e7fd 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToString.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToString.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o = JObject.Parse(@"{'string1':'value','integer2':99,'datetime3':'2000-05-23T00:00:00'}");
Console.WriteLine(o.ToString());
@@ -25,6 +26,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(o.ToString(Formatting.None, new JavaScriptDateTimeConverter()));
// {"string1":"value","integer2":99,"datetime3":new Date(959032800000)}
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToStringJsonConverter.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToStringJsonConverter.cs
index 2628c49e..df361536 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToStringJsonConverter.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/ToStringJsonConverter.cs
@@ -11,10 +11,12 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o = JObject.Parse(@"{'string1':'value','integer2':99,'datetime3':'2000-05-23T00:00:00'}");
Console.WriteLine(o.ToString(Formatting.None, new JavaScriptDateTimeConverter()));
// {"string1":"value","integer2":99,"datetime3":new Date(959032800000)}
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/WriteJTokenToBson.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/WriteJTokenToBson.cs
index e10ee3e7..6a2ce498 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/WriteJTokenToBson.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/WriteJTokenToBson.cs
@@ -12,6 +12,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject o = new JObject
{
{"name1","value1"},
@@ -28,6 +29,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
Console.WriteLine(data);
// KQAAAAJuYW1lMQAHAAAAdmFsdWUxAAJuYW1lMgAHAAAAdmFsdWUyAAA=
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/WriteToJsonFile.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/WriteToJsonFile.cs
index 57a4376f..65967283 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/WriteToJsonFile.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Linq/WriteToJsonFile.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
public void Example()
{
+ #region Usage
JObject videogameRatings = new JObject(
new JProperty("Halo", 9),
new JProperty("Starcraft", 9),
@@ -24,6 +25,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Linq
{
videogameRatings.WriteTo(writer);
}
+ #endregion
}
}
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/CreateJsonSchemaManually.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/CreateJsonSchemaManually.cs
index ae6a51c5..2290c511 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/CreateJsonSchemaManually.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/CreateJsonSchemaManually.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
public void Example()
{
+ #region Usage
JsonSchema schema = new JsonSchema();
schema.Type = JsonSchemaType.Object;
schema.Properties = new Dictionary
@@ -52,6 +53,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
Console.WriteLine(valid);
// true
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenIsValid.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenIsValid.cs
index 9e073d60..d99bdd68 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenIsValid.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenIsValid.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
public void Example()
{
+ #region Usage
string schemaJson = @"{
'description': 'A person',
'type': 'object',
@@ -34,6 +35,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
Console.WriteLine(valid);
// true
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenIsValidWithMessages.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenIsValidWithMessages.cs
index 172d3a81..01c5e1ed 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenIsValidWithMessages.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenIsValidWithMessages.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
public void Example()
{
+ #region Usage
string schemaJson = @"{
'description': 'A person',
'type': 'object',
@@ -42,6 +43,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
}
// Invalid type. Expected String but got Null. Line 2, position 21.
// Invalid type. Expected String but got Float. Line 3, position 51.
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenValidateWithEvent.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenValidateWithEvent.cs
index c98ba7ab..90c740d9 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenValidateWithEvent.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JTokenValidateWithEvent.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
public void Example()
{
+ #region Usage
string schemaJson = @"{
'description': 'A person',
'type': 'object',
@@ -41,6 +42,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
}
// Invalid type. Expected String but got Null. Line 2, position 21.
// Invalid type. Expected String but got Float. Line 3, position 51.
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonSchemaLoad.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonSchemaLoad.cs
deleted file mode 100644
index 725ba4c0..00000000
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonSchemaLoad.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using Newtonsoft.Json.Linq;
-using Newtonsoft.Json.Schema;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-
-namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
-{
- public class JsonSchemaLoad
- {
- public void Example()
- {
- string schemaJson = @"{'type': 'object'}";
-
- JsonSchema schema;
- using (TextReader file = File.OpenText(@"c:\schema.json"))
- using (JsonTextReader reader = new JsonTextReader(file))
- {
- schema = JsonSchema.Read(reader);
- }
-
- JObject o = JObject.Parse(@"{}");
-
- bool valid = o.IsValid(schema);
-
- Console.WriteLine(valid);
- // true
- }
- }
-}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonSchemaParse.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonSchemaParse.cs
index 28137f7d..ea318b74 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonSchemaParse.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonSchemaParse.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
public void Example()
{
+ #region Usage
string schemaJson = @"{
'description': 'A person',
'type': 'object',
@@ -34,6 +35,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
}
// name - String
// hobbies - Array
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonValidatingReaderAndSerializer.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonValidatingReaderAndSerializer.cs
index 94eabfc4..1e8c065b 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonValidatingReaderAndSerializer.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/JsonValidatingReaderAndSerializer.cs
@@ -9,14 +9,17 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
public class JsonValidatingReaderAndSerializer
{
+ #region Types
public class Person
{
public string Name { get; set; }
public IList Hobbies { get; set; }
}
+ #endregion
public void Example()
{
+ #region Usage
string schemaJson = @"{
'description': 'A person',
'type': 'object',
@@ -52,6 +55,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
Console.WriteLine(isValid);
// true
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/LoadJsonSchemaFromFile.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/LoadJsonSchemaFromFile.cs
index 9f929fa2..20e7ce4e 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/LoadJsonSchemaFromFile.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/LoadJsonSchemaFromFile.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
public void Example()
{
+ #region Usage
// read file into a string and parse JsonSchema from the string
JsonSchema schema1 = JsonSchema.Parse(File.ReadAllText(@"c:\schema.json"));
@@ -20,6 +21,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
JsonSchema schema2 = JsonSchema.Read(reader);
}
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/RefJsonSchemaResolver.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/RefJsonSchemaResolver.cs
index 3ff211da..86463be3 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/RefJsonSchemaResolver.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/RefJsonSchemaResolver.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
public void Example()
{
+ #region Usage
string schemaJson;
JsonSchemaResolver resolver = new JsonSchemaResolver();
@@ -50,6 +51,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
Console.WriteLine(valid);
// true
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/SaveJsonSchemaToFile.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/SaveJsonSchemaToFile.cs
index b315890d..f7440351 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/SaveJsonSchemaToFile.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Schema/SaveJsonSchemaToFile.cs
@@ -11,6 +11,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
public void Example()
{
+ #region Usage
JsonSchema schema = JsonSchema.Parse(@"{'type': 'object'}");
// serialize JsonSchema to a string and then write string to a file
@@ -22,6 +23,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Schema
{
schema.WriteTo(writer);
}
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Serializer/DeserializeConstructorHandling.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Serializer/DeserializeConstructorHandling.cs
index d68d006c..5861eea8 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Serializer/DeserializeConstructorHandling.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Serializer/DeserializeConstructorHandling.cs
@@ -36,8 +36,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Serializer
{
JsonConvert.DeserializeObject(json);
}
- catch (TargetInvocationException)
+ catch (TargetInvocationException ex)
{
+ Console.WriteLine(ex);
// Value cannot be null.
// Parameter name: website
}
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Serializer/NullValueHandlingIgnore.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Serializer/NullValueHandlingIgnore.cs
index a676cba5..2c181392 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Serializer/NullValueHandlingIgnore.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Serializer/NullValueHandlingIgnore.cs
@@ -49,4 +49,4 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Serializer
#endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertJsonToXml.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertJsonToXml.cs
index d6cbf2a3..85819819 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertJsonToXml.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertJsonToXml.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Xml
{
public void Example()
{
+ #region Usage
string json = @"{
'@Id': 1,
'Email': 'james@example.com',
@@ -40,6 +41,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Xml
// Creators of fine software products and services.
//
//
+ #endregion
}
}
}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertXmlToJson.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertXmlToJson.cs
index 2c23a92d..ae3c6a81 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertXmlToJson.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertXmlToJson.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Xml
{
public void Example()
{
+ #region Usage
string xml = @"
@@ -48,6 +49,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Xml
// ]
// }
// }
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertXmlToJsonForceArray.cs b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertXmlToJsonForceArray.cs
index d98e5a0d..68e093f9 100644
--- a/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertXmlToJsonForceArray.cs
+++ b/Src/Newtonsoft.Json.Tests/Documentation/Examples/Xml/ConvertXmlToJsonForceArray.cs
@@ -10,6 +10,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Xml
{
public void Example()
{
+ #region Usage
string xml = @"
Alan
http://www.google.com
@@ -53,6 +54,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Examples.Xml
// ]
// }
// }
+ #endregion
}
}
-}
+}
\ No newline at end of file
diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
index 5393d246..09f33ddb 100644
--- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
+++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
@@ -135,7 +135,6 @@
-
diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
index 59511a74..4a01ed07 100644
--- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
+++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
@@ -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.15726")]
+[assembly: AssemblyFileVersion("4.5.11.15727")]
#endif
diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs
index e7a6c8d7..e783aa4c 100644
--- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs
+++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs
@@ -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.15726")]
+[assembly: AssemblyFileVersion("4.5.11.15727")]
#endif
[assembly: CLSCompliant(true)]