-Added ReflectionDelegateFactory, DynamicReflectionDelegateFactory and LateBoundDelegateFactory to support switching between dynamic and late bound reflection for medium trust environments
-Added WriteObjectId to BsonWriter -Added BsonObjectId and BsonObjectIdConverter classes -Added KeyValuePairConverter -Added DynamicCodeGeneration flag to DefaultContractResolver -Changed JsonConverter.ReadJson to add an extra parameter: currentValue
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
private readonly Type _genericCollectionDefinitionType;
|
||||
private Type _genericWrapperType;
|
||||
private MethodCaller<object> _genericWrapperCreator;
|
||||
private MethodCall<object> _genericWrapperCreator;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JsonDictionaryContract"/> class.
|
||||
@@ -81,11 +81,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
_genericWrapperType = ReflectionUtils.MakeGenericType(typeof(DictionaryWrapper<,>), DictionaryKeyType, DictionaryValueType);
|
||||
|
||||
ConstructorInfo genericWrapperConstructor = _genericWrapperType.GetConstructor(new[] { _genericCollectionDefinitionType });
|
||||
#if !PocketPC && !SILVERLIGHT
|
||||
_genericWrapperCreator = LateBoundDelegateFactory.CreateMethodCall(genericWrapperConstructor);
|
||||
#else
|
||||
_genericWrapperCreator = (target, args) => genericWrapperConstructor.Invoke(new[] { args[0] });
|
||||
#endif
|
||||
_genericWrapperCreator = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall(genericWrapperConstructor);
|
||||
}
|
||||
|
||||
return (IWrappedDictionary)_genericWrapperCreator(null, dictionary);
|
||||
|
||||
Reference in New Issue
Block a user