From 10aee582bc93901aeef160b0bdd82be153f5f188 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 19 Mar 2012 21:17:12 +1300 Subject: [PATCH] -Various Metro fixes --- Build/build.ps1 | 2 +- Src/Newtonsoft.Json/Properties/AssemblyInfo.cs | 3 +++ Src/Newtonsoft.Json/SerializationBinder.cs | 8 +++++++- Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs | 4 ++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index a5ef4e89..049231ee 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -119,7 +119,7 @@ task Package -depends Build { 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 /XF *.suo *.user + robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD .svn bin obj TestResults AppPackage /XF *.suo *.user *.pri 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 diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index a399274c..ba840dea 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -38,6 +38,9 @@ using System.Security; [assembly: AssemblyTitle("Json.NET Silverlight")] #elif PocketPC [assembly: AssemblyTitle("Json.NET Compact")] +#elif NETFX_CORE +[assembly: AssemblyTitle("Json.NET Metro")] +[assembly: AllowPartiallyTrustedCallers] #elif NET20 [assembly: AssemblyTitle("Json.NET .NET 2.0")] [assembly: AllowPartiallyTrustedCallers] diff --git a/Src/Newtonsoft.Json/SerializationBinder.cs b/Src/Newtonsoft.Json/SerializationBinder.cs index 760068c7..2f79df4d 100644 --- a/Src/Newtonsoft.Json/SerializationBinder.cs +++ b/Src/Newtonsoft.Json/SerializationBinder.cs @@ -14,9 +14,15 @@ namespace Newtonsoft.Json /// /// Specifies the name of the serialized object. /// Specifies the name of the serialized object - /// + /// The type of the object the formatter creates a new instance of. public abstract Type BindToType(string assemblyName, string typeName); + /// + /// When overridden in a derived class, controls the binding of a serialized object to a type. + /// + /// The type of the object the formatter creates a new instance of. + /// Specifies the name of the serialized object. + /// Specifies the name of the serialized object. public virtual void BindToName(Type serializedType, out string assemblyName, out string typeName) { assemblyName = null; diff --git a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs index 93acf1b0..f3fea9cf 100644 --- a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs +++ b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs @@ -18,14 +18,14 @@ namespace Newtonsoft.Json.Utilities new IDictionaryEnumerator GetEnumerator(); } - public interface IDictionaryEnumerator : IEnumerator + internal interface IDictionaryEnumerator : IEnumerator { DictionaryEntry Entry { get; } object Key { get; } object Value { get; } } - public struct DictionaryEntry + internal struct DictionaryEntry { private readonly object _key; private readonly object _value;