From a96f4d42481b55db2e97516fa7103a90d450ee14 Mon Sep 17 00:00:00 2001 From: JamesNK Date: Mon, 3 Jan 2011 05:19:57 +0000 Subject: [PATCH] -Upgraded Silverlight project to Silverlight 4 -Included .NET 4 features in Silverlight project --- Build/build.ps1 | 2 +- .../Linq/DynamicTests.cs | 71 ++++++++++++++++++- .../Newtonsoft.Json.Tests.Silverlight.csproj | 12 +++- .../Serialization/DynamicTests.cs | 13 ++-- .../Serialization/JsonSerializerTest.cs | 4 +- .../SerializationErrorHandlingTests.cs | 2 +- Src/Newtonsoft.Json.Tests/SilverlightTests.cs | 4 +- Src/Newtonsoft.Json/Linq/JObject.cs | 4 +- Src/Newtonsoft.Json/Linq/JToken.cs | 6 +- Src/Newtonsoft.Json/Linq/JValue.cs | 15 +--- .../Newtonsoft.Json.Silverlight.csproj | 5 +- .../Serialization/DefaultContractResolver.cs | 10 +-- .../Serialization/JsonDynamicContract.cs | 2 +- .../JsonSerializerInternalReader.cs | 18 +++-- .../JsonSerializerInternalWriter.cs | 6 +- Src/Newtonsoft.Json/Utilities/DynamicProxy.cs | 2 +- .../Utilities/DynamicProxyMetaObject.cs | 2 +- Src/Newtonsoft.Json/Utilities/DynamicUtils.cs | 7 +- 18 files changed, 134 insertions(+), 51 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index 04769f73..1f0cdfab 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -16,7 +16,7 @@ $builds = @( @{Name = "Newtonsoft.Json"; TestsName = "Newtonsoft.Json.Tests"; Constants=""; FinalDir="Net"; NuGetDir = "40"; Framework="net-4.0"}, @{Name = "Newtonsoft.Json.WindowsPhone"; TestsName = $null; Constants="SILVERLIGHT;WINDOWS_PHONE"; FinalDir="WindowsPhone"; NuGetDir = "WP"; Framework="net-4.0"}, - @{Name = "Newtonsoft.Json.Silverlight"; TestsName = "Newtonsoft.Json.Tests.Silverlight"; Constants="SILVERLIGHT"; FinalDir="Silverlight"; NuGetDir = "SL"; Framework="net-2.0"}, + @{Name = "Newtonsoft.Json.Silverlight"; TestsName = "Newtonsoft.Json.Tests.Silverlight"; Constants="SILVERLIGHT"; FinalDir="Silverlight"; NuGetDir = "SL"; Framework="net-4.0"}, @{Name = "Newtonsoft.Json.Net35"; TestsName = "Newtonsoft.Json.Tests.Net35"; Constants="NET35"; FinalDir="Net35"; NuGetDir = "35"; Framework="net-2.0"}, @{Name = "Newtonsoft.Json.Net20"; TestsName = "Newtonsoft.Json.Tests.Net20"; Constants="NET20"; FinalDir="Net20"; NuGetDir = "20"; Framework="net-2.0"} ) diff --git a/Src/Newtonsoft.Json.Tests/Linq/DynamicTests.cs b/Src/Newtonsoft.Json.Tests/Linq/DynamicTests.cs index e592243b..629d6e88 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/DynamicTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/DynamicTests.cs @@ -1,6 +1,7 @@ -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20) using System; using System.Collections.Generic; +using System.Dynamic; using System.Linq; using System.Text; using Newtonsoft.Json.Linq; @@ -177,6 +178,74 @@ namespace Newtonsoft.Json.Tests.Linq T t = d; Assert.AreEqual(value, t); } + + [Test] + public void DynamicSerializerExample() + { + dynamic value = new DynamicDictionary(); + + value.Name = "Arine Admin"; + value.Enabled = true; + value.Roles = new[] {"Admin", "User"}; + + string json = JsonConvert.SerializeObject(value, Formatting.Indented); + // { + // "Name": "Arine Admin", + // "Enabled": true, + // "Roles": [ + // "Admin", + // "User" + // ] + // } + + dynamic newValue = JsonConvert.DeserializeObject(json); + + string role = newValue.Roles[0]; + // Admin + } + + [Test] + public void DynamicLinqExample() + { + JObject oldAndBusted = new JObject(); + oldAndBusted["Name"] = "Arnie Admin"; + oldAndBusted["Enabled"] = true; + oldAndBusted["Roles"] = new JArray(new[] { "Admin", "User" }); + + string oldRole = (string) oldAndBusted["Roles"][0]; + // Admin + + + dynamic newHotness = new JObject(); + newHotness.Name = "Arnie Admin"; + newHotness.Enabled = true; + newHotness.Roles = new JArray(new[] { "Admin", "User" }); + + string newRole = newHotness.Roles[0]; + // Admin + } + + public class DynamicDictionary : DynamicObject + { + private readonly IDictionary _values = new Dictionary(); + + public override IEnumerable GetDynamicMemberNames() + { + return _values.Keys; + } + + public override bool TryGetMember(GetMemberBinder binder, out object result) + { + result = _values[binder.Name]; + return true; + } + + public override bool TrySetMember(SetMemberBinder binder, object value) + { + _values[binder.Name] = value; + return true; + } + } } } #endif \ No newline at end of file diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Silverlight.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Silverlight.csproj index b0a6688f..325ae313 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Silverlight.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Silverlight.csproj @@ -14,7 +14,7 @@ Properties Newtonsoft.Json.Tests.Silverlight Newtonsoft.Json.Tests.Silverlight - v3.0 + v4.0 false @@ -65,9 +65,16 @@ AllRules.ruleset + + True + False ..\Lib\NUnit\Silverlight\nunit.framework.dll + True + + + True True @@ -106,6 +113,7 @@ + @@ -116,6 +124,7 @@ + @@ -243,6 +252,7 @@ {DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D} Newtonsoft.Json.Silverlight + True diff --git a/Src/Newtonsoft.Json.Tests/Serialization/DynamicTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/DynamicTests.cs index 7268ddd4..fd3c1f8e 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/DynamicTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/DynamicTests.cs @@ -1,4 +1,4 @@ -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20) using System; using System.Collections; using System.Collections.Generic; @@ -147,15 +147,17 @@ namespace Newtonsoft.Json.Tests.Serialization string json = JsonConvert.SerializeObject(o, Formatting.Indented, new JsonSerializerSettings { - TypeNameHandling = TypeNameHandling.All + TypeNameHandling = TypeNameHandling.All, + TypeNameAssemblyFormat = FormatterAssemblyStyle.Full }); Console.WriteLine(json); - string dynamicChildObjectTypeName = ReflectionUtils.GetTypeName(typeof(DynamicChildObject), FormatterAssemblyStyle.Simple); + string dynamicChildObjectTypeName = ReflectionUtils.GetTypeName(typeof(DynamicChildObject), FormatterAssemblyStyle.Full); + string expandoObjectTypeName = ReflectionUtils.GetTypeName(typeof(ExpandoObject), FormatterAssemblyStyle.Full); Assert.AreEqual(@"{ - ""$type"": ""System.Dynamic.ExpandoObject, System.Core"", + ""$type"": """ + expandoObjectTypeName + @""", ""Text"": ""Text!"", ""Integer"": 2147483647, ""DynamicChildObject"": { @@ -167,7 +169,8 @@ namespace Newtonsoft.Json.Tests.Serialization dynamic n = JsonConvert.DeserializeObject(json, null, new JsonSerializerSettings { - TypeNameHandling = TypeNameHandling.All + TypeNameHandling = TypeNameHandling.All, + TypeNameAssemblyFormat = FormatterAssemblyStyle.Full }); Assert.IsInstanceOfType(typeof(ExpandoObject), n); diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs index b0918f12..e31d98a9 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs @@ -55,7 +55,7 @@ using System.Text.RegularExpressions; using System.Collections.Specialized; using System.Linq.Expressions; #endif -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System.Dynamic; #endif @@ -3753,7 +3753,7 @@ keyword such as type of business."" }", json); } -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) [Test] public void SerializeExpandoObject() { diff --git a/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs index e6af2f84..70f14947 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs @@ -195,7 +195,7 @@ namespace Newtonsoft.Json.Tests.Serialization Assert.AreEqual(new DateTime(2000, 12, 1, 0, 0, 0, DateTimeKind.Utc), c[2]); Assert.AreEqual(3, errors.Count); -#if !(NET20 || NET35 || SILVERLIGHT) +#if !(NET20 || NET35 || WINDOWS_PHONE) Assert.AreEqual("The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.", errors[0]); #else Assert.AreEqual("The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.", errors[0]); diff --git a/Src/Newtonsoft.Json.Tests/SilverlightTests.cs b/Src/Newtonsoft.Json.Tests/SilverlightTests.cs index e1df7816..e037eed5 100644 --- a/Src/Newtonsoft.Json.Tests/SilverlightTests.cs +++ b/Src/Newtonsoft.Json.Tests/SilverlightTests.cs @@ -13,8 +13,8 @@ namespace Newtonsoft.Json.Tests public void SystemVersion() { Assembly systemAssembly = typeof(Uri).Assembly; - StringAssert.Contains("=2.0.5.0,", systemAssembly.FullName, - "Check we're testing a Silverlight 2.0 assembly"); + StringAssert.Contains("=4.0.0.0,", systemAssembly.FullName, + "Check we're testing a Silverlight 4.0 assembly"); } } #endif diff --git a/Src/Newtonsoft.Json/Linq/JObject.cs b/Src/Newtonsoft.Json/Linq/JObject.cs index 52741bd6..47066457 100644 --- a/Src/Newtonsoft.Json/Linq/JObject.cs +++ b/Src/Newtonsoft.Json/Linq/JObject.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System.Dynamic; using System.Linq.Expressions; #endif @@ -654,7 +654,7 @@ namespace Newtonsoft.Json.Linq #endregion #endif -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) /// /// Returns the responsible for binding operations performed on this object. /// diff --git a/Src/Newtonsoft.Json/Linq/JToken.cs b/Src/Newtonsoft.Json/Linq/JToken.cs index d48e969a..8e63c80b 100644 --- a/Src/Newtonsoft.Json/Linq/JToken.cs +++ b/Src/Newtonsoft.Json/Linq/JToken.cs @@ -25,7 +25,7 @@ using System; using System.Collections.Generic; -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System.Dynamic; using System.Linq.Expressions; #endif @@ -46,7 +46,7 @@ namespace Newtonsoft.Json.Linq #if !SILVERLIGHT , ICloneable #endif -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) , IDynamicMetaObjectProvider #endif { @@ -1276,7 +1276,7 @@ namespace Newtonsoft.Json.Linq return p.Evaluate(this, errorWhenNoMatch); } -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) /// /// Returns the responsible for binding operations performed on this object. /// diff --git a/Src/Newtonsoft.Json/Linq/JValue.cs b/Src/Newtonsoft.Json/Linq/JValue.cs index e8ad67d6..554acd48 100644 --- a/Src/Newtonsoft.Json/Linq/JValue.cs +++ b/Src/Newtonsoft.Json/Linq/JValue.cs @@ -30,7 +30,7 @@ using System.Text; using Newtonsoft.Json.Utilities; using System.Globalization; using System.ComponentModel; -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System.Dynamic; using System.Linq.Expressions; #endif @@ -406,7 +406,7 @@ namespace Newtonsoft.Json.Linq return _value.GetHashCode(); } -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) /// /// Returns the responsible for binding operations performed on this object. /// @@ -437,16 +437,7 @@ namespace Newtonsoft.Json.Linq return ReflectionUtils.IsNullable(binder.Type); } - Type t = binder.Type; - if (ReflectionUtils.IsNullableType(t)) - t = Nullable.GetUnderlyingType(t); - - TypeConverter converter = TypeDescriptor.GetConverter(instance.Value); - if (converter != null && converter.CanConvertTo(t)) - result = converter.ConvertTo(instance.Value, t); - else - result = Convert.ChangeType(instance.Value, t, CultureInfo.InvariantCulture); - + result = ConvertUtils.Convert(instance.Value, CultureInfo.InvariantCulture, binder.Type); return true; } } diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Silverlight.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Silverlight.csproj index b0dfbe60..3bb79fb2 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Silverlight.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Silverlight.csproj @@ -14,7 +14,7 @@ Properties Newtonsoft.Json Newtonsoft.Json.Silverlight - v3.0 + v4.0 false true false @@ -191,7 +191,10 @@ + + + diff --git a/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs b/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs index 141782bb..62c64846 100644 --- a/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs +++ b/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs @@ -27,7 +27,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System.Dynamic; #endif using System.Globalization; @@ -86,8 +86,10 @@ namespace Newtonsoft.Json.Serialization #endif new BinaryConverter(), new KeyValuePairConverter(), -#if !SILVERLIGHT +#if !SILVERLIGHT || WINDOWS_PHONE new XmlNodeConverter(), +#endif +#if !SILVERLIGHT new DataSetConverter(), new DataTableConverter(), #endif @@ -450,7 +452,7 @@ namespace Newtonsoft.Json.Serialization } #endif -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) /// /// Creates a for the given type. /// @@ -515,7 +517,7 @@ namespace Newtonsoft.Json.Serialization return CreateISerializableContract(t); #endif -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) if (typeof(IDynamicMetaObjectProvider).IsAssignableFrom(t)) return CreateDynamicContract(t); #endif diff --git a/Src/Newtonsoft.Json/Serialization/JsonDynamicContract.cs b/Src/Newtonsoft.Json/Serialization/JsonDynamicContract.cs index ade8c8a8..007579e3 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonDynamicContract.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonDynamicContract.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System; using System.Collections.Generic; using System.Reflection; diff --git a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs index 8ca39544..0d2b0837 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs @@ -27,7 +27,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System.Dynamic; #endif using System.Globalization; @@ -406,7 +406,7 @@ namespace Newtonsoft.Json.Serialization } #endif -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) JsonDynamicContract dynamicContract = contract as JsonDynamicContract; if (dynamicContract != null) { @@ -456,7 +456,11 @@ namespace Newtonsoft.Json.Serialization private bool HasDefinedType(Type type) { - return (type != null && type != typeof (object) && !type.IsSubclassOf(typeof(JToken))); + return (type != null && type != typeof (object) && !typeof(JToken).IsAssignableFrom(type) +#if !(NET35 || NET20 || WINDOWS_PHONE) + && type != typeof(IDynamicMetaObjectProvider) +#endif + ); } private object EnsureType(object value, Type targetType) @@ -762,7 +766,7 @@ namespace Newtonsoft.Json.Serialization } #endif -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) private object CreateDynamic(JsonReader reader, JsonDynamicContract contract, string id) { IDynamicMetaObjectProvider newObject = null; @@ -799,9 +803,9 @@ namespace Newtonsoft.Json.Serialization } else { - object value = (JsonReader.IsPrimitiveToken(reader.TokenType)) - ? reader.Value - : CreateObject(reader, typeof(IDynamicMetaObjectProvider), GetContractSafe(typeof(IDynamicMetaObjectProvider), null), null, null); + Type t = (JsonReader.IsPrimitiveToken(reader.TokenType)) ? reader.ValueType : typeof (IDynamicMetaObjectProvider); + + object value = CreateValueNonProperty(reader, t, GetContractSafe(t, null)); newObject.TrySetMember(memberName, value); } diff --git a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs index c9ee6995..706e17ab 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs @@ -27,7 +27,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System.Dynamic; #endif using System.Globalization; @@ -136,7 +136,7 @@ namespace Newtonsoft.Json.Serialization SerializeISerializable(writer, (ISerializable)value, (JsonISerializableContract)valueContract); } #endif -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) else if (valueContract is JsonDynamicContract) { SerializeDynamic(writer, (IDynamicMetaObjectProvider)value, (JsonDynamicContract)valueContract); @@ -474,7 +474,7 @@ namespace Newtonsoft.Json.Serialization } #endif -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) private void SerializeDynamic(JsonWriter writer, IDynamicMetaObjectProvider value, JsonDynamicContract contract) { contract.InvokeOnSerializing(value, Serializer.Context); diff --git a/Src/Newtonsoft.Json/Utilities/DynamicProxy.cs b/Src/Newtonsoft.Json/Utilities/DynamicProxy.cs index 9133bd09..441866aa 100644 --- a/Src/Newtonsoft.Json/Utilities/DynamicProxy.cs +++ b/Src/Newtonsoft.Json/Utilities/DynamicProxy.cs @@ -1,4 +1,4 @@ -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System; using System.Collections.Generic; using System.Dynamic; diff --git a/Src/Newtonsoft.Json/Utilities/DynamicProxyMetaObject.cs b/Src/Newtonsoft.Json/Utilities/DynamicProxyMetaObject.cs index 98111989..347474a1 100644 --- a/Src/Newtonsoft.Json/Utilities/DynamicProxyMetaObject.cs +++ b/Src/Newtonsoft.Json/Utilities/DynamicProxyMetaObject.cs @@ -1,4 +1,4 @@ -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System; using System.Collections.Generic; using System.Dynamic; diff --git a/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs b/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs index 75b9ac3c..92e338ed 100644 --- a/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs @@ -1,4 +1,4 @@ -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20 || WINDOWS_PHONE) using System; using System.Collections.Generic; using System.Dynamic; @@ -8,6 +8,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Globalization; +using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json.Utilities { @@ -70,10 +71,10 @@ namespace Newtonsoft.Json.Utilities Type csharpArgumentInfoTypeEnumerableType = typeof(IEnumerable<>).MakeGenericType(csharpArgumentInfoType); MethodInfo getMemberMethod = binderType.GetMethod("GetMember", BindingFlags.Public | BindingFlags.Static, null, new[] { csharpBinderFlagsType, typeof(string), typeof(Type), csharpArgumentInfoTypeEnumerableType }, null); - _getMemberCall = DynamicReflectionDelegateFactory.Instance.CreateMethodCall(getMemberMethod); + _getMemberCall = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(getMemberMethod); MethodInfo setMemberMethod = binderType.GetMethod("SetMember", BindingFlags.Public | BindingFlags.Static, null, new[] { csharpBinderFlagsType, typeof(string), typeof(Type), csharpArgumentInfoTypeEnumerableType }, null); - _setMemberCall = DynamicReflectionDelegateFactory.Instance.CreateMethodCall(setMemberMethod); + _setMemberCall = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(setMemberMethod); } public static CallSiteBinder GetMember(string name, Type context)