-Fixed build

This commit is contained in:
James Newton-King
2013-04-01 13:04:37 +13:00
parent b5e7005735
commit 8e14d1c66c
8 changed files with 20 additions and 3 deletions
@@ -64,6 +64,7 @@ namespace Newtonsoft.Json.Tests
Assert.IsTrue(ms.CanRead);
}
#if !(PORTABLE || NETFX_CORE)
[Test]
public void WriteIConvertable()
{
@@ -73,6 +74,7 @@ namespace Newtonsoft.Json.Tests
Assert.AreEqual("1", sw.ToString());
}
#endif
[Test]
public void ValueFormatting()
@@ -1272,6 +1274,7 @@ _____'propertyName': NaN
}
}
#if !(PORTABLE || NETFX_CORE)
public struct ConvertibleInt : IConvertible
{
private readonly int _value;
@@ -1369,4 +1372,5 @@ _____'propertyName': NaN
throw new NotImplementedException();
}
}
#endif
}
@@ -75,4 +75,4 @@ using System.Security;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")]
[assembly: AssemblyFileVersion("5.0.1.15931")]
[assembly: AssemblyFileVersion("5.0.1.16001")]
@@ -5762,6 +5762,7 @@ To fix this error either change the environment to be fully trusted, change the
});
}
#if !(PORTABLE || NETFX_CORE)
public class ConvertableIntTestClass
{
public ConvertibleInt Integer { get; set; }
@@ -5801,6 +5802,7 @@ To fix this error either change the environment to be fully trusted, change the
"Error converting value 1 to type 'Newtonsoft.Json.Tests.ConvertibleInt'. Path 'Integer', line 2, position 15.",
() => JsonConvert.DeserializeObject<ConvertableIntTestClass>(json));
}
#endif
[Test]
public void SerializeNullableWidgetStruct()
+2
View File
@@ -687,11 +687,13 @@ namespace Newtonsoft.Json
if (typeCode != PrimitiveTypeCode.Empty && typeCode != PrimitiveTypeCode.Object)
return true;
#if !(PORTABLE || NETFX_CORE)
if (typeof(IConvertible).IsAssignableFrom(t)
|| (ReflectionUtils.IsNullableType(t) && typeof(IConvertible).IsAssignableFrom(Nullable.GetUnderlyingType(t))))
{
return !typeof(JToken).IsAssignableFrom(t);
}
#endif
return false;
}
@@ -90,6 +90,6 @@ using System.Security;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")]
[assembly: AssemblyFileVersion("5.0.1.15931")]
[assembly: AssemblyFileVersion("5.0.1.16001")]
[assembly: CLSCompliant(true)]
@@ -443,7 +443,9 @@ namespace Newtonsoft.Json.Schema
case PrimitiveTypeCode.UInt32:
case PrimitiveTypeCode.Int64:
case PrimitiveTypeCode.UInt64:
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
case PrimitiveTypeCode.BigInteger:
#endif
return schemaType | JsonSchemaType.Integer;
case PrimitiveTypeCode.Single:
case PrimitiveTypeCode.Double:
@@ -451,7 +453,9 @@ namespace Newtonsoft.Json.Schema
return schemaType | JsonSchemaType.Float;
// convert to string?
case PrimitiveTypeCode.DateTime:
#if !NET20
case PrimitiveTypeCode.DateTimeOffset:
#endif
return schemaType | JsonSchemaType.String;
case PrimitiveTypeCode.String:
case PrimitiveTypeCode.Uri:
@@ -25,7 +25,6 @@
using System;
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
using System.Globalization;
using System.Numerics;
#endif
using Newtonsoft.Json.Utilities;
@@ -25,7 +25,9 @@
using System;
using System.Collections.Generic;
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
using System.Numerics;
#endif
using System.Reflection;
using System.Collections;
using System.Globalization;
@@ -981,12 +983,16 @@ namespace Newtonsoft.Json.Utilities
return 0m;
case PrimitiveTypeCode.DateTime:
return new DateTime();
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
case PrimitiveTypeCode.BigInteger:
return new BigInteger();
#endif
case PrimitiveTypeCode.Guid:
return new Guid();
#if !NET20
case PrimitiveTypeCode.DateTimeOffset:
return new DateTimeOffset();
#endif
}
if (IsNullable(type))