-Fixed build

-Removed unused code
This commit is contained in:
James Newton-King
2013-04-06 15:19:33 +13:00
parent 032bf82e0a
commit 695bb8368f
45 changed files with 755 additions and 574 deletions
@@ -83,7 +83,7 @@ namespace Newtonsoft.Json.Serialization
{
CollectionItemType = ReflectionUtils.GetCollectionItemType(UnderlyingType);
IsReadOnlyOrFixedSize = true;
_genericCollectionDefinitionType = ReflectionUtils.MakeGenericType(typeof (List<>), CollectionItemType);
_genericCollectionDefinitionType = typeof(List<>).MakeGenericType(CollectionItemType);
canDeserialize = true;
IsMultidimensionalArray = (UnderlyingType.IsArray && UnderlyingType.GetArrayRank() > 1);
@@ -108,11 +108,11 @@ namespace Newtonsoft.Json.Serialization
if (ReflectionUtils.IsGenericDefinition(underlyingType, typeof(ICollection<>))
|| ReflectionUtils.IsGenericDefinition(underlyingType, typeof(IList<>)))
CreatedType = ReflectionUtils.MakeGenericType(typeof(List<>), CollectionItemType);
CreatedType = typeof(List<>).MakeGenericType(CollectionItemType);
#if !(NET20 || NET35 || PORTABLE40)
if (ReflectionUtils.IsGenericDefinition(underlyingType, typeof(ISet<>)))
CreatedType = ReflectionUtils.MakeGenericType(typeof(HashSet<>), CollectionItemType);
CreatedType = typeof(HashSet<>).MakeGenericType(CollectionItemType);
#endif
ParametrizedConstructor = CollectionUtils.ResolveEnumableCollectionConstructor(underlyingType, CollectionItemType);
@@ -126,9 +126,9 @@ namespace Newtonsoft.Json.Serialization
if (ReflectionUtils.IsGenericDefinition(underlyingType, typeof (IReadOnlyCollection<>))
|| ReflectionUtils.IsGenericDefinition(underlyingType, typeof (IReadOnlyList<>)))
CreatedType = ReflectionUtils.MakeGenericType(typeof(ReadOnlyCollection<>), CollectionItemType);
CreatedType = typeof(ReadOnlyCollection<>).MakeGenericType(CollectionItemType);
_genericCollectionDefinitionType = ReflectionUtils.MakeGenericType(typeof(List<>), CollectionItemType);
_genericCollectionDefinitionType = typeof(List<>).MakeGenericType(CollectionItemType);
ParametrizedConstructor = CollectionUtils.ResolveEnumableCollectionConstructor(CreatedType, CollectionItemType);
IsReadOnlyOrFixedSize = true;
canDeserialize = (ParametrizedConstructor != null);
@@ -139,7 +139,7 @@ namespace Newtonsoft.Json.Serialization
CollectionItemType = tempCollectionType.GetGenericArguments()[0];
if (ReflectionUtils.IsGenericDefinition(UnderlyingType, typeof(IEnumerable<>)))
CreatedType = ReflectionUtils.MakeGenericType(typeof(List<>), CollectionItemType);
CreatedType = typeof(List<>).MakeGenericType(CollectionItemType);
ParametrizedConstructor = CollectionUtils.ResolveEnumableCollectionConstructor(underlyingType, CollectionItemType);
@@ -153,7 +153,7 @@ namespace Newtonsoft.Json.Serialization
}
else
{
_genericCollectionDefinitionType = ReflectionUtils.MakeGenericType(typeof(List<>), CollectionItemType);
_genericCollectionDefinitionType = typeof(List<>).MakeGenericType(CollectionItemType);
IsReadOnlyOrFixedSize = true;
ShouldCreateWrapper = true;
@@ -188,13 +188,13 @@ namespace Newtonsoft.Json.Serialization
{
if (_genericWrapperCreator == null)
{
_genericWrapperType = ReflectionUtils.MakeGenericType(typeof (CollectionWrapper<>), CollectionItemType);
_genericWrapperType = typeof(CollectionWrapper<>).MakeGenericType(CollectionItemType);
Type constructorArgument;
if (ReflectionUtils.InheritsGenericDefinition(_genericCollectionDefinitionType, typeof(List<>))
|| _genericCollectionDefinitionType.GetGenericTypeDefinition() == typeof(IEnumerable<>))
constructorArgument = ReflectionUtils.MakeGenericType(typeof(ICollection<>), CollectionItemType);
constructorArgument = typeof(ICollection<>).MakeGenericType(CollectionItemType);
else
constructorArgument = _genericCollectionDefinitionType;
@@ -211,7 +211,7 @@ namespace Newtonsoft.Json.Serialization
{
// multidimensional array will also have array instances in it
Type collectionItemType = (IsMultidimensionalArray) ? typeof (object) : CollectionItemType;
Type temporaryListType = ReflectionUtils.MakeGenericType(typeof(List<>), collectionItemType);
Type temporaryListType = typeof(List<>).MakeGenericType(collectionItemType);
_genericTemporaryCollectionCreator = JsonTypeReflector.ReflectionDelegateFactory.CreateDefaultConstructor<object>(temporaryListType);
}