From 7127b1a070837251243b4ed3fe55c2367ac1224f Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 11 Mar 2013 20:26:25 +1300 Subject: [PATCH] -Fixed WinRT --- Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs | 2 ++ .../Serialization/JsonSerializerTest.cs | 2 +- Src/Newtonsoft.Json/Linq/JValue.cs | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs index ba7b567a..d1a08f81 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs @@ -398,6 +398,7 @@ namespace Newtonsoft.Json.Tests.Linq } #endif +#if !NETFX_CORE [Test] public void ConvertsToBoolean() { @@ -537,5 +538,6 @@ namespace Newtonsoft.Json.Tests.Linq Assert.AreEqual(TypeCode.Object, v.GetTypeCode()); } +#endif } } \ No newline at end of file diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs index 952b74b7..018794db 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs @@ -4904,7 +4904,7 @@ To fix this error either change the environment to be fully trusted, change the JsonConvert.DeserializeObject(json); } -#if !NET20 +#if !(NET20 || SILVERLIGHT) [DataContract] public class BaseDataContract { diff --git a/Src/Newtonsoft.Json/Linq/JValue.cs b/Src/Newtonsoft.Json/Linq/JValue.cs index 60d3b32d..00b82ffa 100644 --- a/Src/Newtonsoft.Json/Linq/JValue.cs +++ b/Src/Newtonsoft.Json/Linq/JValue.cs @@ -37,7 +37,10 @@ namespace Newtonsoft.Json.Linq /// /// Represents a value in JSON (string, integer, date, etc). /// - public class JValue : JToken, IEquatable, IFormattable, IComparable, IComparable, IConvertible + public class JValue : JToken, IEquatable, IFormattable, IComparable, IComparable +#if !(NETFX_CORE) + , IConvertible +#endif { private JTokenType _valueType; private object _value; @@ -831,6 +834,7 @@ namespace Newtonsoft.Json.Linq return Compare(_valueType, _value, obj._value); } +#if !(NETFX_CORE) TypeCode IConvertible.GetTypeCode() { if (_value == null) @@ -918,5 +922,6 @@ namespace Newtonsoft.Json.Linq { return Convert.ChangeType(_value, conversionType, provider); } +#endif } } \ No newline at end of file