Skip to content
Browse files

Merge from upstream.

  • Loading branch information...
1 parent 9687989 commit c48b14ab6a629531a968659d2b327d8ff832a2fb @bojanrajkovic bojanrajkovic committed
Showing with 11,397 additions and 11,666 deletions.
  1. +51 −0 .gitattributes
  2. +10 −5 .gitignore
  3. +13 −13 Build/Newtonsoft.Json.nuspec
  4. +193 −199 Build/build.ps1
  5. +1 −1 Build/runbuild.cmd
  6. +4 −4 Build/runbuild.ps1
  7. +41 −0 Doc/ConditionalProperties.aml
  8. +70 −0 Doc/ContractResolver.aml
  9. +0 −92 Doc/ContractResolver.html
  10. +87 −0 Doc/ConvertingJSONandXML.aml
  11. +0 −146 Doc/ConvertingJSONandXML.html
  12. +50 −0 Doc/CreatingLINQtoJSON.aml
  13. +30 −0 Doc/CustomCreationConverter.aml
  14. +0 −99 Doc/CustomCreationConverter.html
  15. +99 −0 Doc/DatesInJSON.aml
  16. +0 −101 Doc/DatesInJSON.html
  17. +133 −0 Doc/Introduction.aml
  18. +0 −68 Doc/Introduction.html
  19. +454 −0 Doc/JsonNetVsDotNetSerializers.aml
  20. +101 −0 Doc/JsonNetVsWindowsDataJson.aml
  21. +62 −0 Doc/JsonSchema.aml
  22. +62 −0 Doc/LINQtoJSON.aml
  23. +0 −254 Doc/LINQtoJSON.html
  24. +37 −0 Doc/ParsingLINQtoJSON.aml
  25. +91 −0 Doc/Performance.aml
  26. +75 −0 Doc/PreserveObjectReferences.aml
  27. +0 −138 Doc/PreserveObjectReferences.html
  28. +60 −0 Doc/QueryingLINQtoJSON.aml
  29. +67 −0 Doc/ReadingWritingJSON.aml
  30. +0 −87 Doc/ReadingWritingJSON.html
  31. +133 −0 Doc/ReducingSerializedJSONSize.aml
  32. +0 −280 Doc/ReducingSerializedJSONSize.html
  33. +46 −0 Doc/SelectToken.aml
  34. +0 −116 Doc/SelectToken.html
  35. +145 −0 Doc/SerializationAttributes.aml
  36. +0 −123 Doc/SerializationAttributes.html
  37. +58 −0 Doc/SerializationCallbacks.aml
  38. +0 −143 Doc/SerializationCallbacks.html
  39. +107 −0 Doc/SerializationErrorHandling.aml
  40. +0 −172 Doc/SerializationErrorHandling.html
  41. +314 −0 Doc/SerializationGuide.aml
  42. +0 −338 Doc/SerializationGuide.html
  43. +390 −0 Doc/SerializationSettings.aml
  44. +0 −513 Doc/SerializationSettings.html
  45. +39 −0 Doc/SerializationTracing.aml
  46. +66 −0 Doc/SerializingCollections.aml
  47. +0 −128 Doc/SerializingCollections.html
  48. +79 −0 Doc/SerializingJSON.aml
  49. +0 −103 Doc/SerializingJSON.html
  50. +27 −0 Doc/SerializingJSONFragments.aml
  51. +0 −125 Doc/SerializingJSONFragments.html
  52. BIN Doc/cross.png
  53. +0 −19 Doc/custom.css
  54. +32 −0 Doc/doc.content
  55. +195 −89 Doc/doc.shfbproj
  56. +22 −22 Doc/doc.sitemap
  57. BIN Doc/donate.gif
  58. BIN Doc/jsonnetwindowsdatajson.png
  59. BIN Doc/logo.jpg
  60. BIN Doc/performance.png
  61. +86 −59 Doc/readme.txt
  62. +0 −439 Doc/styles.css
  63. BIN Doc/tick.png
  64. +34 −31 Doc/versions.txt
  65. +5,521 −5,521 Src/Lib/NUnit/DotNet/nunit.framework.xml
  66. +32 −32 Src/Newtonsoft.Json.Net20.sln
  67. +26 −26 Src/Newtonsoft.Json.Net35.sln
  68. +32 −0 Src/Newtonsoft.Json.Portable.sln
  69. +31 −31 Src/Newtonsoft.Json.Silverlight.sln
  70. +1,316 −1,315 Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs
  71. +683 −667 Src/Newtonsoft.Json.Tests/Bson/BsonWriterTests.cs
  72. +192 −167 Src/Newtonsoft.Json.Tests/Converters/BinaryConverterTests.cs
