From 7cc5d306d14b10faec2fc0902a25522e747830f5 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Tue, 12 Feb 2013 01:51:44 -0800 Subject: [PATCH] -patch signatures in DefaultContractResolver to use arrays --- .../Serialization/DefaultContractResolver.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs b/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs index d1a3d8cb..e52245f8 100644 --- a/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs +++ b/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs @@ -550,11 +550,11 @@ namespace Newtonsoft.Json.Serialization if (t.BaseType() != null) ResolveCallbackMethods(contract, t.BaseType()); - MethodInfo onSerializing; - MethodInfo onSerialized; - MethodInfo onDeserializing; - MethodInfo onDeserialized; - MethodInfo onError; + List onSerializing; + List onSerialized; + List onDeserializing; + List onDeserialized; + List onError; GetCallbackMethodsForType(t, out onSerializing, out onSerialized, out onDeserializing, out onDeserialized, out onError); @@ -562,34 +562,34 @@ namespace Newtonsoft.Json.Serialization { #if NETFX_CORE if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>))) - contract.OnSerializing = onSerializing; + contract.OnSerializingMethods = onSerializing; #else - contract.OnSerializing = onSerializing; + contract.OnSerializingMethods = onSerializing; #endif } if (onSerialized != null) - contract.OnSerialized = onSerialized; + contract.OnSerializedMethods = onSerialized; if (onDeserializing != null) - contract.OnDeserializing = onDeserializing; + contract.OnDeserializingMethods = onDeserializing; if (onDeserialized != null) { // ConcurrentDictionary throws an error here so don't use its OnDeserialized - http://json.codeplex.com/discussions/257093 #if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE) if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>))) - contract.OnDeserialized = onDeserialized; + contract.OnDeserializedMethods = onDeserialized; #else - contract.OnDeserialized = onDeserialized; + contract.OnDeserializedMethods = onDeserialized; #endif } if (onError != null) - contract.OnError = onError; + contract.OnErrorMethods = onError; } - private void GetCallbackMethodsForType(Type type, out MethodInfo onSerializing, out MethodInfo onSerialized, out MethodInfo onDeserializing, out MethodInfo onDeserialized, out MethodInfo onError) + private void GetCallbackMethodsForType(Type type, out List onSerializing, out List onSerialized, out List onDeserializing, out List onDeserialized, out List onError) { onSerializing = null; onSerialized = null;