-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
@@ -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)]