Sorry, we could not display the entire diff because too many files (462) changed.
View
51 .gitattributes
@@ -0,0 +1,51 @@
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
+
+*.jpg binary
+*.png binary
+*.gif binary
+
+*.cs text diff=csharp
+*.vb text
+*.c text
+*.cpp text
+*.cxx text
+*.h text
+*.hxx text
+*.py text
+*.rb text
+*.java text
+*.html text
+*.htm text
+*.css text
+*.scss text
+*.sass text
+*.less text
+*.js text
+*.lisp text
+*.clj text
+*.sql text
+*.php text
+*.lua text
+*.m text
+*.asm text
+*.erl text
+*.fs text
+*.fsx text
+*.hs text
+*.ps1 text
+*.psm1 text
+
+*.csproj text merge=union
+*.vbproj text merge=union
+*.fsproj text merge=union
+*.dbproj text merge=union
+*.sln text eol=crlf merge=union
View
15 .gitignore
@@ -1,5 +1,10 @@
-[Bb]in/
-[Oo]bj/
-[Ww]orking/
-*.suo
-*.user
+[Bb]in/
+[Oo]bj/
+[Ww]orking/
+TestResults/
+AppPackages/
+*.suo
+*.user
+_ReSharper.*
+*.ReSharper.user
+*.resharper.user
View
26 Build/Newtonsoft.Json.nuspec
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
- <metadata>
- <id>Newtonsoft.Json</id>
- <version>4.5.1</version>
- <title>Json.NET</title>
- <description>Json.NET is a popular high-performance JSON framework for .NET</description>
- <authors>James Newton-King</authors>
- <language>en-US</language>
- <projectUrl>http://james.newtonking.com/projects/json-net.aspx</projectUrl>
- <licenseUrl>http://json.codeplex.com/license</licenseUrl>
- <tags>json</tags>
- </metadata>
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>Newtonsoft.Json</id>
+ <version>4.5.11</version>
+ <title>Json.NET</title>
+ <description>Json.NET is a popular high-performance JSON framework for .NET</description>
+ <authors>James Newton-King</authors>
+ <language>en-US</language>
+ <projectUrl>http://james.newtonking.com/projects/json-net.aspx</projectUrl>
+ <licenseUrl>http://json.codeplex.com/license</licenseUrl>
+ <tags>json</tags>
+ </metadata>
</package>
View
392 Build/build.ps1
@@ -1,200 +1,194 @@
-properties {
- $zipFileName = "Json45r1.zip"
- $majorVersion = "4.5"
- $majorWithReleaseVersion = "4.5.1"
- $version = GetVersion $majorWithReleaseVersion
- $signAssemblies = $false
- $signKeyPath = "D:\Development\Releases\newtonsoft.snk"
- $buildDocumentation = $false
- $buildNuGet = $false
-
- $baseDir = resolve-path ..
- $buildDir = "$baseDir\Build"
- $sourceDir = "$baseDir\Src"
- $toolsDir = "$baseDir\Tools"
- $docDir = "$baseDir\Doc"
- $releaseDir = "$baseDir\Release"
- $workingDir = "$baseDir\Working"
- $builds = @(
- @{Name = "Newtonsoft.Json"; TestsName = "Newtonsoft.Json.Tests"; Constants=""; FinalDir="Net40"; NuGetDir = "net40"; Framework="net-4.0"; Sign=$true},
- @{Name = "Newtonsoft.Json.Metro"; TestsName = $null; Constants="NETFX_CORE"; FinalDir="Metro"; NuGetDir = "winrt45"; Framework="net-4.5"; Sign=$true},
-
- # unsigned SL/WP
- @{Name = "Newtonsoft.Json.WindowsPhone"; TestsName = $null; Constants="SILVERLIGHT;WINDOWS_PHONE"; FinalDir="WindowsPhone"; NuGetDir = "sl3-wp,sl4-windowsphone71"; Framework="net-4.0"; Sign=$false},
- @{Name = "Newtonsoft.Json.Silverlight"; TestsName = "Newtonsoft.Json.Tests.Silverlight"; Constants="SILVERLIGHT"; FinalDir="Silverlight"; NuGetDir = "sl4"; Framework="net-4.0"; Sign=$false},
- # signed SL/WP
- @{Name = "Newtonsoft.Json.WindowsPhone"; TestsName = $null; Constants="SILVERLIGHT;WINDOWS_PHONE"; FinalDir="WindowsPhone\Signed"; NuGetDir = $null; Framework="net-4.0"; Sign=$true},
- @{Name = "Newtonsoft.Json.Silverlight"; TestsName = "Newtonsoft.Json.Tests.Silverlight"; Constants="SILVERLIGHT"; FinalDir="Silverlight\Signed"; NuGetDir = $null; Framework="net-4.0"; Sign=$true},
-
- @{Name = "Newtonsoft.Json.Net35"; TestsName = "Newtonsoft.Json.Tests.Net35"; Constants="NET35"; FinalDir="Net35"; NuGetDir = "net35"; Framework="net-2.0"; Sign=$true},
- @{Name = "Newtonsoft.Json.Net20"; TestsName = "Newtonsoft.Json.Tests.Net20"; Constants="NET20"; FinalDir="Net20"; NuGetDir = "net20"; Framework="net-2.0"; Sign=$true}
- )
-}
-
-$framework = '4.0x86'
-
-task default -depends Test
-
-# Ensure a clean working directory
-task Clean {
- Set-Location $baseDir
-
- if (Test-Path -path $workingDir)
- {
- Write-Output "Deleting Working Directory"
-
- del $workingDir -Recurse -Force
- }
-
- New-Item -Path $workingDir -ItemType Directory
-}
-
-# Build each solution, optionally signed
-task Build -depends Clean {
- Write-Host -ForegroundColor Green "Updating assembly version"
- Write-Host
- Update-AssemblyInfoFiles $sourceDir ($majorVersion + '.0.0') $version
-
- foreach ($build in $builds)
- {
- $name = $build.Name
- $finalDir = $build.FinalDir
- $sign = ($build.Sign -and $signAssemblies)
-
- Write-Host -ForegroundColor Green "Building " $name
- Write-Host -ForegroundColor Green "Signed " $sign
- Write-Host
- exec { msbuild "/t:Clean;Rebuild" /p:Configuration=Release "/p:Platform=Any CPU" /p:OutputPath=bin\Release\$finalDir\ /p:AssemblyOriginatorKeyFile=$signKeyPath "/p:SignAssembly=$sign" (GetConstants $build.Constants $sign) ".\Src\$name.sln" } "Error building $name"
- }
-}
-
-# Optional build documentation, add files to final zip
-task Package -depends Build {
- foreach ($build in $builds)
- {
- $name = $build.TestsName
- $finalDir = $build.FinalDir
-
- robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\Package\Bin\$finalDir /NP /XO /XF *.pri
- }
-
- if ($buildNuGet)
- {
- New-Item -Path $workingDir\NuGet -ItemType Directory
- Copy-Item -Path "$buildDir\Newtonsoft.Json.nuspec" -Destination $workingDir\NuGet\Newtonsoft.Json.nuspec -recurse
-
- foreach ($build in $builds)
- {
- if ($build.NuGetDir -ne $null)
- {
- $name = $build.TestsName
- $finalDir = $build.FinalDir
- $frameworkDirs = $build.NuGetDir.Split(",")
-
- foreach ($frameworkDir in $frameworkDirs)
- {
- robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\NuGet\lib\$frameworkDir /NP /XO /XF *.pri
- }
- }
- }
-
- exec { .\Tools\NuGet\NuGet.exe pack $workingDir\NuGet\Newtonsoft.Json.nuspec }
- move -Path .\*.nupkg -Destination $workingDir\NuGet
- }
-
- if ($buildDocumentation)
- {
- $mainBuild = $builds | where { $_.Name -eq "Newtonsoft.Json" } | select -first 1
- $mainBuildFinalDir = $mainBuild.FinalDir
- $documentationSourcePath = "$workingDir\Package\Bin\$mainBuildFinalDir"
- Write-Host -ForegroundColor Green "Building documentation from $documentationSourcePath"
-
- # Sandcastle has issues when compiling with .NET 4 MSBuild - http://shfb.codeplex.com/Thread/View.aspx?ThreadId=50652
- exec { msbuild "/t:Clean;Rebuild" /p:Configuration=Release "/p:DocumentationSourcePath=$documentationSourcePath" $docDir\doc.shfbproj } "Error building documentation. Check that you have Sandcastle, Sandcastle Help File Builder and HTML Help Workshop installed."
-
- move -Path $workingDir\Documentation\Documentation.chm -Destination $workingDir\Package\Documentation.chm
- move -Path $workingDir\Documentation\LastBuild.log -Destination $workingDir\Documentation.log
- }
-
- Copy-Item -Path $docDir\readme.txt -Destination $workingDir\Package\
- Copy-Item -Path $docDir\versions.txt -Destination $workingDir\Package\Bin\
-
- robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults AppPackages /XF *.suo *.user
- robocopy $buildDir $workingDir\Package\Source\Build /MIR /NP /XD .svn
- robocopy $docDir $workingDir\Package\Source\Doc /MIR /NP /XD .svn
- robocopy $toolsDir $workingDir\Package\Source\Tools /MIR /NP /XD .svn
-
- exec { .\Tools\7-zip\7za.exe a -tzip $workingDir\$zipFileName $workingDir\Package\* } "Error zipping"
-}
-
-# Unzip package to a location
-task Deploy -depends Package {
- exec { .\Tools\7-zip\7za.exe x -y "-o$workingDir\Deployed" $workingDir\$zipFileName } "Error unzipping"
-}
-
-# Run tests on deployed files
-task Test -depends Deploy {
- foreach ($build in $builds)
- {
- $name = $build.TestsName
- if ($name -ne $null)
- {
- $finalDir = $build.FinalDir
- $framework = $build.Framework
-
- Write-Host -ForegroundColor Green "Copying test assembly $name to deployed directory"
- Write-Host
- robocopy ".\Src\Newtonsoft.Json.Tests\bin\Release\$finalDir" $workingDir\Deployed\Bin\$finalDir /NP /XO /XF LinqBridge.dll
-
- Copy-Item -Path ".\Src\Newtonsoft.Json.Tests\bin\Release\$finalDir\Newtonsoft.Json.Tests.dll" -Destination $workingDir\Deployed\Bin\$finalDir\
-
- Write-Host -ForegroundColor Green "Running tests " $name
- Write-Host
- exec { .\Tools\NUnit\nunit-console.exe "$workingDir\Deployed\Bin\$finalDir\Newtonsoft.Json.Tests.dll" /framework=$framework /xml:$workingDir\$name.xml } "Error running $name tests"
- }
- }
-}
-
-function GetConstants($constants, $includeSigned)
-{
- $signed = switch($includeSigned) { $true { ";SIGNED" } default { "" } }
-
- return "/p:DefineConstants=`"TRACE;$constants$signed`""
-}
-
-function GetVersion($majorVersion)
-{
- $now = [DateTime]::Now
-
- $year = $now.Year - 2000
- $month = $now.Month
- $totalMonthsSince2000 = ($year * 12) + $month
- $day = $now.Day
- $minor = "{0}{1:00}" -f $totalMonthsSince2000, $day
-
- $hour = $now.Hour
- $minute = $now.Minute
- $revision = "{0:00}{1:00}" -f $hour, $minute
-
- return $majorVersion + "." + $minor
-}
-
-function Update-AssemblyInfoFiles ([string] $sourceDir, [string] $assemblyVersionNumber, [string] $fileVersionNumber)
-{
- $assemblyVersionPattern = 'AssemblyVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
- $fileVersionPattern = 'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
- $assemblyVersion = 'AssemblyVersion("' + $assemblyVersionNumber + '")';
- $fileVersion = 'AssemblyFileVersion("' + $fileVersionNumber + '")';
-
- Get-ChildItem -Path $sourceDir -r -filter AssemblyInfo.cs | ForEach-Object {
-
- $filename = $_.Directory.ToString() + '\' + $_.Name
- Write-Host $filename
- $filename + ' -> ' + $version
-
- (Get-Content $filename) | ForEach-Object {
- % {$_ -replace $assemblyVersionPattern, $assemblyVersion } |
- % {$_ -replace $fileVersionPattern, $fileVersion }
- } | Set-Content $filename
- }
+properties {
+ $zipFileName = "Json45r11.zip"
+ $majorVersion = "4.5"
+ $majorWithReleaseVersion = "4.5.11"
+ $version = GetVersion $majorWithReleaseVersion
+ $signAssemblies = $false
+ $signKeyPath = "D:\Development\Releases\newtonsoft.snk"
+ $buildDocumentation = $false
+ $buildNuGet = $false
+
+ $baseDir = resolve-path ..
+ $buildDir = "$baseDir\Build"
+ $sourceDir = "$baseDir\Src"
+ $toolsDir = "$baseDir\Tools"
+ $docDir = "$baseDir\Doc"
+ $releaseDir = "$baseDir\Release"
+ $workingDir = "$baseDir\Working"
+ $builds = @(
+ @{Name = "Newtonsoft.Json"; TestsName = "Newtonsoft.Json.Tests"; Constants=""; FinalDir="Net40"; NuGetDir = "net40"; Framework="net-4.0"; Sign=$true},
+ @{Name = "Newtonsoft.Json.Portable"; TestsName = "Newtonsoft.Json.Tests.Portable"; Constants="PORTABLE"; FinalDir="Portable"; NuGetDir = "portable-net40+sl4+wp7+win8"; Framework="net-4.0"; Sign=$true},
+ @{Name = "Newtonsoft.Json.WinRT"; TestsName = $null; Constants="NETFX_CORE"; FinalDir="WinRT"; NuGetDir = "winrt45"; Framework="net-4.5"; Sign=$true},
+ @{Name = "Newtonsoft.Json.WindowsPhone"; TestsName = $null; Constants="SILVERLIGHT;WINDOWS_PHONE"; FinalDir="WindowsPhone"; NuGetDir = "sl3-wp,sl4-windowsphone71"; Framework="net-4.0"; Sign=$true},
+ @{Name = "Newtonsoft.Json.Silverlight"; TestsName = "Newtonsoft.Json.Tests.Silverlight"; Constants="SILVERLIGHT"; FinalDir="Silverlight"; NuGetDir = "sl4"; Framework="net-4.0"; Sign=$true},
+ @{Name = "Newtonsoft.Json.Net35"; TestsName = "Newtonsoft.Json.Tests.Net35"; Constants="NET35"; FinalDir="Net35"; NuGetDir = "net35"; Framework="net-2.0"; Sign=$true},
+ @{Name = "Newtonsoft.Json.Net20"; TestsName = "Newtonsoft.Json.Tests.Net20"; Constants="NET20"; FinalDir="Net20"; NuGetDir = "net20"; Framework="net-2.0"; Sign=$true}
+ )
+}
+
+$framework = '4.0x86'
+
+task default -depends Test
+
+# Ensure a clean working directory
+task Clean {
+ Set-Location $baseDir
+
+ if (Test-Path -path $workingDir)
+ {
+ Write-Output "Deleting Working Directory"
+
+ del $workingDir -Recurse -Force
+ }
+
+ New-Item -Path $workingDir -ItemType Directory
+}
+
+# Build each solution, optionally signed
+task Build -depends Clean {
+ Write-Host -ForegroundColor Green "Updating assembly version"
+ Write-Host
+ Update-AssemblyInfoFiles $sourceDir ($majorVersion + '.0.0') $version
+
+ foreach ($build in $builds)
+ {
+ $name = $build.Name
+ $finalDir = $build.FinalDir
+ $sign = ($build.Sign -and $signAssemblies)
+
+ Write-Host -ForegroundColor Green "Building " $name
+ Write-Host -ForegroundColor Green "Signed " $sign
+ Write-Host
+ exec { msbuild "/t:Clean;Rebuild" /p:Configuration=Release "/p:Platform=Any CPU" /p:OutputPath=bin\Release\$finalDir\ /p:AssemblyOriginatorKeyFile=$signKeyPath "/p:SignAssembly=$sign" (GetConstants $build.Constants $sign) ".\Src\$name.sln" } "Error building $name"
+ }
+}
+
+# Optional build documentation, add files to final zip
+task Package -depends Build {
+ foreach ($build in $builds)
+ {
+ $name = $build.TestsName
+ $finalDir = $build.FinalDir
+
+ robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\Package\Bin\$finalDir /NP /XO /XF *.pri
+ }
+
+ if ($buildNuGet)
+ {
+ New-Item -Path $workingDir\NuGet -ItemType Directory
+ Copy-Item -Path "$buildDir\Newtonsoft.Json.nuspec" -Destination $workingDir\NuGet\Newtonsoft.Json.nuspec -recurse
+
+ foreach ($build in $builds)
+ {
+ if ($build.NuGetDir -ne $null)
+ {
+ $name = $build.TestsName
+ $finalDir = $build.FinalDir
+ $frameworkDirs = $build.NuGetDir.Split(",")
+
+ foreach ($frameworkDir in $frameworkDirs)
+ {
+ robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\NuGet\lib\$frameworkDir /NP /XO /XF *.pri
+ }
+ }
+ }
+
+ exec { .\Tools\NuGet\NuGet.exe pack $workingDir\NuGet\Newtonsoft.Json.nuspec -Symbols }
+ move -Path .\*.nupkg -Destination $workingDir\NuGet
+ }
+
+ if ($buildDocumentation)
+ {
+ $mainBuild = $builds | where { $_.Name -eq "Newtonsoft.Json" } | select -first 1
+ $mainBuildFinalDir = $mainBuild.FinalDir
+ $documentationSourcePath = "$workingDir\Package\Bin\$mainBuildFinalDir"
+ Write-Host -ForegroundColor Green "Building documentation from $documentationSourcePath"
+
+ # Sandcastle has issues when compiling with .NET 4 MSBuild - http://shfb.codeplex.com/Thread/View.aspx?ThreadId=50652
+ exec { msbuild "/t:Clean;Rebuild" /p:Configuration=Release "/p:DocumentationSourcePath=$documentationSourcePath" $docDir\doc.shfbproj } "Error building documentation. Check that you have Sandcastle, Sandcastle Help File Builder and HTML Help Workshop installed."
+
+ move -Path $workingDir\Documentation\LastBuild.log -Destination $workingDir\Documentation.log
+ }
+
+ Copy-Item -Path $docDir\readme.txt -Destination $workingDir\Package\
+ Copy-Item -Path $docDir\versions.txt -Destination $workingDir\Package\Bin\
+
+ robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults AppPackages /XF *.suo *.user
+ robocopy $buildDir $workingDir\Package\Source\Build /MIR /NP /XD .svn
+ robocopy $docDir $workingDir\Package\Source\Doc /MIR /NP /XD .svn
+ robocopy $toolsDir $workingDir\Package\Source\Tools /MIR /NP /XD .svn
+
+ exec { .\Tools\7-zip\7za.exe a -tzip $workingDir\$zipFileName $workingDir\Package\* } "Error zipping"
+}
+
+# Unzip package to a location
+task Deploy -depends Package {
+ exec { .\Tools\7-zip\7za.exe x -y "-o$workingDir\Deployed" $workingDir\$zipFileName } "Error unzipping"
+}
+
+# Run tests on deployed files
+task Test -depends Deploy {
+ foreach ($build in $builds)
+ {
+ $name = $build.TestsName
+ if ($name -ne $null)
+ {
+ $finalDir = $build.FinalDir
+ $framework = $build.Framework
+
+ Write-Host -ForegroundColor Green "Copying test assembly $name to deployed directory"
+ Write-Host
+ robocopy ".\Src\Newtonsoft.Json.Tests\bin\Release\$finalDir" $workingDir\Deployed\Bin\$finalDir /NP /XO /XF LinqBridge.dll
+
+ Copy-Item -Path ".\Src\Newtonsoft.Json.Tests\bin\Release\$finalDir\Newtonsoft.Json.Tests.dll" -Destination $workingDir\Deployed\Bin\$finalDir\
+
+ Write-Host -ForegroundColor Green "Running tests " $name
+ Write-Host
+ exec { .\Tools\NUnit\nunit-console.exe "$workingDir\Deployed\Bin\$finalDir\Newtonsoft.Json.Tests.dll" /framework=$framework /xml:$workingDir\$name.xml } "Error running $name tests"
+ }
+ }
+}
+
+function GetConstants($constants, $includeSigned)
+{
+ $signed = switch($includeSigned) { $true { ";SIGNED" } default { "" } }
+
+ return "/p:DefineConstants=`"TRACE;$constants$signed`""
+}
+
+function GetVersion($majorVersion)
+{
+ $now = [DateTime]::Now
+
+ $year = $now.Year - 2000
+ $month = $now.Month
+ $totalMonthsSince2000 = ($year * 12) + $month
+ $day = $now.Day
+ $minor = "{0}{1:00}" -f $totalMonthsSince2000, $day
+
+ $hour = $now.Hour
+ $minute = $now.Minute
+ $revision = "{0:00}{1:00}" -f $hour, $minute
+
+ return $majorVersion + "." + $minor
+}
+
+function Update-AssemblyInfoFiles ([string] $sourceDir, [string] $assemblyVersionNumber, [string] $fileVersionNumber)
+{
+ $assemblyVersionPattern = 'AssemblyVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
+ $fileVersionPattern = 'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
+ $assemblyVersion = 'AssemblyVersion("' + $assemblyVersionNumber + '")';
+ $fileVersion = 'AssemblyFileVersion("' + $fileVersionNumber + '")';
+
+ Get-ChildItem -Path $sourceDir -r -filter AssemblyInfo.cs | ForEach-Object {
+
+ $filename = $_.Directory.ToString() + '\' + $_.Name
+ Write-Host $filename
+ $filename + ' -> ' + $version
+
+ (Get-Content $filename) | ForEach-Object {
+ % {$_ -replace $assemblyVersionPattern, $assemblyVersion } |
+ % {$_ -replace $fileVersionPattern, $fileVersion }
+ } | Set-Content $filename
+ }
}
View
2 Build/runbuild.cmd
@@ -1,2 +1,2 @@
-powershell -Command "& {Import-Module ..\Tools\PSake\psake.psm1; Invoke-psake .\build.ps1 %*}"
+powershell -Command "& {Import-Module ..\Tools\PSake\psake.psm1; Invoke-psake .\build.ps1 %*}"
pause
View
8 Build/runbuild.ps1
@@ -1,5 +1,5 @@
-cls
-
-Import-Module '..\Tools\PSake\psake.psm1'
-Invoke-psake '.\build.ps1' Test -framework 3.5
+cls
+
+Import-Module '..\Tools\PSake\psake.psm1'
+Invoke-psake '.\build.ps1' Test -framework 3.5
Remove-Module psake
View
41 Doc/ConditionalProperties.aml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="ConditionalProperties" revisionNumber="1">
+ <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <introduction>
+ <para>Json.NET has the ability to conditionally serialize properties by placing a ShouldSerialize method on a class.
+ This funtionality is similar to the <externalLink>
+<linkText>XmlSerializer ShouldSerialize feature</linkText>
+<linkUri>http://msdn.microsoft.com/en-us/library/53b8022e.aspx</linkUri>
+<linkTarget>_blank</linkTarget>
+</externalLink>.</para>
+ </introduction>
+ <section>
+ <title>ShouldSerialize</title>
+ <content>
+ <para>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.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ConditionalPropertiesTests.cs" region="EmployeeShouldSerializeExample" title="Employee class with a ShouldSerialize method" />
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ConditionalPropertiesTests.cs" region="ShouldSerializeClassTest" title="ShouldSerialize output" />
+
+ </content>
+ </section>
+ <section>
+ <title>IContractResolver</title>
+ <content>
+ <para>ShouldSerialize can also be set using an <codeEntityReference>T:Newtonsoft.Json.Serialization.IContractResolver</codeEntityReference>.
+ 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.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ConditionalPropertiesTests.cs" region="ShouldSerializeContractResolver" title="Conditional properties with IContractResolver" />
+
+ </content>
+ </section>
+ <relatedTopics>
+ <codeEntityReference>T:Newtonsoft.Json.JsonSerializer</codeEntityReference>
+ <codeEntityReference>T:Newtonsoft.Json.Serialization.IContractResolver</codeEntityReference>
+ <codeEntityReference>P:Newtonsoft.Json.Serialization.JsonProperty.ShouldSerialize</codeEntityReference>
+ </relatedTopics>
+ </developerConceptualDocument>
+</topic>
View
70 Doc/ContractResolver.aml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="ContractResolver" revisionNumber="1">
+ <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!--
+ <summary>
+ <para>Optional summary abstract</para>
+ </summary>
+ -->
+ <introduction>
+ <para>The <codeEntityReference>T:Newtonsoft.Json.Serialization.IContractResolver</codeEntityReference>
+ interface provides a way to customize how the
+ JsonSerializer serializes and deserializes .NET objects to JSON without placing attributes on your classes.
+ </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>
+ </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>
+ <title>DefaultContractResolver</title>
+ <content>
+ <!-- Uncomment this to create a sub-section outline
+ <autoOutline /> -->
+ <para>The <codeEntityReference>T:Newtonsoft.Json.Serialization.DefaultContractResolver</codeEntityReference>
+ is the default resolver used by the
+ serializer. It provides many avenues of extensibility in the form of
+ virtual methods that can be overriden.</para>
+ </content>
+ </section>
+ <section>
+ <title>CamelCasePropertyNamesContractResolver</title>
+ <content>
+ <!-- Uncomment this to create a sub-section outline
+ <autoOutline /> -->
+ <para><codeEntityReference>T:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver</codeEntityReference>
+ inherits from DefaultContractResolver and simply overrides the JSON
+ property name to be written in <externalLink>
+<linkText>camelcase</linkText>
+<linkUri>http://en.wikipedia.org/wiki/CamelCase</linkUri>
+<linkTarget>_blank</linkTarget>
+</externalLink>.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="ContractResolver" title="ContractResolver" />
+ </content>
+ </section>
+ <section>
+ <title>Custom IContractResolver Examples</title>
+ <content>
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\PerformanceTests.cs" region="JsonConverterContractResolver" title="Use JsonConverter with IContractResolver" />
+
+ <para>This example sets a <codeEntityReference>T:Newtonsoft.Json.JsonConverter</codeEntityReference> 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.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ConditionalPropertiesTests.cs" region="ShouldSerializeContractResolver" title="Conditional properties with IContractResolver" />
+
+ <para>This example sets up <externalLink>
+ <linkText>conditional serialization for a property</linkText>
+ <linkUri>ConditionalProperties.htm</linkUri>
+ <linkTarget>_self</linkTarget>
+ </externalLink> using an IContractResolver. This is useful if you want to conditional serialize a property but don't want to add additional methods to your type.</para>
+ </content>
+ </section>
+ <relatedTopics>
+ <codeEntityReference>T:Newtonsoft.Json.Serialization.IContractResolver</codeEntityReference>
+ <codeEntityReference>T:Newtonsoft.Json.Serialization.DefaultContractResolver</codeEntityReference>
+ <codeEntityReference>T:Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver</codeEntityReference>
+ </relatedTopics>
+ </developerConceptualDocument>
+</topic>
View
92 Doc/ContractResolver.html
@@ -1,92 +0,0 @@
-<html>
-
- <head>
- <title>Contract Resolver</title>
- <link href="styles.css" rel="stylesheet" type="text/css" />
- <link href="custom.css" rel="stylesheet" type="text/css" />
- </head>
-
- <body>
-
- <div id="control">
- <span class="productTitle">Json.NET - Quick Starts & API Documentation</span><br />
- <span class="topicTitle">Contract Resolvers</span></div>
-
- <div id="content">
- <span style="color: DarkGray"> </span>
-
-
- <p>The <a href="./html/T_Newtonsoft_Json_Serialization_IContractResolver.htm">IContractResolver</a> interface provides a way to customize how the JsonSerializer serializes and deserializes .NET objects to JSON.</p>
- <p>Implementing the IContractResolver interface and then assigning an instance to a JsonSerializer lets you control
- whether the object is serialized as a JSON object or JSON array, what object members should be serialized, how they are serialized and what they are called.</p>
-
- <h4>DefaultContractResolver</h4>
- <p>The <a href="./html/T_Newtonsoft_Json_Serialization_DefaultContractResolver.htm">DefaultContractResolver</a> is the default resolver used by the serializer. It provides many avenues of extensibility in the form of virtual methods that can be overriden.</p>
-
- <h4>CamelCasePropertyNamesContractResolver</h4>
- <p><a href="./html/T_Newtonsoft_Json_Serialization_CamelCasePropertyNamesContractResolver.htm">CamelCasePropertyNamesContractResolver</a> inherits from DefaultContractResolver and simply overrides the JSON property name to be written in <a href="http://en.wikipedia.org/wiki/CamelCase" target="_blank">camelcase</a>.</p>
-
- <div class="overflowpanel"> <div class="code"> <div style="font-family: courier new; color: black; font-size: 10pt;"> <pre style="margin: 0px;"><span style="color: rgb(43, 145, 175);">Product</span> product = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">Product</span></pre>
-
- <pre style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</pre>
-
- <pre style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExpiryDate = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">DateTime</span>(2010, 12, 20, 18, 1, 0, <span style="color: rgb(43, 145, 175);">DateTimeKind</span>.Utc),</pre>
-
- <pre style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name = <span style="color: rgb(163, 21, 21);">"Widget"</span>,</pre>
-
- <pre style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Price = 9.99m,</pre>
-
- <pre style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sizes = <span style="color: blue;">new</span>[] {<span style="color: rgb(163, 21, 21);">"Small"</span>, <span style="color: rgb(163, 21, 21);">"Medium"</span>, <span style="color: rgb(163, 21, 21);">"Large"</span>}</pre>
-
- <pre style="margin: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</pre>
-
- <pre style="margin: 0px;">&nbsp;</pre>
-
- <pre style="margin: 0px;"><span style="color: blue;">string</span> json = </pre>
-
- <pre style="margin: 0px;">&nbsp; <span style="color: rgb(43, 145, 175);">JsonConvert</span>.SerializeObject(</pre>
-
- <pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; product,</pre>
-
- <pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: rgb(43, 145, 175);">Formatting</span>.Indented,</pre>
-
- <pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">JsonSerializerSettings</span> { ContractResolver = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">CamelCasePropertyNamesContractResolver</span>() }</pre>
-
- <pre style="margin: 0px;">&nbsp; );</pre>
-
- <pre style="margin: 0px;">&nbsp;</pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//{</span></pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//&nbsp; "name": "Widget",</span></pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//&nbsp; "expiryDate": "\/Date(1292868060000)\/",</span></pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//&nbsp; "price": 9.99,</span></pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//&nbsp; "sizes": [</span></pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp;&nbsp; "Small",</span></pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp;&nbsp; "Medium",</span></pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp;&nbsp; "Large"</span></pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//&nbsp; ]</span></pre>
-
- <pre style="margin: 0px;"><span style="color: green;">//}</span></pre>
- </div>
- </div>
-</div>
-
-
- <div id="footer">
-
-
-
- </div>
- </div>
-
- </body>
-
-</html>
View
87 Doc/ConvertingJSONandXML.aml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="ConvertingJSONandXML" revisionNumber="1">
+ <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <introduction>
+ <para>Json.NET supports converting JSON to XML and vice versa using the
+ <codeEntityReference>T:Newtonsoft.Json.Converters.XmlNodeConverter</codeEntityReference>.</para>
+ <para>Elements, attributes, text, comments, character data, processing instructions,
+ namespaces and the XML declaration are all preserved when converting between the two. The
+ only caveat is that it is possible to lose the order of differently named nodes at the
+ same level when they are grouped together into an array.</para>
+ </introduction>
+ <section>
+ <title>Conversion Rules</title>
+ <content>
+
+<list class="bullet">
+ <listItem><para>Elements remain unchanged.</para></listItem>
+ <listItem><para>Attributes are prefixed with an @ and should be at the start of the object.</para></listItem>
+ <listItem><para>Single child text nodes are a value directly against an element, otherwise they are accessed via #text.</para></listItem>
+ <listItem><para>The XML declaration and processing instructions are prefixed with ?.</para></listItem>
+ <listItem><para>Charater data, comments, whitespace and significate whitespace nodes are accessed via
+ #cdata-section, #comment, #whitespace and #significate-whitespace respectively.</para></listItem>
+ <listItem><para>Multiple nodes with the same name at the same level are grouped together into an array.</para></listItem>
+ <listItem><para>Empty elements are null.</para></listItem>
+</list>
+
+<para>If the XML created from JSON doesn't match what you want then you will need to convert it manually.
+The best approach to do this is to load your JSON into a LINQ to JSON object like JObject or JArray and then use LINQ to create
+an XDocument. The opposite process, using LINQ with an XDocument to create a JObject or JArray, also works.
+Find out more about using LINQ to JSON with LINQ <externalLink>
+<linkText>here</linkText>
+<linkUri>QueryingLINQtoJSON.htm</linkUri>
+<linkTarget>_self</linkTarget>
+</externalLink>.</para>
+
+<alert class="note">
+ <para>The version of Json.NET being used in your application will change what XML conversion methods are available.
+ SerializeXmlNode/DeserializeXmlNode are available when the framework supports XmlDocument,
+ SerializeXNode/DeserializeXNode are available when the framework supports XDocument.</para>
+</alert>
+
+ </content>
+ </section>
+ <section>
+ <title>SerializeXmlNode</title>
+ <content>
+
+ <para>The JsonConvert has two helper methods for converting between JSON and XML. The first is
+ <codeEntityReference>Overload:Newtonsoft.Json.JsonConvert.SerializeXmlNode</codeEntityReference>.
+ This method takes an XmlNode and serializes it to JSON text.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ConvertingJsonAndXmlTests.cs" region="SerializeXmlNode" title="Converting XML to JSON with SerializeXmlNode" />
+
+ <para>Because multiple nodes with a the same name at the same level are grouped together into an array
+ the convernsion process can produce different JSON depending on the number of nodes. For example if some
+ XML for a user has a single <codeInline>&lt;Role&gt;</codeInline> node then that role will be text against
+ a JSON <codeInline>"Role"</codeInline> property, but if the user has multiple <codeInline>&lt;Role&gt;</codeInline>
+ nodes then the role values will be placed in a JSON array.</para>
+
+ <para>To fix this situation a custom XML attribute can be added to force a JSON array to be created.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ConvertingJsonAndXmlTests.cs" region="ForceJsonArray" title="Attribute to Force a JSON Array" />
+ </content>
+ </section>
+ <section>
+ <title>DeserializeXmlNode</title>
+ <content>
+
+ <para>The second helper method on JsonConvert is
+ <codeEntityReference>Overload:Newtonsoft.Json.JsonConvert.DeserializeXmlNode</codeEntityReference>.
+ This method takes JSON text and deserializes it into a XmlNode.</para>
+
+ <para>Because valid XML must have one root element the JSON passed to DeserializeXmlNode should
+ have one property in the root JSON object. If the root JSON object has multiple properties then
+ the overload that also takes an element name should be used. A root element with that name will
+ be inserted into the deserialized XmlNode.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\ConvertingJsonAndXmlTests.cs" region="DeserializeXmlNode" title="Converting JSON to XML with DeserializeXmlNode" />
+
+ </content>
+ </section>
+ <relatedTopics>
+ <codeEntityReference>T:Newtonsoft.Json.Converters.XmlNodeConverter</codeEntityReference>
+ <codeEntityReference>T:Newtonsoft.Json.JsonConvert</codeEntityReference>
+ </relatedTopics>
+ </developerConceptualDocument>
+</topic>
View
146 Doc/ConvertingJSONandXML.html
@@ -1,146 +0,0 @@
-<html>
-
- <head>
- <title>Converting between JSON and XML</title>
- <link href="styles.css" rel="stylesheet" type="text/css" />
- <link href="custom.css" rel="stylesheet" type="text/css" />
- </head>
-
- <body>
-
- <div id="control">
- <span class="productTitle">Json.NET - Quick Starts & API Documentation</span><br />
- <span class="topicTitle">Converting between JSON and XML</span></div>
-
- <div id="content">
- <span style="color: DarkGray"> </span>
- <p>Json.NET supports converting JSON to XML and vice versa using the
- <a href="./html/T_Newtonsoft_Json_Converters_XmlNodeConverter.htm">XmlNodeConverter</a>.</p>
-
- <p>
- Elements, attributes, text, comments, character data, processing instructions,
- namespaces and the XML declaration are all preserved when converting between the
- two. The only caveat is that it is possible to lose the order of differently
- named nodes at the same level when they are grouped together into an array.</p>
- <h3>Conversion Rules</h3>
- <ul>
- <li>Elements remain unchanged. </li>
- <li>Attributes are prefixed with an @ and should be at the start of the object. </li>
- <li>Single child text nodes are a value directly against an element, otherwise they
- are accessed via #text. </li>
- <li>The XML declaration and processing instructions are prefixed with ?. </li>
- <li>Charater data, comments, whitespace and significate whitespace nodes are
- accessed via #cdata-section,&nbsp;#comment, #whitespace and #significate-whitespace
- respectively. </li>
- <li>Multiple nodes with the same name at the same level are grouped together into an
- array. </li>
- <li>Empty elements are null.</li>
- </ul>
-
-<h3>SerializeXmlNode</h3>
-<p>The JsonConvert has two helper methods for converting between JSON and XML. The first is <a href="./html/M_Newtonsoft_Json_JsonConvert_SerializeXmlNode.htm">SerializeXmlNode</a>. This method takes an
-XmlNode and serializes it to JSON text.</p>
-<div class="overflowpanel">
- <div class="code">
-<div style="font-family: Courier New; font-size: 10pt; color: black;">
-<pre style="margin: 0px;"><span style="color: blue;">string</span> xml = <span style="color: #a31515;">@&quot;&lt;?xml version=&quot;&quot;1.0&quot;&quot; standalone=&quot;&quot;no&quot;&quot;?&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&lt;root&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &lt;person id=&quot;&quot;1&quot;&quot;&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &lt;name&gt;Alan&lt;/name&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &lt;url&gt;http://www.google.com&lt;/url&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &lt;/person&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &lt;person id=&quot;&quot;2&quot;&quot;&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &lt;name&gt;Louis&lt;/name&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &lt;url&gt;http://www.yahoo.com&lt;/url&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &lt;/person&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&lt;/root&gt;&quot;</span>;</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: #2b91af;">XmlDocument</span> doc = <span style="color: blue;">new</span> <span style="color: #2b91af;">XmlDocument</span>();</pre>
-<pre style="margin: 0px;">doc.LoadXml(xml);</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: blue;">string</span> jsonText = <span style="color: #2b91af;">JsonConvert</span>.SerializeXmlNode(doc);</pre>
-<pre style="margin: 0px;"><span style="color: green;">//{</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &quot;?xml&quot;: {</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &quot;@version&quot;: &quot;1.0&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &quot;@standalone&quot;: &quot;no&quot;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; },</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &quot;root&quot;: {</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &quot;person&quot;: [</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; {</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; &nbsp; &quot;@id&quot;: &quot;1&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; &nbsp; &quot;name&quot;: &quot;Alan&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; &nbsp; &quot;url&quot;: &quot;http://www.google.com&quot;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; },</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; {</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; &nbsp; &quot;@id&quot;: &quot;2&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; &nbsp; &quot;name&quot;: &quot;Louis&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; &nbsp; &quot;url&quot;: &quot;http://www.yahoo.com&quot;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; &nbsp; }</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; ]</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; }</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//}</span></pre>
-</div>
-
-</div>
- </div>
-
-<h3>DeserializeXmlNode</h3>
-
-<p>The second helper method on JsonConvert is <a href="./html/M_Newtonsoft_Json_JsonConvert_DeserializeXmlNode.htm">DeserializeXmlNode</a>. This method takes
- JSON text and deserializes it into a XmlNode.</p>
- <p>Because valid XML must have one root element the JSON passed to
- DeserializeXmlNode should have one property in the root JSON object. If the root
- JSON object has multiple properties then the overload that also takes an element
- name should be used. A root element with that name will be inserted into the
- deserialized XmlNode.</p>
-
-<div class="overflowpanel">
-
- <div class="code">
-
-<div style="font-family: Courier New; font-size: 10pt; color: black;">
-<pre style="margin: 0px;"><span style="color: blue;">string</span> json = <span style="color: #a31515;">@&quot;{</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &quot;&quot;?xml&quot;&quot;: {</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &quot;&quot;@version&quot;&quot;: &quot;&quot;1.0&quot;&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &quot;&quot;@standalone&quot;&quot;: &quot;&quot;no&quot;&quot;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; },</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &quot;&quot;root&quot;&quot;: {</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &quot;&quot;person&quot;&quot;: [</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; {</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;@id&quot;&quot;: &quot;&quot;1&quot;&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;name&quot;&quot;: &quot;&quot;Alan&quot;&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;url&quot;&quot;: &quot;&quot;http://www.google.com&quot;&quot;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; },</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; {</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;@id&quot;&quot;: &quot;&quot;2&quot;&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;name&quot;&quot;: &quot;&quot;Louis&quot;&quot;,</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;url&quot;&quot;: &quot;&quot;http://www.yahoo.com&quot;&quot;</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; &nbsp; }</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; &nbsp; ]</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">&nbsp; }</span></pre>
-<pre style="margin: 0px;"><span style="color: #a31515;">}&quot;</span>;</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: #2b91af;">XmlDocument</span> doc = (<span style="color: #2b91af;">XmlDocument</span>)<span style="color: #2b91af;">JsonConvert</span>.DeserializeXmlNode(json);</pre>
-<pre style="margin: 0px;"><span style="color: green;">// &lt;?xml version=&quot;1.0&quot; standalone=&quot;no&quot;?&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">// &lt;root&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp; &lt;person id=&quot;1&quot;&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp; &lt;name&gt;Alan&lt;/name&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp; &lt;url&gt;http://www.google.com&lt;/url&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp; &lt;/person&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp; &lt;person id=&quot;2&quot;&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp; &lt;name&gt;Louis&lt;/name&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp; &lt;url&gt;http://www.yahoo.com&lt;/url&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp;&nbsp; &lt;/person&gt;</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">// &lt;/root&gt;</span></pre>
-</div>
-
-
- </div>
-</div>
-
- <div id="footer"></div>
- </div>
-
- </body>
-
-</html>
View
50 Doc/CreatingLINQtoJSON.aml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="CreatingLINQtoJSON" revisionNumber="1">
+ <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>
+ </introduction>
+
+ <section>
+ <title>Manually Creating JSON</title>
+ <content>
+ <para>Setting values and creating objects and arrays one at a time gives you
+ total control but it is more verbose than other options.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\LinqToJsonTests.cs" region="LinqToJsonCreateNormal" title="Creating JSON" />
+ </content>
+ </section>
+
+ <section>
+ <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>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\LinqToJsonTests.cs" region="LinqToJsonCreateDeclaratively" title="Creating JSON Declaratively" />
+ </content>
+ </section>
+
+ <section>
+ <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
+ <codeEntityReference>Overload:Newtonsoft.Json.Linq.JObject.FromObject</codeEntityReference>
+ method. Internally FromObject will use the JsonSerializer to serialize the object to LINQ to JSON objects instead of text.</para>
+
+ <para>The example below is creating a JSON object from an anonymous object but any
+ .NET type can be used with FromObject to create JSON.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\LinqToJsonTests.cs" region="LinqToJsonCreateFromObject" title="Creating JSON from an Object" />
+ </content>
+ </section>
+ <relatedTopics>
+ <externalLink>
+ <linkText>LINQ to JSON</linkText>
+ <linkUri>LINQtoJSON.htm</linkUri>
+ <linkTarget>_self</linkTarget>
+ </externalLink>
+
+ <codeEntityReference>Overload:Newtonsoft.Json.Linq.JObject.FromObject</codeEntityReference>
+ </relatedTopics>
+ </developerConceptualDocument>
+</topic>
View
30 Doc/CustomCreationConverter.aml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="CustomCreationConverter" revisionNumber="1">
+ <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!--
+ <summary>
+ <para>Optional summary abstract</para>
+ </summary>
+ -->
+ <introduction>
+ <para>The <codeEntityReference>T:Newtonsoft.Json.Converters.CustomCreationConverter`1</codeEntityReference>
+ is a JsonConverter that provides a way
+ to customize how an object is created during JSON deserialization. Once
+ the object has been created it will then have values populated onto it by
+ the serializer.</para>
+ </introduction>
+ <section>
+ <title>Example</title>
+ <content>
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="CustomCreationConverterObject" title="CustomCreationConverter" />
+ <para>This is an extremely simple example. A more complicated scenario
+ could involve an object factory or service locator which resolves the
+ object at runtime.</para>
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="CustomCreationConverterExample" title="CustomCreationConverter Example" />
+ </content>
+ </section>
+ <relatedTopics>
+ <codeEntityReference>T:Newtonsoft.Json.Converters.CustomCreationConverter`1</codeEntityReference>
+ </relatedTopics>
+ </developerConceptualDocument>
+</topic>
View
99 Doc/CustomCreationConverter.html
@@ -1,99 +0,0 @@
-<html>
-
- <head>
- <title>CustomCreationConverter</title>
- <link href="styles.css" rel="stylesheet" type="text/css" />
- <link href="custom.css" rel="stylesheet" type="text/css" />
- </head>
-
- <body>
-
- <div id="control">
- <span class="productTitle">Json.NET - Quick Starts & API Documentation</span><br />
- <span class="topicTitle">CustomCreationConverter</span></div>
-
- <div id="content">
- <span style="color: DarkGray"> </span>
-
- <p>
- The CustomCreationConverter is a JsonConverter that provides a way to customize how an object is created
- during JSON deserialization.
- Once the object has been created it will then have values populated onto it by the serializer.
- </p>
-
-<div class="overflowpanel"> <div class="code">
-<div style="font-family: Courier New; font-size: 10pt; color: black;">
-<pre style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">interface</span> <span style="color: #2b91af;">IPerson</span></pre>
-<pre style="margin: 0px;">{</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">string</span> FirstName { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">string</span> LastName { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: #2b91af;">DateTime</span> BirthDate { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-<pre style="margin: 0px;">}</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">Employee</span> : <span style="color: #2b91af;">IPerson</span></pre>
-<pre style="margin: 0px;">{</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">string</span> FirstName { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">string</span> LastName { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">public</span> <span style="color: #2b91af;">DateTime</span> BirthDate { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">string</span> Department { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">string</span> JobTitle { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-<pre style="margin: 0px;">}</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">PersonConverter</span> : <span style="color: #2b91af;">CustomCreationConverter</span>&lt;<span style="color: #2b91af;">IPerson</span>&gt;</pre>
-<pre style="margin: 0px;">{</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">override</span> <span style="color: #2b91af;">IPerson</span> Create(<span style="color: #2b91af;">Type</span> objectType)</pre>
-<pre style="margin: 0px;">&nbsp; {</pre>
-<pre style="margin: 0px;">&nbsp; &nbsp; <span style="color: blue;">return</span> <span style="color: blue;">new</span> <span style="color: #2b91af;">Employee</span>();</pre>
-<pre style="margin: 0px;">&nbsp; }</pre>
-<pre style="margin: 0px;">}</pre>
-</div>
-</div></div>
-
-<p>
-This is an extremely simple example. A more complicated scenario could involve an object factory or service locator
- which resolves the object at runtime.
-</p>
-
-<div class="overflowpanel"> <div class="code">
-<div style="font-family: Courier New; font-size: 10pt; color: black;">
-<pre style="margin: 0px;"><span style="color: green;">//[</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; {</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "FirstName": "Maurice",</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "LastName": "Moss",</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "BirthDate": "\/Date(252291661000)\/",</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "Department": "IT",</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "JobTitle": "Support"</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; },</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; {</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "FirstName": "Jen",</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "LastName": "Barber",</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "BirthDate": "\/Date(258771661000)\/",</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "Department": "IT",</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; &nbsp; "JobTitle": "Manager"</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//&nbsp; }</span></pre>
-<pre style="margin: 0px;"><span style="color: green;">//]</span></pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: #2b91af;">List</span>&lt;<span style="color: #2b91af;">IPerson</span>&gt; people = <span style="color: #2b91af;">JsonConvert</span>.DeserializeObject&lt;<span style="color: #2b91af;">List</span>&lt;<span style="color: #2b91af;">IPerson</span>&gt;&gt;(json, <span style="color: blue;">new</span> <span style="color: #2b91af;">PersonConverter</span>());</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: #2b91af;">IPerson</span> person = people[0];</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: #2b91af;">Console</span>.WriteLine(person.GetType());</pre>
-<pre style="margin: 0px;"><span style="color: green;">// Newtonsoft.Json.Tests.Employee</span></pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: #2b91af;">Console</span>.WriteLine(person.FirstName);</pre>
-<pre style="margin: 0px;"><span style="color: green;">// Maurice</span></pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: #2b91af;">Employee</span> employee = (<span style="color: #2b91af;">Employee</span>)person;</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;"><span style="color: #2b91af;">Console</span>.WriteLine(employee.JobTitle);</pre>
-<pre style="margin: 0px;"><span style="color: green;">// Support</span></pre>
-</div>
-</div></div>
-
- <div id="footer"></div>
- </div>
-
- </body>
-
-</html>
View
99 Doc/DatesInJSON.aml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="DatesInJSON" revisionNumber="1">
+ <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!--
+ <summary>
+ <para>Optional summary abstract</para>
+ </summary>
+ -->
+ <introduction>
+ <para>DateTimes in JSON are hard.</para>
+ <para>The problem comes from the <externalLink>
+<linkText>JSON spec</linkText>
+<linkUri>http://www.ietf.org/rfc/rfc4627.txt</linkUri>
+<linkTarget>_blank</linkTarget>
+</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>
+ </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>
+ <title>Dates and Json.NET</title>
+ <content>
+ <!-- Uncomment this to create a sub-section outline
+ <autoOutline /> -->
+ <para>The default format used by Json.NET is the <externalLink>
+<linkText>ISO 8601 standard</linkText>
+<linkUri>http://en.wikipedia.org/wiki/ISO_8601</linkUri>
+<linkTarget>_blank</linkTarget>
+</externalLink>: <codeInline>"2012-03-19T07:22Z"</codeInline>.</para>
+ <para>Prior to Json.NET 4.5 dates were written using the Microsoft
+ format: <codeInline>"\/Date(1198908717056)\/"</codeInline>. If you want to use this format, or
+ you want to maintain compatibility with Microsoft JSON serializers or
+ older versions of Json.NET then change the
+ <codeEntityReference>T:Newtonsoft.Json.DateFormatHandling</codeEntityReference>
+ setting to MicrosoftDateFormat.</para>
+ <para>Json.NET also has the <codeEntityReference>T:Newtonsoft.Json.DateTimeZoneHandling</codeEntityReference>
+ setting. This can be
+ used to convert DateTime's kind when serializing, e.g. set
+ DateTimeZoneHandling to Utc to serialize all DateTimes as UTC dates.</para>
+ </content>
+ </section>
+ <section>
+ <title>DateTime JsonConverters</title>
+ <content>
+ <!-- Uncomment this to create a sub-section outline
+ <autoOutline /> -->
+ <para>With no standard for dates in JSON, the number of possible
+ different formats when interoping with other systems is endless.
+ Fortunately Json.NET has a solution to deal with reading and writing
+ custom dates: JsonConverters. A JsonConverter is used to override how a
+ type is serialized.</para>
+
+<code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\SerializationTests.cs" region="SerializingDatesInJson" title="DateTime JsonConverters Example" />
+
+ <para>Simply pass the JsonConverter you wish to use to the Json.NET
+ serializer.</para>
+ </content>
+ </section>
+ <section>
+ <title>JavaScriptDateTimeConverter</title>
+ <content>
+ <para>The JavaScriptDateTimeConverter class is one of the two DateTime
+ JsonConverters that come with Json.NET. This converter serializes a
+ DateTime as a <externalLink>
+<linkText>JavaScript Date object</linkText>
+<linkUri>http://msdn.microsoft.com/en-us/library/cd9w2te4.aspx</linkUri>
+<linkTarget>_blank</linkTarget>
+</externalLink>: <codeInline>new Date(1234656000000)</codeInline></para>
+ <para>Technically this is invalid JSON according to the spec but all
+ browsers, and some JSON frameworks, including Json.NET, support it.</para>
+ </content>
+ </section>
+ <section>
+ <title>IsoDateTimeConverter</title>
+ <content>
+ <alert class="note">
+ <para>From Json.NET 4.5 and onwards dates are written using the ISO 8601
+ format by default and using this converter is unnecessary.</para>
+</alert>
+ <para>IsoDateTimeConverter seralizes a DateTime to an <externalLink>
+<linkText>ISO 8601</linkText>
+<linkUri>http://en.wikipedia.org/wiki/ISO_8601</linkUri>
+<linkTarget>_blank</linkTarget>
+</externalLink> formatted
+ string: <codeInline>"2009-02-15T00:00:00Z"</codeInline></para>
+ <para>The IsoDateTimeConverter class has a property, DateTimeFormat, to
+ further customize the formatted string.</para>
+ </content>
+ </section>
+ <relatedTopics>
+ <codeEntityReference>T:Newtonsoft.Json.DateFormatHandling</codeEntityReference>
+ <codeEntityReference>T:Newtonsoft.Json.DateTimeZoneHandling</codeEntityReference>
+ <codeEntityReference>T:Newtonsoft.Json.Converters.JavaScriptDateTimeConverter</codeEntityReference>
+ <codeEntityReference>T:Newtonsoft.Json.Converters.IsoDateTimeConverter</codeEntityReference>
+ </relatedTopics>
+ </developerConceptualDocument>
+</topic>
View
101 Doc/DatesInJSON.html
@@ -1,101 +0,0 @@
-<html>
-
- <head>
- <title>Serializing Dates in JSON</title>
- <link href="styles.css" rel="stylesheet" type="text/css" />
- <link href="custom.css" rel="stylesheet" type="text/css" />
- </head>
-
- <body>
-
- <div id="control">
- <span class="productTitle">Json.NET - Quick Starts & API Documentation</span><br />
- <span class="topicTitle">Serializing Dates in JSON</span></div>
-
- <div id="content">
- <span style="color: DarkGray"> </span>
- <p>DateTimes in JSON are hard.</p>
- <p>
- The problem comes from the <a href="http://www.ietf.org/rfc/rfc4627.txt" target="_blank">JSON spec</a> 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.</p>
-<p>The default format used by <a href="http://james.newtonking.com/projects/json-net.aspx" target="_blank">Json.NET</a>
- is the ISO 8601 standard: 2012-03-19T07:22Z. You can read more about it <a href="http://en.wikipedia.org/wiki/ISO_8601" target="_blank">here</a>.</p>
- <p>Prior to Json.NET 4.5 dates were written using the Microsoft format:
- &quot;\/Date(1198908717056)\/&quot;. If you want to use this format, or you want to
- maintain compatibility with Microsoft JSON serializers or older versions of
- Json.NET then change the DateFormatHandling setting to MicrosoftDateFormat.</p>
-
-<h3>DateTime JsonConverters</h3>
-<p>With no standard for dates in JSON, the number of possible different formats when interoping with other systems is endless. Fortunately Json.NET has a solution to deal with reading and writing custom dates: JsonConverters. A JsonConverter is used to override how a type is serialized.</p>
-
-<div class="overflowpanel">
-<div class="code">
-<div style="font-size: 10pt; color: black; font-family: courier new;">
-<pre style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: rgb(43, 145, 175);">LogEntry</span></pre>
-<pre style="margin: 0px;">{</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">string</span> Details { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">public</span> <span style="color: rgb(43, 145, 175);">DateTime</span> LogDate { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</pre>
-<pre style="margin: 0px;">}</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;">[<span style="color: rgb(43, 145, 175);">Test</span>]</pre>
-
-<pre style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">void</span> WriteJsonDates()</pre>
-<pre style="margin: 0px;">{</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: rgb(43, 145, 175);">LogEntry</span> entry = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">LogEntry</span></pre>
-<pre style="margin: 0px;">&nbsp; {</pre>
-
-<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; LogDate = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">DateTime</span>(2009, 2, 15, 0, 0, 0, <span style="color: rgb(43, 145, 175);">DateTimeKind</span>.Utc),</pre>
-<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; Details = <span style="color: rgb(163, 21, 21);">"Application started."</span></pre>
-<pre style="margin: 0px;">&nbsp; };</pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">string</span> defaultJson = <span style="color: rgb(43, 145, 175);">JsonConvert</span>.SerializeObject(entry);</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: green;">// {"Details":"Application started.","LogDate":"\/Date(1234656000000)\/"}</span></pre>
-<pre style="margin: 0px;"></pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">string</span> javascriptJson = <span style="color: rgb(43, 145, 175);">JsonConvert</span>.SerializeObject(entry, <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">JavaScriptDateTimeConverter</span>());</pre>
-
-<pre style="margin: 0px;">&nbsp; <span style="color: green;">// {"Details":"Application started.","LogDate":new Date(1234656000000)}</span></pre>
-<pre style="margin: 0px;">&nbsp;</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: blue;">string</span> isoJson = <span style="color: rgb(43, 145, 175);">JsonConvert</span>.SerializeObject(entry, <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">IsoDateTimeConverter</span>());</pre>
-<pre style="margin: 0px;">&nbsp; <span style="color: green;">// {"Details":"Application started.","LogDate":"2009-02-15T00:00:00Z"}</span></pre>
-
-<pre style="margin: 0px;">}</pre>
-</div>
-</div>
-</div>
-<p>Simply pass the JsonConverter you wish to use to the Json.NET serializer.</p>
-<h4>JavaScriptDateTimeConverter</h4>
-<p>The JavaScriptDateTimeConverter class is one of the two DateTime JsonConverters that come with Json.NET. This converter serializes a DateTime as a <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date" target="_blank">JavaScript Date object</a>.</p>
-<div class="overflowpanel">
-<div class="code">
-<div style="font-size: 10pt; color: black; font-family: courier new;">
-<pre style="margin: 0px;">new Date(1234656000000)</pre>
-
-</div>
-</div>
-</div>
-<p>Technically this is invalid JSON according to the spec but all browsers, and some JSON frameworks including Json.NET, support it. </p>
-<h4>IsoDateTimeConverter</h4>
-<p>IsoDateTimeConverter seralizes a DateTime to an <a href="http://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a> formatted string.
- Note that since Json.NET 4.5 dates are written using the ISO 8601 format by
- default and using this converter is unnecessary.</p>
-<div class="overflowpanel">
-<div class="code">
-<div style="font-size: 10pt; color: black; font-family: courier new;">
-<pre style="margin: 0px;"><span style="color: rgb(163, 21, 21);">"2009-02-15T00:00:00Z"</span></pre>
-
-</div>
-</div>
-</div>
-<p>The IsoDateTimeConverter class has a property, DateTimeFormat, to further customize the formatted string.</p>
-<p>&nbsp;</p>
-<p>One final thing to note is all date values returned by Json.NET are in <a href="http://en.wikipedia.org/wiki/Utc" target="_blank">UTC time</a>.</p>
-
-
- <div id="footer"></div>
- </div>
-
- </body>
-
-</html>
View
133 Doc/Introduction.aml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="Introduction" revisionNumber="1">
+ <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!--
+ <summary>
+ <para>Optional summary abstract</para>
+ </summary>
+ -->
+ <introduction>
+ <para>Json.NET is a popular high-performance JSON framework for .NET</para>
+ </introduction>
+ <!-- Optional procedures followed by optional code example but must have
+ at least one procedure or code example -->
+<section>
+ <title>Benefits and Features</title>
+<content>
+<list class="bullet">
+ <listItem>
+ <para>Flexible JSON serializer for converting between .NET objects and JSON</para>
+ </listItem>
+ <listItem>
+ <para>LINQ to JSON for manually reading and writing JSON </para>
+ </listItem>
+ <listItem>
+ <para>High performance, faster than .NET's built-in JSON serializers</para>
+ </listItem>
+ <listItem>
+ <para>Write indented, easy to read JSON</para>
+ </listItem>
+ <listItem>
+ <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>
+ </listItem>
+
+</list>
+<para>The JSON serializer in Json.NET is a good choice when the JSON you are reading or writing maps closely to a .NET class.</para>
+<para>LINQ to JSON is good for situations where you are only interested in
+getting values from JSON, you don't have a class to serialize or deserialize to,
+or the JSON is radically different from your class and you need to manually read
+and write from your objects.</para>
+</content>
+</section>
+
+<section>
+ <title>Getting Started</title>
+ <content>
+
+<list class="bullet">
+ <listItem><para><externalLink>
+<linkText>Serializing and Deserializing JSON</linkText>
+<linkUri>SerializingJSON.htm</linkUri>
+<linkTarget>_self</linkTarget>
+</externalLink></para></listItem>
+ <listItem><para><externalLink>
+<linkText>LINQ to JSON</linkText>
+<linkUri>LINQtoJSON.htm</linkUri>
+<linkTarget>_self</linkTarget>
+</externalLink></para></listItem>
+</list>
+
+ </content>
+</section>
+<section>
+ <title>History</title>
+ <content><para>Json.NET grew out of projects I was working on in late 2005 involving JavaScript,
+ AJAX and .NET. At the time there were no libraries for working with JavaScript in
+ .NET so I made my own.</para>
+ <para>Starting out as a couple of static methods for escaping JavaScript strings, Json.NET
+ evolved as features were added. To add support for reading JSON a major refactor
+ was required and Json.NET will split into the three major classes it still uses
+ today, JsonReader, JsonWriter and JsonSerializer.</para>
+ <para>Json.NET was first released in June 2006. Since then Json.NET has been downloaded
+ hundreds of thousands of times by developers around the world. It is used in many major open
+ source projects including <externalLink>
+ <linkText>Mono</linkText>
+ <linkUri>http://www.mono-project.com/</linkUri>
+ <linkTarget>_blank</linkTarget>
+ </externalLink>,
+ an open source implementation
+ of the .NET framework; <externalLink>
+ <linkText>RavenDB</linkText>
+ <linkUri>http://ravendb.net/</linkUri>
+ <linkTarget>_blank</linkTarget>
+ </externalLink>,
+ a JSON based documentat database; <externalLink>
+ <linkText>SignalR</linkText>
+ <linkUri>http://signalr.net/</linkUri>
+ <linkTarget>_blank</linkTarget>
+ </externalLink>,
+ an async library for building real-time, multi-user interactive web applications; and <externalLink>
+ <linkText>ASP.NET Web API</linkText>
+ <linkUri>http://www.asp.net/web-api</linkUri>
+ <linkTarget>_blank</linkTarget>
+ </externalLink>,
+ Microsoft's HTTP service framework.</para>
+ <para><externalLink>
+ <linkText>James Newton-King</linkText>
+ <linkUri>http://twitter.com/jamesnk</linkUri>
+ <linkTarget>_blank</linkTarget>
+ </externalLink></para>
+</content>
+</section>
+
+<section>
+ <title>Donate</title>
+ <content><para>Json.NET is a free open source project developed in my own time.</para>
+ <para>I really appreciate your feedback and donations help support Json.NET and its future development.</para></content>
+</section>
+
+ <markup>
+ <p>
+ <a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=james%40newtonking%2ecom&amp;item_name=Supporting%20Json%2eNET&amp;no_shipping=0&amp;no_note=1&amp;tax=0&amp;currency_code=USD&amp;lc=US&amp;bn=PP%2dDonationsBF&amp;charset=UTF%2d8">
+ <img style="border-width:0;" alt="Donate" src="../donate.gif" />
+ </a>
+ </p>
+ </markup>
+ <relatedTopics>
+ <externalLink>
+ <linkText>Serializing and Deserializing JSON</linkText>
+ <linkUri>SerializingJSON.htm</linkUri>
+ <linkTarget>_self</linkTarget>
+ </externalLink>
+ <externalLink>
+ <linkText>LINQ to JSON</linkText>
+ <linkUri>LINQtoJSON.htm</linkUri>
+ <linkTarget>_self</linkTarget>
+ </externalLink>
+ </relatedTopics>
+
+ </developerConceptualDocument>
+</topic>
View
68 Doc/Introduction.html
@@ -1,68 +0,0 @@
-<html>
-<head>
- <title>Introduction</title>
- <link href="styles.css" rel="stylesheet" type="text/css" />
- <link href="custom.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
- <div id="control">
- <span class="productTitle">Json.NET - Quick Starts & API Documentation</span><br />
- <span class="topicTitle">Introduction</span></div>
- <div id="content">
- <span style="color: DarkGray"></span>
- <p>
- Json.NET makes working with JSON formatted data in .NET
- simple. Quickly read and write JSON using LINQ to JSON or serialize
- your .NET objects with a single method call using the JsonSerializer.</p>
- <h3>
- Features</h3>
- <ul>
- <li>Flexible JSON serializer to convert .NET objects to JSON and back again</li>
- <li>LINQ to JSON for reading and writing JSON</li>
- <li>Writes indented, easy to read JSON</li>
- <li>Convert JSON to and from XML</li>
- <li>Supports Silverlight and the Compact Framework</li>
- </ul>
- <p>The JSON serializer is a good choice when the JSON you are reading or writing maps closely
- to a .NET class. The serializer automatically reads and writes JSON for the class.</p>
- <p class="MsoNormal">
- For situations where you are only interested in getting values from JSON, don&#39;t
- have a class to serialize or deserialize to, or the JSON is radically different
- from your class and you need to manually read and write from your objects then
- LINQ to JSON is what you should use. LINQ to JSON allows you to easily read,
- create and modify JSON in .NET.</p>
- <h3>
- History</h3>
- <p>
- Json.NET grew out of projects I was working on in late 2005 involving JavaScript,
- AJAX and .NET. At the time there were no libraries for working with JavaScript in
- .NET so I began to grow my own.</p>
- <p>
- Starting out as a couple of static methods for escaping JavaScript strings, Json.NET
- evolved as features were added. To add support for reading JSON a major refactor
- was required and Json.NET will split into the three major classes it still uses
- today, JsonReader, JsonWriter and JsonSerializer.
- </p>
- <p>
- Json.NET was first released in June 2006. Since then Json.NET has been downloaded
- thousands of times by developers and is used in a number of major projects open
- source projects including <a href="http://www.castleproject.org/monorail/index.html" target="_blank">MonoRail</a>,
- Castle Project's MVC web framework, and <a href="http://www.mono-project.com/" target="_blank">Mono</a>,
- an open source implementation
- of the .NET framework.</p>
- <p>
- <i>~ James Newton-King</i></p>
- <h3>
- Donate</h3>
- <p>
- Json.NET is a free open source project that I have developed in my personal time.</p>
- <p>
- I really appreciate your feedback and support for Json.NET and its future development.</p>
- <p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=james%40newtonking%2ecom&item_name=Supporting%20Json%2eNET&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8" target="_blank">
- <img src="donate.gif" alt="Donate" style="border-width:0;" />
- </a></p>
- <div id="footer">
- </div>
- </div>
-</body>
-</html>
View
454 Doc/JsonNetVsDotNetSerializers.aml
@@ -0,0 +1,454 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="JsonNetVsDotNetSerializers" revisionNumber="1">
+ <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>
+ </introduction>
+ <section>
+ <title>Feature Comparison</title>
+ <content>
+<table>
+ <tableHeader>
+ <row>
+ <entry><para></para></entry>
+ <entry><para>Json.NET</para></entry>
+ <entry><para>DataContractJsonSerializer</para></entry>
+ <entry><para>JavaScriptSerializer</para></entry>
+ </row>
+ </tableHeader>
+ <row>
+ <entry><para>Supports JSON</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports BSON</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports JSON Schema</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports .NET 2.0</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports .NET 3.5</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports .NET 4.0</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports Silverlight</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports Windows Phone</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports WinRT</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Open Source</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>MIT License</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>LINQ to JSON</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Thread Safe</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>XPath-like JSON query syntax</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Indented JSON support</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>
+ <externalLink>
+ <linkText>Efficient dictionary serialization</linkText>
+ <linkUri>http://stackoverflow.com/questions/1207731/how-can-i-deserialize-json-to-a-simple-dictionarystring-string-in-asp-net</linkUri>
+ <linkTarget>_blank</linkTarget>
+ </externalLink>
+ </para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>
+ <externalLink>
+ <linkText>Nonsensical dictionary serialization</linkText>
+ <linkUri>http://stackoverflow.com/questions/4559991/any-way-to-make-datacontractjsonserializer-serialize-dictionaries-properly</linkUri>
+ <linkTarget>_blank</linkTarget>
+ </externalLink>
+ </para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Deserializes IList, IEnumerable, ICollection, IDictionary properties</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Serializes circular references</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports serializing objects by reference</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Deserializes polymorphic properties and collections</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Serializes and deserializes multidimensional arrays</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports including type names with JSON</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Globally customize serialization process</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports excluding null values when serializing</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports SerializationBinder</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Conditional property serialization</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Includes line number information in errors</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Converts XML to JSON and JSON to XML</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>JSON Schema validation</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>JSON Schema generation from .NET types</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Camel case JSON property names</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Non-default constructors support</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Serialization error handling</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports populating an existing object</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Efficiently serializes byte arrays as base64 text</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Handles NaN, Infinity, -Infinity and undefined</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Handles JavaScript constructors</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Serializes .NET 4.0 dynamic objects</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Serializes ISerializable objects</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports serializing enums to their text name</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>JSON recursion limit support</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Attribute property name customization</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Attribute property order customization</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Attribute property required customization</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports ISO8601 dates</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports JavaScript constructor dates</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports Microsoft AJAX dates</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Unquoted property names support</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Raw JSON support</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports reading and writing comments</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Serializes anonymous types</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Deserializes anonymous types</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Opt-in mode serialization</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Opt-out mode serialization</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Field (Serializable) mode serialization</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Efficiently stream reading and writing JSON</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Single or double quote JSON content</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports overriding a type&apos;s serialization</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports OnDeserialized, OnSerializing, OnSerialized and OnDeserializing attributes</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Supports serializing private properties</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>DataMember attribute support</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>MetdataType attribute support</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>DefaultValue attribute support</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Serializes DataSets and DataTables</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>
+ <entry><para>Serailizes Entity Framework</para></entry>
+ <entry><para><markup><img src="../tick.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ <entry><para><markup><img src="../cross.png" /></markup></para></entry>
+ </row>
+ <row>