diff --git a/Src/Newtonsoft.Json.Silverlight.sln b/Src/Newtonsoft.Json.Silverlight.sln deleted file mode 100644 index 75720f1f..00000000 --- a/Src/Newtonsoft.Json.Silverlight.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{F69285DD-24FB-4A60-AE8B-4C2744285D0F}" - ProjectSection(SolutionItems) = preProject - Lib\NUnit\Silverlight\nunit.framework.dll = Lib\NUnit\Silverlight\nunit.framework.dll - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Newtonsoft.Json.Silverlight", "Newtonsoft.Json\Newtonsoft.Json.Silverlight.csproj", "{DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Newtonsoft.Json.Tests.Silverlight", "Newtonsoft.Json.Tests\Newtonsoft.Json.Tests.Silverlight.csproj", "{0D8C3C2E-62C6-4C93-9377-6F74DD6BFD93}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D}.Release|Any CPU.Build.0 = Release|Any CPU - {0D8C3C2E-62C6-4C93-9377-6F74DD6BFD93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D8C3C2E-62C6-4C93-9377-6F74DD6BFD93}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D8C3C2E-62C6-4C93-9377-6F74DD6BFD93}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D8C3C2E-62C6-4C93-9377-6F74DD6BFD93}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs b/Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs index e30b0467..5db43112 100644 --- a/Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs +++ b/Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; using System.Globalization; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -1428,7 +1428,7 @@ namespace Newtonsoft.Json.Tests.Bson } } -#if !(WINDOWS_PHONE || SILVERLIGHT || NET20 || NET35 || NETFX_CORE) +#if !(NET20 || NET35 || NETFX_CORE) public void Utf8Text() { string badText = System.IO.File.ReadAllText(@"PoisonText.txt"); @@ -1447,7 +1447,7 @@ namespace Newtonsoft.Json.Tests.Bson } #endif -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) public class BigIntegerTestClass { public BigInteger Blah { get; set; } diff --git a/Src/Newtonsoft.Json.Tests/Bson/BsonWriterTests.cs b/Src/Newtonsoft.Json.Tests/Bson/BsonWriterTests.cs index c6ed4cab..422e7247 100644 --- a/Src/Newtonsoft.Json.Tests/Bson/BsonWriterTests.cs +++ b/Src/Newtonsoft.Json.Tests/Bson/BsonWriterTests.cs @@ -25,7 +25,7 @@ using System; using System.Collections.Generic; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -747,7 +747,7 @@ namespace Newtonsoft.Json.Tests.Bson //} } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) [Test] public void WriteBigInteger() { diff --git a/Src/Newtonsoft.Json.Tests/Converters/BinaryConverterTests.cs b/Src/Newtonsoft.Json.Tests/Converters/BinaryConverterTests.cs index 759a503d..34e24ba5 100644 --- a/Src/Newtonsoft.Json.Tests/Converters/BinaryConverterTests.cs +++ b/Src/Newtonsoft.Json.Tests/Converters/BinaryConverterTests.cs @@ -25,10 +25,10 @@ using System; using System.Collections.Generic; -#if !SILVERLIGHT && !NET20 && !NETFX_CORE +#if !NET20 && !NETFX_CORE using System.Data.Linq; #endif -#if !(SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) using System.Data.SqlTypes; #endif using System.Text; @@ -55,7 +55,7 @@ namespace Newtonsoft.Json.Tests.Converters public byte[] NullByteArray { get; set; } } -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void DeserializeBinaryClass() { @@ -121,7 +121,7 @@ namespace Newtonsoft.Json.Tests.Converters }", json); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) public class SqlBinaryClass { public SqlBinary SqlBinary { get; set; } diff --git a/Src/Newtonsoft.Json.Tests/Converters/DataSetConverterTests.cs b/Src/Newtonsoft.Json.Tests/Converters/DataSetConverterTests.cs index a46753e9..cd79de50 100644 --- a/Src/Newtonsoft.Json.Tests/Converters/DataSetConverterTests.cs +++ b/Src/Newtonsoft.Json.Tests/Converters/DataSetConverterTests.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) using System; using Newtonsoft.Json.Converters; #if !NETFX_CORE diff --git a/Src/Newtonsoft.Json.Tests/Converters/DataTableConverterTests.cs b/Src/Newtonsoft.Json.Tests/Converters/DataTableConverterTests.cs index 45c31b4f..2b79e7f1 100644 --- a/Src/Newtonsoft.Json.Tests/Converters/DataTableConverterTests.cs +++ b/Src/Newtonsoft.Json.Tests/Converters/DataTableConverterTests.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) using System; using System.Collections.Generic; #if !NETFX_CORE diff --git a/Src/Newtonsoft.Json.Tests/Converters/ExpandoObjectConverterTests.cs b/Src/Newtonsoft.Json.Tests/Converters/ExpandoObjectConverterTests.cs index 0984a0cb..6f1cc88b 100644 --- a/Src/Newtonsoft.Json.Tests/Converters/ExpandoObjectConverterTests.cs +++ b/Src/Newtonsoft.Json.Tests/Converters/ExpandoObjectConverterTests.cs @@ -27,10 +27,10 @@ using System; using System.Collections.Generic; -#if !SILVERLIGHT && !NET20 && !NETFX_CORE +#if !NET20 && !NETFX_CORE using System.Data.Linq; #endif -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE using System.Data.SqlTypes; #endif using System.Dynamic; diff --git a/Src/Newtonsoft.Json.Tests/Converters/IsoDateTimeConverterTests.cs b/Src/Newtonsoft.Json.Tests/Converters/IsoDateTimeConverterTests.cs index 606aa8f2..47f611f4 100644 --- a/Src/Newtonsoft.Json.Tests/Converters/IsoDateTimeConverterTests.cs +++ b/Src/Newtonsoft.Json.Tests/Converters/IsoDateTimeConverterTests.cs @@ -122,7 +122,7 @@ namespace Newtonsoft.Json.Tests.Converters Assert.AreEqual(2006, d.Year); } -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE [Test] public void SerializeFormattedDateTimeNewZealandCulture() { diff --git a/Src/Newtonsoft.Json.Tests/Converters/RegexConverterTests.cs b/Src/Newtonsoft.Json.Tests/Converters/RegexConverterTests.cs index ec4682f3..116cef03 100644 --- a/Src/Newtonsoft.Json.Tests/Converters/RegexConverterTests.cs +++ b/Src/Newtonsoft.Json.Tests/Converters/RegexConverterTests.cs @@ -25,10 +25,10 @@ using System; using System.Collections.Generic; -#if !SILVERLIGHT && !NET20 && !NETFX_CORE +#if !NET20 && !NETFX_CORE using System.Data.Linq; #endif -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE using System.Data.SqlTypes; #endif using System.IO; diff --git a/Src/Newtonsoft.Json.Tests/Converters/XmlNodeConverterTest.cs b/Src/Newtonsoft.Json.Tests/Converters/XmlNodeConverterTest.cs index 614e444d..4db6eeed 100644 --- a/Src/Newtonsoft.Json.Tests/Converters/XmlNodeConverterTest.cs +++ b/Src/Newtonsoft.Json.Tests/Converters/XmlNodeConverterTest.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) using System; using System.Collections.Generic; using Newtonsoft.Json.Tests.Serialization; @@ -1879,7 +1879,7 @@ namespace Newtonsoft.Json.Tests.Converters Assert.AreEqual(@"{""root"":{""@xmlns"":""http://www.example.com/ns"",""a"":null,""bns:b"":{""@xmlns:bns"":""http://www.example.com/ns""},""c"":null}}", json1); #endif -#if !(SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) var xml1 = new XmlDocument(); xml1.LoadXml(xmlString); diff --git a/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs b/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs index 89e92b85..fa08bf0b 100644 --- a/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs +++ b/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs @@ -28,7 +28,7 @@ using System.Collections.Generic; using System.IO; using System.Runtime.Serialization; using System.Text; -#if !(NET20 || NET35 || SILVERLIGHT) +#if !(NET20 || NET35) using System.Threading.Tasks; #endif using System.Xml; @@ -873,7 +873,7 @@ now brown cow?", '"', true); return (T)converter.ReadJson(reader, typeof(T), null, null); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) [Test] public void Async() { diff --git a/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs b/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs index af8f9f6a..e29cd1d5 100644 --- a/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs +++ b/Src/Newtonsoft.Json.Tests/JsonTextReaderTest.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; using System.Globalization; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -832,7 +832,7 @@ Parameter name: reader", } } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) [Test] public void ReadInt64Overflow() { diff --git a/Src/Newtonsoft.Json.Tests/JsonValidatingReaderTests.cs b/Src/Newtonsoft.Json.Tests/JsonValidatingReaderTests.cs index 637ff8a5..5bcf2e00 100644 --- a/Src/Newtonsoft.Json.Tests/JsonValidatingReaderTests.cs +++ b/Src/Newtonsoft.Json.Tests/JsonValidatingReaderTests.cs @@ -29,7 +29,7 @@ using System.IO; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -352,7 +352,7 @@ namespace Newtonsoft.Json.Tests Assert.IsNotNull(validationEventArgs); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) [Test] public void IntegerGreaterThanMaximumValue_BigInteger() { @@ -606,7 +606,7 @@ namespace Newtonsoft.Json.Tests Assert.IsNotNull(validationEventArgs); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) [Test] public void BigIntegerDivisibleBy_Success() { diff --git a/Src/Newtonsoft.Json.Tests/Linq/ComponentModel/BindingTests.cs b/Src/Newtonsoft.Json.Tests/Linq/ComponentModel/BindingTests.cs index a05efac8..957e1df6 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/ComponentModel/BindingTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/ComponentModel/BindingTests.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) using NUnit.Framework; using System.Web.UI; using Newtonsoft.Json.Linq; diff --git a/Src/Newtonsoft.Json.Tests/Linq/ComponentModel/JPropertyDescriptorTests.cs b/Src/Newtonsoft.Json.Tests/Linq/ComponentModel/JPropertyDescriptorTests.cs index a9c4643a..fc8dc557 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/ComponentModel/JPropertyDescriptorTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/ComponentModel/JPropertyDescriptorTests.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) using NUnit.Framework; using Newtonsoft.Json.Linq; diff --git a/Src/Newtonsoft.Json.Tests/Linq/DynamicTests.cs b/Src/Newtonsoft.Json.Tests/Linq/DynamicTests.cs index 13e55202..1a62c976 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/DynamicTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/DynamicTests.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Dynamic; using System.Linq; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -178,7 +178,7 @@ namespace Newtonsoft.Json.Tests.Linq new JProperty("Uri", new Uri("http://json.codeplex.com/")), new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")), new JProperty("TimeSpan", TimeSpan.FromDays(1)) -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) , new JProperty("BigInteger", BigInteger.Parse("1")) #endif ); @@ -211,7 +211,7 @@ namespace Newtonsoft.Json.Tests.Linq Assert.IsTrue(d.Decimal == 1.1m); Assert.IsTrue(d.Decimal != 1.0f); Assert.IsTrue(d.Decimal != 1.0d); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) Assert.IsTrue(d.Decimal > new BigInteger(0)); #endif @@ -227,11 +227,11 @@ namespace Newtonsoft.Json.Tests.Linq Assert.IsTrue(d.Float == 1.1m); Assert.IsTrue(d.Float != 1.0f); Assert.IsTrue(d.Float != 1.0d); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) Assert.IsTrue(d.Float > new BigInteger(0)); #endif -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) Assert.IsTrue(d.BigInteger == d.BigInteger); Assert.IsTrue(d.BigInteger > 0); Assert.IsTrue(d.BigInteger > 0.0m); @@ -287,7 +287,7 @@ namespace Newtonsoft.Json.Tests.Linq new JProperty("Uri", new Uri("http://json.codeplex.com/")), new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")), new JProperty("TimeSpan", TimeSpan.FromDays(1)) -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) , new JProperty("BigInteger", new BigInteger(100)) #endif ); @@ -366,7 +366,7 @@ namespace Newtonsoft.Json.Tests.Linq r += 2; Assert.AreEqual(null, r.Value); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) r = d.BigInteger + null; Assert.AreEqual(null, r.Value); r += 2; @@ -445,7 +445,7 @@ namespace Newtonsoft.Json.Tests.Linq r -= 2; Assert.AreEqual(null, r.Value); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) r = d.BigInteger - null; Assert.AreEqual(null, r.Value); r -= 2; @@ -519,7 +519,7 @@ namespace Newtonsoft.Json.Tests.Linq r *= 2; Assert.AreEqual(null, r.Value); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) r = d.BigInteger * 1.1d; Assert.AreEqual(100m, (decimal)r); r *= 2; @@ -593,7 +593,7 @@ namespace Newtonsoft.Json.Tests.Linq r /= 2; Assert.AreEqual(null, r.Value); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) r = d.BigInteger / 1.1d; Assert.AreEqual(100m, (decimal)r); r /= 2; @@ -621,7 +621,7 @@ namespace Newtonsoft.Json.Tests.Linq new JProperty("Uri", new Uri("http://json.codeplex.com/")), new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")), new JProperty("TimeSpan", TimeSpan.FromDays(1)) -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) , new JProperty("BigInteger", new BigInteger(100)) #endif ); @@ -638,7 +638,7 @@ namespace Newtonsoft.Json.Tests.Linq Assert.AreEqual("http://json.codeplex.com/", d.Uri.ToString()); Assert.AreEqual("ea27fe1d-0d80-44f2-bf34-4654156fa7af", d.Guid.ToString()); Assert.AreEqual("1.00:00:00", d.TimeSpan.ToString()); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) Assert.AreEqual("100", d.BigInteger.ToString()); #endif } @@ -722,7 +722,7 @@ namespace Newtonsoft.Json.Tests.Linq AssertValueConverted(null); AssertValueConverted(new Uri("http://json.codeplex.com/")); AssertValueConverted(null); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) AssertValueConverted(new BigInteger(100)); AssertValueConverted(null); #endif diff --git a/Src/Newtonsoft.Json.Tests/Linq/JArrayTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JArrayTests.cs index a2a09476..ab7f270c 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JArrayTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JArrayTests.cs @@ -450,7 +450,7 @@ Parameter name: index", } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void ITypedListGetItemProperties() { diff --git a/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs index 5a3eddae..a0c65860 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) using System.Numerics; #endif using Newtonsoft.Json.Serialization; @@ -42,7 +42,7 @@ using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAtt using Newtonsoft.Json.Linq; using System.IO; using System.Collections; -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE using System.Web.UI; #endif #if NET20 @@ -684,7 +684,7 @@ Parameter name: arrayIndex", Assert.AreEqual(p4, l[1]); } -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void PropertyChanging() { @@ -1241,7 +1241,7 @@ Parameter name: arrayIndex", }); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void IBindingListSortDirection() { @@ -1444,7 +1444,7 @@ Parameter name: arrayIndex", } #endif -#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) [Test] public void CollectionChanged() { @@ -1690,7 +1690,7 @@ Parameter name: arrayIndex", }); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void GetProperties() { diff --git a/Src/Newtonsoft.Json.Tests/Linq/JPropertyTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JPropertyTests.cs index 45f876ff..bed7057a 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JPropertyTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JPropertyTests.cs @@ -56,7 +56,7 @@ namespace Newtonsoft.Json.Tests.Linq Assert.AreEqual(p, p.Value.Parent); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void ListChanged() { diff --git a/Src/Newtonsoft.Json.Tests/Linq/JTokenTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JTokenTests.cs index 25fa9440..24d0a2c7 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JTokenTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JTokenTests.cs @@ -25,7 +25,7 @@ using System; using System.Collections.Generic; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -355,7 +355,7 @@ namespace Newtonsoft.Json.Tests.Linq Assert.AreEqual(5, (int)(new JValue(StringComparison.OrdinalIgnoreCase))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) string bigIntegerText = "1234567899999999999999999999999999999999999999999999999999999999999990"; Assert.AreEqual(BigInteger.Parse(bigIntegerText), (new JValue(BigInteger.Parse(bigIntegerText))).Value); @@ -435,7 +435,7 @@ namespace Newtonsoft.Json.Tests.Linq #endif ExceptionAssert.Throws("Can not convert Boolean to Uri.", () => { var i = (Uri)new JValue(true); }); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) ExceptionAssert.Throws("Can not convert Uri to BigInteger.", () => { var i = (new JValue(new Uri("http://www.google.com"))).ToObject(); }); ExceptionAssert.Throws("Can not convert Null to BigInteger.", () => { var i = (new JValue((object)null)).ToObject(); }); ExceptionAssert.Throws("Can not convert Guid to BigInteger.", () => { var i = (new JValue(Guid.NewGuid())).ToObject(); }); @@ -449,7 +449,7 @@ namespace Newtonsoft.Json.Tests.Linq [Test] public void ToObject() { -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) Assert.AreEqual((BigInteger)1, (new JValue(1).ToObject(typeof(BigInteger)))); Assert.AreEqual((BigInteger)1, (new JValue(1).ToObject(typeof(BigInteger?)))); Assert.AreEqual((BigInteger?)null, (new JValue((object)null).ToObject(typeof(BigInteger?)))); @@ -503,7 +503,7 @@ namespace Newtonsoft.Json.Tests.Linq Assert.IsTrue(JToken.DeepEquals(new JValue((DateTimeOffset?)null), (JValue)(DateTimeOffset?)null)); #endif -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) // had to remove implicit casting to avoid user reference to System.Numerics.dll Assert.IsTrue(JToken.DeepEquals(new JValue(new BigInteger(1)), new JValue(new BigInteger(1)))); Assert.IsTrue(JToken.DeepEquals(new JValue((BigInteger?)null), new JValue((BigInteger?)null))); @@ -945,7 +945,7 @@ namespace Newtonsoft.Json.Tests.Linq Assert.IsTrue(a.DeepEquals(a2)); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void Clone() { diff --git a/Src/Newtonsoft.Json.Tests/Linq/JTokenWriterTest.cs b/Src/Newtonsoft.Json.Tests/Linq/JTokenWriterTest.cs index 96246127..90324656 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JTokenWriterTest.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JTokenWriterTest.cs @@ -25,7 +25,7 @@ using System; using System.Collections.Generic; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) using System.Numerics; #endif using System.Text; @@ -120,7 +120,7 @@ namespace Newtonsoft.Json.Tests.Linq jsonWriter.WriteValue("DVD read/writer"); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) jsonWriter.WriteValue(new BigInteger(123)); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); #endif @@ -149,7 +149,7 @@ namespace Newtonsoft.Json.Tests.Linq /*fail*/]", writer.Token.ToString()); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) [Test] public void WriteBigInteger() { diff --git a/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs index 5f90e430..8780cbc0 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; using System.IO; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -140,7 +140,7 @@ namespace Newtonsoft.Json.Tests.Linq Assert.AreEqual(g, v.Value); Assert.AreEqual(JTokenType.Guid, v.Type); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) BigInteger i = BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990"); v.Value = i; Assert.AreEqual(i, v.Value); @@ -200,13 +200,13 @@ namespace Newtonsoft.Json.Tests.Linq v = new JValue(new Guid("B282ADE7-C520-496C-A448-4084F6803DE5")); Assert.AreEqual("b282ade7-c520-496c-a448-4084f6803de5", v.ToString(null, CultureInfo.InvariantCulture)); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) v = new JValue(BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990")); Assert.AreEqual("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990", v.ToString(null, CultureInfo.InvariantCulture)); #endif } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) [Test] public void JValueParse() { @@ -481,7 +481,7 @@ namespace Newtonsoft.Json.Tests.Linq Assert.AreEqual(Int32.MaxValue, Convert.ToInt32(new JValue(Int32.MaxValue))); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) [Test] public void ConvertsToInt32_BigInteger() { @@ -618,7 +618,7 @@ namespace Newtonsoft.Json.Tests.Linq v = new JValue(new Uri("http://www.google.com")); Assert.AreEqual(TypeCode.Object, v.GetTypeCode()); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) v = new JValue(new BigInteger(3)); Assert.AreEqual(TypeCode.Object, v.GetTypeCode()); #endif @@ -632,7 +632,7 @@ namespace Newtonsoft.Json.Tests.Linq int i = (int)v.ToType(typeof(int), CultureInfo.InvariantCulture); Assert.AreEqual(9, i); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) BigInteger bi = (BigInteger)v.ToType(typeof(BigInteger), CultureInfo.InvariantCulture); Assert.AreEqual(new BigInteger(9), bi); #endif @@ -647,7 +647,7 @@ namespace Newtonsoft.Json.Tests.Linq Assert.AreEqual("2013", v.ToString("yyyy")); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) [Test] public void ToStringNewTypes() { diff --git a/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs b/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs index 2402de04..6644f276 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/LinqToJsonTest.cs @@ -732,7 +732,7 @@ keyword such as type of business."" Assert.AreEqual(new DateTime(2000, 10, 15, 5, 5, 5, DateTimeKind.Utc), d); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) [Test] public void CovariantIJEnumerable() { @@ -892,7 +892,7 @@ keyword such as type of business."" Assert.AreEqual("hi!", (string)a[0]); } -#if !(NET35 || NET20 || WINDOWS_PHONE) +#if !(NET35 || NET20) [Test] public void ExceptionFromOverloadWithJValue() { diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj index 4e1717e2..bebda336 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj @@ -232,7 +232,6 @@ - diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj index 1e4a6bbd..2cb0991c 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj @@ -276,7 +276,6 @@ - diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj index 644e137e..566b8346 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj @@ -394,7 +394,6 @@ - diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj index 35521d6b..c92c76db 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj @@ -276,7 +276,6 @@ - diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj index 60740cb1..ce8e0cc2 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj @@ -271,7 +271,6 @@ - diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Silverlight.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Silverlight.csproj deleted file mode 100644 index 46a29f42..00000000 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Silverlight.csproj +++ /dev/null @@ -1,311 +0,0 @@ - - - - v3.5 - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0D8C3C2E-62C6-4C93-9377-6F74DD6BFD93} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Newtonsoft.Json.Tests - Newtonsoft.Json.Tests - v5.0 - false - - - 3.5 - - - Silverlight - $(TargetFrameworkVersion) - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - false - - - true - full - false - Bin\Debug\Silverlight\ - DEBUG;TRACE;SILVERLIGHT - true - true - prompt - 4 - AllRules.ruleset - false - - - pdbonly - true - Bin\Release\Silverlight\ - TRACE;SILVERLIGHT - true - true - prompt - 4 - AllRules.ruleset - false - - - - False - ..\..\..\..\..\..\..\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Libraries\Client\Microsoft.CSharp.dll - - - False - ..\Lib\NUnit\Silverlight\nunit.framework.dll - True - - - True - - - True - - - True - - - True - - - - True - - - True - - - True - - - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D} - Newtonsoft.Json.Silverlight - True - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - \ No newline at end of file diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WindowsPhone.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WindowsPhone.csproj deleted file mode 100644 index d59e67fb..00000000 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.WindowsPhone.csproj +++ /dev/null @@ -1,236 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {5ED71C8C-D0A6-487C-9A8C-BB855ECEAF75} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Newtonsoft.Json.Tests - Newtonsoft.Json.Tests - v8.0 - - - - - WindowsPhone - false - true - true - 11.0 - - - true - full - false - Bin\Debug\WindowsPhone\ - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - false - - - pdbonly - true - Bin\Release\WindowsPhone\ - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - false - - - - ..\Lib\NUnit\Silverlight\nunit.framework.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E} - Newtonsoft.Json.WindowsPhone - - - - - - - \ No newline at end of file diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj index 2eb8df65..0c478a8c 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj @@ -244,7 +244,6 @@ - diff --git a/Src/Newtonsoft.Json.Tests/PerformanceTests.cs b/Src/Newtonsoft.Json.Tests/PerformanceTests.cs index af267a3e..0436097b 100644 --- a/Src/Newtonsoft.Json.Tests/PerformanceTests.cs +++ b/Src/Newtonsoft.Json.Tests/PerformanceTests.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE) +#if !(NET20 || NET35 || NETFX_CORE || PORTABLE) using System; using System.Collections; using System.Collections.Generic; diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs index 5a1eb3c4..41c9a55e 100644 --- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs @@ -31,11 +31,7 @@ using System.Security; // set of attributes. Change these attribute values to modify the information // associated with an assembly. -#if WINDOWS_PHONE -[assembly: AssemblyTitle("Json.NET Tests Windows Phone")] -#elif SILVERLIGHT -[assembly: AssemblyTitle("Json.NET Tests Silverlight")] -#elif PORTABLE +#if PORTABLE [assembly: AssemblyTitle("Json.NET Tests Portable")] #elif NETFX_CORE [assembly: AssemblyTitle("Json.NET Tests WinRT")] @@ -79,4 +75,4 @@ using System.Security; // by using the '*' as shown below: [assembly: AssemblyVersion("4.5.0.0")] -[assembly: AssemblyFileVersion("5.0.8.16620")] \ No newline at end of file +[assembly: AssemblyFileVersion("5.0.8.16620")] diff --git a/Src/Newtonsoft.Json.Tests/Schema/ExtensionsTests.cs b/Src/Newtonsoft.Json.Tests/Schema/ExtensionsTests.cs index 5888f6ab..0f31119d 100644 --- a/Src/Newtonsoft.Json.Tests/Schema/ExtensionsTests.cs +++ b/Src/Newtonsoft.Json.Tests/Schema/ExtensionsTests.cs @@ -36,7 +36,7 @@ using Newtonsoft.Json.Schema; using Newtonsoft.Json.Linq; using System.IO; using Newtonsoft.Json.Tests.TestObjects; -#if !(SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) using System.Data; #endif @@ -200,7 +200,7 @@ namespace Newtonsoft.Json.Tests.Schema #if !NET20 GenerateSchemaAndSerializeFromType(new NullableDateTimeTestClass()); #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) GenerateSchemaAndSerializeFromType(new DataSet()); #endif GenerateSchemaAndSerializeFromType(new object()); diff --git a/Src/Newtonsoft.Json.Tests/Schema/JsonSchemaGeneratorTests.cs b/Src/Newtonsoft.Json.Tests/Schema/JsonSchemaGeneratorTests.cs index 57fda964..aa211f76 100644 --- a/Src/Newtonsoft.Json.Tests/Schema/JsonSchemaGeneratorTests.cs +++ b/Src/Newtonsoft.Json.Tests/Schema/JsonSchemaGeneratorTests.cs @@ -311,7 +311,7 @@ namespace Newtonsoft.Json.Tests.Schema Assert.IsTrue(v.IsValid(schema)); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void GenerateSchemaForISerializable() { @@ -371,7 +371,7 @@ namespace Newtonsoft.Json.Tests.Schema generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName; generator.ContractResolver = new CustomDirectoryInfoMapper { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) IgnoreSerializableAttribute = true #endif }; @@ -455,7 +455,7 @@ namespace Newtonsoft.Json.Tests.Schema serializer.Converters.Add(new IsoDateTimeConverter()); serializer.ContractResolver = new CustomDirectoryInfoMapper { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) IgnoreSerializableInterface = true #endif }; @@ -475,7 +475,7 @@ namespace Newtonsoft.Json.Tests.Schema generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName; generator.ContractResolver = new CamelCasePropertyNamesContractResolver() { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) IgnoreSerializableAttribute = true #endif }; @@ -520,7 +520,7 @@ namespace Newtonsoft.Json.Tests.Schema }", json); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void GenerateSchemaSerializable() { diff --git a/Src/Newtonsoft.Json.Tests/Serialization/DefaultValueHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/DefaultValueHandlingTests.cs index 53015ad9..05a3e33f 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/DefaultValueHandlingTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/DefaultValueHandlingTests.cs @@ -27,7 +27,7 @@ using System; using System.ComponentModel; using System.IO; using System.Runtime.Serialization; -#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE) +#if !(NET20 || NET35 || NETFX_CORE || PORTABLE) using System.Runtime.Serialization.Json; #endif using System.Text; @@ -237,7 +237,7 @@ namespace Newtonsoft.Json.Tests.Serialization { EmitDefaultValueClass c = new EmitDefaultValueClass(); -#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE) +#if !(NET20 || NET35 || NETFX_CORE || PORTABLE) DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(EmitDefaultValueClass)); MemoryStream ms = new MemoryStream(); diff --git a/Src/Newtonsoft.Json.Tests/Serialization/EntitiesSerializationTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/EntitiesSerializationTests.cs index aeecea62..ef9ae25d 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/EntitiesSerializationTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/EntitiesSerializationTests.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(NET35 || NET20 || SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NET35 || NET20 || NETFX_CORE || PORTABLE || PORTABLE40) using System; using System.Collections.Generic; using System.Data; diff --git a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs index 38ddd09f..121034f6 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs @@ -25,14 +25,14 @@ using System; using System.ComponentModel; -#if !(NET35 || NET20 || SILVERLIGHT) +#if !(NET35 || NET20) using System.Collections.Concurrent; #endif using System.Collections.Generic; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) +#if !(NET20 || NET35 || PORTABLE) using System.Numerics; #endif -#if !SILVERLIGHT && !NET20 && !NETFX_CORE +#if !NET20 && !NETFX_CORE using System.ComponentModel.DataAnnotations; using System.Configuration; using System.Runtime.CompilerServices; @@ -68,7 +68,7 @@ using System.Runtime.Serialization; using System.Globalization; using Newtonsoft.Json.Utilities; using System.Reflection; -#if !NET20 && !SILVERLIGHT +#if !NET20 using System.Xml.Linq; using System.Collections.Specialized; using System.Linq.Expressions; @@ -81,7 +81,7 @@ using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; #endif -#if !(SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) using System.Drawing; using System.Diagnostics; @@ -1291,7 +1291,7 @@ namespace Newtonsoft.Json.Tests.Serialization Assert.AreEqual(executorObject2.clientGetResultFunction, "ClientBanSubsCB"); } -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE [Test] public void HashtableDeserialization() { @@ -1535,7 +1535,7 @@ keyword such as type of business."" { string json = @"[""vvv\/vvv\tvvv\""vvv\bvvv\nvvv\rvvv\\vvv\fvvv""]"; -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); List javaScriptSerializerResult = javaScriptSerializer.Deserialize>(json); #endif @@ -1547,7 +1547,7 @@ keyword such as type of business."" Assert.AreEqual(1, jsonNetResult.Count); Assert.AreEqual(dataContractResult[0], jsonNetResult[0]); -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE Assert.AreEqual(javaScriptSerializerResult[0], jsonNetResult[0]); #endif } @@ -1904,7 +1904,7 @@ keyword such as type of business."" Assert.AreEqual(99, c.Field); } -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE [Test] public void SerializeArrayAsArrayList() { @@ -2704,7 +2704,7 @@ keyword such as type of business."" Assert.AreEqual("titleId", n.FidOrder[n.FidOrder.Count - 1]); } -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40) [MetadataType(typeof(OptInClassMetadata))] public class OptInClass { @@ -3214,7 +3214,7 @@ Path '', line 1, position 1.", () => { JsonConvert.DeserializeObject>(json); }); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) [Test] public void CannotDeserializeArrayIntoSerializable() { @@ -3336,7 +3336,7 @@ Path '', line 1, position 2.", { ContractResolver = new DefaultContractResolver { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) IgnoreSerializableAttribute = true #endif } @@ -3355,7 +3355,7 @@ Path '', line 1, position 2.", { ContractResolver = new DefaultContractResolver { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) IgnoreSerializableAttribute = true #endif } @@ -3374,7 +3374,7 @@ Path '', line 1, position 2.", { ContractResolver = new DefaultContractResolver { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) IgnoreSerializableAttribute = true #endif } @@ -3393,7 +3393,7 @@ Path '', line 1, position 2.", { ContractResolver = new DefaultContractResolver { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) IgnoreSerializableAttribute = true #endif } @@ -4063,7 +4063,7 @@ Path '', line 1, position 2.", Assert.AreEqual("value", newModelStateDictionary["key"]); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) public class ISerializableTestObject : ISerializable { internal string _stringValue; @@ -4547,7 +4547,7 @@ To fix this error either change the environment to be fully trusted, change the } } -#if !NET20 && !SILVERLIGHT +#if !NET20 public class XNodeTestObject { public XDocument Document { get; set; } @@ -4555,14 +4555,14 @@ To fix this error either change the environment to be fully trusted, change the } #endif -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE public class XmlNodeTestObject { public XmlDocument Document { get; set; } } #endif -#if !(NET20 || SILVERLIGHT || PORTABLE40) +#if !(NET20 || PORTABLE40) [Test] public void SerializeDeserializeXNodeProperties() { @@ -4593,7 +4593,7 @@ To fix this error either change the environment to be fully trusted, change the } #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void SerializeDeserializeXmlNodeProperties() { @@ -5260,7 +5260,7 @@ To fix this error either change the environment to be fully trusted, change the Assert.AreEqual(null, d[2]); } -#if !SILVERLIGHT && !NET20 +#if !NET20 [Test] public void SerializeHashSet() { @@ -5313,7 +5313,7 @@ To fix this error either change the environment to be fully trusted, change the Assert.AreEqual(0, z[1].Prop1.Length); } -#if !NET20 && !SILVERLIGHT && !NETFX_CORE +#if !NET20 && !NETFX_CORE public class StringDictionaryTestClass { public StringDictionary StringDictionaryProperty { get; set; } @@ -5605,7 +5605,7 @@ To fix this error either change the environment to be fully trusted, change the Assert.AreEqual(meh.IDontWork, "meh"); } -#if !(SILVERLIGHT || NET20 || NETFX_CORE) +#if !(NET20 || NETFX_CORE) [DataContract] public struct StructISerializable : ISerializable { @@ -6025,7 +6025,7 @@ To fix this error either change the environment to be fully trusted, change the JsonConvert.DeserializeObject(json); } -#if !(NET20 || SILVERLIGHT) +#if !(NET20) [DataContract] public class BaseDataContract { @@ -6452,7 +6452,7 @@ To fix this error either change the environment to be fully trusted, change the } } -#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void SerializeException1() { @@ -6582,7 +6582,7 @@ To fix this error either change the environment to be fully trusted, change the } } -#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE || PORTABLE40) +#if !(NET35 || NET20 || PORTABLE || PORTABLE40) [Test] public void DeserializeConcurrentDictionary() { @@ -6713,7 +6713,7 @@ To fix this error either change the environment to be fully trusted, change the } } -#if !(SILVERLIGHT || WINDOWS_PHONE || NET20 || NETFX_CORE) +#if !(NET20 || NETFX_CORE) [Test] public void DeserializeDecimalsWithCulture() { @@ -7177,7 +7177,7 @@ Parameter name: value", } #endif -#if !(SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) [Test] public void MetroBlogPost() { @@ -7509,7 +7509,7 @@ Parameter name: value", Assert.AreEqual("", s); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void SerializeAndDeserializeWithAttributes() { @@ -7672,7 +7672,7 @@ Parameter name: value", () => { s.Deserialize>(new JsonTextReader(new StringReader(json))); }); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void DeserializeException() { @@ -7928,7 +7928,7 @@ Parameter name: value", Assert.AreEqual("[1.1,0.0,0.0]", json); } -#if !(NET20 || NET35 || NET40 || SILVERLIGHT || PORTABLE40) +#if !(NET20 || NET35 || NET40 || PORTABLE40) #if !PORTABLE [Test] public void DeserializeReadOnlyListWithBigInteger() @@ -7987,7 +7987,7 @@ Parameter name: value", Action doStuff = () => { obj = JsonConvert.DeserializeObject>(json); }; -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) doStuff(); Assert.AreEqual(500, obj.Item1); #else @@ -8020,7 +8020,7 @@ Parameter name: value", } #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || NET35 || NET20 || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || NET35 || NET20 || PORTABLE40) [Test] public void SerializeTupleWithSerializableAttribute() { @@ -8047,7 +8047,7 @@ Parameter name: value", } #endif -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) public class PopulateReadOnlyTestClass { public IList NonReadOnlyList { get; set; } @@ -8888,7 +8888,7 @@ Parameter name: value", } #endif -#if !(PORTABLE || NET35 || NET20 || SILVERLIGHT || PORTABLE40) +#if !(PORTABLE || NET35 || NET20 || PORTABLE40) [Test] public void ReadTooLargeInteger() { @@ -9055,7 +9055,7 @@ Parameter name: value", Assert.AreEqual(1234567890.123456m, d); } -#if !(PORTABLE || SILVERLIGHT || NETFX_CORE || WINDOWS_PHONE || PORTABLE40) +#if !(PORTABLE || NETFX_CORE || PORTABLE40) [Test] public void DontSerializeStaticFields() { @@ -9089,7 +9089,7 @@ Parameter name: value", Assert.AreEqual("string!", l[0]); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) [Test] public void SerializeBigInteger() { @@ -9103,7 +9103,7 @@ Parameter name: value", } #endif -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) [Test] public void DeserializeReadOnlyListInterface() { @@ -9853,7 +9853,7 @@ Parameter name: value", public bool Selected { get; set; } } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) [Serializable] public class AnswerFilterModel { @@ -10086,7 +10086,7 @@ Parameter name: value", public new bool no; } -#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE) +#if !(NET35 || NET20) [JsonObject(MemberSerialization.OptIn)] public class GameObject { @@ -10161,7 +10161,7 @@ Parameter name: value", { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { -#if !(SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) writer.WriteValue(":::" + value.ToString().ToUpper(CultureInfo.InvariantCulture) + ":::"); #else writer.WriteValue(":::" + value.ToString().ToUpper() + ":::"); @@ -10174,7 +10174,7 @@ Parameter name: value", if (s == null) return null; -#if !(SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) return s.ToLower(CultureInfo.InvariantCulture).Trim(new[] { ':' }); #else return s.ToLower().Trim(new[] { ':' }); @@ -10191,7 +10191,7 @@ Parameter name: value", { protected internal override string ResolvePropertyName(string propertyName) { -#if !(SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) return ":::" + propertyName.ToUpper(CultureInfo.InvariantCulture) + ":::"; #else return ":::" + propertyName.ToUpper() + ":::"; diff --git a/Src/Newtonsoft.Json.Tests/Serialization/ReferenceLoopHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/ReferenceLoopHandlingTests.cs index 4c5640df..324ae400 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/ReferenceLoopHandlingTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/ReferenceLoopHandlingTests.cs @@ -149,7 +149,7 @@ namespace Newtonsoft.Json.Tests.Serialization }", json); } -#if !(PORTABLE || SILVERLIGHT || NETFX_CORE || PORTABLE40) +#if !(PORTABLE || NETFX_CORE || PORTABLE40) public class MainClass : ISerializable { public ChildClass Child { get; set; } diff --git a/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs index 17bb9756..cd993214 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/SerializationErrorHandlingTests.cs @@ -301,7 +301,7 @@ namespace Newtonsoft.Json.Tests.Serialization Assert.AreEqual(new DateTime(2000, 12, 1, 0, 0, 0, DateTimeKind.Utc), c[2]); Assert.AreEqual(3, errors.Count); -#if !(NET20 || NET35 || WINDOWS_PHONE) +#if !(NET20 || NET35) Assert.AreEqual("[1] - 1 - The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.", errors[0]); #else Assert.AreEqual("[1] - 1 - The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.", errors[0]); diff --git a/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs index 7cc31a1e..536ea80b 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/SerializationEventAttributeTests.cs @@ -282,7 +282,7 @@ namespace Newtonsoft.Json.Tests.Serialization }", json); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) public class SerializationEventContextTestObject { public string TestMember { get; set; } @@ -400,7 +400,7 @@ OnSerialized_Derived OnSerialized_Derived_Derived", string.Join(Environment.NewLine, e.ToArray())); } -#if !(NET20 || SILVERLIGHT) +#if !(NET20) [Test] public void DerivedDerivedSerializationEvents_DataContractSerializer() { diff --git a/Src/Newtonsoft.Json.Tests/Serialization/TraceWriterTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/TraceWriterTests.cs index edfb34fd..5365e848 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/TraceWriterTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/TraceWriterTests.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) using System.Numerics; #endif using System.Runtime.Serialization; @@ -38,7 +38,7 @@ namespace Newtonsoft.Json.Tests.Serialization [TestFixture] public class TraceWriterTests : TestFixtureBase { -#if !(SILVERLIGHT || PORTABLE || NETFX_CORE || PORTABLE40) +#if !(PORTABLE || NETFX_CORE || PORTABLE40) [Test] public void DiagnosticsTraceWriterTest() { @@ -531,7 +531,7 @@ Newtonsoft.Json Error: 0 : Error! Assert.AreEqual("Finished deserializing System.Collections.Generic.List`1[System.Object]. Path '$values', line 17, position 4.", traceWriter.TraceRecords[9].Message); } -#if !(NETFX_CORE || PORTABLE || SILVERLIGHT || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void DeserializeISerializable() { @@ -718,7 +718,7 @@ Newtonsoft.Json Error: 0 : Error! Assert.AreEqual(23, deserialized.FavoriteNumber); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) [Test] public void TraceJsonWriterTest() { diff --git a/Src/Newtonsoft.Json.Tests/Serialization/TypeNameHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/TypeNameHandlingTests.cs index 34fcf81b..3b810f2c 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/TypeNameHandlingTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/TypeNameHandlingTests.cs @@ -203,7 +203,7 @@ namespace Newtonsoft.Json.Tests.Serialization Assert.AreEqual("Name!", ((EmployeeReference)employee).Name); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) [Test] public void DeserializeTypeNameFromGacAssembly() { @@ -977,7 +977,7 @@ namespace Newtonsoft.Json.Tests.Serialization CollectionAssert.AreEquivalent(data, d); } -#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) [Test] public void ISerializableTypeNameHandlingTest() { @@ -1043,7 +1043,7 @@ namespace Newtonsoft.Json.Tests.Serialization Binder = new MetroBinder(), ContractResolver = new DefaultContractResolver { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) IgnoreSerializableAttribute = true #endif } @@ -1723,7 +1723,7 @@ namespace Newtonsoft.Json.Tests.Serialization public int Quantity { get; set; } } -#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE) +#if !(NETFX_CORE) public class SerializableWrapper { public object Content { get; set; } diff --git a/Src/Newtonsoft.Json.Tests/Serialization/WebApiIntegrationTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/WebApiIntegrationTests.cs index b9d79457..d9b190ad 100644 --- a/Src/Newtonsoft.Json.Tests/Serialization/WebApiIntegrationTests.cs +++ b/Src/Newtonsoft.Json.Tests/Serialization/WebApiIntegrationTests.cs @@ -37,7 +37,7 @@ using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; #endif -#if !(SILVERLIGHT || NETFX_CORE || NET20) +#if !(NETFX_CORE || NET20) using System.Runtime.Serialization.Json; #endif using Newtonsoft.Json.Serialization; @@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Tests.Serialization nonSerializedField = "Error" }; -#if !(SILVERLIGHT || NETFX_CORE || NET20 || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || NET20 || PORTABLE || PORTABLE40) MemoryStream ms = new MemoryStream(); DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(SerializableType)); dataContractJsonSerializer.WriteObject(ms, serializableType); @@ -75,7 +75,7 @@ namespace Newtonsoft.Json.Tests.Serialization { ContractResolver = new DefaultContractResolver { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) IgnoreSerializableAttribute = false #endif } @@ -84,7 +84,7 @@ namespace Newtonsoft.Json.Tests.Serialization Assert.AreEqual(expected, json); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Test] public void SerializeInheritedType() { @@ -114,7 +114,7 @@ namespace Newtonsoft.Json.Tests.Serialization } } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Serializable] #else [JsonObject(MemberSerialization.Fields)] @@ -138,7 +138,7 @@ namespace Newtonsoft.Json.Tests.Serialization set { privateField = value; } } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [NonSerialized] #else [JsonIgnore] diff --git a/Src/Newtonsoft.Json.Tests/SilverlightTests.cs b/Src/Newtonsoft.Json.Tests/SilverlightTests.cs deleted file mode 100644 index 6d0c5238..00000000 --- a/Src/Newtonsoft.Json.Tests/SilverlightTests.cs +++ /dev/null @@ -1,53 +0,0 @@ -#region License -// Copyright (c) 2007 James Newton-King -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -#endregion - -using System; -using System.Reflection; -#if !NETFX_CORE -using NUnit.Framework; - -#else -using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; -using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; -using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; -#endif - -namespace Newtonsoft.Json.Tests -{ - // todo: need to fix this to get WP unit tests running off right dlls -#if SILVERLIGHT - [TestFixture] - public class SilverlightTests - { - [Test] - public void SystemVersion() - { - Assembly systemAssembly = typeof(Uri).Assembly; - StringAssert.Contains("=4.0.0.0,", systemAssembly.FullName, - "Check we're testing a Silverlight 4.0 assembly"); - } - } -#endif -} \ No newline at end of file diff --git a/Src/Newtonsoft.Json.Tests/TestFixtureBase.cs b/Src/Newtonsoft.Json.Tests/TestFixtureBase.cs index 391b8860..3ff2597f 100644 --- a/Src/Newtonsoft.Json.Tests/TestFixtureBase.cs +++ b/Src/Newtonsoft.Json.Tests/TestFixtureBase.cs @@ -152,11 +152,9 @@ namespace Newtonsoft.Json.Tests { public static void IsInstanceOfType(Type t, object instance) { -#if (WINDOWS_PHONE || SILVERLIGHT) - Assert.IsInstanceOfType(t, instance); -#elif NETFX_CORE - if (!instance.GetType().IsAssignableFrom(t)) - throw new Exception("Not instance of type"); +#if NETFX_CORE + if (!instance.GetType().IsAssignableFrom(t)) + throw new Exception("Not instance of type"); #else Assert.IsInstanceOf(t, instance); #endif @@ -167,8 +165,8 @@ namespace Newtonsoft.Json.Tests #if !NETFX_CORE Assert.Contains(value, collection); #else - if (!collection.Cast().Any(i => i.Equals(value))) - throw new Exception("Value not found in collection."); + if (!collection.Cast().Any(i => i.Equals(value))) + throw new Exception("Value not found in collection."); #endif } } diff --git a/Src/Newtonsoft.Json.Tests/TestObjects/CustomerDataSet.cs b/Src/Newtonsoft.Json.Tests/TestObjects/CustomerDataSet.cs index 50eebf22..76554d33 100644 --- a/Src/Newtonsoft.Json.Tests/TestObjects/CustomerDataSet.cs +++ b/Src/Newtonsoft.Json.Tests/TestObjects/CustomerDataSet.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) using System; using System.Collections.Generic; using System.Text; diff --git a/Src/Newtonsoft.Json.Tests/TestObjects/TypedSubHashtable.cs b/Src/Newtonsoft.Json.Tests/TestObjects/TypedSubHashtable.cs index eb0b38a5..88b01c45 100644 --- a/Src/Newtonsoft.Json.Tests/TestObjects/TypedSubHashtable.cs +++ b/Src/Newtonsoft.Json.Tests/TestObjects/TypedSubHashtable.cs @@ -27,7 +27,7 @@ using System.Collections; namespace Newtonsoft.Json.Tests.TestObjects { -#if !SILVERLIGHT && !NETFX_CORE +#if !NETFX_CORE public class TypedSubHashtable { public string Name; diff --git a/Src/Newtonsoft.Json.Tests/Utilities/DynamicReflectionDelegateFactoryTests.cs b/Src/Newtonsoft.Json.Tests/Utilities/DynamicReflectionDelegateFactoryTests.cs index ff6aafac..9eea3acf 100644 --- a/Src/Newtonsoft.Json.Tests/Utilities/DynamicReflectionDelegateFactoryTests.cs +++ b/Src/Newtonsoft.Json.Tests/Utilities/DynamicReflectionDelegateFactoryTests.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || PORTABLE || NETFX_CORE || PORTABLE40) +#if !(PORTABLE || NETFX_CORE || PORTABLE40) using System; using System.Diagnostics; using System.Reflection; diff --git a/Src/Newtonsoft.Json.WindowsPhone.sln b/Src/Newtonsoft.Json.WindowsPhone.sln deleted file mode 100644 index 422b0099..00000000 --- a/Src/Newtonsoft.Json.WindowsPhone.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{F69285DD-24FB-4A60-AE8B-4C2744285D0F}" - ProjectSection(SolutionItems) = preProject - Lib\NUnit\Silverlight\nunit.framework.dll = Lib\NUnit\Silverlight\nunit.framework.dll - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Newtonsoft.Json.WindowsPhone", "Newtonsoft.Json\Newtonsoft.Json.WindowsPhone.csproj", "{7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Newtonsoft.Json.Tests.WindowsPhone", "Newtonsoft.Json.Tests\Newtonsoft.Json.Tests.WindowsPhone.csproj", "{5ED71C8C-D0A6-487C-9A8C-BB855ECEAF75}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E}.Release|Any CPU.Build.0 = Release|Any CPU - {5ED71C8C-D0A6-487C-9A8C-BB855ECEAF75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5ED71C8C-D0A6-487C-9A8C-BB855ECEAF75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5ED71C8C-D0A6-487C-9A8C-BB855ECEAF75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5ED71C8C-D0A6-487C-9A8C-BB855ECEAF75}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Src/Newtonsoft.Json/Bson/BsonWriter.cs b/Src/Newtonsoft.Json/Bson/BsonWriter.cs index cfed08f7..0acc35d2 100644 --- a/Src/Newtonsoft.Json/Bson/BsonWriter.cs +++ b/Src/Newtonsoft.Json/Bson/BsonWriter.cs @@ -27,7 +27,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.IO; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -228,7 +228,7 @@ namespace Newtonsoft.Json.Bson /// The value to write. public override void WriteValue(object value) { -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) if (value is BigInteger) { InternalWriteValue(JsonToken.Integer); diff --git a/Src/Newtonsoft.Json/Converters/BinaryConverter.cs b/Src/Newtonsoft.Json/Converters/BinaryConverter.cs index fc4939e8..387b129f 100644 --- a/Src/Newtonsoft.Json/Converters/BinaryConverter.cs +++ b/Src/Newtonsoft.Json/Converters/BinaryConverter.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) using System; using System.Data.SqlTypes; using System.Globalization; diff --git a/Src/Newtonsoft.Json/Converters/DataSetConverter.cs b/Src/Newtonsoft.Json/Converters/DataSetConverter.cs index a9b25e48..5361a55c 100644 --- a/Src/Newtonsoft.Json/Converters/DataSetConverter.cs +++ b/Src/Newtonsoft.Json/Converters/DataSetConverter.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) using System; using System.Data; using Newtonsoft.Json.Serialization; diff --git a/Src/Newtonsoft.Json/Converters/DataTableConverter.cs b/Src/Newtonsoft.Json/Converters/DataTableConverter.cs index f7ee8d8e..31bbf4f8 100644 --- a/Src/Newtonsoft.Json/Converters/DataTableConverter.cs +++ b/Src/Newtonsoft.Json/Converters/DataTableConverter.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) using System; using System.Data; using Newtonsoft.Json.Serialization; diff --git a/Src/Newtonsoft.Json/Converters/EntityKeyMemberConverter.cs b/Src/Newtonsoft.Json/Converters/EntityKeyMemberConverter.cs index dc9dc8a8..26f654bd 100644 --- a/Src/Newtonsoft.Json/Converters/EntityKeyMemberConverter.cs +++ b/Src/Newtonsoft.Json/Converters/EntityKeyMemberConverter.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) using System; using Newtonsoft.Json.Serialization; using System.Globalization; diff --git a/Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs b/Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs index 519963ec..8a742295 100644 --- a/Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs +++ b/Src/Newtonsoft.Json/Converters/XmlNodeConverter.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if (!(SILVERLIGHT) || WINDOWS_PHONE) && !PORTABLE40 +#if !PORTABLE40 using System; using System.Collections.Generic; using System.Globalization; @@ -43,7 +43,7 @@ namespace Newtonsoft.Json.Converters { #region XmlNodeWrappers -#if !SILVERLIGHT && !NETFX_CORE && !PORTABLE && !PORTABLE40 +#if !NETFX_CORE && !PORTABLE && !PORTABLE40 internal class XmlDocumentWrapper : XmlNodeWrapper, IXmlDocument { private readonly XmlDocument _document; @@ -799,7 +799,7 @@ namespace Newtonsoft.Json.Converters if (value is XObject) return XContainerWrapper.WrapNode((XObject)value); #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) if (value is XmlNode) return new XmlNodeWrapper((XmlNode)value); #endif @@ -1092,7 +1092,7 @@ namespace Newtonsoft.Json.Converters rootNode = document; } #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) if (typeof(XmlNode).IsAssignableFrom(objectType)) { if (objectType != typeof(XmlDocument)) @@ -1555,7 +1555,7 @@ namespace Newtonsoft.Json.Converters if (typeof(XObject).IsAssignableFrom(valueType)) return true; #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NETFX_CORE || PORTABLE) if (typeof(XmlNode).IsAssignableFrom(valueType)) return true; #endif diff --git a/Src/Newtonsoft.Json/FormatterAssemblyStyle.cs b/Src/Newtonsoft.Json/FormatterAssemblyStyle.cs index 541c0a4f..0029781f 100644 --- a/Src/Newtonsoft.Json/FormatterAssemblyStyle.cs +++ b/Src/Newtonsoft.Json/FormatterAssemblyStyle.cs @@ -1,5 +1,5 @@  -#if SILVERLIGHT || PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE +#if PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE namespace System.Runtime.Serialization.Formatters { diff --git a/Src/Newtonsoft.Json/JsonConvert.cs b/Src/Newtonsoft.Json/JsonConvert.cs index e5a22f5b..3cbafc96 100644 --- a/Src/Newtonsoft.Json/JsonConvert.cs +++ b/Src/Newtonsoft.Json/JsonConvert.cs @@ -26,10 +26,10 @@ using System; using System.IO; using System.Globalization; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) using System.Threading.Tasks; #endif using Newtonsoft.Json.Linq; @@ -38,7 +38,7 @@ using System.Xml; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; using System.Text; -#if !NET20 && (!SILVERLIGHT || WINDOWS_PHONE) && !PORTABLE40 +#if !(NET20 || PORTABLE40) using System.Xml.Linq; #endif @@ -238,7 +238,7 @@ namespace Newtonsoft.Json return value.ToString(null, CultureInfo.InvariantCulture); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) private static string ToStringInternal(BigInteger value) { return value.ToString(null, CultureInfo.InvariantCulture); @@ -482,7 +482,7 @@ namespace Newtonsoft.Json return ToString((Uri)value); case PrimitiveTypeCode.TimeSpan: return ToString((TimeSpan)value); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) case PrimitiveTypeCode.BigInteger: return ToStringInternal((BigInteger)value); #endif @@ -602,7 +602,7 @@ namespace Newtonsoft.Json return sw.ToString(); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) /// /// Asynchronously serializes the specified object to a JSON string. /// Serialization will happen on a new thread. @@ -798,7 +798,7 @@ namespace Newtonsoft.Json return jsonSerializer.Deserialize(new JsonTextReader(sr), type); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) /// /// Asynchronously deserializes the JSON to the specified .NET type. /// Deserialization will happen on a new thread. @@ -897,7 +897,7 @@ namespace Newtonsoft.Json } } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) /// /// Asynchronously populates the object with values from the JSON string using . /// @@ -916,7 +916,7 @@ namespace Newtonsoft.Json } #endif -#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) +#if !(PORTABLE40 || PORTABLE || NETFX_CORE) /// /// Serializes the XML node to a JSON string. /// @@ -996,7 +996,7 @@ namespace Newtonsoft.Json } #endif -#if !NET20 && (!(SILVERLIGHT) || WINDOWS_PHONE) && !PORTABLE40 +#if !NET20 && !PORTABLE40 /// /// Serializes the to a JSON string. /// diff --git a/Src/Newtonsoft.Json/JsonException.cs b/Src/Newtonsoft.Json/JsonException.cs index 299b2655..edf123e5 100644 --- a/Src/Newtonsoft.Json/JsonException.cs +++ b/Src/Newtonsoft.Json/JsonException.cs @@ -35,7 +35,7 @@ namespace Newtonsoft.Json /// /// The exception thrown when an error occurs during Json serialization or deserialization. /// -#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) [Serializable] #endif public class JsonException : Exception @@ -68,7 +68,7 @@ namespace Newtonsoft.Json { } -#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) /// /// Initializes a new instance of the class. /// diff --git a/Src/Newtonsoft.Json/JsonReaderException.cs b/Src/Newtonsoft.Json/JsonReaderException.cs index b54ab5f6..034a7e5a 100644 --- a/Src/Newtonsoft.Json/JsonReaderException.cs +++ b/Src/Newtonsoft.Json/JsonReaderException.cs @@ -33,7 +33,7 @@ namespace Newtonsoft.Json /// /// The exception thrown when an error occurs while reading Json text. /// -#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) [Serializable] #endif public class JsonReaderException : JsonException @@ -84,7 +84,7 @@ namespace Newtonsoft.Json { } -#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) /// /// Initializes a new instance of the class. /// diff --git a/Src/Newtonsoft.Json/JsonSerializationException.cs b/Src/Newtonsoft.Json/JsonSerializationException.cs index 08d9a92a..2c1099f7 100644 --- a/Src/Newtonsoft.Json/JsonSerializationException.cs +++ b/Src/Newtonsoft.Json/JsonSerializationException.cs @@ -33,7 +33,7 @@ namespace Newtonsoft.Json /// /// The exception thrown when an error occurs during Json serialization or deserialization. /// -#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) [Serializable] #endif public class JsonSerializationException : JsonException @@ -66,7 +66,7 @@ namespace Newtonsoft.Json { } -#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) /// /// Initializes a new instance of the class. /// diff --git a/Src/Newtonsoft.Json/JsonTextReader.cs b/Src/Newtonsoft.Json/JsonTextReader.cs index 33a0c04c..3e006808 100644 --- a/Src/Newtonsoft.Json/JsonTextReader.cs +++ b/Src/Newtonsoft.Json/JsonTextReader.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -1266,7 +1266,7 @@ namespace Newtonsoft.Json } else if (parseResult == ParseResult.Overflow) { -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) string number = _stringReference.ToString(); numberValue = BigInteger.Parse(number, CultureInfo.InvariantCulture); numberType = JsonToken.Integer; diff --git a/Src/Newtonsoft.Json/JsonTextWriter.cs b/Src/Newtonsoft.Json/JsonTextWriter.cs index 5023c10f..294b6184 100644 --- a/Src/Newtonsoft.Json/JsonTextWriter.cs +++ b/Src/Newtonsoft.Json/JsonTextWriter.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; using System.Globalization; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -311,7 +311,7 @@ namespace Newtonsoft.Json /// The value to write. public override void WriteValue(object value) { -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) if (value is BigInteger) { InternalWriteValue(JsonToken.Integer); diff --git a/Src/Newtonsoft.Json/JsonValidatingReader.cs b/Src/Newtonsoft.Json/JsonValidatingReader.cs index b66dff92..29b51c93 100644 --- a/Src/Newtonsoft.Json/JsonValidatingReader.cs +++ b/Src/Newtonsoft.Json/JsonValidatingReader.cs @@ -25,7 +25,7 @@ using System; using System.Collections.Generic; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif using Newtonsoft.Json.Linq; @@ -735,7 +735,7 @@ namespace Newtonsoft.Json if (schema.DivisibleBy != null) { bool notDivisible; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (value is BigInteger) { // not that this will lose any decimal point on DivisibleBy diff --git a/Src/Newtonsoft.Json/JsonWriter.cs b/Src/Newtonsoft.Json/JsonWriter.cs index 0e679889..6a645572 100644 --- a/Src/Newtonsoft.Json/JsonWriter.cs +++ b/Src/Newtonsoft.Json/JsonWriter.cs @@ -26,7 +26,7 @@ using System; using System.Collections.Generic; using System.IO; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif using Newtonsoft.Json.Utilities; @@ -493,7 +493,7 @@ namespace Newtonsoft.Json WriteComment((reader.Value != null) ? reader.Value.ToString() : null); break; case JsonToken.Integer: -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) if (reader.Value is BigInteger) { WriteValue((BigInteger)reader.Value); @@ -1219,7 +1219,7 @@ namespace Newtonsoft.Json } else { -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) // this is here because adding a WriteValue(BigInteger) to JsonWriter will // mean the user has to add a reference to System.Numerics.dll if (value is BigInteger) @@ -1368,7 +1368,7 @@ namespace Newtonsoft.Json case PrimitiveTypeCode.TimeSpanNullable: writer.WriteValue((value == null) ? (TimeSpan?)null : (TimeSpan)value); break; -#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) +#if !(PORTABLE || PORTABLE40 || NET35 || NET20) case PrimitiveTypeCode.BigInteger: // this will call to WriteValue(object) writer.WriteValue((BigInteger)value); diff --git a/Src/Newtonsoft.Json/JsonWriterException.cs b/Src/Newtonsoft.Json/JsonWriterException.cs index f956261c..a955e222 100644 --- a/Src/Newtonsoft.Json/JsonWriterException.cs +++ b/Src/Newtonsoft.Json/JsonWriterException.cs @@ -33,7 +33,7 @@ namespace Newtonsoft.Json /// /// The exception thrown when an error occurs while reading Json text. /// -#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) [Serializable] #endif public class JsonWriterException : JsonException @@ -72,7 +72,7 @@ namespace Newtonsoft.Json { } -#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) /// /// Initializes a new instance of the class. /// diff --git a/Src/Newtonsoft.Json/Linq/IJEnumerable.cs b/Src/Newtonsoft.Json/Linq/IJEnumerable.cs index 67d8cbe3..c5c03aff 100644 --- a/Src/Newtonsoft.Json/Linq/IJEnumerable.cs +++ b/Src/Newtonsoft.Json/Linq/IJEnumerable.cs @@ -32,7 +32,7 @@ namespace Newtonsoft.Json.Linq /// /// The type of token public interface IJEnumerable< -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) out #endif T> : IEnumerable where T : JToken diff --git a/Src/Newtonsoft.Json/Linq/JContainer.cs b/Src/Newtonsoft.Json/Linq/JContainer.cs index 3a71dc52..a99cbd42 100644 --- a/Src/Newtonsoft.Json/Linq/JContainer.cs +++ b/Src/Newtonsoft.Json/Linq/JContainer.cs @@ -46,17 +46,17 @@ namespace Newtonsoft.Json.Linq /// Represents a token that can contain other tokens. /// public abstract class JContainer : JToken, IList -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) , ITypedList, IBindingList #elif PORTABLE , INotifyCollectionChanged #endif , IList -#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || NETFX_CORE || PORTABLE40 || PORTABLE) , INotifyCollectionChanged #endif { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) internal ListChangedEventHandler _listChanged; internal AddingNewEventHandler _addingNew; @@ -78,7 +78,7 @@ namespace Newtonsoft.Json.Linq remove { _addingNew -= value; } } #endif -#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) internal NotifyCollectionChangedEventHandler _collectionChanged; /// @@ -130,7 +130,7 @@ namespace Newtonsoft.Json.Linq return new List(); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) /// /// Raises the event. /// @@ -164,7 +164,7 @@ namespace Newtonsoft.Json.Linq } } #endif -#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) /// /// Raises the event. /// @@ -357,11 +357,11 @@ namespace Newtonsoft.Json.Linq ChildrenTokens.Insert(index, item); -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) if (_listChanged != null) OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index)); #endif -#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) if (_collectionChanged != null) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index)); #endif @@ -391,11 +391,11 @@ namespace Newtonsoft.Json.Linq ChildrenTokens.RemoveAt(index); -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) if (_listChanged != null) OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index)); #endif -#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) if (_collectionChanged != null) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index)); #endif @@ -455,11 +455,11 @@ namespace Newtonsoft.Json.Linq existing.Previous = null; existing.Next = null; -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) if (_listChanged != null) OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index)); #endif -#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) if (_collectionChanged != null) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, item, existing, index)); #endif @@ -478,11 +478,11 @@ namespace Newtonsoft.Json.Linq ChildrenTokens.Clear(); -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) if (_listChanged != null) OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1)); #endif -#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) if (_collectionChanged != null) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); #endif @@ -751,7 +751,7 @@ namespace Newtonsoft.Json.Linq return hashCode; } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) string ITypedList.GetListName(PropertyDescriptor[] listAccessors) { return string.Empty; @@ -920,7 +920,7 @@ namespace Newtonsoft.Json.Linq #endregion #region IBindingList Members -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) void IBindingList.AddIndex(PropertyDescriptor property) { } diff --git a/Src/Newtonsoft.Json/Linq/JObject.cs b/Src/Newtonsoft.Json/Linq/JObject.cs index 68a709c8..bdf44679 100644 --- a/Src/Newtonsoft.Json/Linq/JObject.cs +++ b/Src/Newtonsoft.Json/Linq/JObject.cs @@ -53,10 +53,10 @@ namespace Newtonsoft.Json.Linq /// /// public class JObject : JContainer, IDictionary, INotifyPropertyChanged -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) , ICustomTypeDescriptor #endif -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) , INotifyPropertyChanging #endif { @@ -76,7 +76,7 @@ namespace Newtonsoft.Json.Linq /// public event PropertyChangedEventHandler PropertyChanged; -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40) /// /// Occurs when a property value is changing. /// @@ -159,11 +159,11 @@ namespace Newtonsoft.Json.Linq internal void InternalPropertyChanged(JProperty childProperty) { OnPropertyChanged(childProperty.Name); -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) if (_listChanged != null) OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, IndexOfItem(childProperty))); #endif -#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE40) if (_collectionChanged != null) OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, childProperty, childProperty, IndexOfItem(childProperty))); #endif @@ -171,7 +171,7 @@ namespace Newtonsoft.Json.Linq internal void InternalPropertyChanging(JProperty childProperty) { -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) OnPropertyChanging(childProperty.Name); #endif } @@ -274,7 +274,7 @@ namespace Newtonsoft.Json.Linq } else { -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) OnPropertyChanging(propertyName); #endif Add(new JProperty(propertyName, value)); @@ -584,7 +584,7 @@ namespace Newtonsoft.Json.Linq PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE || NET20) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE || NET20) /// /// Raises the event with the provided arguments. /// @@ -596,7 +596,7 @@ namespace Newtonsoft.Json.Linq } #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) // include custom type descriptor on JObject rather than use a provider because the properties are specific to a type #region ICustomTypeDescriptor diff --git a/Src/Newtonsoft.Json/Linq/JPropertyDescriptor.cs b/Src/Newtonsoft.Json/Linq/JPropertyDescriptor.cs index a0b80d8b..1570d50a 100644 --- a/Src/Newtonsoft.Json/Linq/JPropertyDescriptor.cs +++ b/Src/Newtonsoft.Json/Linq/JPropertyDescriptor.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) using System; using System.ComponentModel; using Newtonsoft.Json.Utilities; diff --git a/Src/Newtonsoft.Json/Linq/JToken.cs b/Src/Newtonsoft.Json/Linq/JToken.cs index 9832851a..ffce1d22 100644 --- a/Src/Newtonsoft.Json/Linq/JToken.cs +++ b/Src/Newtonsoft.Json/Linq/JToken.cs @@ -30,7 +30,7 @@ using System.Dynamic; using System.Linq.Expressions; #endif using System.IO; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif using System.Text; @@ -51,7 +51,7 @@ namespace Newtonsoft.Json.Linq /// Represents an abstract JSON token. /// public abstract class JToken : IJEnumerable, IJsonLineInfo -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) , ICloneable #endif #if !(NET35 || NET20 || PORTABLE40) @@ -456,7 +456,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, BooleanTypes, false)) throw new ArgumentException("Can not convert {0} to Boolean.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return Convert.ToBoolean((int)(BigInteger)v.Value); #endif @@ -498,7 +498,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, BooleanTypes, true)) throw new ArgumentException("Can not convert {0} to Boolean.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return Convert.ToBoolean((int)(BigInteger)v.Value); #endif @@ -517,7 +517,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to Int64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (long)(BigInteger)v.Value; #endif @@ -586,7 +586,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to Decimal.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (decimal?)(BigInteger)v.Value; #endif @@ -608,7 +608,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to Double.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (double?)(BigInteger)v.Value; #endif @@ -630,7 +630,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, CharTypes, true)) throw new ArgumentException("Can not convert {0} to Char.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (char?)(BigInteger)v.Value; #endif @@ -649,7 +649,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to Int32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (int)(BigInteger)v.Value; #endif @@ -668,7 +668,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to Int16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (short)(BigInteger)v.Value; #endif @@ -688,7 +688,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to UInt16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (ushort)(BigInteger)v.Value; #endif @@ -708,7 +708,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, CharTypes, false)) throw new ArgumentException("Can not convert {0} to Char.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (char)(BigInteger)v.Value; #endif @@ -727,7 +727,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to Byte.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (byte)(BigInteger)v.Value; #endif @@ -747,7 +747,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to SByte.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (sbyte)(BigInteger)v.Value; #endif @@ -769,7 +769,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to Int32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (int?)(BigInteger)v.Value; #endif @@ -791,7 +791,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to Int16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (short?)(BigInteger)v.Value; #endif @@ -814,7 +814,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to UInt16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (ushort?)(BigInteger)v.Value; #endif @@ -836,7 +836,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to Byte.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (byte?)(BigInteger)v.Value; #endif @@ -859,7 +859,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to SByte.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (sbyte?)(BigInteger)v.Value; #endif @@ -900,7 +900,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to Int64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (long?)(BigInteger)v.Value; #endif @@ -922,7 +922,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to Single.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (float?)(BigInteger)v.Value; #endif @@ -941,7 +941,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to Decimal.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (decimal)(BigInteger)v.Value; #endif @@ -964,7 +964,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to UInt32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (uint?)(BigInteger)v.Value; #endif @@ -987,7 +987,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, true)) throw new ArgumentException("Can not convert {0} to UInt64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (ulong?)(BigInteger)v.Value; #endif @@ -1006,7 +1006,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to Double.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (double)(BigInteger)v.Value; #endif @@ -1025,7 +1025,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to Single.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (float)(BigInteger)v.Value; #endif @@ -1051,7 +1051,7 @@ namespace Newtonsoft.Json.Linq return null; if (v.Value is byte[]) return Convert.ToBase64String((byte[])v.Value); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return ((BigInteger)v.Value).ToString(CultureInfo.InvariantCulture); #endif @@ -1071,7 +1071,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to UInt32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (uint)(BigInteger)v.Value; #endif @@ -1091,7 +1091,7 @@ namespace Newtonsoft.Json.Linq if (v == null || !ValidateToken(v, NumberTypes, false)) throw new ArgumentException("Can not convert {0} to UInt64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return (ulong)(BigInteger)v.Value; #endif @@ -1115,7 +1115,7 @@ namespace Newtonsoft.Json.Linq if (v.Value is string) return Convert.FromBase64String(Convert.ToString(v.Value, CultureInfo.InvariantCulture)); -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (v.Value is BigInteger) return ((BigInteger)v.Value).ToByteArray(); #endif @@ -1220,7 +1220,7 @@ namespace Newtonsoft.Json.Linq return (v.Value is Uri) ? (Uri)v.Value : new Uri(Convert.ToString(v.Value, CultureInfo.InvariantCulture)); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) private static BigInteger ToBigInteger(JToken value) { JValue v = EnsureValue(value); @@ -1769,7 +1769,7 @@ namespace Newtonsoft.Json.Linq return (TimeSpan?)this; case PrimitiveTypeCode.TimeSpan: return (TimeSpan)this; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) case PrimitiveTypeCode.BigIntegerNullable: return ToBigIntegerNullable(this); case PrimitiveTypeCode.BigInteger: @@ -1963,7 +1963,7 @@ namespace Newtonsoft.Json.Linq } #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) object ICloneable.Clone() { return DeepClone(); diff --git a/Src/Newtonsoft.Json/Linq/JTokenWriter.cs b/Src/Newtonsoft.Json/Linq/JTokenWriter.cs index c40547ce..9235fab1 100644 --- a/Src/Newtonsoft.Json/Linq/JTokenWriter.cs +++ b/Src/Newtonsoft.Json/Linq/JTokenWriter.cs @@ -25,7 +25,7 @@ using System; using System.Globalization; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif using Newtonsoft.Json.Utilities; @@ -188,7 +188,7 @@ namespace Newtonsoft.Json.Linq /// The value to write. public override void WriteValue(object value) { -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) if (value is BigInteger) { InternalWriteValue(JsonToken.Integer); diff --git a/Src/Newtonsoft.Json/Linq/JValue.cs b/Src/Newtonsoft.Json/Linq/JValue.cs index 1b676263..ac631406 100644 --- a/Src/Newtonsoft.Json/Linq/JValue.cs +++ b/Src/Newtonsoft.Json/Linq/JValue.cs @@ -31,7 +31,7 @@ using System.Globalization; using System.Dynamic; using System.Linq.Expressions; #endif -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif @@ -195,7 +195,7 @@ namespace Newtonsoft.Json.Linq get { return false; } } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) private static int CompareBigInteger(BigInteger i1, object i2) { int result = i1.CompareTo(ConvertUtils.ToBigInteger(i2)); @@ -232,7 +232,7 @@ namespace Newtonsoft.Json.Linq switch (valueType) { case JTokenType.Integer: -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (objA is BigInteger) return CompareBigInteger((BigInteger)objA, objB); if (objB is BigInteger) @@ -245,7 +245,7 @@ namespace Newtonsoft.Json.Linq else return Convert.ToInt64(objA, CultureInfo.InvariantCulture).CompareTo(Convert.ToInt64(objB, CultureInfo.InvariantCulture)); case JTokenType.Float: -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (objA is BigInteger) return CompareBigInteger((BigInteger)objA, objB); if (objB is BigInteger) @@ -360,7 +360,7 @@ namespace Newtonsoft.Json.Linq } } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (objA is BigInteger || objB is BigInteger) { if (objA == null || objB == null) @@ -536,7 +536,7 @@ namespace Newtonsoft.Json.Linq return JTokenType.Integer; else if (value is Enum) return JTokenType.Integer; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) else if (value is BigInteger) return JTokenType.Integer; #endif @@ -638,7 +638,7 @@ namespace Newtonsoft.Json.Linq writer.WriteUndefined(); return; case JTokenType.Integer: -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (_value is BigInteger) writer.WriteValue((BigInteger)_value); else @@ -930,7 +930,7 @@ namespace Newtonsoft.Json.Linq if (_value is DateTimeOffset) return TypeCode.DateTime; #endif -#if !(NET20 || NET35 || PORTABLE40 || SILVERLIGHT) +#if !(NET20 || NET35 || PORTABLE40) if (_value is BigInteger) return TypeCode.Object; #endif diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Silverlight.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Silverlight.csproj deleted file mode 100644 index f5660a07..00000000 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Silverlight.csproj +++ /dev/null @@ -1,287 +0,0 @@ - - - - v3.5 - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Newtonsoft.Json - Newtonsoft.Json - v5.0 - false - true - false - - - 3.5 - - - Silverlight - $(TargetFrameworkVersion) - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - false - - - true - full - false - Bin\Debug\Silverlight\ - DEBUG;TRACE;SILVERLIGHT - true - true - prompt - 4 - Bin\Debug\Silverlight\Newtonsoft.Json.xml - Newtonsoft.Json.ruleset - true - false - - - pdbonly - true - Bin\Release\Silverlight\ - TRACE;SILVERLIGHT - true - true - prompt - 4 - Bin\Release\Silverlight\Newtonsoft.Json.xml - Newtonsoft.Json.ruleset - true - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - \ No newline at end of file diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.WindowsPhone.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.WindowsPhone.csproj deleted file mode 100644 index 2adffc9a..00000000 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.WindowsPhone.csproj +++ /dev/null @@ -1,236 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Newtonsoft.Json - Newtonsoft.Json - v8.0 - - - - - WindowsPhone - false - true - true - 11.0 - - - true - full - false - Bin\Debug\WindowsPhone\ - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - true - Newtonsoft.Json.ruleset - false - - - pdbonly - true - Bin\Release\WindowsPhone\ - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - Bin\Release\WindowsPhone\Newtonsoft.Json.xml - true - Newtonsoft.Json.ruleset - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index 7721fb4f..d40f88a0 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -32,12 +32,7 @@ using System.Security; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -#if WINDOWS_PHONE -[assembly: AssemblyTitle("Json.NET Windows Phone")] -#elif SILVERLIGHT -[assembly: AssemblyTitle("Json.NET Silverlight")] -#elif PORTABLE40 - +#if PORTABLE40 [assembly: AssemblyTitle("Json.NET Portable .NET 4.0")] #elif PORTABLE [assembly: AssemblyTitle("Json.NET Portable")] @@ -53,7 +48,6 @@ using System.Security; [assembly: AssemblyTitle("Json.NET .NET 4.0")] [assembly: AllowPartiallyTrustedCallers] #else - [assembly: AssemblyTitle("Json.NET")] [assembly: AllowPartiallyTrustedCallers] #endif @@ -98,4 +92,4 @@ using System.Security; [assembly: AssemblyVersion("4.5.0.0")] [assembly: AssemblyFileVersion("5.0.8.16620")] -[assembly: CLSCompliant(true)] \ No newline at end of file +[assembly: CLSCompliant(true)] diff --git a/Src/Newtonsoft.Json/Schema/JsonSchemaException.cs b/Src/Newtonsoft.Json/Schema/JsonSchemaException.cs index 94c93d59..5cc0f4f6 100644 --- a/Src/Newtonsoft.Json/Schema/JsonSchemaException.cs +++ b/Src/Newtonsoft.Json/Schema/JsonSchemaException.cs @@ -31,7 +31,7 @@ namespace Newtonsoft.Json.Schema /// /// Returns detailed information about the schema exception. /// -#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) [Serializable] #endif public class JsonSchemaException : JsonException @@ -83,7 +83,7 @@ namespace Newtonsoft.Json.Schema { } -#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) /// /// Initializes a new instance of the class. /// diff --git a/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs b/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs index 9a6aae73..50b1cb2d 100644 --- a/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs +++ b/Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs @@ -329,14 +329,14 @@ namespace Newtonsoft.Json.Schema } } break; -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) case JsonContractType.Serializable: CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired); CurrentSchema.Id = GetTypeId(type, false); GenerateISerializableContract(type, (JsonISerializableContract)contract); break; #endif -#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE40) +#if !(NET35 || NET20 || PORTABLE40) case JsonContractType.Dynamic: #endif case JsonContractType.Linq: @@ -388,7 +388,7 @@ namespace Newtonsoft.Json.Schema CurrentSchema.AllowAdditionalProperties = false; } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) private void GenerateISerializableContract(Type type, JsonISerializableContract contract) { CurrentSchema.AllowAdditionalProperties = true; @@ -445,7 +445,7 @@ namespace Newtonsoft.Json.Schema case PrimitiveTypeCode.UInt32: case PrimitiveTypeCode.Int64: case PrimitiveTypeCode.UInt64: -#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) +#if !(PORTABLE || NET35 || NET20) case PrimitiveTypeCode.BigInteger: #endif return schemaType | JsonSchemaType.Integer; diff --git a/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs b/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs index e02de4f3..709f6392 100644 --- a/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs +++ b/Src/Newtonsoft.Json/Serialization/DefaultContractResolver.cs @@ -25,7 +25,7 @@ using System; using System.Collections; -#if !(NET35 || NET20 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET35 || NET20 || PORTABLE || PORTABLE40) using System.Collections.Concurrent; #endif using System.Collections.Generic; @@ -97,16 +97,16 @@ namespace Newtonsoft.Json.Serialization private static readonly IList BuiltInConverters = new List { -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) new EntityKeyMemberConverter(), #endif #if !(NET35 || NET20 || PORTABLE40) new ExpandoObjectConverter(), #endif -#if (!(SILVERLIGHT || PORTABLE40) || WINDOWS_PHONE) +#if (!(PORTABLE40)) new XmlNodeConverter(), #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) new BinaryConverter(), new DataSetConverter(), new DataTableConverter(), @@ -155,7 +155,7 @@ namespace Newtonsoft.Json.Serialization /// public bool SerializeCompilerGeneratedMembers { get; set; } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) /// /// Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. /// @@ -195,7 +195,7 @@ namespace Newtonsoft.Json.Serialization #if !NETFX_CORE DefaultMembersSearchFlags = BindingFlags.Public | BindingFlags.Instance; #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) IgnoreSerializableAttribute = true; #endif @@ -260,7 +260,7 @@ namespace Newtonsoft.Json.Serialization protected virtual List GetSerializableMembers(Type objectType) { bool ignoreSerializableAttribute; -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) ignoreSerializableAttribute = IgnoreSerializableAttribute; #else ignoreSerializableAttribute = true; @@ -308,7 +308,7 @@ namespace Newtonsoft.Json.Serialization } } -#if !SILVERLIGHT && !NET20 +#if !NET20 Type match; // don't include EntityKey on entities objects... this is a bit hacky if (objectType.AssignableToTypeName("System.Data.Objects.DataClasses.EntityObject", out match)) @@ -329,7 +329,7 @@ namespace Newtonsoft.Json.Serialization return serializableMembers; } -#if !SILVERLIGHT && !NET20 +#if !NET20 private bool ShouldSerializeEntityMember(MemberInfo memberInfo) { PropertyInfo propertyInfo = memberInfo as PropertyInfo; @@ -354,7 +354,7 @@ namespace Newtonsoft.Json.Serialization InitializeContract(contract); bool ignoreSerializableAttribute; -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) ignoreSerializableAttribute = IgnoreSerializableAttribute; #else ignoreSerializableAttribute = true; @@ -377,7 +377,7 @@ namespace Newtonsoft.Json.Serialization } else if (contract.MemberSerialization == MemberSerialization.Fields) { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) // mimic DataContractSerializer behaviour when populating fields by overriding default creator to create an uninitialized object // note that this is only possible when the application is fully trusted so fall back to using the default constructor (if available) in partial trust if (JsonTypeReflector.FullyTrusted) @@ -732,7 +732,7 @@ namespace Newtonsoft.Json.Serialization 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 || PORTABLE40) +#if !(NET35 || NET20 || PORTABLE || PORTABLE40) if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>))) contract.OnDeserializedCallbacks.AddRange(onDeserialized); #else @@ -875,7 +875,7 @@ namespace Newtonsoft.Json.Serialization return contract; } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) /// /// Creates a for the given type. /// @@ -962,7 +962,7 @@ namespace Newtonsoft.Json.Serialization if (CanConvertToString(t)) return CreateStringContract(objectType); -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) if (!IgnoreSerializableInterface && typeof(ISerializable).IsAssignableFrom(t)) return CreateISerializableContract(objectType); #endif @@ -1008,10 +1008,8 @@ namespace Newtonsoft.Json.Serialization // use the objectType's TypeConverter if it has one and can convert to a string if (converter != null -#if !SILVERLIGHT && !(converter is ComponentConverter) && !(converter is ReferenceConverter) -#endif && converter.GetType() != typeof(TypeConverter)) { if (converter.CanConvertTo(typeof(string))) @@ -1022,11 +1020,6 @@ namespace Newtonsoft.Json.Serialization if (type == typeof(Type) || type.IsSubclassOf(typeof(Type))) return true; -#if SILVERLIGHT - if (type == typeof(Guid) || type == typeof(Uri) || type == typeof(TimeSpan)) - return true; -#endif - return false; } @@ -1107,7 +1100,7 @@ namespace Newtonsoft.Json.Serialization // warning - this method use to cause errors with Intellitrace. Retest in VS Ultimate after changes IValueProvider valueProvider; -#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) +#if !(PORTABLE40 || PORTABLE || NETFX_CORE) if (DynamicCodeGeneration) valueProvider = new DynamicValueProvider(member); else @@ -1208,7 +1201,7 @@ namespace Newtonsoft.Json.Serialization JsonTypeReflector.GetAttribute(attributeProvider) != null // automatically ignore extension data dictionary property if it is public || JsonTypeReflector.GetAttribute(attributeProvider) != null -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) || JsonTypeReflector.GetAttribute(attributeProvider) != null #endif ; diff --git a/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs b/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs index fe371e86..aa9ad70a 100644 --- a/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs +++ b/Src/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs @@ -49,7 +49,7 @@ namespace Newtonsoft.Json.Serialization { Assembly assembly; -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) // look, I don't like using obsolete methods as much as you do but this is the only way // Assembly.Load won't check the GAC for a partial name #pragma warning disable 618,612 @@ -145,14 +145,11 @@ namespace Newtonsoft.Json.Serialization public override void BindToName(Type serializedType, out string assemblyName, out string typeName) { #if NETFX_CORE || PORTABLE - assemblyName = serializedType.GetTypeInfo().Assembly.FullName; - typeName = serializedType.FullName; -#elif !SILVERLIGHT - assemblyName = serializedType.Assembly.FullName; + assemblyName = serializedType.GetTypeInfo().Assembly.FullName; typeName = serializedType.FullName; #else - assemblyName = null; - typeName = serializedType.AssemblyQualifiedName; + assemblyName = serializedType.Assembly.FullName; + typeName = serializedType.FullName; #endif } #endif diff --git a/Src/Newtonsoft.Json/Serialization/DiagnosticsTraceWriter.cs b/Src/Newtonsoft.Json/Serialization/DiagnosticsTraceWriter.cs index 9ab1e071..ef00dd2b 100644 --- a/Src/Newtonsoft.Json/Serialization/DiagnosticsTraceWriter.cs +++ b/Src/Newtonsoft.Json/Serialization/DiagnosticsTraceWriter.cs @@ -1,4 +1,4 @@ -#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) +#if !(PORTABLE40 || PORTABLE || NETFX_CORE) using System; using System.Diagnostics; using DiagnosticsTrace = System.Diagnostics.Trace; diff --git a/Src/Newtonsoft.Json/Serialization/DynamicValueProvider.cs b/Src/Newtonsoft.Json/Serialization/DynamicValueProvider.cs index 501fdeba..1be7e930 100644 --- a/Src/Newtonsoft.Json/Serialization/DynamicValueProvider.cs +++ b/Src/Newtonsoft.Json/Serialization/DynamicValueProvider.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) +#if !(PORTABLE40 || PORTABLE || NETFX_CORE) using System; using System.Collections.Generic; #if NET20 diff --git a/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs b/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs index a6ead5b0..29d4d4bb 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonArrayContract.cs @@ -124,7 +124,7 @@ namespace Newtonsoft.Json.Serialization canDeserialize = true; ShouldCreateWrapper = true; } -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyCollection<>), out tempCollectionType)) { CollectionItemType = underlyingType.GetGenericArguments()[0]; diff --git a/Src/Newtonsoft.Json/Serialization/JsonContract.cs b/Src/Newtonsoft.Json/Serialization/JsonContract.cs index 24b3191e..b1cf0a78 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonContract.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonContract.cs @@ -44,7 +44,7 @@ namespace Newtonsoft.Json.Serialization #if !(NET35 || NET20 || PORTABLE40) Dynamic, #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) Serializable, #endif Linq diff --git a/Src/Newtonsoft.Json/Serialization/JsonDictionaryContract.cs b/Src/Newtonsoft.Json/Serialization/JsonDictionaryContract.cs index c84121bf..8fac58fe 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonDictionaryContract.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonDictionaryContract.cs @@ -92,11 +92,11 @@ namespace Newtonsoft.Json.Serialization if (ReflectionUtils.IsGenericDefinition(UnderlyingType, typeof(IDictionary<,>))) CreatedType = typeof(Dictionary<,>).MakeGenericType(keyType, valueType); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) IsReadOnlyOrFixedSize = ReflectionUtils.InheritsGenericDefinition(underlyingType, typeof(ReadOnlyDictionary<,>)); #endif } -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyDictionary<,>), out _genericCollectionDefinitionType)) { keyType = _genericCollectionDefinitionType.GetGenericArguments()[0]; diff --git a/Src/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs b/Src/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs index 31d37d9a..b4135d8a 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonFormatterConverter.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) using System; using System.Globalization; using System.Runtime.Serialization; diff --git a/Src/Newtonsoft.Json/Serialization/JsonISerializableContract.cs b/Src/Newtonsoft.Json/Serialization/JsonISerializableContract.cs index 4cf5396e..50d0d4e6 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonISerializableContract.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonISerializableContract.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) using System; namespace Newtonsoft.Json.Serialization diff --git a/Src/Newtonsoft.Json/Serialization/JsonObjectContract.cs b/Src/Newtonsoft.Json/Serialization/JsonObjectContract.cs index a7972648..11e11e80 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonObjectContract.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonObjectContract.cs @@ -130,7 +130,7 @@ namespace Newtonsoft.Json.Serialization ConstructorParameters = new JsonPropertyCollection(UnderlyingType); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NET35) [SecuritySafeCritical] #endif diff --git a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs index 9b4932ab..96ada2a3 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs @@ -33,7 +33,7 @@ using System.Dynamic; #endif using System.Diagnostics; using System.Globalization; -#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || SILVERLIGHT) +#if !(PORTABLE || PORTABLE40 || NET35 || NET20) using System.Numerics; #endif using System.Reflection; @@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Serialization } private JsonSerializerProxy _internalSerializer; -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) private JsonFormatterConverter _formatterConverter; #endif @@ -188,7 +188,7 @@ namespace Newtonsoft.Json.Serialization return _internalSerializer; } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) private JsonFormatterConverter GetFormatterConverter() { if (_formatterConverter == null) @@ -304,7 +304,7 @@ namespace Newtonsoft.Json.Serialization { case JsonContractType.Object: case JsonContractType.Dictionary: -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) case JsonContractType.Serializable: #endif #if !(NET35 || NET20 || PORTABLE40) @@ -458,7 +458,7 @@ namespace Newtonsoft.Json.Serialization JsonDynamicContract dynamicContract = (JsonDynamicContract)contract; return CreateDynamic(reader, dynamicContract, member, id); #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) case JsonContractType.Serializable: JsonISerializableContract serializableContract = (JsonISerializableContract)contract; return CreateISerializable(reader, serializableContract, member, id); @@ -720,7 +720,7 @@ To fix this error either change the JSON to a {1} or change the deserialized typ return Enum.ToObject(contract.NonNullableUnderlyingType, value); } -#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || SILVERLIGHT) +#if !(PORTABLE || PORTABLE40 || NET35 || NET20) if (value is BigInteger) return ConvertUtils.FromBigInteger((BigInteger)value, targetType); #endif @@ -1286,7 +1286,7 @@ To fix this error either change the JSON to a {1} or change the deserialized typ return underlyingList; } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) private object CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, string id) { Type objectType = contract.UnderlyingType; diff --git a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs index 0061544a..c6d99bf0 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalWriter.cs @@ -154,7 +154,7 @@ namespace Newtonsoft.Json.Serialization SerializeDynamic(writer, (IDynamicMetaObjectProvider)value, (JsonDynamicContract)valueContract, member, containerContract, containerProperty); break; #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) case JsonContractType.Serializable: SerializeISerializable(writer, (ISerializable)value, (JsonISerializableContract)valueContract, member, containerContract, containerProperty); break; @@ -298,25 +298,18 @@ namespace Newtonsoft.Json.Serialization // use the objectType's TypeConverter if it has one and can convert to a string if (converter != null -#if !SILVERLIGHT && !(converter is ComponentConverter) -#endif && converter.GetType() != typeof(TypeConverter)) { if (converter.CanConvertTo(typeof(string))) { -#if !SILVERLIGHT s = converter.ConvertToInvariantString(value); -#else - s = converter.ConvertToString(value); -#endif - return true; } } #endif -#if SILVERLIGHT || NETFX_CORE || PORTABLE +#if NETFX_CORE || PORTABLE if (value is Guid || value is Uri || value is TimeSpan) { s = value.ToString(); @@ -704,7 +697,7 @@ namespace Newtonsoft.Json.Serialization return writeMetadataObject; } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NET35) [SecuritySafeCritical] #endif diff --git a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs index bbea6cc4..d50e0908 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonTypeReflector.cs @@ -41,7 +41,7 @@ using System.Runtime.Serialization; namespace Newtonsoft.Json.Serialization { -#if !SILVERLIGHT && !NET20 && !NETFX_CORE +#if !NET20 && !NETFX_CORE internal interface IMetadataTypeAttribute { Type MetadataClassType { get; } @@ -63,7 +63,7 @@ namespace Newtonsoft.Json.Serialization public const string SpecifiedPostfix = "Specified"; private static readonly ThreadSafeStore JsonConverterTypeCache = new ThreadSafeStore(GetJsonConverterTypeFromAttribute); -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) private static readonly ThreadSafeStore AssociatedMetadataTypesCache = new ThreadSafeStore(GetAssociateMetadataTypeFromAttribute); private const string MetadataTypeAttributeTypeName = @@ -71,23 +71,6 @@ namespace Newtonsoft.Json.Serialization private static Type _cachedMetadataTypeAttributeType; #endif -#if SILVERLIGHT - private static readonly ThreadSafeStore TypeConverterTypeCache = new ThreadSafeStore(GetTypeConverterTypeFromAttribute); - - private static Type GetTypeConverterTypeFromAttribute(object attributeProvider) - { - TypeConverterAttribute converterAttribute = GetAttribute(attributeProvider); - if (converterAttribute == null) - return null; - - return Type.GetType(converterAttribute.ConverterTypeName); - } - - private static Type GetTypeConverterType(object attributeProvider) - { - return TypeConverterTypeCache.Get(attributeProvider); - } -#endif public static JsonContainerAttribute GetJsonContainerAttribute(Type type) { @@ -109,7 +92,7 @@ namespace Newtonsoft.Json.Serialization return GetJsonContainerAttribute(type) as JsonDictionaryAttribute; } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) +#if !(NETFX_CORE || PORTABLE || PORTABLE40) public static SerializableAttribute GetSerializableAttribute(Type type) { return CachedAttributeGetter.GetAttribute(type); @@ -178,7 +161,7 @@ namespace Newtonsoft.Json.Serialization return MemberSerialization.OptIn; #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) if (!ignoreSerializableAttribute) { SerializableAttribute serializableAttribute = GetSerializableAttribute(objectType); @@ -221,20 +204,11 @@ namespace Newtonsoft.Json.Serialization #if !(NETFX_CORE || PORTABLE40 || PORTABLE) public static TypeConverter GetTypeConverter(Type type) { -#if !SILVERLIGHT return TypeDescriptor.GetConverter(type); -#else - Type converterType = GetTypeConverterType(type); - - if (converterType != null) - return (TypeConverter)Activator.CreateInstance(converterType); - - return null; -#endif } #endif -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) private static Type GetAssociatedMetadataType(Type type) { return AssociatedMetadataTypesCache.Get(type); @@ -279,7 +253,7 @@ namespace Newtonsoft.Json.Serialization { T attribute; -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) Type metadataType = GetAssociatedMetadataType(type); if (metadataType != null) { @@ -307,7 +281,7 @@ namespace Newtonsoft.Json.Serialization { T attribute; -#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) Type metadataType = GetAssociatedMetadataType(memberInfo.DeclaringType); if (metadataType != null) { @@ -371,14 +345,14 @@ namespace Newtonsoft.Json.Serialization public static bool DynamicCodeGeneration { -#if !(NET20 || NET35 || SILVERLIGHT || NETFX_CORE || PORTABLE) +#if !(NET20 || NET35 || NETFX_CORE || PORTABLE) [SecuritySafeCritical] #endif get { if (_dynamicCodeGeneration == null) { -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) try { new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Demand(); @@ -407,7 +381,7 @@ namespace Newtonsoft.Json.Serialization { if (_fullyTrusted == null) { -#if (NETFX_CORE || SILVERLIGHT || PORTABLE || PORTABLE40) +#if (NETFX_CORE || PORTABLE || PORTABLE40) _fullyTrusted = false; #elif !(NET20 || NET35 || PORTABLE40) AppDomain appDomain = AppDomain.CurrentDomain; @@ -434,7 +408,7 @@ namespace Newtonsoft.Json.Serialization { get { -#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) +#if !(PORTABLE40 || PORTABLE || NETFX_CORE) if (DynamicCodeGeneration) return DynamicReflectionDelegateFactory.Instance; diff --git a/Src/Newtonsoft.Json/Serialization/LateBoundMetadataTypeAttribute.cs b/Src/Newtonsoft.Json/Serialization/LateBoundMetadataTypeAttribute.cs index 8c31d32c..4583443e 100644 --- a/Src/Newtonsoft.Json/Serialization/LateBoundMetadataTypeAttribute.cs +++ b/Src/Newtonsoft.Json/Serialization/LateBoundMetadataTypeAttribute.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !SILVERLIGHT && !NET20 && !NETFX_CORE +#if !NET20 && !NETFX_CORE using System; using System.Collections.Generic; using System.Linq; diff --git a/Src/Newtonsoft.Json/Serialization/TraceJsonWriter.cs b/Src/Newtonsoft.Json/Serialization/TraceJsonWriter.cs index b5e3b582..cd8c4a17 100644 --- a/Src/Newtonsoft.Json/Serialization/TraceJsonWriter.cs +++ b/Src/Newtonsoft.Json/Serialization/TraceJsonWriter.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Globalization; using System.IO; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) using System.Numerics; #endif using System.Text; @@ -143,7 +143,7 @@ namespace Newtonsoft.Json.Serialization public override void WriteValue(object value) { -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) if (value is BigInteger) { _textWriter.WriteValue(value); diff --git a/Src/Newtonsoft.Json/SerializationBinder.cs b/Src/Newtonsoft.Json/SerializationBinder.cs index 74ad77ce..0489ef1e 100644 --- a/Src/Newtonsoft.Json/SerializationBinder.cs +++ b/Src/Newtonsoft.Json/SerializationBinder.cs @@ -1,5 +1,5 @@  -#if SILVERLIGHT || PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE +#if PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE using System; using System.Reflection; diff --git a/Src/Newtonsoft.Json/TraceLevel.cs b/Src/Newtonsoft.Json/TraceLevel.cs index bc51d9df..e80d532d 100644 --- a/Src/Newtonsoft.Json/TraceLevel.cs +++ b/Src/Newtonsoft.Json/TraceLevel.cs @@ -1,5 +1,5 @@  -#if (NETFX_CORE || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if (NETFX_CORE || PORTABLE40 || PORTABLE) using Newtonsoft.Json.Serialization; namespace Newtonsoft.Json diff --git a/Src/Newtonsoft.Json/Utilities/CollectionUtils.cs b/Src/Newtonsoft.Json/Utilities/CollectionUtils.cs index f47812e1..8851cfe1 100644 --- a/Src/Newtonsoft.Json/Utilities/CollectionUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/CollectionUtils.cs @@ -76,7 +76,7 @@ namespace Newtonsoft.Json.Utilities } } -#if (NET20 || NET35 || SILVERLIGHT || PORTABLE40) +#if (NET20 || NET35 || PORTABLE40) public static void AddRange(this IList initial, IEnumerable collection) { ValidationUtils.ArgumentNotNull(initial, "initial"); @@ -94,7 +94,7 @@ namespace Newtonsoft.Json.Utilities return true; if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IDictionary<,>))) return true; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IReadOnlyDictionary<,>))) return true; #endif diff --git a/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs b/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs index 16c811d5..22ec8fcc 100644 --- a/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.ComponentModel; -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) using System.Numerics; #endif using Newtonsoft.Json.Serialization; @@ -35,7 +35,7 @@ using System.Reflection; #if NET20 using Newtonsoft.Json.Utilities.LinqBridge; #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) using System.Data.SqlTypes; #endif @@ -82,7 +82,7 @@ namespace Newtonsoft.Json.Utilities GuidNullable, TimeSpan, TimeSpanNullable, -#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) +#if !(PORTABLE || NET35 || NET20) BigInteger, BigIntegerNullable, #endif @@ -147,7 +147,7 @@ namespace Newtonsoft.Json.Utilities { typeof(Guid?), PrimitiveTypeCode.GuidNullable }, { typeof(TimeSpan), PrimitiveTypeCode.TimeSpan }, { typeof(TimeSpan?), PrimitiveTypeCode.TimeSpanNullable }, -#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) +#if !(PORTABLE || PORTABLE40 || NET35 || NET20) { typeof(BigInteger), PrimitiveTypeCode.BigInteger }, { typeof(BigInteger?), PrimitiveTypeCode.BigIntegerNullable }, #endif @@ -295,7 +295,7 @@ namespace Newtonsoft.Json.Utilities return o => call(null, o); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) +#if !(NET20 || NET35 || PORTABLE || PORTABLE40) internal static BigInteger ToBigInteger(object value) { if (value is BigInteger) @@ -399,7 +399,7 @@ namespace Newtonsoft.Json.Utilities return Type.GetType((string)initialValue, true); } -#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(NET20 || NET35 || PORTABLE40 || PORTABLE) if (targetType == typeof(BigInteger)) return ToBigInteger(initialValue); if (initialValue is BigInteger) @@ -411,24 +411,12 @@ namespace Newtonsoft.Json.Utilities TypeConverter toConverter = GetConverter(initialType); if (toConverter != null && toConverter.CanConvertTo(targetType)) - { -#if !SILVERLIGHT return toConverter.ConvertTo(null, culture, initialValue, targetType); -#else - return toConverter.ConvertTo(initialValue, targetType); -#endif - } TypeConverter fromConverter = GetConverter(targetType); if (fromConverter != null && fromConverter.CanConvertFrom(initialType)) - { -#if !SILVERLIGHT return fromConverter.ConvertFrom(null, culture, initialValue); -#else - return fromConverter.ConvertFrom(initialValue); -#endif - } #endif #if !(NETFX_CORE || PORTABLE40 || PORTABLE) // handle DBNull and INullable @@ -440,7 +428,7 @@ namespace Newtonsoft.Json.Utilities throw new Exception("Can not convert null {0} into non-nullable {1}.".FormatWith(CultureInfo.InvariantCulture, initialType, targetType)); } #endif -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) if (initialValue is INullable) return EnsureTypeAssignable(ToValue((INullable)initialValue), initialType, targetType); #endif @@ -529,7 +517,7 @@ namespace Newtonsoft.Json.Utilities throw new ArgumentException("Could not cast or convert from {0} to {1}.".FormatWith(CultureInfo.InvariantCulture, (initialType != null) ? initialType.ToString() : "{null}", targetType)); } -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) public static object ToValue(INullable nullableValue) { if (nullableValue == null) diff --git a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs index ba69ab96..457d40e0 100644 --- a/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs +++ b/Src/Newtonsoft.Json/Utilities/DictionaryWrapper.cs @@ -46,7 +46,7 @@ namespace Newtonsoft.Json.Utilities { private readonly IDictionary _dictionary; private readonly IDictionary _genericDictionary; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) private readonly IReadOnlyDictionary _readOnlyDictionary; #endif private object _syncRoot; @@ -65,7 +65,7 @@ namespace Newtonsoft.Json.Utilities _genericDictionary = dictionary; } -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) public DictionaryWrapper(IReadOnlyDictionary dictionary) { ValidationUtils.ArgumentNotNull(dictionary, "dictionary"); @@ -88,7 +88,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return _dictionary.Contains(key); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary.ContainsKey(key); #endif @@ -102,7 +102,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return _dictionary.Keys.Cast().ToList(); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary.Keys.ToList(); #endif @@ -125,7 +125,7 @@ namespace Newtonsoft.Json.Utilities return false; } } -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) { throw new NotSupportedException(); @@ -152,7 +152,7 @@ namespace Newtonsoft.Json.Utilities return true; } } -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) { throw new NotSupportedException(); @@ -170,7 +170,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return _dictionary.Values.Cast().ToList(); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary.Values.ToList(); #endif @@ -185,7 +185,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return (TValue)_dictionary[key]; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary[key]; #endif @@ -196,7 +196,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) _dictionary[key] = value; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) throw new NotSupportedException(); #endif @@ -209,7 +209,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) ((IList)_dictionary).Add(item); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) throw new NotSupportedException(); #endif @@ -221,7 +221,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) _dictionary.Clear(); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) throw new NotSupportedException(); #endif @@ -233,7 +233,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return ((IList)_dictionary).Contains(item); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary.Contains(item); #endif @@ -250,7 +250,7 @@ namespace Newtonsoft.Json.Utilities array[arrayIndex++] = new KeyValuePair((TKey)item.Key, (TValue)item.Value); } } -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) { throw new NotSupportedException(); @@ -268,7 +268,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return _dictionary.Count; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary.Count; #endif @@ -283,7 +283,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return _dictionary.IsReadOnly; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return true; #endif @@ -315,7 +315,7 @@ namespace Newtonsoft.Json.Utilities return true; } } -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) { throw new NotSupportedException(); @@ -331,7 +331,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return _dictionary.Cast().Select(de => new KeyValuePair((TKey)de.Key, (TValue)de.Value)).GetEnumerator(); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary.GetEnumerator(); #endif @@ -348,7 +348,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) _dictionary.Add(key, value); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) throw new NotSupportedException(); #endif @@ -362,7 +362,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return _dictionary[key]; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary[(TKey)key]; #endif @@ -373,7 +373,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) _dictionary[key] = value; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) throw new NotSupportedException(); #endif @@ -427,7 +427,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return _dictionary.GetEnumerator(); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return new DictionaryEnumerator(_readOnlyDictionary.GetEnumerator()); #endif @@ -439,7 +439,7 @@ namespace Newtonsoft.Json.Utilities { if (_genericDictionary != null) return _genericDictionary.ContainsKey((TKey)key); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary.ContainsKey((TKey)key); #endif @@ -453,7 +453,7 @@ namespace Newtonsoft.Json.Utilities { if (_genericDictionary != null) return false; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return true; #endif @@ -468,7 +468,7 @@ namespace Newtonsoft.Json.Utilities { if (_genericDictionary != null) return _genericDictionary.Keys.ToList(); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary.Keys.ToList(); #endif @@ -481,7 +481,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) _dictionary.Remove(key); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) throw new NotSupportedException(); #endif @@ -495,7 +495,7 @@ namespace Newtonsoft.Json.Utilities { if (_genericDictionary != null) return _genericDictionary.Values.ToList(); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary.Values.ToList(); #endif @@ -508,7 +508,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) _dictionary.CopyTo(array, index); -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) throw new NotSupportedException(); #endif @@ -544,7 +544,7 @@ namespace Newtonsoft.Json.Utilities { if (_dictionary != null) return _dictionary; -#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) +#if !(NET40 || NET35 || NET20 || PORTABLE40) else if (_readOnlyDictionary != null) return _readOnlyDictionary; #endif diff --git a/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs b/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs index 05145437..0e531edd 100644 --- a/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs +++ b/Src/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || PORTABLE || NETFX_CORE || PORTABLE40) +#if !(PORTABLE || NETFX_CORE || PORTABLE40) using System; using System.Collections.Generic; #if NET20 diff --git a/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs b/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs index 4690b8a6..9dfc68d1 100644 --- a/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/DynamicUtils.cs @@ -29,7 +29,7 @@ using System.Collections.Generic; using System.Dynamic; using System.Linq; using System.Linq.Expressions; -#if !(PORTABLE || WINDOWS_PHONE) +#if !(PORTABLE) using System.Reflection; #else using Microsoft.CSharp.RuntimeBinder; @@ -45,12 +45,8 @@ namespace Newtonsoft.Json.Utilities { internal static class BinderWrapper { -#if !(PORTABLE || WINDOWS_PHONE) -#if !SILVERLIGHT +#if !(PORTABLE) public const string CSharpAssemblyName = "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; -#else - public const string CSharpAssemblyName = "Microsoft.CSharp, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; -#endif private const string BinderTypeName = "Microsoft.CSharp.RuntimeBinder.Binder, " + CSharpAssemblyName; private const string CSharpArgumentInfoTypeName = "Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo, " + CSharpAssemblyName; @@ -116,7 +112,7 @@ namespace Newtonsoft.Json.Utilities public static CallSiteBinder GetMember(string name, Type context) { -#if !(PORTABLE || WINDOWS_PHONE) +#if !(PORTABLE) Init(); return (CallSiteBinder)_getMemberCall(null, 0, name, context, _getCSharpArgumentInfoArray); #else @@ -127,7 +123,7 @@ namespace Newtonsoft.Json.Utilities public static CallSiteBinder SetMember(string name, Type context) { -#if !(PORTABLE || WINDOWS_PHONE) +#if !(PORTABLE) Init(); return (CallSiteBinder)_setMemberCall(null, 0, name, context, _setCSharpArgumentInfoArray); #else diff --git a/Src/Newtonsoft.Json/Utilities/DynamicWrapper.cs b/Src/Newtonsoft.Json/Utilities/DynamicWrapper.cs index 0a1b92af..aa256c3a 100644 --- a/Src/Newtonsoft.Json/Utilities/DynamicWrapper.cs +++ b/Src/Newtonsoft.Json/Utilities/DynamicWrapper.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) +#if !(NETFX_CORE || PORTABLE40 || PORTABLE) using System; using System.Collections.Generic; using System.IO; diff --git a/Src/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs b/Src/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs index f08ca62b..40d900e5 100644 --- a/Src/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs +++ b/Src/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs @@ -23,7 +23,7 @@ // OTHER DEALINGS IN THE SOFTWARE. #endregion -#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) +#if !(PORTABLE40 || PORTABLE || NETFX_CORE) using System; using System.Reflection.Emit; using System.Reflection; diff --git a/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs b/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs index 9eb8a6d5..646fa393 100644 --- a/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs @@ -25,7 +25,7 @@ using System; using System.Collections.Generic; -#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) +#if !(PORTABLE || PORTABLE40 || NET35 || NET20) using System.Numerics; #endif using System.Reflection; @@ -928,7 +928,7 @@ namespace Newtonsoft.Json.Utilities return 0m; case PrimitiveTypeCode.DateTime: return new DateTime(); -#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) +#if !(PORTABLE || PORTABLE40 || NET35 || NET20) case PrimitiveTypeCode.BigInteger: return new BigInteger(); #endif diff --git a/Src/Newtonsoft.Json/Utilities/StringUtils.cs b/Src/Newtonsoft.Json/Utilities/StringUtils.cs index 21f09a6f..ea52e12f 100644 --- a/Src/Newtonsoft.Json/Utilities/StringUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/StringUtils.cs @@ -182,7 +182,7 @@ namespace Newtonsoft.Json.Utilities public static bool IsHighSurrogate(char c) { -#if !(SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(PORTABLE40 || PORTABLE) return char.IsHighSurrogate(c); #else return (c >= 55296 && c <= 56319); @@ -191,7 +191,7 @@ namespace Newtonsoft.Json.Utilities public static bool IsLowSurrogate(char c) { -#if !(SILVERLIGHT || PORTABLE40 || PORTABLE) +#if !(PORTABLE40 || PORTABLE) return char.IsLowSurrogate(c); #else return (c >= 56320 && c <= 57343);