-Removed SL/WP code and fiels

This commit is contained in:
James Newton-King
2013-10-20 16:41:15 +13:00
parent bcd6982419
commit 44bc7ea246
104 changed files with 371 additions and 1633 deletions
-31
View File
@@ -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
@@ -26,7 +26,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; 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() public void Utf8Text()
{ {
string badText = System.IO.File.ReadAllText(@"PoisonText.txt"); string badText = System.IO.File.ReadAllText(@"PoisonText.txt");
@@ -1447,7 +1447,7 @@ namespace Newtonsoft.Json.Tests.Bson
} }
#endif #endif
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
public class BigIntegerTestClass public class BigIntegerTestClass
{ {
public BigInteger Blah { get; set; } public BigInteger Blah { get; set; }
@@ -25,7 +25,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -747,7 +747,7 @@ namespace Newtonsoft.Json.Tests.Bson
//} //}
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
[Test] [Test]
public void WriteBigInteger() public void WriteBigInteger()
{ {
@@ -25,10 +25,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !SILVERLIGHT && !NET20 && !NETFX_CORE #if !NET20 && !NETFX_CORE
using System.Data.Linq; using System.Data.Linq;
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
using System.Data.SqlTypes; using System.Data.SqlTypes;
#endif #endif
using System.Text; using System.Text;
@@ -55,7 +55,7 @@ namespace Newtonsoft.Json.Tests.Converters
public byte[] NullByteArray { get; set; } public byte[] NullByteArray { get; set; }
} }
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void DeserializeBinaryClass() public void DeserializeBinaryClass()
{ {
@@ -121,7 +121,7 @@ namespace Newtonsoft.Json.Tests.Converters
}", json); }", json);
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
public class SqlBinaryClass public class SqlBinaryClass
{ {
public SqlBinary SqlBinary { get; set; } public SqlBinary SqlBinary { get; set; }
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
using System; using System;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
#if !NETFX_CORE #if !NETFX_CORE
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !NETFX_CORE #if !NETFX_CORE
@@ -27,10 +27,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !SILVERLIGHT && !NET20 && !NETFX_CORE #if !NET20 && !NETFX_CORE
using System.Data.Linq; using System.Data.Linq;
#endif #endif
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
using System.Data.SqlTypes; using System.Data.SqlTypes;
#endif #endif
using System.Dynamic; using System.Dynamic;
@@ -122,7 +122,7 @@ namespace Newtonsoft.Json.Tests.Converters
Assert.AreEqual(2006, d.Year); Assert.AreEqual(2006, d.Year);
} }
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
[Test] [Test]
public void SerializeFormattedDateTimeNewZealandCulture() public void SerializeFormattedDateTimeNewZealandCulture()
{ {
@@ -25,10 +25,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !SILVERLIGHT && !NET20 && !NETFX_CORE #if !NET20 && !NETFX_CORE
using System.Data.Linq; using System.Data.Linq;
#endif #endif
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
using System.Data.SqlTypes; using System.Data.SqlTypes;
#endif #endif
using System.IO; using System.IO;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json.Tests.Serialization; 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); Assert.AreEqual(@"{""root"":{""@xmlns"":""http://www.example.com/ns"",""a"":null,""bns:b"":{""@xmlns:bns"":""http://www.example.com/ns""},""c"":null}}", json1);
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
var xml1 = new XmlDocument(); var xml1 = new XmlDocument();
xml1.LoadXml(xmlString); xml1.LoadXml(xmlString);
+2 -2
View File
@@ -28,7 +28,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Text; using System.Text;
#if !(NET20 || NET35 || SILVERLIGHT) #if !(NET20 || NET35)
using System.Threading.Tasks; using System.Threading.Tasks;
#endif #endif
using System.Xml; using System.Xml;
@@ -873,7 +873,7 @@ now brown cow?", '"', true);
return (T)converter.ReadJson(reader, typeof(T), null, null); return (T)converter.ReadJson(reader, typeof(T), null, null);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
[Test] [Test]
public void Async() public void Async()
{ {
@@ -26,7 +26,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -832,7 +832,7 @@ Parameter name: reader",
} }
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
[Test] [Test]
public void ReadInt64Overflow() public void ReadInt64Overflow()
{ {
@@ -29,7 +29,7 @@ using System.IO;
#if NET20 #if NET20
using Newtonsoft.Json.Utilities.LinqBridge; using Newtonsoft.Json.Utilities.LinqBridge;
#endif #endif
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -352,7 +352,7 @@ namespace Newtonsoft.Json.Tests
Assert.IsNotNull(validationEventArgs); Assert.IsNotNull(validationEventArgs);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
[Test] [Test]
public void IntegerGreaterThanMaximumValue_BigInteger() public void IntegerGreaterThanMaximumValue_BigInteger()
{ {
@@ -606,7 +606,7 @@ namespace Newtonsoft.Json.Tests
Assert.IsNotNull(validationEventArgs); Assert.IsNotNull(validationEventArgs);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
[Test] [Test]
public void BigIntegerDivisibleBy_Success() public void BigIntegerDivisibleBy_Success()
{ {
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
using NUnit.Framework; using NUnit.Framework;
using System.Web.UI; using System.Web.UI;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
using NUnit.Framework; using NUnit.Framework;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
+13 -13
View File
@@ -28,7 +28,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Dynamic; using System.Dynamic;
using System.Linq; using System.Linq;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -178,7 +178,7 @@ namespace Newtonsoft.Json.Tests.Linq
new JProperty("Uri", new Uri("http://json.codeplex.com/")), new JProperty("Uri", new Uri("http://json.codeplex.com/")),
new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")), new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")),
new JProperty("TimeSpan", TimeSpan.FromDays(1)) new JProperty("TimeSpan", TimeSpan.FromDays(1))
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
, new JProperty("BigInteger", BigInteger.Parse("1")) , new JProperty("BigInteger", BigInteger.Parse("1"))
#endif #endif
); );
@@ -211,7 +211,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.IsTrue(d.Decimal == 1.1m); Assert.IsTrue(d.Decimal == 1.1m);
Assert.IsTrue(d.Decimal != 1.0f); Assert.IsTrue(d.Decimal != 1.0f);
Assert.IsTrue(d.Decimal != 1.0d); Assert.IsTrue(d.Decimal != 1.0d);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
Assert.IsTrue(d.Decimal > new BigInteger(0)); Assert.IsTrue(d.Decimal > new BigInteger(0));
#endif #endif
@@ -227,11 +227,11 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.IsTrue(d.Float == 1.1m); Assert.IsTrue(d.Float == 1.1m);
Assert.IsTrue(d.Float != 1.0f); Assert.IsTrue(d.Float != 1.0f);
Assert.IsTrue(d.Float != 1.0d); Assert.IsTrue(d.Float != 1.0d);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
Assert.IsTrue(d.Float > new BigInteger(0)); Assert.IsTrue(d.Float > new BigInteger(0));
#endif #endif
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
Assert.IsTrue(d.BigInteger == d.BigInteger); Assert.IsTrue(d.BigInteger == d.BigInteger);
Assert.IsTrue(d.BigInteger > 0); Assert.IsTrue(d.BigInteger > 0);
Assert.IsTrue(d.BigInteger > 0.0m); 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("Uri", new Uri("http://json.codeplex.com/")),
new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")), new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")),
new JProperty("TimeSpan", TimeSpan.FromDays(1)) new JProperty("TimeSpan", TimeSpan.FromDays(1))
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
, new JProperty("BigInteger", new BigInteger(100)) , new JProperty("BigInteger", new BigInteger(100))
#endif #endif
); );
@@ -366,7 +366,7 @@ namespace Newtonsoft.Json.Tests.Linq
r += 2; r += 2;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
r = d.BigInteger + null; r = d.BigInteger + null;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
r += 2; r += 2;
@@ -445,7 +445,7 @@ namespace Newtonsoft.Json.Tests.Linq
r -= 2; r -= 2;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
r = d.BigInteger - null; r = d.BigInteger - null;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
r -= 2; r -= 2;
@@ -519,7 +519,7 @@ namespace Newtonsoft.Json.Tests.Linq
r *= 2; r *= 2;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
r = d.BigInteger * 1.1d; r = d.BigInteger * 1.1d;
Assert.AreEqual(100m, (decimal)r); Assert.AreEqual(100m, (decimal)r);
r *= 2; r *= 2;
@@ -593,7 +593,7 @@ namespace Newtonsoft.Json.Tests.Linq
r /= 2; r /= 2;
Assert.AreEqual(null, r.Value); Assert.AreEqual(null, r.Value);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
r = d.BigInteger / 1.1d; r = d.BigInteger / 1.1d;
Assert.AreEqual(100m, (decimal)r); Assert.AreEqual(100m, (decimal)r);
r /= 2; r /= 2;
@@ -621,7 +621,7 @@ namespace Newtonsoft.Json.Tests.Linq
new JProperty("Uri", new Uri("http://json.codeplex.com/")), new JProperty("Uri", new Uri("http://json.codeplex.com/")),
new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")), new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")),
new JProperty("TimeSpan", TimeSpan.FromDays(1)) new JProperty("TimeSpan", TimeSpan.FromDays(1))
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
, new JProperty("BigInteger", new BigInteger(100)) , new JProperty("BigInteger", new BigInteger(100))
#endif #endif
); );
@@ -638,7 +638,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual("http://json.codeplex.com/", d.Uri.ToString()); Assert.AreEqual("http://json.codeplex.com/", d.Uri.ToString());
Assert.AreEqual("ea27fe1d-0d80-44f2-bf34-4654156fa7af", d.Guid.ToString()); Assert.AreEqual("ea27fe1d-0d80-44f2-bf34-4654156fa7af", d.Guid.ToString());
Assert.AreEqual("1.00:00:00", d.TimeSpan.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()); Assert.AreEqual("100", d.BigInteger.ToString());
#endif #endif
} }
@@ -722,7 +722,7 @@ namespace Newtonsoft.Json.Tests.Linq
AssertValueConverted<Guid?>(null); AssertValueConverted<Guid?>(null);
AssertValueConverted<Uri>(new Uri("http://json.codeplex.com/")); AssertValueConverted<Uri>(new Uri("http://json.codeplex.com/"));
AssertValueConverted<Uri>(null); AssertValueConverted<Uri>(null);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
AssertValueConverted<BigInteger>(new BigInteger(100)); AssertValueConverted<BigInteger>(new BigInteger(100));
AssertValueConverted<BigInteger?>(null); AssertValueConverted<BigInteger?>(null);
#endif #endif
@@ -450,7 +450,7 @@ Parameter name: index",
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void ITypedListGetItemProperties() public void ITypedListGetItemProperties()
{ {
@@ -27,7 +27,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.ComponentModel; using System.ComponentModel;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
@@ -42,7 +42,7 @@ using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAtt
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System.IO; using System.IO;
using System.Collections; using System.Collections;
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
using System.Web.UI; using System.Web.UI;
#endif #endif
#if NET20 #if NET20
@@ -684,7 +684,7 @@ Parameter name: arrayIndex",
Assert.AreEqual(p4, l[1]); Assert.AreEqual(p4, l[1]);
} }
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void PropertyChanging() public void PropertyChanging()
{ {
@@ -1241,7 +1241,7 @@ Parameter name: arrayIndex",
}); });
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void IBindingListSortDirection() public void IBindingListSortDirection()
{ {
@@ -1444,7 +1444,7 @@ Parameter name: arrayIndex",
} }
#endif #endif
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
[Test] [Test]
public void CollectionChanged() public void CollectionChanged()
{ {
@@ -1690,7 +1690,7 @@ Parameter name: arrayIndex",
}); });
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void GetProperties() public void GetProperties()
{ {
@@ -56,7 +56,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(p, p.Value.Parent); Assert.AreEqual(p, p.Value.Parent);
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void ListChanged() public void ListChanged()
{ {
@@ -25,7 +25,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -355,7 +355,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(5, (int)(new JValue(StringComparison.OrdinalIgnoreCase))); Assert.AreEqual(5, (int)(new JValue(StringComparison.OrdinalIgnoreCase)));
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
string bigIntegerText = "1234567899999999999999999999999999999999999999999999999999999999999990"; string bigIntegerText = "1234567899999999999999999999999999999999999999999999999999999999999990";
Assert.AreEqual(BigInteger.Parse(bigIntegerText), (new JValue(BigInteger.Parse(bigIntegerText))).Value); Assert.AreEqual(BigInteger.Parse(bigIntegerText), (new JValue(BigInteger.Parse(bigIntegerText))).Value);
@@ -435,7 +435,7 @@ namespace Newtonsoft.Json.Tests.Linq
#endif #endif
ExceptionAssert.Throws<ArgumentException>("Can not convert Boolean to Uri.", () => { var i = (Uri)new JValue(true); }); ExceptionAssert.Throws<ArgumentException>("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<ArgumentException>("Can not convert Uri to BigInteger.", () => { var i = (new JValue(new Uri("http://www.google.com"))).ToObject<BigInteger>(); }); ExceptionAssert.Throws<ArgumentException>("Can not convert Uri to BigInteger.", () => { var i = (new JValue(new Uri("http://www.google.com"))).ToObject<BigInteger>(); });
ExceptionAssert.Throws<ArgumentException>("Can not convert Null to BigInteger.", () => { var i = (new JValue((object)null)).ToObject<BigInteger>(); }); ExceptionAssert.Throws<ArgumentException>("Can not convert Null to BigInteger.", () => { var i = (new JValue((object)null)).ToObject<BigInteger>(); });
ExceptionAssert.Throws<ArgumentException>("Can not convert Guid to BigInteger.", () => { var i = (new JValue(Guid.NewGuid())).ToObject<BigInteger>(); }); ExceptionAssert.Throws<ArgumentException>("Can not convert Guid to BigInteger.", () => { var i = (new JValue(Guid.NewGuid())).ToObject<BigInteger>(); });
@@ -449,7 +449,7 @@ namespace Newtonsoft.Json.Tests.Linq
[Test] [Test]
public void ToObject() 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)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?)))); 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)); Assert.IsTrue(JToken.DeepEquals(new JValue((DateTimeOffset?)null), (JValue)(DateTimeOffset?)null));
#endif #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 // 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(new BigInteger(1)), new JValue(new BigInteger(1))));
Assert.IsTrue(JToken.DeepEquals(new JValue((BigInteger?)null), new JValue((BigInteger?)null))); 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)); Assert.IsTrue(a.DeepEquals(a2));
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void Clone() public void Clone()
{ {
@@ -25,7 +25,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -120,7 +120,7 @@ namespace Newtonsoft.Json.Tests.Linq
jsonWriter.WriteValue("DVD read/writer"); jsonWriter.WriteValue("DVD read/writer");
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
jsonWriter.WriteValue(new BigInteger(123)); jsonWriter.WriteValue(new BigInteger(123));
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState); Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
#endif #endif
@@ -149,7 +149,7 @@ namespace Newtonsoft.Json.Tests.Linq
/*fail*/]", writer.Token.ToString()); /*fail*/]", writer.Token.ToString());
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
[Test] [Test]
public void WriteBigInteger() public void WriteBigInteger()
{ {
@@ -26,7 +26,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -140,7 +140,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(g, v.Value); Assert.AreEqual(g, v.Value);
Assert.AreEqual(JTokenType.Guid, v.Type); Assert.AreEqual(JTokenType.Guid, v.Type);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
BigInteger i = BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990"); BigInteger i = BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990");
v.Value = i; v.Value = i;
Assert.AreEqual(i, v.Value); Assert.AreEqual(i, v.Value);
@@ -200,13 +200,13 @@ namespace Newtonsoft.Json.Tests.Linq
v = new JValue(new Guid("B282ADE7-C520-496C-A448-4084F6803DE5")); v = new JValue(new Guid("B282ADE7-C520-496C-A448-4084F6803DE5"));
Assert.AreEqual("b282ade7-c520-496c-a448-4084f6803de5", v.ToString(null, CultureInfo.InvariantCulture)); 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")); v = new JValue(BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990"));
Assert.AreEqual("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990", v.ToString(null, CultureInfo.InvariantCulture)); Assert.AreEqual("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990", v.ToString(null, CultureInfo.InvariantCulture));
#endif #endif
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
[Test] [Test]
public void JValueParse() public void JValueParse()
{ {
@@ -481,7 +481,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(Int32.MaxValue, Convert.ToInt32(new JValue(Int32.MaxValue))); Assert.AreEqual(Int32.MaxValue, Convert.ToInt32(new JValue(Int32.MaxValue)));
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
[Test] [Test]
public void ConvertsToInt32_BigInteger() public void ConvertsToInt32_BigInteger()
{ {
@@ -618,7 +618,7 @@ namespace Newtonsoft.Json.Tests.Linq
v = new JValue(new Uri("http://www.google.com")); v = new JValue(new Uri("http://www.google.com"));
Assert.AreEqual(TypeCode.Object, v.GetTypeCode()); Assert.AreEqual(TypeCode.Object, v.GetTypeCode());
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
v = new JValue(new BigInteger(3)); v = new JValue(new BigInteger(3));
Assert.AreEqual(TypeCode.Object, v.GetTypeCode()); Assert.AreEqual(TypeCode.Object, v.GetTypeCode());
#endif #endif
@@ -632,7 +632,7 @@ namespace Newtonsoft.Json.Tests.Linq
int i = (int)v.ToType(typeof(int), CultureInfo.InvariantCulture); int i = (int)v.ToType(typeof(int), CultureInfo.InvariantCulture);
Assert.AreEqual(9, i); Assert.AreEqual(9, i);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
BigInteger bi = (BigInteger)v.ToType(typeof(BigInteger), CultureInfo.InvariantCulture); BigInteger bi = (BigInteger)v.ToType(typeof(BigInteger), CultureInfo.InvariantCulture);
Assert.AreEqual(new BigInteger(9), bi); Assert.AreEqual(new BigInteger(9), bi);
#endif #endif
@@ -647,7 +647,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual("2013", v.ToString("yyyy")); Assert.AreEqual("2013", v.ToString("yyyy"));
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
[Test] [Test]
public void ToStringNewTypes() public void ToStringNewTypes()
{ {
@@ -732,7 +732,7 @@ keyword such as type of business.""
Assert.AreEqual(new DateTime(2000, 10, 15, 5, 5, 5, DateTimeKind.Utc), d); Assert.AreEqual(new DateTime(2000, 10, 15, 5, 5, 5, DateTimeKind.Utc), d);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
[Test] [Test]
public void CovariantIJEnumerable() public void CovariantIJEnumerable()
{ {
@@ -892,7 +892,7 @@ keyword such as type of business.""
Assert.AreEqual("hi!", (string)a[0]); Assert.AreEqual("hi!", (string)a[0]);
} }
#if !(NET35 || NET20 || WINDOWS_PHONE) #if !(NET35 || NET20)
[Test] [Test]
public void ExceptionFromOverloadWithJValue() public void ExceptionFromOverloadWithJValue()
{ {
@@ -232,7 +232,6 @@
<Compile Include="Linq\LinqToJsonTest.cs" /> <Compile Include="Linq\LinqToJsonTest.cs" />
<Compile Include="PerformanceTests.cs" /> <Compile Include="PerformanceTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SilverlightTests.cs" />
<Compile Include="TestFixtureBase.cs" /> <Compile Include="TestFixtureBase.cs" />
<Compile Include="Converters\XmlNodeConverterTest.cs" /> <Compile Include="Converters\XmlNodeConverterTest.cs" />
<Compile Include="TestObjects\TypeClass.cs" /> <Compile Include="TestObjects\TypeClass.cs" />
@@ -276,7 +276,6 @@
<Compile Include="Linq\LinqToJsonTest.cs" /> <Compile Include="Linq\LinqToJsonTest.cs" />
<Compile Include="PerformanceTests.cs" /> <Compile Include="PerformanceTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SilverlightTests.cs" />
<Compile Include="TestFixtureBase.cs" /> <Compile Include="TestFixtureBase.cs" />
<Compile Include="Converters\XmlNodeConverterTest.cs" /> <Compile Include="Converters\XmlNodeConverterTest.cs" />
<Compile Include="TestObjects\TypeClass.cs" /> <Compile Include="TestObjects\TypeClass.cs" />
@@ -394,7 +394,6 @@
<Compile Include="Linq\LinqToJsonTest.cs" /> <Compile Include="Linq\LinqToJsonTest.cs" />
<Compile Include="PerformanceTests.cs" /> <Compile Include="PerformanceTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SilverlightTests.cs" />
<Compile Include="TestFixtureBase.cs" /> <Compile Include="TestFixtureBase.cs" />
<Compile Include="Converters\XmlNodeConverterTest.cs" /> <Compile Include="Converters\XmlNodeConverterTest.cs" />
<Compile Include="TestObjects\TypeClass.cs" /> <Compile Include="TestObjects\TypeClass.cs" />
@@ -276,7 +276,6 @@
<Compile Include="Linq\LinqToJsonTest.cs" /> <Compile Include="Linq\LinqToJsonTest.cs" />
<Compile Include="PerformanceTests.cs" /> <Compile Include="PerformanceTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SilverlightTests.cs" />
<Compile Include="TestFixtureBase.cs" /> <Compile Include="TestFixtureBase.cs" />
<Compile Include="Converters\XmlNodeConverterTest.cs" /> <Compile Include="Converters\XmlNodeConverterTest.cs" />
<Compile Include="TestObjects\TypeClass.cs" /> <Compile Include="TestObjects\TypeClass.cs" />
@@ -271,7 +271,6 @@
<Compile Include="Linq\LinqToJsonTest.cs" /> <Compile Include="Linq\LinqToJsonTest.cs" />
<Compile Include="PerformanceTests.cs" /> <Compile Include="PerformanceTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SilverlightTests.cs" />
<Compile Include="TestFixtureBase.cs" /> <Compile Include="TestFixtureBase.cs" />
<Compile Include="Converters\XmlNodeConverterTest.cs" /> <Compile Include="Converters\XmlNodeConverterTest.cs" />
<Compile Include="TestObjects\TypeClass.cs" /> <Compile Include="TestObjects\TypeClass.cs" />
@@ -1,311 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0D8C3C2E-62C6-4C93-9377-6F74DD6BFD93}</ProjectGuid>
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json.Tests</RootNamespace>
<AssemblyName>Newtonsoft.Json.Tests</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<SilverlightApplication>false</SilverlightApplication>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\Debug\Silverlight\</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\Release\Silverlight\</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Libraries\Client\Microsoft.CSharp.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.4.7.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\NUnit\Silverlight\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net">
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.Serialization">
<Private>True</Private>
</Reference>
<Reference Include="System.ServiceModel.Web">
<Private>True</Private>
</Reference>
<Reference Include="System.Windows">
<Private>True</Private>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="system">
<Private>True</Private>
</Reference>
<Reference Include="System.Core">
<Private>True</Private>
</Reference>
<Reference Include="System.Xml">
<Private>True</Private>
</Reference>
<Reference Include="System.Windows.Browser">
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Bson\BsonReaderTests.cs" />
<Compile Include="Bson\BsonWriterTests.cs" />
<Compile Include="Converters\BinaryConverterTests.cs" />
<Compile Include="Converters\CustomCreationConverterTests.cs" />
<Compile Include="Converters\DataSetConverterTests.cs" />
<Compile Include="Converters\DataTableConverterTests.cs" />
<Compile Include="Converters\ExpandoObjectConverterTests.cs" />
<Compile Include="Converters\ObjectIdConverterTests.cs" />
<Compile Include="Converters\RegexConverterTests.cs" />
<Compile Include="Converters\StringEnumConverterTests.cs" />
<Compile Include="Converters\VersionConverterTests.cs" />
<Compile Include="ExceptionTests.cs" />
<Compile Include="JsonArrayAttributeTests.cs" />
<Compile Include="Linq\ComponentModel\BindingTests.cs" />
<Compile Include="Linq\ComponentModel\JPropertyDescriptorTests.cs" />
<Compile Include="Linq\DynamicTests.cs" />
<Compile Include="Linq\JPathTests.cs" />
<Compile Include="Linq\JRawTests.cs" />
<Compile Include="Linq\JTokenReaderTest.cs" />
<Compile Include="Linq\JTokenWriterTest.cs" />
<Compile Include="JsonValidatingReaderTests.cs" />
<Compile Include="Schema\ExtensionsTests.cs" />
<Compile Include="Schema\JsonSchemaModelBuilderTests.cs" />
<Compile Include="Schema\JsonSchemaNodeTests.cs" />
<Compile Include="Serialization\CamelCasePropertyNamesContractResolverTests.cs" />
<Compile Include="Serialization\ConstructorHandlingTests.cs" />
<Compile Include="Serialization\ContractResolverTests.cs" />
<Compile Include="Serialization\DefaultValueHandlingTests.cs" />
<Compile Include="Serialization\DynamicTests.cs" />
<Compile Include="Serialization\EntitiesSerializationTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
<Compile Include="Serialization\JsonSerializerTest.cs" />
<Compile Include="Serialization\MissingMemberHandlingTests.cs" />
<Compile Include="Serialization\NullValueHandlingTests.cs" />
<Compile Include="Serialization\PopulateTests.cs" />
<Compile Include="Serialization\PreserveReferencesHandlingTests.cs" />
<Compile Include="Serialization\ReferenceLoopHandlingTests.cs" />
<Compile Include="Serialization\SerializationErrorHandlingTests.cs" />
<Compile Include="Serialization\SerializationEventAttributeTests.cs" />
<Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\TypeNameHandlingTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
<Compile Include="TestObjects\AbstractGenericBase.cs" />
<Compile Include="TestObjects\ArgumentConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\BadJsonPropertyClass.cs" />
<Compile Include="TestObjects\Bar.cs" />
<Compile Include="TestObjects\Car.cs" />
<Compile Include="TestObjects\CircularReferenceClass.cs" />
<Compile Include="TestObjects\ClassAndMemberConverterClass.cs" />
<Compile Include="TestObjects\ClassConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\Computer.cs" />
<Compile Include="TestObjects\ConstructorCaseSensitivityClass.cs" />
<Compile Include="TestObjects\ConstructorReadonlyFields.cs" />
<Compile Include="TestObjects\Container.cs" />
<Compile Include="TestObjects\Content.cs" />
<Compile Include="TestObjects\ContentBaseClass.cs" />
<Compile Include="TestObjects\ContentSubClass.cs" />
<Compile Include="TestObjects\ConverterPrecedenceClass.cs" />
<Compile Include="TestObjects\ConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\CircularReferenceWithIdClass.cs" />
<Compile Include="TestObjects\DateTimeErrorObjectCollection.cs" />
<Compile Include="TestObjects\DefaultValueAttributeTestClass.cs" />
<Compile Include="TestObjects\DictionaryInterfaceClass.cs" />
<Compile Include="TestObjects\DoubleClass.cs" />
<Compile Include="TestObjects\EmployeeReference.cs" />
<Compile Include="TestObjects\Event.cs" />
<Compile Include="TestObjects\Foo.cs" />
<Compile Include="TestObjects\GenericImpl.cs" />
<Compile Include="TestObjects\GenericListAndDictionaryInterfaceProperties.cs" />
<Compile Include="TestObjects\GetOnlyPropertyClass.cs" />
<Compile Include="TestObjects\GoogleMapGeocoderStructure.cs" />
<Compile Include="TestObjects\HolderClass.cs" />
<Compile Include="TestObjects\IncompatibleJsonAttributeClass.cs" />
<Compile Include="TestObjects\InterfacePropertyTestClass.cs" />
<Compile Include="TestObjects\Invoice.cs" />
<Compile Include="TestObjects\IPrivateImplementationA.cs" />
<Compile Include="TestObjects\IPrivateImplementationB.cs" />
<Compile Include="TestObjects\IPrivateOverriddenImplementation.cs" />
<Compile Include="TestObjects\JaggedArray.cs" />
<Compile Include="TestObjects\JsonIgnoreAttributeTestClass.cs" />
<Compile Include="TestObjects\JsonPropertyClass.cs" />
<Compile Include="TestObjects\JsonPropertyWithHandlingValues.cs" />
<Compile Include="TestObjects\ListErrorObject.cs" />
<Compile Include="TestObjects\ListErrorObjectCollection.cs" />
<Compile Include="TestObjects\ListOfIds.cs" />
<Compile Include="TestObjects\ListTestClass.cs" />
<Compile Include="TestObjects\LogEntry.cs" />
<Compile Include="TestObjects\MemberConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\MethodExecutorObject.cs" />
<Compile Include="TestObjects\Movie.cs" />
<Compile Include="TestObjects\MyClass.cs" />
<Compile Include="TestObjects\Name.cs" />
<Compile Include="TestObjects\NonRequest.cs" />
<Compile Include="TestObjects\NullableDateTimeTestClass.cs" />
<Compile Include="TestObjects\ObjectArrayPropertyTest.cs" />
<Compile Include="TestObjects\PersonError.cs" />
<Compile Include="TestObjects\PersonPropertyClass.cs" />
<Compile Include="TestObjects\PersonRaw.cs" />
<Compile Include="TestObjects\PhoneNumber.cs" />
<Compile Include="TestObjects\PrivateConstructorTestClass.cs" />
<Compile Include="TestObjects\PrivateConstructorWithPublicParametizedConstructorTestClass.cs" />
<Compile Include="TestObjects\PrivateImplementationAClass.cs" />
<Compile Include="TestObjects\PrivateImplementationBClass.cs" />
<Compile Include="TestObjects\PrivateMembersClass.cs" />
<Compile Include="TestObjects\PropertyCase.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorRequiringConverterTestClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorTestClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorWithNonPropertyParameterTestClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorWithPropertyNameConflict.cs" />
<Compile Include="TestObjects\RequestOnly.cs" />
<Compile Include="TestObjects\RequiredMembersClass.cs" />
<Compile Include="TestObjects\RoleTransfer.cs" />
<Compile Include="TestObjects\SearchResult.cs" />
<Compile Include="TestObjects\SerializationEventTestDictionary.cs" />
<Compile Include="TestObjects\SerializationEventTestList.cs" />
<Compile Include="TestObjects\SerializationEventTestObject.cs" />
<Compile Include="TestObjects\SerializationEventTestObjectWithConstructor.cs" />
<Compile Include="TestObjects\SetOnlyPropertyClass.cs" />
<Compile Include="TestObjects\Article.cs" />
<Compile Include="TestObjects\ArticleCollection.cs" />
<Compile Include="TestObjects\ClassWithArray.cs" />
<Compile Include="TestObjects\ClassWithGuid.cs" />
<Compile Include="TestObjects\ConverableMembers.cs" />
<Compile Include="TestObjects\JsonIgnoreAttributeOnClassTestClass.cs" />
<Compile Include="Linq\JConstructorTests.cs" />
<Compile Include="Linq\JPropertyTests.cs" />
<Compile Include="TestObjects\MemberConverterClass.cs" />
<Compile Include="TestObjects\Product.cs" />
<Compile Include="TestObjects\ProductCollection.cs" />
<Compile Include="TestObjects\ProductShort.cs" />
<Compile Include="TestObjects\SetOnlyPropertyClass2.cs" />
<Compile Include="TestObjects\Shortie.cs" />
<Compile Include="TestObjects\Store.cs" />
<Compile Include="TestObjects\StoreColor.cs" />
<Compile Include="TestObjects\Person.cs" />
<Compile Include="Schema\JsonSchemaBuilderTests.cs" />
<Compile Include="Schema\JsonSchemaGeneratorTests.cs" />
<Compile Include="Schema\JsonSchemaTests.cs" />
<Compile Include="TestObjects\DateTimeTestClass.cs" />
<Compile Include="Converters\IsoDateTimeConverterTests.cs" />
<Compile Include="JsonConvertTest.cs" />
<Compile Include="Converters\JavaScriptDateTimeConverterTests.cs" />
<Compile Include="JsonTextReaderTest.cs" />
<Compile Include="JsonTextWriterTest.cs" />
<Compile Include="Linq\JArrayTests.cs" />
<Compile Include="Linq\JObjectTests.cs" />
<Compile Include="Linq\JTokenEqualityComparerTests.cs" />
<Compile Include="Linq\JTokenTests.cs" />
<Compile Include="Linq\JValueTests.cs" />
<Compile Include="Linq\LinqToJsonTest.cs" />
<Compile Include="PerformanceTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SilverlightTests.cs" />
<Compile Include="TestFixtureBase.cs" />
<Compile Include="Converters\XmlNodeConverterTest.cs" />
<Compile Include="TestObjects\StructTest.cs" />
<Compile Include="TestObjects\SubKlass.cs" />
<Compile Include="TestObjects\SuperKlass.cs" />
<Compile Include="TestObjects\TypeClass.cs" />
<Compile Include="TestObjects\TypedSubHashtable.cs" />
<Compile Include="TestObjects\UserNullable.cs" />
<Compile Include="TestObjects\VersionKeyedCollection.cs" />
<Compile Include="TestObjects\WagePerson.cs" />
<Compile Include="Utilities\DynamicReflectionDelegateFactoryTests.cs" />
<Compile Include="Utilities\ReflectionUtilsTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Newtonsoft.Json\Newtonsoft.Json.Silverlight.csproj">
<Project>{DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D}</Project>
<Name>Newtonsoft.Json.Silverlight</Name>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
<SilverlightProjectProperties />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
@@ -1,236 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5ED71C8C-D0A6-487C-9A8C-BB855ECEAF75}</ProjectGuid>
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json.Tests</RootNamespace>
<AssemblyName>Newtonsoft.Json.Tests</AssemblyName>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<SilverlightVersion>
</SilverlightVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\Debug\WindowsPhone\</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\Release\WindowsPhone\</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\Lib\NUnit\Silverlight\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Bson\BsonReaderTests.cs" />
<Compile Include="Bson\BsonWriterTests.cs" />
<Compile Include="Converters\BinaryConverterTests.cs" />
<Compile Include="Converters\CustomCreationConverterTests.cs" />
<Compile Include="Converters\DataSetConverterTests.cs" />
<Compile Include="Converters\DataTableConverterTests.cs" />
<Compile Include="Converters\ExpandoObjectConverterTests.cs" />
<Compile Include="Converters\ObjectIdConverterTests.cs" />
<Compile Include="Converters\RegexConverterTests.cs" />
<Compile Include="Converters\StringEnumConverterTests.cs" />
<Compile Include="Converters\VersionConverterTests.cs" />
<Compile Include="ExceptionTests.cs" />
<Compile Include="JsonArrayAttributeTests.cs" />
<Compile Include="Linq\ComponentModel\BindingTests.cs" />
<Compile Include="Linq\ComponentModel\JPropertyDescriptorTests.cs" />
<Compile Include="Linq\DynamicTests.cs" />
<Compile Include="Linq\JPathTests.cs" />
<Compile Include="Linq\JRawTests.cs" />
<Compile Include="Linq\JTokenReaderTest.cs" />
<Compile Include="Linq\JTokenWriterTest.cs" />
<Compile Include="JsonValidatingReaderTests.cs" />
<Compile Include="Schema\ExtensionsTests.cs" />
<Compile Include="Schema\JsonSchemaModelBuilderTests.cs" />
<Compile Include="Schema\JsonSchemaNodeTests.cs" />
<Compile Include="Serialization\CamelCasePropertyNamesContractResolverTests.cs" />
<Compile Include="Serialization\ConstructorHandlingTests.cs" />
<Compile Include="Serialization\ContractResolverTests.cs" />
<Compile Include="Serialization\DefaultValueHandlingTests.cs" />
<Compile Include="Serialization\DynamicTests.cs" />
<Compile Include="Serialization\EntitiesSerializationTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
<Compile Include="Serialization\JsonSerializerTest.cs" />
<Compile Include="Serialization\MissingMemberHandlingTests.cs" />
<Compile Include="Serialization\NullValueHandlingTests.cs" />
<Compile Include="Serialization\PopulateTests.cs" />
<Compile Include="Serialization\PreserveReferencesHandlingTests.cs" />
<Compile Include="Serialization\ReferenceLoopHandlingTests.cs" />
<Compile Include="Serialization\SerializationErrorHandlingTests.cs" />
<Compile Include="Serialization\SerializationEventAttributeTests.cs" />
<Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\TypeNameHandlingTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
<Compile Include="TestObjects\AbstractGenericBase.cs" />
<Compile Include="TestObjects\ArgumentConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\BadJsonPropertyClass.cs" />
<Compile Include="TestObjects\Bar.cs" />
<Compile Include="TestObjects\Car.cs" />
<Compile Include="TestObjects\CircularReferenceClass.cs" />
<Compile Include="TestObjects\ClassAndMemberConverterClass.cs" />
<Compile Include="TestObjects\ClassConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\Computer.cs" />
<Compile Include="TestObjects\ConstructorCaseSensitivityClass.cs" />
<Compile Include="TestObjects\ConstructorReadonlyFields.cs" />
<Compile Include="TestObjects\Container.cs" />
<Compile Include="TestObjects\Content.cs" />
<Compile Include="TestObjects\ContentBaseClass.cs" />
<Compile Include="TestObjects\ContentSubClass.cs" />
<Compile Include="TestObjects\ConverterPrecedenceClass.cs" />
<Compile Include="TestObjects\ConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\CircularReferenceWithIdClass.cs" />
<Compile Include="TestObjects\DateTimeErrorObjectCollection.cs" />
<Compile Include="TestObjects\DefaultValueAttributeTestClass.cs" />
<Compile Include="TestObjects\DictionaryInterfaceClass.cs" />
<Compile Include="TestObjects\DoubleClass.cs" />
<Compile Include="TestObjects\EmployeeReference.cs" />
<Compile Include="TestObjects\Event.cs" />
<Compile Include="TestObjects\Foo.cs" />
<Compile Include="TestObjects\GenericImpl.cs" />
<Compile Include="TestObjects\GenericListAndDictionaryInterfaceProperties.cs" />
<Compile Include="TestObjects\GetOnlyPropertyClass.cs" />
<Compile Include="TestObjects\GoogleMapGeocoderStructure.cs" />
<Compile Include="TestObjects\HolderClass.cs" />
<Compile Include="TestObjects\IncompatibleJsonAttributeClass.cs" />
<Compile Include="TestObjects\InterfacePropertyTestClass.cs" />
<Compile Include="TestObjects\Invoice.cs" />
<Compile Include="TestObjects\IPrivateImplementationA.cs" />
<Compile Include="TestObjects\IPrivateImplementationB.cs" />
<Compile Include="TestObjects\IPrivateOverriddenImplementation.cs" />
<Compile Include="TestObjects\JaggedArray.cs" />
<Compile Include="TestObjects\JsonIgnoreAttributeTestClass.cs" />
<Compile Include="TestObjects\JsonPropertyClass.cs" />
<Compile Include="TestObjects\JsonPropertyWithHandlingValues.cs" />
<Compile Include="TestObjects\ListErrorObject.cs" />
<Compile Include="TestObjects\ListErrorObjectCollection.cs" />
<Compile Include="TestObjects\ListOfIds.cs" />
<Compile Include="TestObjects\ListTestClass.cs" />
<Compile Include="TestObjects\LogEntry.cs" />
<Compile Include="TestObjects\MemberConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\MethodExecutorObject.cs" />
<Compile Include="TestObjects\Movie.cs" />
<Compile Include="TestObjects\MyClass.cs" />
<Compile Include="TestObjects\Name.cs" />
<Compile Include="TestObjects\NonRequest.cs" />
<Compile Include="TestObjects\NullableDateTimeTestClass.cs" />
<Compile Include="TestObjects\ObjectArrayPropertyTest.cs" />
<Compile Include="TestObjects\PersonError.cs" />
<Compile Include="TestObjects\PersonPropertyClass.cs" />
<Compile Include="TestObjects\PersonRaw.cs" />
<Compile Include="TestObjects\PhoneNumber.cs" />
<Compile Include="TestObjects\PrivateConstructorTestClass.cs" />
<Compile Include="TestObjects\PrivateConstructorWithPublicParametizedConstructorTestClass.cs" />
<Compile Include="TestObjects\PrivateImplementationAClass.cs" />
<Compile Include="TestObjects\PrivateImplementationBClass.cs" />
<Compile Include="TestObjects\PrivateMembersClass.cs" />
<Compile Include="TestObjects\PropertyCase.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorRequiringConverterTestClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorTestClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorWithNonPropertyParameterTestClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorWithPropertyNameConflict.cs" />
<Compile Include="TestObjects\RequestOnly.cs" />
<Compile Include="TestObjects\RequiredMembersClass.cs" />
<Compile Include="TestObjects\RoleTransfer.cs" />
<Compile Include="TestObjects\SearchResult.cs" />
<Compile Include="TestObjects\SerializationEventTestDictionary.cs" />
<Compile Include="TestObjects\SerializationEventTestList.cs" />
<Compile Include="TestObjects\SerializationEventTestObject.cs" />
<Compile Include="TestObjects\SerializationEventTestObjectWithConstructor.cs" />
<Compile Include="TestObjects\SetOnlyPropertyClass.cs" />
<Compile Include="TestObjects\Article.cs" />
<Compile Include="TestObjects\ArticleCollection.cs" />
<Compile Include="TestObjects\ClassWithArray.cs" />
<Compile Include="TestObjects\ClassWithGuid.cs" />
<Compile Include="TestObjects\ConverableMembers.cs" />
<Compile Include="TestObjects\JsonIgnoreAttributeOnClassTestClass.cs" />
<Compile Include="Linq\JConstructorTests.cs" />
<Compile Include="Linq\JPropertyTests.cs" />
<Compile Include="TestObjects\MemberConverterClass.cs" />
<Compile Include="TestObjects\Product.cs" />
<Compile Include="TestObjects\ProductCollection.cs" />
<Compile Include="TestObjects\ProductShort.cs" />
<Compile Include="TestObjects\SetOnlyPropertyClass2.cs" />
<Compile Include="TestObjects\Shortie.cs" />
<Compile Include="TestObjects\Store.cs" />
<Compile Include="TestObjects\StoreColor.cs" />
<Compile Include="TestObjects\Person.cs" />
<Compile Include="Schema\JsonSchemaBuilderTests.cs" />
<Compile Include="Schema\JsonSchemaGeneratorTests.cs" />
<Compile Include="Schema\JsonSchemaTests.cs" />
<Compile Include="TestObjects\DateTimeTestClass.cs" />
<Compile Include="Converters\IsoDateTimeConverterTests.cs" />
<Compile Include="JsonConvertTest.cs" />
<Compile Include="Converters\JavaScriptDateTimeConverterTests.cs" />
<Compile Include="JsonTextReaderTest.cs" />
<Compile Include="JsonTextWriterTest.cs" />
<Compile Include="Linq\JArrayTests.cs" />
<Compile Include="Linq\JObjectTests.cs" />
<Compile Include="Linq\JTokenEqualityComparerTests.cs" />
<Compile Include="Linq\JTokenTests.cs" />
<Compile Include="Linq\JValueTests.cs" />
<Compile Include="Linq\LinqToJsonTest.cs" />
<Compile Include="PerformanceTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SilverlightTests.cs" />
<Compile Include="TestFixtureBase.cs" />
<Compile Include="Converters\XmlNodeConverterTest.cs" />
<Compile Include="TestObjects\StructTest.cs" />
<Compile Include="TestObjects\SubKlass.cs" />
<Compile Include="TestObjects\SuperKlass.cs" />
<Compile Include="TestObjects\TypeClass.cs" />
<Compile Include="TestObjects\TypedSubHashtable.cs" />
<Compile Include="TestObjects\UserNullable.cs" />
<Compile Include="TestObjects\VersionKeyedCollection.cs" />
<Compile Include="TestObjects\WagePerson.cs" />
<Compile Include="Utilities\DynamicReflectionDelegateFactoryTests.cs" />
<Compile Include="Utilities\ReflectionUtilsTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Newtonsoft.Json\Newtonsoft.Json.WindowsPhone.csproj">
<Project>{7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E}</Project>
<Name>Newtonsoft.Json.WindowsPhone</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
<ProjectExtensions />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -244,7 +244,6 @@
<Compile Include="Serialization\TraceWriterTests.cs" /> <Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\TypeNameHandlingTests.cs" /> <Compile Include="Serialization\TypeNameHandlingTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" /> <Compile Include="Serialization\WebApiIntegrationTests.cs" />
<Compile Include="SilverlightTests.cs" />
<Compile Include="TestFixtureBase.cs" /> <Compile Include="TestFixtureBase.cs" />
<Compile Include="TestObjects\AbstractGenericBase.cs" /> <Compile Include="TestObjects\AbstractGenericBase.cs" />
<Compile Include="TestObjects\ArgumentConverterPrecedenceClassConverter.cs" /> <Compile Include="TestObjects\ArgumentConverterPrecedenceClassConverter.cs" />
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE) #if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@@ -31,11 +31,7 @@ using System.Security;
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
#if WINDOWS_PHONE #if PORTABLE
[assembly: AssemblyTitle("Json.NET Tests Windows Phone")]
#elif SILVERLIGHT
[assembly: AssemblyTitle("Json.NET Tests Silverlight")]
#elif PORTABLE
[assembly: AssemblyTitle("Json.NET Tests Portable")] [assembly: AssemblyTitle("Json.NET Tests Portable")]
#elif NETFX_CORE #elif NETFX_CORE
[assembly: AssemblyTitle("Json.NET Tests WinRT")] [assembly: AssemblyTitle("Json.NET Tests WinRT")]
@@ -36,7 +36,7 @@ using Newtonsoft.Json.Schema;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System.IO; using System.IO;
using Newtonsoft.Json.Tests.TestObjects; using Newtonsoft.Json.Tests.TestObjects;
#if !(SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
using System.Data; using System.Data;
#endif #endif
@@ -200,7 +200,7 @@ namespace Newtonsoft.Json.Tests.Schema
#if !NET20 #if !NET20
GenerateSchemaAndSerializeFromType(new NullableDateTimeTestClass()); GenerateSchemaAndSerializeFromType(new NullableDateTimeTestClass());
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
GenerateSchemaAndSerializeFromType(new DataSet()); GenerateSchemaAndSerializeFromType(new DataSet());
#endif #endif
GenerateSchemaAndSerializeFromType(new object()); GenerateSchemaAndSerializeFromType(new object());
@@ -311,7 +311,7 @@ namespace Newtonsoft.Json.Tests.Schema
Assert.IsTrue(v.IsValid(schema)); Assert.IsTrue(v.IsValid(schema));
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void GenerateSchemaForISerializable() public void GenerateSchemaForISerializable()
{ {
@@ -371,7 +371,7 @@ namespace Newtonsoft.Json.Tests.Schema
generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName; generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName;
generator.ContractResolver = new CustomDirectoryInfoMapper generator.ContractResolver = new CustomDirectoryInfoMapper
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
}; };
@@ -455,7 +455,7 @@ namespace Newtonsoft.Json.Tests.Schema
serializer.Converters.Add(new IsoDateTimeConverter()); serializer.Converters.Add(new IsoDateTimeConverter());
serializer.ContractResolver = new CustomDirectoryInfoMapper serializer.ContractResolver = new CustomDirectoryInfoMapper
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
IgnoreSerializableInterface = true IgnoreSerializableInterface = true
#endif #endif
}; };
@@ -475,7 +475,7 @@ namespace Newtonsoft.Json.Tests.Schema
generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName; generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName;
generator.ContractResolver = new CamelCasePropertyNamesContractResolver() generator.ContractResolver = new CamelCasePropertyNamesContractResolver()
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
}; };
@@ -520,7 +520,7 @@ namespace Newtonsoft.Json.Tests.Schema
}", json); }", json);
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void GenerateSchemaSerializable() public void GenerateSchemaSerializable()
{ {
@@ -27,7 +27,7 @@ using System;
using System.ComponentModel; using System.ComponentModel;
using System.IO; using System.IO;
using System.Runtime.Serialization; using System.Runtime.Serialization;
#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE) #if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
using System.Runtime.Serialization.Json; using System.Runtime.Serialization.Json;
#endif #endif
using System.Text; using System.Text;
@@ -237,7 +237,7 @@ namespace Newtonsoft.Json.Tests.Serialization
{ {
EmitDefaultValueClass c = new EmitDefaultValueClass(); EmitDefaultValueClass c = new EmitDefaultValueClass();
#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE) #if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(EmitDefaultValueClass)); DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(EmitDefaultValueClass));
MemoryStream ms = new MemoryStream(); MemoryStream ms = new MemoryStream();
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(NET35 || NET20 || SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
@@ -25,14 +25,14 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
#if !(NET35 || NET20 || SILVERLIGHT) #if !(NET35 || NET20)
using System.Collections.Concurrent; using System.Collections.Concurrent;
#endif #endif
using System.Collections.Generic; using System.Collections.Generic;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE) #if !(NET20 || NET35 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
#if !SILVERLIGHT && !NET20 && !NETFX_CORE #if !NET20 && !NETFX_CORE
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Configuration; using System.Configuration;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@@ -68,7 +68,7 @@ using System.Runtime.Serialization;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Utilities;
using System.Reflection; using System.Reflection;
#if !NET20 && !SILVERLIGHT #if !NET20
using System.Xml.Linq; using System.Xml.Linq;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Linq.Expressions; using System.Linq.Expressions;
@@ -81,7 +81,7 @@ using Newtonsoft.Json.Utilities.LinqBridge;
#else #else
using System.Linq; using System.Linq;
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
using System.Drawing; using System.Drawing;
using System.Diagnostics; using System.Diagnostics;
@@ -1291,7 +1291,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(executorObject2.clientGetResultFunction, "ClientBanSubsCB"); Assert.AreEqual(executorObject2.clientGetResultFunction, "ClientBanSubsCB");
} }
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
[Test] [Test]
public void HashtableDeserialization() public void HashtableDeserialization()
{ {
@@ -1535,7 +1535,7 @@ keyword such as type of business.""
{ {
string json = @"[""vvv\/vvv\tvvv\""vvv\bvvv\nvvv\rvvv\\vvv\fvvv""]"; string json = @"[""vvv\/vvv\tvvv\""vvv\bvvv\nvvv\rvvv\\vvv\fvvv""]";
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
List<string> javaScriptSerializerResult = javaScriptSerializer.Deserialize<List<string>>(json); List<string> javaScriptSerializerResult = javaScriptSerializer.Deserialize<List<string>>(json);
#endif #endif
@@ -1547,7 +1547,7 @@ keyword such as type of business.""
Assert.AreEqual(1, jsonNetResult.Count); Assert.AreEqual(1, jsonNetResult.Count);
Assert.AreEqual(dataContractResult[0], jsonNetResult[0]); Assert.AreEqual(dataContractResult[0], jsonNetResult[0]);
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
Assert.AreEqual(javaScriptSerializerResult[0], jsonNetResult[0]); Assert.AreEqual(javaScriptSerializerResult[0], jsonNetResult[0]);
#endif #endif
} }
@@ -1904,7 +1904,7 @@ keyword such as type of business.""
Assert.AreEqual(99, c.Field); Assert.AreEqual(99, c.Field);
} }
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
[Test] [Test]
public void SerializeArrayAsArrayList() public void SerializeArrayAsArrayList()
{ {
@@ -2704,7 +2704,7 @@ keyword such as type of business.""
Assert.AreEqual("titleId", n.FidOrder[n.FidOrder.Count - 1]); 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))] [MetadataType(typeof(OptInClassMetadata))]
public class OptInClass public class OptInClass
{ {
@@ -3214,7 +3214,7 @@ Path '', line 1, position 1.",
() => { JsonConvert.DeserializeObject<Dictionary<string, string>>(json); }); () => { JsonConvert.DeserializeObject<Dictionary<string, string>>(json); });
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
[Test] [Test]
public void CannotDeserializeArrayIntoSerializable() public void CannotDeserializeArrayIntoSerializable()
{ {
@@ -3336,7 +3336,7 @@ Path '', line 1, position 2.",
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
} }
@@ -3355,7 +3355,7 @@ Path '', line 1, position 2.",
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
} }
@@ -3374,7 +3374,7 @@ Path '', line 1, position 2.",
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
} }
@@ -3393,7 +3393,7 @@ Path '', line 1, position 2.",
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
} }
@@ -4063,7 +4063,7 @@ Path '', line 1, position 2.",
Assert.AreEqual("value", newModelStateDictionary["key"]); Assert.AreEqual("value", newModelStateDictionary["key"]);
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
public class ISerializableTestObject : ISerializable public class ISerializableTestObject : ISerializable
{ {
internal string _stringValue; 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 class XNodeTestObject
{ {
public XDocument Document { get; set; } public XDocument Document { get; set; }
@@ -4555,14 +4555,14 @@ To fix this error either change the environment to be fully trusted, change the
} }
#endif #endif
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
public class XmlNodeTestObject public class XmlNodeTestObject
{ {
public XmlDocument Document { get; set; } public XmlDocument Document { get; set; }
} }
#endif #endif
#if !(NET20 || SILVERLIGHT || PORTABLE40) #if !(NET20 || PORTABLE40)
[Test] [Test]
public void SerializeDeserializeXNodeProperties() public void SerializeDeserializeXNodeProperties()
{ {
@@ -4593,7 +4593,7 @@ To fix this error either change the environment to be fully trusted, change the
} }
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void SerializeDeserializeXmlNodeProperties() 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]); Assert.AreEqual(null, d[2]);
} }
#if !SILVERLIGHT && !NET20 #if !NET20
[Test] [Test]
public void SerializeHashSet() 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); Assert.AreEqual(0, z[1].Prop1.Length);
} }
#if !NET20 && !SILVERLIGHT && !NETFX_CORE #if !NET20 && !NETFX_CORE
public class StringDictionaryTestClass public class StringDictionaryTestClass
{ {
public StringDictionary StringDictionaryProperty { get; set; } 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"); Assert.AreEqual(meh.IDontWork, "meh");
} }
#if !(SILVERLIGHT || NET20 || NETFX_CORE) #if !(NET20 || NETFX_CORE)
[DataContract] [DataContract]
public struct StructISerializable : ISerializable public struct StructISerializable : ISerializable
{ {
@@ -6025,7 +6025,7 @@ To fix this error either change the environment to be fully trusted, change the
JsonConvert.DeserializeObject<EnumerableArrayPropertyClass>(json); JsonConvert.DeserializeObject<EnumerableArrayPropertyClass>(json);
} }
#if !(NET20 || SILVERLIGHT) #if !(NET20)
[DataContract] [DataContract]
public class BaseDataContract 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] [Test]
public void SerializeException1() 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] [Test]
public void DeserializeConcurrentDictionary() 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] [Test]
public void DeserializeDecimalsWithCulture() public void DeserializeDecimalsWithCulture()
{ {
@@ -7177,7 +7177,7 @@ Parameter name: value",
} }
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
[Test] [Test]
public void MetroBlogPost() public void MetroBlogPost()
{ {
@@ -7509,7 +7509,7 @@ Parameter name: value",
Assert.AreEqual("", s); Assert.AreEqual("", s);
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void SerializeAndDeserializeWithAttributes() public void SerializeAndDeserializeWithAttributes()
{ {
@@ -7672,7 +7672,7 @@ Parameter name: value",
() => { s.Deserialize<Dictionary<string, int>>(new JsonTextReader(new StringReader(json))); }); () => { s.Deserialize<Dictionary<string, int>>(new JsonTextReader(new StringReader(json))); });
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void DeserializeException() public void DeserializeException()
{ {
@@ -7928,7 +7928,7 @@ Parameter name: value",
Assert.AreEqual("[1.1,0.0,0.0]", json); Assert.AreEqual("[1.1,0.0,0.0]", json);
} }
#if !(NET20 || NET35 || NET40 || SILVERLIGHT || PORTABLE40) #if !(NET20 || NET35 || NET40 || PORTABLE40)
#if !PORTABLE #if !PORTABLE
[Test] [Test]
public void DeserializeReadOnlyListWithBigInteger() public void DeserializeReadOnlyListWithBigInteger()
@@ -7987,7 +7987,7 @@ Parameter name: value",
Action doStuff = () => { obj = JsonConvert.DeserializeObject<MyTuple<int>>(json); }; Action doStuff = () => { obj = JsonConvert.DeserializeObject<MyTuple<int>>(json); };
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
doStuff(); doStuff();
Assert.AreEqual(500, obj.Item1); Assert.AreEqual(500, obj.Item1);
#else #else
@@ -8020,7 +8020,7 @@ Parameter name: value",
} }
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || NET35 || NET20 || PORTABLE40) #if !(NETFX_CORE || PORTABLE || NET35 || NET20 || PORTABLE40)
[Test] [Test]
public void SerializeTupleWithSerializableAttribute() public void SerializeTupleWithSerializableAttribute()
{ {
@@ -8047,7 +8047,7 @@ Parameter name: value",
} }
#endif #endif
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
public class PopulateReadOnlyTestClass public class PopulateReadOnlyTestClass
{ {
public IList<int> NonReadOnlyList { get; set; } public IList<int> NonReadOnlyList { get; set; }
@@ -8888,7 +8888,7 @@ Parameter name: value",
} }
#endif #endif
#if !(PORTABLE || NET35 || NET20 || SILVERLIGHT || PORTABLE40) #if !(PORTABLE || NET35 || NET20 || PORTABLE40)
[Test] [Test]
public void ReadTooLargeInteger() public void ReadTooLargeInteger()
{ {
@@ -9055,7 +9055,7 @@ Parameter name: value",
Assert.AreEqual(1234567890.123456m, d); Assert.AreEqual(1234567890.123456m, d);
} }
#if !(PORTABLE || SILVERLIGHT || NETFX_CORE || WINDOWS_PHONE || PORTABLE40) #if !(PORTABLE || NETFX_CORE || PORTABLE40)
[Test] [Test]
public void DontSerializeStaticFields() public void DontSerializeStaticFields()
{ {
@@ -9089,7 +9089,7 @@ Parameter name: value",
Assert.AreEqual("string!", l[0]); Assert.AreEqual("string!", l[0]);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
[Test] [Test]
public void SerializeBigInteger() public void SerializeBigInteger()
{ {
@@ -9103,7 +9103,7 @@ Parameter name: value",
} }
#endif #endif
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
[Test] [Test]
public void DeserializeReadOnlyListInterface() public void DeserializeReadOnlyListInterface()
{ {
@@ -9853,7 +9853,7 @@ Parameter name: value",
public bool Selected { get; set; } public bool Selected { get; set; }
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
[Serializable] [Serializable]
public class AnswerFilterModel public class AnswerFilterModel
{ {
@@ -10086,7 +10086,7 @@ Parameter name: value",
public new bool no; public new bool no;
} }
#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE) #if !(NET35 || NET20)
[JsonObject(MemberSerialization.OptIn)] [JsonObject(MemberSerialization.OptIn)]
public class GameObject public class GameObject
{ {
@@ -10161,7 +10161,7 @@ Parameter name: value",
{ {
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{ {
#if !(SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
writer.WriteValue(":::" + value.ToString().ToUpper(CultureInfo.InvariantCulture) + ":::"); writer.WriteValue(":::" + value.ToString().ToUpper(CultureInfo.InvariantCulture) + ":::");
#else #else
writer.WriteValue(":::" + value.ToString().ToUpper() + ":::"); writer.WriteValue(":::" + value.ToString().ToUpper() + ":::");
@@ -10174,7 +10174,7 @@ Parameter name: value",
if (s == null) if (s == null)
return null; return null;
#if !(SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
return s.ToLower(CultureInfo.InvariantCulture).Trim(new[] { ':' }); return s.ToLower(CultureInfo.InvariantCulture).Trim(new[] { ':' });
#else #else
return s.ToLower().Trim(new[] { ':' }); return s.ToLower().Trim(new[] { ':' });
@@ -10191,7 +10191,7 @@ Parameter name: value",
{ {
protected internal override string ResolvePropertyName(string propertyName) protected internal override string ResolvePropertyName(string propertyName)
{ {
#if !(SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
return ":::" + propertyName.ToUpper(CultureInfo.InvariantCulture) + ":::"; return ":::" + propertyName.ToUpper(CultureInfo.InvariantCulture) + ":::";
#else #else
return ":::" + propertyName.ToUpper() + ":::"; return ":::" + propertyName.ToUpper() + ":::";
@@ -149,7 +149,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", json); }", json);
} }
#if !(PORTABLE || SILVERLIGHT || NETFX_CORE || PORTABLE40) #if !(PORTABLE || NETFX_CORE || PORTABLE40)
public class MainClass : ISerializable public class MainClass : ISerializable
{ {
public ChildClass Child { get; set; } public ChildClass Child { get; set; }
@@ -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(new DateTime(2000, 12, 1, 0, 0, 0, DateTimeKind.Utc), c[2]);
Assert.AreEqual(3, errors.Count); 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]); 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 #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]); Assert.AreEqual("[1] - 1 - The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.", errors[0]);
@@ -282,7 +282,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", json); }", json);
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
public class SerializationEventContextTestObject public class SerializationEventContextTestObject
{ {
public string TestMember { get; set; } public string TestMember { get; set; }
@@ -400,7 +400,7 @@ OnSerialized_Derived
OnSerialized_Derived_Derived", string.Join(Environment.NewLine, e.ToArray())); OnSerialized_Derived_Derived", string.Join(Environment.NewLine, e.ToArray()));
} }
#if !(NET20 || SILVERLIGHT) #if !(NET20)
[Test] [Test]
public void DerivedDerivedSerializationEvents_DataContractSerializer() public void DerivedDerivedSerializationEvents_DataContractSerializer()
{ {
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Runtime.Serialization; using System.Runtime.Serialization;
@@ -38,7 +38,7 @@ namespace Newtonsoft.Json.Tests.Serialization
[TestFixture] [TestFixture]
public class TraceWriterTests : TestFixtureBase public class TraceWriterTests : TestFixtureBase
{ {
#if !(SILVERLIGHT || PORTABLE || NETFX_CORE || PORTABLE40) #if !(PORTABLE || NETFX_CORE || PORTABLE40)
[Test] [Test]
public void DiagnosticsTraceWriterTest() 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); 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] [Test]
public void DeserializeISerializable() public void DeserializeISerializable()
{ {
@@ -718,7 +718,7 @@ Newtonsoft.Json Error: 0 : Error!
Assert.AreEqual(23, deserialized.FavoriteNumber); Assert.AreEqual(23, deserialized.FavoriteNumber);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
[Test] [Test]
public void TraceJsonWriterTest() public void TraceJsonWriterTest()
{ {
@@ -203,7 +203,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual("Name!", ((EmployeeReference)employee).Name); Assert.AreEqual("Name!", ((EmployeeReference)employee).Name);
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
[Test] [Test]
public void DeserializeTypeNameFromGacAssembly() public void DeserializeTypeNameFromGacAssembly()
{ {
@@ -977,7 +977,7 @@ namespace Newtonsoft.Json.Tests.Serialization
CollectionAssert.AreEquivalent(data, d); CollectionAssert.AreEquivalent(data, d);
} }
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
[Test] [Test]
public void ISerializableTypeNameHandlingTest() public void ISerializableTypeNameHandlingTest()
{ {
@@ -1043,7 +1043,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Binder = new MetroBinder(), Binder = new MetroBinder(),
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = true IgnoreSerializableAttribute = true
#endif #endif
} }
@@ -1723,7 +1723,7 @@ namespace Newtonsoft.Json.Tests.Serialization
public int Quantity { get; set; } public int Quantity { get; set; }
} }
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE) #if !(NETFX_CORE)
public class SerializableWrapper public class SerializableWrapper
{ {
public object Content { get; set; } public object Content { get; set; }
@@ -37,7 +37,7 @@ using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || NET20) #if !(NETFX_CORE || NET20)
using System.Runtime.Serialization.Json; using System.Runtime.Serialization.Json;
#endif #endif
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
@@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Tests.Serialization
nonSerializedField = "Error" nonSerializedField = "Error"
}; };
#if !(SILVERLIGHT || NETFX_CORE || NET20 || PORTABLE || PORTABLE40) #if !(NETFX_CORE || NET20 || PORTABLE || PORTABLE40)
MemoryStream ms = new MemoryStream(); MemoryStream ms = new MemoryStream();
DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(SerializableType)); DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(SerializableType));
dataContractJsonSerializer.WriteObject(ms, serializableType); dataContractJsonSerializer.WriteObject(ms, serializableType);
@@ -75,7 +75,7 @@ namespace Newtonsoft.Json.Tests.Serialization
{ {
ContractResolver = new DefaultContractResolver ContractResolver = new DefaultContractResolver
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
IgnoreSerializableAttribute = false IgnoreSerializableAttribute = false
#endif #endif
} }
@@ -84,7 +84,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(expected, json); Assert.AreEqual(expected, json);
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Test] [Test]
public void SerializeInheritedType() public void SerializeInheritedType()
{ {
@@ -114,7 +114,7 @@ namespace Newtonsoft.Json.Tests.Serialization
} }
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Serializable] [Serializable]
#else #else
[JsonObject(MemberSerialization.Fields)] [JsonObject(MemberSerialization.Fields)]
@@ -138,7 +138,7 @@ namespace Newtonsoft.Json.Tests.Serialization
set { privateField = value; } set { privateField = value; }
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[NonSerialized] [NonSerialized]
#else #else
[JsonIgnore] [JsonIgnore]
@@ -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
}
+5 -7
View File
@@ -152,11 +152,9 @@ namespace Newtonsoft.Json.Tests
{ {
public static void IsInstanceOfType(Type t, object instance) public static void IsInstanceOfType(Type t, object instance)
{ {
#if (WINDOWS_PHONE || SILVERLIGHT) #if NETFX_CORE
Assert.IsInstanceOfType(t, instance); if (!instance.GetType().IsAssignableFrom(t))
#elif NETFX_CORE throw new Exception("Not instance of type");
if (!instance.GetType().IsAssignableFrom(t))
throw new Exception("Not instance of type");
#else #else
Assert.IsInstanceOf(t, instance); Assert.IsInstanceOf(t, instance);
#endif #endif
@@ -167,8 +165,8 @@ namespace Newtonsoft.Json.Tests
#if !NETFX_CORE #if !NETFX_CORE
Assert.Contains(value, collection); Assert.Contains(value, collection);
#else #else
if (!collection.Cast<object>().Any(i => i.Equals(value))) if (!collection.Cast<object>().Any(i => i.Equals(value)))
throw new Exception("Value not found in collection."); throw new Exception("Value not found in collection.");
#endif #endif
} }
} }
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
@@ -27,7 +27,7 @@ using System.Collections;
namespace Newtonsoft.Json.Tests.TestObjects namespace Newtonsoft.Json.Tests.TestObjects
{ {
#if !SILVERLIGHT && !NETFX_CORE #if !NETFX_CORE
public class TypedSubHashtable public class TypedSubHashtable
{ {
public string Name; public string Name;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || PORTABLE || NETFX_CORE || PORTABLE40) #if !(PORTABLE || NETFX_CORE || PORTABLE40)
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Reflection; using System.Reflection;
-31
View File
@@ -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
+2 -2
View File
@@ -27,7 +27,7 @@ using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -228,7 +228,7 @@ namespace Newtonsoft.Json.Bson
/// <param name="value">The <see cref="Object"/> value to write.</param> /// <param name="value">The <see cref="Object"/> value to write.</param>
public override void WriteValue(object value) public override void WriteValue(object value)
{ {
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
if (value is BigInteger) if (value is BigInteger)
{ {
InternalWriteValue(JsonToken.Integer); InternalWriteValue(JsonToken.Integer);
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
using System; using System;
using System.Data.SqlTypes; using System.Data.SqlTypes;
using System.Globalization; using System.Globalization;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
using System; using System;
using System.Data; using System.Data;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
using System; using System;
using System.Data; using System.Data;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
using System; using System;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using System.Globalization; using System.Globalization;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if (!(SILVERLIGHT) || WINDOWS_PHONE) && !PORTABLE40 #if !PORTABLE40
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
@@ -43,7 +43,7 @@ namespace Newtonsoft.Json.Converters
{ {
#region XmlNodeWrappers #region XmlNodeWrappers
#if !SILVERLIGHT && !NETFX_CORE && !PORTABLE && !PORTABLE40 #if !NETFX_CORE && !PORTABLE && !PORTABLE40
internal class XmlDocumentWrapper : XmlNodeWrapper, IXmlDocument internal class XmlDocumentWrapper : XmlNodeWrapper, IXmlDocument
{ {
private readonly XmlDocument _document; private readonly XmlDocument _document;
@@ -799,7 +799,7 @@ namespace Newtonsoft.Json.Converters
if (value is XObject) if (value is XObject)
return XContainerWrapper.WrapNode((XObject)value); return XContainerWrapper.WrapNode((XObject)value);
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
if (value is XmlNode) if (value is XmlNode)
return new XmlNodeWrapper((XmlNode)value); return new XmlNodeWrapper((XmlNode)value);
#endif #endif
@@ -1092,7 +1092,7 @@ namespace Newtonsoft.Json.Converters
rootNode = document; rootNode = document;
} }
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
if (typeof(XmlNode).IsAssignableFrom(objectType)) if (typeof(XmlNode).IsAssignableFrom(objectType))
{ {
if (objectType != typeof(XmlDocument)) if (objectType != typeof(XmlDocument))
@@ -1555,7 +1555,7 @@ namespace Newtonsoft.Json.Converters
if (typeof(XObject).IsAssignableFrom(valueType)) if (typeof(XObject).IsAssignableFrom(valueType))
return true; return true;
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NETFX_CORE || PORTABLE)
if (typeof(XmlNode).IsAssignableFrom(valueType)) if (typeof(XmlNode).IsAssignableFrom(valueType))
return true; return true;
#endif #endif
@@ -1,5 +1,5 @@
 
#if SILVERLIGHT || PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE #if PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE
namespace System.Runtime.Serialization.Formatters namespace System.Runtime.Serialization.Formatters
{ {
+10 -10
View File
@@ -26,10 +26,10 @@
using System; using System;
using System.IO; using System.IO;
using System.Globalization; using System.Globalization;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
using System.Threading.Tasks; using System.Threading.Tasks;
#endif #endif
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -38,7 +38,7 @@ using System.Xml;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using System.Text; using System.Text;
#if !NET20 && (!SILVERLIGHT || WINDOWS_PHONE) && !PORTABLE40 #if !(NET20 || PORTABLE40)
using System.Xml.Linq; using System.Xml.Linq;
#endif #endif
@@ -238,7 +238,7 @@ namespace Newtonsoft.Json
return value.ToString(null, CultureInfo.InvariantCulture); return value.ToString(null, CultureInfo.InvariantCulture);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
private static string ToStringInternal(BigInteger value) private static string ToStringInternal(BigInteger value)
{ {
return value.ToString(null, CultureInfo.InvariantCulture); return value.ToString(null, CultureInfo.InvariantCulture);
@@ -482,7 +482,7 @@ namespace Newtonsoft.Json
return ToString((Uri)value); return ToString((Uri)value);
case PrimitiveTypeCode.TimeSpan: case PrimitiveTypeCode.TimeSpan:
return ToString((TimeSpan)value); return ToString((TimeSpan)value);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
case PrimitiveTypeCode.BigInteger: case PrimitiveTypeCode.BigInteger:
return ToStringInternal((BigInteger)value); return ToStringInternal((BigInteger)value);
#endif #endif
@@ -602,7 +602,7 @@ namespace Newtonsoft.Json
return sw.ToString(); return sw.ToString();
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
/// <summary> /// <summary>
/// Asynchronously serializes the specified object to a JSON string. /// Asynchronously serializes the specified object to a JSON string.
/// Serialization will happen on a new thread. /// Serialization will happen on a new thread.
@@ -798,7 +798,7 @@ namespace Newtonsoft.Json
return jsonSerializer.Deserialize(new JsonTextReader(sr), type); return jsonSerializer.Deserialize(new JsonTextReader(sr), type);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
/// <summary> /// <summary>
/// Asynchronously deserializes the JSON to the specified .NET type. /// Asynchronously deserializes the JSON to the specified .NET type.
/// Deserialization will happen on a new thread. /// Deserialization will happen on a new thread.
@@ -897,7 +897,7 @@ namespace Newtonsoft.Json
} }
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
/// <summary> /// <summary>
/// Asynchronously populates the object with values from the JSON string using <see cref="JsonSerializerSettings"/>. /// Asynchronously populates the object with values from the JSON string using <see cref="JsonSerializerSettings"/>.
/// </summary> /// </summary>
@@ -916,7 +916,7 @@ namespace Newtonsoft.Json
} }
#endif #endif
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) #if !(PORTABLE40 || PORTABLE || NETFX_CORE)
/// <summary> /// <summary>
/// Serializes the XML node to a JSON string. /// Serializes the XML node to a JSON string.
/// </summary> /// </summary>
@@ -996,7 +996,7 @@ namespace Newtonsoft.Json
} }
#endif #endif
#if !NET20 && (!(SILVERLIGHT) || WINDOWS_PHONE) && !PORTABLE40 #if !NET20 && !PORTABLE40
/// <summary> /// <summary>
/// Serializes the <see cref="XNode"/> to a JSON string. /// Serializes the <see cref="XNode"/> to a JSON string.
/// </summary> /// </summary>
+2 -2
View File
@@ -35,7 +35,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// The exception thrown when an error occurs during Json serialization or deserialization. /// The exception thrown when an error occurs during Json serialization or deserialization.
/// </summary> /// </summary>
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
[Serializable] [Serializable]
#endif #endif
public class JsonException : Exception public class JsonException : Exception
@@ -68,7 +68,7 @@ namespace Newtonsoft.Json
{ {
} }
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="JsonException"/> class. /// Initializes a new instance of the <see cref="JsonException"/> class.
/// </summary> /// </summary>
+2 -2
View File
@@ -33,7 +33,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// The exception thrown when an error occurs while reading Json text. /// The exception thrown when an error occurs while reading Json text.
/// </summary> /// </summary>
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
[Serializable] [Serializable]
#endif #endif
public class JsonReaderException : JsonException public class JsonReaderException : JsonException
@@ -84,7 +84,7 @@ namespace Newtonsoft.Json
{ {
} }
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="JsonReaderException"/> class. /// Initializes a new instance of the <see cref="JsonReaderException"/> class.
/// </summary> /// </summary>
@@ -33,7 +33,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// The exception thrown when an error occurs during Json serialization or deserialization. /// The exception thrown when an error occurs during Json serialization or deserialization.
/// </summary> /// </summary>
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
[Serializable] [Serializable]
#endif #endif
public class JsonSerializationException : JsonException public class JsonSerializationException : JsonException
@@ -66,7 +66,7 @@ namespace Newtonsoft.Json
{ {
} }
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="JsonSerializationException"/> class. /// Initializes a new instance of the <see cref="JsonSerializationException"/> class.
/// </summary> /// </summary>
+2 -2
View File
@@ -26,7 +26,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -1266,7 +1266,7 @@ namespace Newtonsoft.Json
} }
else if (parseResult == ParseResult.Overflow) else if (parseResult == ParseResult.Overflow)
{ {
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
string number = _stringReference.ToString(); string number = _stringReference.ToString();
numberValue = BigInteger.Parse(number, CultureInfo.InvariantCulture); numberValue = BigInteger.Parse(number, CultureInfo.InvariantCulture);
numberType = JsonToken.Integer; numberType = JsonToken.Integer;
+2 -2
View File
@@ -26,7 +26,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -311,7 +311,7 @@ namespace Newtonsoft.Json
/// <param name="value">The <see cref="Object"/> value to write.</param> /// <param name="value">The <see cref="Object"/> value to write.</param>
public override void WriteValue(object value) public override void WriteValue(object value)
{ {
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
if (value is BigInteger) if (value is BigInteger)
{ {
InternalWriteValue(JsonToken.Integer); InternalWriteValue(JsonToken.Integer);
+2 -2
View File
@@ -25,7 +25,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -735,7 +735,7 @@ namespace Newtonsoft.Json
if (schema.DivisibleBy != null) if (schema.DivisibleBy != null)
{ {
bool notDivisible; bool notDivisible;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
if (value is BigInteger) if (value is BigInteger)
{ {
// not that this will lose any decimal point on DivisibleBy // not that this will lose any decimal point on DivisibleBy
+4 -4
View File
@@ -26,7 +26,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Utilities;
@@ -493,7 +493,7 @@ namespace Newtonsoft.Json
WriteComment((reader.Value != null) ? reader.Value.ToString() : null); WriteComment((reader.Value != null) ? reader.Value.ToString() : null);
break; break;
case JsonToken.Integer: case JsonToken.Integer:
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
if (reader.Value is BigInteger) if (reader.Value is BigInteger)
{ {
WriteValue((BigInteger)reader.Value); WriteValue((BigInteger)reader.Value);
@@ -1219,7 +1219,7 @@ namespace Newtonsoft.Json
} }
else else
{ {
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
// this is here because adding a WriteValue(BigInteger) to JsonWriter will // this is here because adding a WriteValue(BigInteger) to JsonWriter will
// mean the user has to add a reference to System.Numerics.dll // mean the user has to add a reference to System.Numerics.dll
if (value is BigInteger) if (value is BigInteger)
@@ -1368,7 +1368,7 @@ namespace Newtonsoft.Json
case PrimitiveTypeCode.TimeSpanNullable: case PrimitiveTypeCode.TimeSpanNullable:
writer.WriteValue((value == null) ? (TimeSpan?)null : (TimeSpan)value); writer.WriteValue((value == null) ? (TimeSpan?)null : (TimeSpan)value);
break; break;
#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) #if !(PORTABLE || PORTABLE40 || NET35 || NET20)
case PrimitiveTypeCode.BigInteger: case PrimitiveTypeCode.BigInteger:
// this will call to WriteValue(object) // this will call to WriteValue(object)
writer.WriteValue((BigInteger)value); writer.WriteValue((BigInteger)value);
+2 -2
View File
@@ -33,7 +33,7 @@ namespace Newtonsoft.Json
/// <summary> /// <summary>
/// The exception thrown when an error occurs while reading Json text. /// The exception thrown when an error occurs while reading Json text.
/// </summary> /// </summary>
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
[Serializable] [Serializable]
#endif #endif
public class JsonWriterException : JsonException public class JsonWriterException : JsonException
@@ -72,7 +72,7 @@ namespace Newtonsoft.Json
{ {
} }
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="JsonWriterException"/> class. /// Initializes a new instance of the <see cref="JsonWriterException"/> class.
/// </summary> /// </summary>
+1 -1
View File
@@ -32,7 +32,7 @@ namespace Newtonsoft.Json.Linq
/// </summary> /// </summary>
/// <typeparam name="T">The type of token</typeparam> /// <typeparam name="T">The type of token</typeparam>
public interface IJEnumerable< public interface IJEnumerable<
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
out out
#endif #endif
T> : IEnumerable<T> where T : JToken T> : IEnumerable<T> where T : JToken
+16 -16
View File
@@ -46,17 +46,17 @@ namespace Newtonsoft.Json.Linq
/// Represents a token that can contain other tokens. /// Represents a token that can contain other tokens.
/// </summary> /// </summary>
public abstract class JContainer : JToken, IList<JToken> public abstract class JContainer : JToken, IList<JToken>
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
, ITypedList, IBindingList , ITypedList, IBindingList
#elif PORTABLE #elif PORTABLE
, INotifyCollectionChanged , INotifyCollectionChanged
#endif #endif
, IList , IList
#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || NETFX_CORE || PORTABLE40 || PORTABLE)
, INotifyCollectionChanged , INotifyCollectionChanged
#endif #endif
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
internal ListChangedEventHandler _listChanged; internal ListChangedEventHandler _listChanged;
internal AddingNewEventHandler _addingNew; internal AddingNewEventHandler _addingNew;
@@ -78,7 +78,7 @@ namespace Newtonsoft.Json.Linq
remove { _addingNew -= value; } remove { _addingNew -= value; }
} }
#endif #endif
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
internal NotifyCollectionChangedEventHandler _collectionChanged; internal NotifyCollectionChangedEventHandler _collectionChanged;
/// <summary> /// <summary>
@@ -130,7 +130,7 @@ namespace Newtonsoft.Json.Linq
return new List<JToken>(); return new List<JToken>();
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
/// <summary> /// <summary>
/// Raises the <see cref="AddingNew"/> event. /// Raises the <see cref="AddingNew"/> event.
/// </summary> /// </summary>
@@ -164,7 +164,7 @@ namespace Newtonsoft.Json.Linq
} }
} }
#endif #endif
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
/// <summary> /// <summary>
/// Raises the <see cref="CollectionChanged"/> event. /// Raises the <see cref="CollectionChanged"/> event.
/// </summary> /// </summary>
@@ -357,11 +357,11 @@ namespace Newtonsoft.Json.Linq
ChildrenTokens.Insert(index, item); ChildrenTokens.Insert(index, item);
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
if (_listChanged != null) if (_listChanged != null)
OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index)); OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
#endif #endif
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
if (_collectionChanged != null) if (_collectionChanged != null)
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index)); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index));
#endif #endif
@@ -391,11 +391,11 @@ namespace Newtonsoft.Json.Linq
ChildrenTokens.RemoveAt(index); ChildrenTokens.RemoveAt(index);
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
if (_listChanged != null) if (_listChanged != null)
OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index)); OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
#endif #endif
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
if (_collectionChanged != null) if (_collectionChanged != null)
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index)); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index));
#endif #endif
@@ -455,11 +455,11 @@ namespace Newtonsoft.Json.Linq
existing.Previous = null; existing.Previous = null;
existing.Next = null; existing.Next = null;
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
if (_listChanged != null) if (_listChanged != null)
OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index)); OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
#endif #endif
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
if (_collectionChanged != null) if (_collectionChanged != null)
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, item, existing, index)); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, item, existing, index));
#endif #endif
@@ -478,11 +478,11 @@ namespace Newtonsoft.Json.Linq
ChildrenTokens.Clear(); ChildrenTokens.Clear();
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
if (_listChanged != null) if (_listChanged != null)
OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1)); OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
#endif #endif
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
if (_collectionChanged != null) if (_collectionChanged != null)
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
#endif #endif
@@ -751,7 +751,7 @@ namespace Newtonsoft.Json.Linq
return hashCode; return hashCode;
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
string ITypedList.GetListName(PropertyDescriptor[] listAccessors) string ITypedList.GetListName(PropertyDescriptor[] listAccessors)
{ {
return string.Empty; return string.Empty;
@@ -920,7 +920,7 @@ namespace Newtonsoft.Json.Linq
#endregion #endregion
#region IBindingList Members #region IBindingList Members
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
void IBindingList.AddIndex(PropertyDescriptor property) void IBindingList.AddIndex(PropertyDescriptor property)
{ {
} }
+9 -9
View File
@@ -53,10 +53,10 @@ namespace Newtonsoft.Json.Linq
/// <code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\LinqToJsonTests.cs" region="LinqToJsonCreateParse" title="Parsing a JSON Object from Text" /> /// <code lang="cs" source="..\Src\Newtonsoft.Json.Tests\Documentation\LinqToJsonTests.cs" region="LinqToJsonCreateParse" title="Parsing a JSON Object from Text" />
/// </example> /// </example>
public class JObject : JContainer, IDictionary<string, JToken>, INotifyPropertyChanged public class JObject : JContainer, IDictionary<string, JToken>, INotifyPropertyChanged
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
, ICustomTypeDescriptor , ICustomTypeDescriptor
#endif #endif
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
, INotifyPropertyChanging , INotifyPropertyChanging
#endif #endif
{ {
@@ -76,7 +76,7 @@ namespace Newtonsoft.Json.Linq
/// </summary> /// </summary>
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
/// <summary> /// <summary>
/// Occurs when a property value is changing. /// Occurs when a property value is changing.
/// </summary> /// </summary>
@@ -159,11 +159,11 @@ namespace Newtonsoft.Json.Linq
internal void InternalPropertyChanged(JProperty childProperty) internal void InternalPropertyChanged(JProperty childProperty)
{ {
OnPropertyChanged(childProperty.Name); OnPropertyChanged(childProperty.Name);
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
if (_listChanged != null) if (_listChanged != null)
OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, IndexOfItem(childProperty))); OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, IndexOfItem(childProperty)));
#endif #endif
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40) #if !(NET20 || NET35 || PORTABLE40)
if (_collectionChanged != null) if (_collectionChanged != null)
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, childProperty, childProperty, IndexOfItem(childProperty))); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, childProperty, childProperty, IndexOfItem(childProperty)));
#endif #endif
@@ -171,7 +171,7 @@ namespace Newtonsoft.Json.Linq
internal void InternalPropertyChanging(JProperty childProperty) internal void InternalPropertyChanging(JProperty childProperty)
{ {
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
OnPropertyChanging(childProperty.Name); OnPropertyChanging(childProperty.Name);
#endif #endif
} }
@@ -274,7 +274,7 @@ namespace Newtonsoft.Json.Linq
} }
else else
{ {
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
OnPropertyChanging(propertyName); OnPropertyChanging(propertyName);
#endif #endif
Add(new JProperty(propertyName, value)); Add(new JProperty(propertyName, value));
@@ -584,7 +584,7 @@ namespace Newtonsoft.Json.Linq
PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE || NET20) #if !(NETFX_CORE || PORTABLE40 || PORTABLE || NET20)
/// <summary> /// <summary>
/// Raises the <see cref="PropertyChanging"/> event with the provided arguments. /// Raises the <see cref="PropertyChanging"/> event with the provided arguments.
/// </summary> /// </summary>
@@ -596,7 +596,7 @@ namespace Newtonsoft.Json.Linq
} }
#endif #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 // include custom type descriptor on JObject rather than use a provider because the properties are specific to a type
#region ICustomTypeDescriptor #region ICustomTypeDescriptor
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Utilities;
+33 -33
View File
@@ -30,7 +30,7 @@ using System.Dynamic;
using System.Linq.Expressions; using System.Linq.Expressions;
#endif #endif
using System.IO; using System.IO;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -51,7 +51,7 @@ namespace Newtonsoft.Json.Linq
/// Represents an abstract JSON token. /// Represents an abstract JSON token.
/// </summary> /// </summary>
public abstract class JToken : IJEnumerable<JToken>, IJsonLineInfo public abstract class JToken : IJEnumerable<JToken>, IJsonLineInfo
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
, ICloneable , ICloneable
#endif #endif
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20 || PORTABLE40)
@@ -456,7 +456,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, BooleanTypes, false)) if (v == null || !ValidateToken(v, BooleanTypes, false))
throw new ArgumentException("Can not convert {0} to Boolean.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return Convert.ToBoolean((int)(BigInteger)v.Value); return Convert.ToBoolean((int)(BigInteger)v.Value);
#endif #endif
@@ -498,7 +498,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, BooleanTypes, true)) if (v == null || !ValidateToken(v, BooleanTypes, true))
throw new ArgumentException("Can not convert {0} to Boolean.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return Convert.ToBoolean((int)(BigInteger)v.Value); return Convert.ToBoolean((int)(BigInteger)v.Value);
#endif #endif
@@ -517,7 +517,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to Int64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (long)(BigInteger)v.Value; return (long)(BigInteger)v.Value;
#endif #endif
@@ -586,7 +586,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to Decimal.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (decimal?)(BigInteger)v.Value; return (decimal?)(BigInteger)v.Value;
#endif #endif
@@ -608,7 +608,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to Double.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (double?)(BigInteger)v.Value; return (double?)(BigInteger)v.Value;
#endif #endif
@@ -630,7 +630,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, CharTypes, true)) if (v == null || !ValidateToken(v, CharTypes, true))
throw new ArgumentException("Can not convert {0} to Char.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (char?)(BigInteger)v.Value; return (char?)(BigInteger)v.Value;
#endif #endif
@@ -649,7 +649,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to Int32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (int)(BigInteger)v.Value; return (int)(BigInteger)v.Value;
#endif #endif
@@ -668,7 +668,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to Int16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (short)(BigInteger)v.Value; return (short)(BigInteger)v.Value;
#endif #endif
@@ -688,7 +688,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to UInt16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (ushort)(BigInteger)v.Value; return (ushort)(BigInteger)v.Value;
#endif #endif
@@ -708,7 +708,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, CharTypes, false)) if (v == null || !ValidateToken(v, CharTypes, false))
throw new ArgumentException("Can not convert {0} to Char.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (char)(BigInteger)v.Value; return (char)(BigInteger)v.Value;
#endif #endif
@@ -727,7 +727,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to Byte.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (byte)(BigInteger)v.Value; return (byte)(BigInteger)v.Value;
#endif #endif
@@ -747,7 +747,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to SByte.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (sbyte)(BigInteger)v.Value; return (sbyte)(BigInteger)v.Value;
#endif #endif
@@ -769,7 +769,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to Int32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (int?)(BigInteger)v.Value; return (int?)(BigInteger)v.Value;
#endif #endif
@@ -791,7 +791,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to Int16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (short?)(BigInteger)v.Value; return (short?)(BigInteger)v.Value;
#endif #endif
@@ -814,7 +814,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to UInt16.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (ushort?)(BigInteger)v.Value; return (ushort?)(BigInteger)v.Value;
#endif #endif
@@ -836,7 +836,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to Byte.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (byte?)(BigInteger)v.Value; return (byte?)(BigInteger)v.Value;
#endif #endif
@@ -859,7 +859,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to SByte.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (sbyte?)(BigInteger)v.Value; return (sbyte?)(BigInteger)v.Value;
#endif #endif
@@ -900,7 +900,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to Int64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (long?)(BigInteger)v.Value; return (long?)(BigInteger)v.Value;
#endif #endif
@@ -922,7 +922,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to Single.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (float?)(BigInteger)v.Value; return (float?)(BigInteger)v.Value;
#endif #endif
@@ -941,7 +941,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to Decimal.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (decimal)(BigInteger)v.Value; return (decimal)(BigInteger)v.Value;
#endif #endif
@@ -964,7 +964,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to UInt32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (uint?)(BigInteger)v.Value; return (uint?)(BigInteger)v.Value;
#endif #endif
@@ -987,7 +987,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, true)) if (v == null || !ValidateToken(v, NumberTypes, true))
throw new ArgumentException("Can not convert {0} to UInt64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (ulong?)(BigInteger)v.Value; return (ulong?)(BigInteger)v.Value;
#endif #endif
@@ -1006,7 +1006,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to Double.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (double)(BigInteger)v.Value; return (double)(BigInteger)v.Value;
#endif #endif
@@ -1025,7 +1025,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to Single.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (float)(BigInteger)v.Value; return (float)(BigInteger)v.Value;
#endif #endif
@@ -1051,7 +1051,7 @@ namespace Newtonsoft.Json.Linq
return null; return null;
if (v.Value is byte[]) if (v.Value is byte[])
return Convert.ToBase64String((byte[])v.Value); return Convert.ToBase64String((byte[])v.Value);
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
if (v.Value is BigInteger) if (v.Value is BigInteger)
return ((BigInteger)v.Value).ToString(CultureInfo.InvariantCulture); return ((BigInteger)v.Value).ToString(CultureInfo.InvariantCulture);
#endif #endif
@@ -1071,7 +1071,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to UInt32.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (uint)(BigInteger)v.Value; return (uint)(BigInteger)v.Value;
#endif #endif
@@ -1091,7 +1091,7 @@ namespace Newtonsoft.Json.Linq
if (v == null || !ValidateToken(v, NumberTypes, false)) if (v == null || !ValidateToken(v, NumberTypes, false))
throw new ArgumentException("Can not convert {0} to UInt64.".FormatWith(CultureInfo.InvariantCulture, GetType(value))); 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) if (v.Value is BigInteger)
return (ulong)(BigInteger)v.Value; return (ulong)(BigInteger)v.Value;
#endif #endif
@@ -1115,7 +1115,7 @@ namespace Newtonsoft.Json.Linq
if (v.Value is string) if (v.Value is string)
return Convert.FromBase64String(Convert.ToString(v.Value, CultureInfo.InvariantCulture)); 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) if (v.Value is BigInteger)
return ((BigInteger)v.Value).ToByteArray(); return ((BigInteger)v.Value).ToByteArray();
#endif #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)); 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) private static BigInteger ToBigInteger(JToken value)
{ {
JValue v = EnsureValue(value); JValue v = EnsureValue(value);
@@ -1769,7 +1769,7 @@ namespace Newtonsoft.Json.Linq
return (TimeSpan?)this; return (TimeSpan?)this;
case PrimitiveTypeCode.TimeSpan: case PrimitiveTypeCode.TimeSpan:
return (TimeSpan)this; return (TimeSpan)this;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
case PrimitiveTypeCode.BigIntegerNullable: case PrimitiveTypeCode.BigIntegerNullable:
return ToBigIntegerNullable(this); return ToBigIntegerNullable(this);
case PrimitiveTypeCode.BigInteger: case PrimitiveTypeCode.BigInteger:
@@ -1963,7 +1963,7 @@ namespace Newtonsoft.Json.Linq
} }
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
object ICloneable.Clone() object ICloneable.Clone()
{ {
return DeepClone(); return DeepClone();
+2 -2
View File
@@ -25,7 +25,7 @@
using System; using System;
using System.Globalization; using System.Globalization;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Utilities;
@@ -188,7 +188,7 @@ namespace Newtonsoft.Json.Linq
/// <param name="value">The <see cref="Object"/> value to write.</param> /// <param name="value">The <see cref="Object"/> value to write.</param>
public override void WriteValue(object value) public override void WriteValue(object value)
{ {
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
if (value is BigInteger) if (value is BigInteger)
{ {
InternalWriteValue(JsonToken.Integer); InternalWriteValue(JsonToken.Integer);
+8 -8
View File
@@ -31,7 +31,7 @@ using System.Globalization;
using System.Dynamic; using System.Dynamic;
using System.Linq.Expressions; using System.Linq.Expressions;
#endif #endif
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
@@ -195,7 +195,7 @@ namespace Newtonsoft.Json.Linq
get { return false; } get { return false; }
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
private static int CompareBigInteger(BigInteger i1, object i2) private static int CompareBigInteger(BigInteger i1, object i2)
{ {
int result = i1.CompareTo(ConvertUtils.ToBigInteger(i2)); int result = i1.CompareTo(ConvertUtils.ToBigInteger(i2));
@@ -232,7 +232,7 @@ namespace Newtonsoft.Json.Linq
switch (valueType) switch (valueType)
{ {
case JTokenType.Integer: case JTokenType.Integer:
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
if (objA is BigInteger) if (objA is BigInteger)
return CompareBigInteger((BigInteger)objA, objB); return CompareBigInteger((BigInteger)objA, objB);
if (objB is BigInteger) if (objB is BigInteger)
@@ -245,7 +245,7 @@ namespace Newtonsoft.Json.Linq
else else
return Convert.ToInt64(objA, CultureInfo.InvariantCulture).CompareTo(Convert.ToInt64(objB, CultureInfo.InvariantCulture)); return Convert.ToInt64(objA, CultureInfo.InvariantCulture).CompareTo(Convert.ToInt64(objB, CultureInfo.InvariantCulture));
case JTokenType.Float: case JTokenType.Float:
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
if (objA is BigInteger) if (objA is BigInteger)
return CompareBigInteger((BigInteger)objA, objB); return CompareBigInteger((BigInteger)objA, objB);
if (objB is BigInteger) 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 is BigInteger || objB is BigInteger)
{ {
if (objA == null || objB == null) if (objA == null || objB == null)
@@ -536,7 +536,7 @@ namespace Newtonsoft.Json.Linq
return JTokenType.Integer; return JTokenType.Integer;
else if (value is Enum) else if (value is Enum)
return JTokenType.Integer; return JTokenType.Integer;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
else if (value is BigInteger) else if (value is BigInteger)
return JTokenType.Integer; return JTokenType.Integer;
#endif #endif
@@ -638,7 +638,7 @@ namespace Newtonsoft.Json.Linq
writer.WriteUndefined(); writer.WriteUndefined();
return; return;
case JTokenType.Integer: case JTokenType.Integer:
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
if (_value is BigInteger) if (_value is BigInteger)
writer.WriteValue((BigInteger)_value); writer.WriteValue((BigInteger)_value);
else else
@@ -930,7 +930,7 @@ namespace Newtonsoft.Json.Linq
if (_value is DateTimeOffset) if (_value is DateTimeOffset)
return TypeCode.DateTime; return TypeCode.DateTime;
#endif #endif
#if !(NET20 || NET35 || PORTABLE40 || SILVERLIGHT) #if !(NET20 || NET35 || PORTABLE40)
if (_value is BigInteger) if (_value is BigInteger)
return TypeCode.Object; return TypeCode.Object;
#endif #endif
@@ -1,287 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DC3C6F3D-2CA1-4278-9B79-63770FB3EA2D}</ProjectGuid>
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json</RootNamespace>
<AssemblyName>Newtonsoft.Json</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>false</ThrowErrorsInValidation>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\Debug\Silverlight\</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Bin\Debug\Silverlight\Newtonsoft.Json.xml</DocumentationFile>
<CodeAnalysisRuleSet>Newtonsoft.Json.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\Release\Silverlight\</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Bin\Release\Silverlight\Newtonsoft.Json.xml</DocumentationFile>
<CodeAnalysisRuleSet>Newtonsoft.Json.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="mscorlib" />
<Reference Include="system" />
<Reference Include="System.Core" />
<Reference Include="System.Windows" />
<Reference Include="System.Xml" />
<Reference Include="System.Net" />
</ItemGroup>
<ItemGroup>
<Compile Include="Bson\BsonBinaryType.cs" />
<Compile Include="Bson\BsonBinaryWriter.cs" />
<Compile Include="Bson\BsonObjectId.cs" />
<Compile Include="Bson\BsonReader.cs" />
<Compile Include="Bson\BsonToken.cs" />
<Compile Include="Bson\BsonType.cs" />
<Compile Include="Bson\BsonWriter.cs" />
<Compile Include="ConstructorHandling.cs" />
<Compile Include="Converters\BinaryConverter.cs" />
<Compile Include="Converters\BsonObjectIdConverter.cs" />
<Compile Include="Converters\CustomCreationConverter.cs" />
<Compile Include="Converters\DataSetConverter.cs" />
<Compile Include="Converters\DataTableConverter.cs" />
<Compile Include="Converters\DateTimeConverterBase.cs" />
<Compile Include="Converters\EntityKeyMemberConverter.cs" />
<Compile Include="Converters\ExpandoObjectConverter.cs" />
<Compile Include="Converters\IsoDateTimeConverter.cs" />
<Compile Include="Converters\JavaScriptDateTimeConverter.cs" />
<Compile Include="Converters\KeyValuePairConverter.cs" />
<Compile Include="Converters\RegexConverter.cs" />
<Compile Include="Converters\StringEnumConverter.cs" />
<Compile Include="Converters\VersionConverter.cs" />
<Compile Include="Converters\XmlNodeConverter.cs" />
<Compile Include="DateFormatHandling.cs" />
<Compile Include="DateParseHandling.cs" />
<Compile Include="DateTimeZoneHandling.cs" />
<Compile Include="FloatFormatHandling.cs" />
<Compile Include="FloatParseHandling.cs" />
<Compile Include="FormatterAssemblyStyle.cs" />
<Compile Include="DefaultValueHandling.cs" />
<Compile Include="Formatting.cs" />
<Compile Include="IJsonLineInfo.cs" />
<Compile Include="JsonArrayAttribute.cs" />
<Compile Include="JsonConstructorAttribute.cs" />
<Compile Include="JsonContainerAttribute.cs" />
<Compile Include="JsonConvert.cs" />
<Compile Include="JsonConverter.cs" />
<Compile Include="JsonConverterAttribute.cs" />
<Compile Include="JsonConverterCollection.cs" />
<Compile Include="JsonDictionaryAttribute.cs" />
<Compile Include="JsonException.cs" />
<Compile Include="JsonIgnoreAttribute.cs" />
<Compile Include="JsonObjectAttribute.cs" />
<Compile Include="JsonPosition.cs" />
<Compile Include="JsonPropertyAttribute.cs" />
<Compile Include="JsonReader.cs" />
<Compile Include="JsonReaderException.cs" />
<Compile Include="JsonSerializationException.cs" />
<Compile Include="JsonSerializer.cs" />
<Compile Include="JsonSerializerSettings.cs" />
<Compile Include="JsonTextReader.cs" />
<Compile Include="JsonTextWriter.cs" />
<Compile Include="JsonToken.cs" />
<Compile Include="JsonValidatingReader.cs" />
<Compile Include="JsonWriter.cs" />
<Compile Include="JsonWriterException.cs" />
<Compile Include="Linq\Extensions.cs" />
<Compile Include="Linq\IJEnumerable.cs" />
<Compile Include="Linq\JArray.cs" />
<Compile Include="Linq\JConstructor.cs" />
<Compile Include="Linq\JContainer.cs" />
<Compile Include="Linq\JEnumerable.cs" />
<Compile Include="Linq\JObject.cs" />
<Compile Include="Linq\JPath.cs" />
<Compile Include="Linq\JProperty.cs" />
<Compile Include="Linq\JPropertyDescriptor.cs" />
<Compile Include="Linq\JPropertyKeyedCollection.cs" />
<Compile Include="Linq\JRaw.cs" />
<Compile Include="Linq\JToken.cs" />
<Compile Include="Linq\JTokenEqualityComparer.cs" />
<Compile Include="Linq\JTokenReader.cs" />
<Compile Include="Linq\JTokenType.cs" />
<Compile Include="Linq\JTokenWriter.cs" />
<Compile Include="Linq\JValue.cs" />
<Compile Include="MemberSerialization.cs" />
<Compile Include="MissingMemberHandling.cs" />
<Compile Include="NullValueHandling.cs" />
<Compile Include="ObjectCreationHandling.cs" />
<Compile Include="PreserveReferencesHandling.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReferenceLoopHandling.cs" />
<Compile Include="Required.cs" />
<Compile Include="SerializationBinder.cs" />
<Compile Include="Serialization\CachedAttributeGetter.cs" />
<Compile Include="Serialization\CamelCasePropertyNamesContractResolver.cs" />
<Compile Include="Serialization\DefaultContractResolver.cs" />
<Compile Include="Serialization\DefaultReferenceResolver.cs" />
<Compile Include="Serialization\DefaultSerializationBinder.cs" />
<Compile Include="Serialization\DiagnosticsTraceWriter.cs" />
<Compile Include="Serialization\DynamicValueProvider.cs" />
<Compile Include="Serialization\ErrorContext.cs" />
<Compile Include="Serialization\ErrorEventArgs.cs" />
<Compile Include="Serialization\IContractResolver.cs" />
<Compile Include="Serialization\IReferenceResolver.cs" />
<Compile Include="Serialization\ITraceWriter.cs" />
<Compile Include="Serialization\IValueProvider.cs" />
<Compile Include="Serialization\JsonArrayContract.cs" />
<Compile Include="Serialization\JsonContainerContract.cs" />
<Compile Include="Serialization\JsonContract.cs" />
<Compile Include="Serialization\JsonDictionaryContract.cs" />
<Compile Include="Serialization\JsonDynamicContract.cs" />
<Compile Include="Serialization\JsonFormatterConverter.cs" />
<Compile Include="Serialization\JsonISerializableContract.cs" />
<Compile Include="Serialization\JsonLinqContract.cs" />
<Compile Include="Serialization\JsonObjectContract.cs" />
<Compile Include="Serialization\JsonPrimitiveContract.cs" />
<Compile Include="Serialization\JsonProperty.cs" />
<Compile Include="Serialization\JsonPropertyCollection.cs" />
<Compile Include="Serialization\JsonSerializerInternalBase.cs" />
<Compile Include="Serialization\JsonSerializerProxy.cs" />
<Compile Include="Serialization\JsonSerializerInternalReader.cs" />
<Compile Include="Serialization\JsonSerializerInternalWriter.cs" />
<Compile Include="Serialization\JsonStringContract.cs" />
<Compile Include="Serialization\LateBoundMetadataTypeAttribute.cs" />
<Compile Include="Serialization\MemoryTraceWriter.cs" />
<Compile Include="Serialization\ObjectConstructor.cs" />
<Compile Include="Serialization\OnErrorAttribute.cs" />
<Compile Include="Serialization\ReflectionValueProvider.cs" />
<Compile Include="StringEscapeHandling.cs" />
<Compile Include="TraceLevel.cs" />
<Compile Include="TypeNameHandling.cs" />
<Compile Include="Utilities\Base64Encoder.cs" />
<Compile Include="Utilities\BidirectionalDictionary.cs" />
<Compile Include="Utilities\CollectionUtils.cs" />
<Compile Include="Utilities\CollectionWrapper.cs" />
<Compile Include="Utilities\ConvertUtils.cs" />
<Compile Include="Utilities\DateTimeUtils.cs" />
<Compile Include="Utilities\DictionaryWrapper.cs" />
<Compile Include="Utilities\DynamicProxy.cs" />
<Compile Include="Utilities\DynamicProxyMetaObject.cs" />
<Compile Include="Utilities\DynamicReflectionDelegateFactory.cs" />
<Compile Include="Utilities\DynamicUtils.cs" />
<Compile Include="Utilities\DynamicWrapper.cs" />
<Compile Include="Utilities\EnumUtils.cs" />
<Compile Include="Utilities\EnumValue.cs" />
<Compile Include="Utilities\EnumValues.cs" />
<Compile Include="Utilities\ILGeneratorExtensions.cs" />
<Compile Include="Utilities\JavaScriptUtils.cs" />
<Compile Include="Utilities\LateBoundReflectionDelegateFactory.cs" />
<Compile Include="Utilities\ListWrapper.cs" />
<Compile Include="Utilities\MathUtils.cs" />
<Compile Include="Utilities\MethodCall.cs" />
<Compile Include="Utilities\MiscellaneousUtils.cs" />
<Compile Include="Utilities\ReflectionDelegateFactory.cs" />
<Compile Include="Utilities\ReflectionUtils.cs" />
<Compile Include="Utilities\StringBuffer.cs" />
<Compile Include="Utilities\StringReference.cs" />
<Compile Include="Utilities\StringUtils.cs" />
<Compile Include="Utilities\ThreadSafeStore.cs" />
<Compile Include="Utilities\TypeExtensions.cs" />
<Compile Include="Utilities\ValidationUtils.cs" />
<Compile Include="Schema\Extensions.cs" />
<Compile Include="Schema\JsonSchemaException.cs" />
<Compile Include="Schema\JsonSchemaModel.cs" />
<Compile Include="Schema\JsonSchemaModelBuilder.cs" />
<Compile Include="Schema\JsonSchemaNodeCollection.cs" />
<Compile Include="Schema\JsonSchemaNode.cs" />
<Compile Include="Schema\JsonSchemaWriter.cs" />
<Compile Include="Schema\UndefinedSchemaIdHandling.cs" />
<Compile Include="Schema\ValidationEventArgs.cs" />
<Compile Include="Schema\ValidationEventHandler.cs" />
<Compile Include="Schema\JsonSchema.cs" />
<Compile Include="Schema\JsonSchemaBuilder.cs" />
<Compile Include="Schema\JsonSchemaConstants.cs" />
<Compile Include="Schema\JsonSchemaGenerator.cs" />
<Compile Include="Schema\JsonSchemaResolver.cs" />
<Compile Include="Schema\JsonSchemaType.cs" />
<Compile Include="Serialization\JsonTypeReflector.cs" />
<Compile Include="WriteState.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
<SilverlightProjectProperties />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
@@ -1,236 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E}</ProjectGuid>
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json</RootNamespace>
<AssemblyName>Newtonsoft.Json</AssemblyName>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<SilverlightVersion>
</SilverlightVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\Debug\WindowsPhone\</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>Newtonsoft.Json.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\Release\WindowsPhone\</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Bin\Release\WindowsPhone\Newtonsoft.Json.xml</DocumentationFile>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>Newtonsoft.Json.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="Bson\BsonBinaryType.cs" />
<Compile Include="Bson\BsonBinaryWriter.cs" />
<Compile Include="Bson\BsonObjectId.cs" />
<Compile Include="Bson\BsonReader.cs" />
<Compile Include="Bson\BsonToken.cs" />
<Compile Include="Bson\BsonType.cs" />
<Compile Include="Bson\BsonWriter.cs" />
<Compile Include="ConstructorHandling.cs" />
<Compile Include="Converters\BinaryConverter.cs" />
<Compile Include="Converters\BsonObjectIdConverter.cs" />
<Compile Include="Converters\CustomCreationConverter.cs" />
<Compile Include="Converters\DataSetConverter.cs" />
<Compile Include="Converters\DataTableConverter.cs" />
<Compile Include="Converters\DateTimeConverterBase.cs" />
<Compile Include="Converters\EntityKeyMemberConverter.cs" />
<Compile Include="Converters\ExpandoObjectConverter.cs" />
<Compile Include="Converters\IsoDateTimeConverter.cs" />
<Compile Include="Converters\JavaScriptDateTimeConverter.cs" />
<Compile Include="Converters\KeyValuePairConverter.cs" />
<Compile Include="Converters\RegexConverter.cs" />
<Compile Include="Converters\StringEnumConverter.cs" />
<Compile Include="Converters\VersionConverter.cs" />
<Compile Include="Converters\XmlNodeConverter.cs" />
<Compile Include="DateFormatHandling.cs" />
<Compile Include="DateParseHandling.cs" />
<Compile Include="DateTimeZoneHandling.cs" />
<Compile Include="FloatFormatHandling.cs" />
<Compile Include="FloatParseHandling.cs" />
<Compile Include="FormatterAssemblyStyle.cs" />
<Compile Include="DefaultValueHandling.cs" />
<Compile Include="Formatting.cs" />
<Compile Include="IJsonLineInfo.cs" />
<Compile Include="JsonArrayAttribute.cs" />
<Compile Include="JsonConstructorAttribute.cs" />
<Compile Include="JsonContainerAttribute.cs" />
<Compile Include="JsonConvert.cs" />
<Compile Include="JsonConverter.cs" />
<Compile Include="JsonConverterAttribute.cs" />
<Compile Include="JsonConverterCollection.cs" />
<Compile Include="JsonDictionaryAttribute.cs" />
<Compile Include="JsonException.cs" />
<Compile Include="JsonIgnoreAttribute.cs" />
<Compile Include="JsonObjectAttribute.cs" />
<Compile Include="JsonPosition.cs" />
<Compile Include="JsonPropertyAttribute.cs" />
<Compile Include="JsonReader.cs" />
<Compile Include="JsonReaderException.cs" />
<Compile Include="JsonSerializationException.cs" />
<Compile Include="JsonSerializer.cs" />
<Compile Include="JsonSerializerSettings.cs" />
<Compile Include="JsonTextReader.cs" />
<Compile Include="JsonTextWriter.cs" />
<Compile Include="JsonToken.cs" />
<Compile Include="JsonValidatingReader.cs" />
<Compile Include="JsonWriter.cs" />
<Compile Include="JsonWriterException.cs" />
<Compile Include="Linq\Extensions.cs" />
<Compile Include="Linq\IJEnumerable.cs" />
<Compile Include="Linq\JArray.cs" />
<Compile Include="Linq\JConstructor.cs" />
<Compile Include="Linq\JContainer.cs" />
<Compile Include="Linq\JEnumerable.cs" />
<Compile Include="Linq\JObject.cs" />
<Compile Include="Linq\JPath.cs" />
<Compile Include="Linq\JProperty.cs" />
<Compile Include="Linq\JPropertyDescriptor.cs" />
<Compile Include="Linq\JPropertyKeyedCollection.cs" />
<Compile Include="Linq\JRaw.cs" />
<Compile Include="Linq\JToken.cs" />
<Compile Include="Linq\JTokenEqualityComparer.cs" />
<Compile Include="Linq\JTokenReader.cs" />
<Compile Include="Linq\JTokenType.cs" />
<Compile Include="Linq\JTokenWriter.cs" />
<Compile Include="Linq\JValue.cs" />
<Compile Include="MemberSerialization.cs" />
<Compile Include="MissingMemberHandling.cs" />
<Compile Include="NullValueHandling.cs" />
<Compile Include="ObjectCreationHandling.cs" />
<Compile Include="PreserveReferencesHandling.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReferenceLoopHandling.cs" />
<Compile Include="Required.cs" />
<Compile Include="SerializationBinder.cs" />
<Compile Include="Serialization\CachedAttributeGetter.cs" />
<Compile Include="Serialization\CamelCasePropertyNamesContractResolver.cs" />
<Compile Include="Serialization\DefaultContractResolver.cs" />
<Compile Include="Serialization\DefaultReferenceResolver.cs" />
<Compile Include="Serialization\DefaultSerializationBinder.cs" />
<Compile Include="Serialization\DiagnosticsTraceWriter.cs" />
<Compile Include="Serialization\DynamicValueProvider.cs" />
<Compile Include="Serialization\ErrorContext.cs" />
<Compile Include="Serialization\ErrorEventArgs.cs" />
<Compile Include="Serialization\IContractResolver.cs" />
<Compile Include="Serialization\IReferenceResolver.cs" />
<Compile Include="Serialization\ITraceWriter.cs" />
<Compile Include="Serialization\IValueProvider.cs" />
<Compile Include="Serialization\JsonArrayContract.cs" />
<Compile Include="Serialization\JsonContainerContract.cs" />
<Compile Include="Serialization\JsonContract.cs" />
<Compile Include="Serialization\JsonDictionaryContract.cs" />
<Compile Include="Serialization\JsonDynamicContract.cs" />
<Compile Include="Serialization\JsonFormatterConverter.cs" />
<Compile Include="Serialization\JsonISerializableContract.cs" />
<Compile Include="Serialization\JsonLinqContract.cs" />
<Compile Include="Serialization\JsonObjectContract.cs" />
<Compile Include="Serialization\JsonPrimitiveContract.cs" />
<Compile Include="Serialization\JsonProperty.cs" />
<Compile Include="Serialization\JsonPropertyCollection.cs" />
<Compile Include="Serialization\JsonSerializerInternalBase.cs" />
<Compile Include="Serialization\JsonSerializerProxy.cs" />
<Compile Include="Serialization\JsonSerializerInternalReader.cs" />
<Compile Include="Serialization\JsonSerializerInternalWriter.cs" />
<Compile Include="Serialization\JsonStringContract.cs" />
<Compile Include="Serialization\LateBoundMetadataTypeAttribute.cs" />
<Compile Include="Serialization\MemoryTraceWriter.cs" />
<Compile Include="Serialization\ObjectConstructor.cs" />
<Compile Include="Serialization\OnErrorAttribute.cs" />
<Compile Include="Serialization\ReflectionValueProvider.cs" />
<Compile Include="StreamingContext.cs" />
<Compile Include="StringEscapeHandling.cs" />
<Compile Include="TraceLevel.cs" />
<Compile Include="TypeNameHandling.cs" />
<Compile Include="Utilities\Base64Encoder.cs" />
<Compile Include="Utilities\BidirectionalDictionary.cs" />
<Compile Include="Utilities\CollectionUtils.cs" />
<Compile Include="Utilities\CollectionWrapper.cs" />
<Compile Include="Utilities\ConvertUtils.cs" />
<Compile Include="Utilities\DateTimeUtils.cs" />
<Compile Include="Utilities\DictionaryWrapper.cs" />
<Compile Include="Utilities\DynamicProxy.cs" />
<Compile Include="Utilities\DynamicProxyMetaObject.cs" />
<Compile Include="Utilities\DynamicReflectionDelegateFactory.cs" />
<Compile Include="Utilities\DynamicUtils.cs" />
<Compile Include="Utilities\DynamicWrapper.cs" />
<Compile Include="Utilities\EnumUtils.cs" />
<Compile Include="Utilities\EnumValue.cs" />
<Compile Include="Utilities\EnumValues.cs" />
<Compile Include="Utilities\ILGeneratorExtensions.cs" />
<Compile Include="Utilities\JavaScriptUtils.cs" />
<Compile Include="Utilities\LateBoundReflectionDelegateFactory.cs" />
<Compile Include="Utilities\MathUtils.cs" />
<Compile Include="Utilities\MethodCall.cs" />
<Compile Include="Utilities\MiscellaneousUtils.cs" />
<Compile Include="Utilities\ReflectionDelegateFactory.cs" />
<Compile Include="Utilities\ReflectionUtils.cs" />
<Compile Include="Utilities\StringBuffer.cs" />
<Compile Include="Utilities\StringReference.cs" />
<Compile Include="Utilities\StringUtils.cs" />
<Compile Include="Utilities\ThreadSafeStore.cs" />
<Compile Include="Utilities\TypeExtensions.cs" />
<Compile Include="Utilities\ValidationUtils.cs" />
<Compile Include="Schema\Extensions.cs" />
<Compile Include="Schema\JsonSchemaException.cs" />
<Compile Include="Schema\JsonSchemaModel.cs" />
<Compile Include="Schema\JsonSchemaModelBuilder.cs" />
<Compile Include="Schema\JsonSchemaNodeCollection.cs" />
<Compile Include="Schema\JsonSchemaNode.cs" />
<Compile Include="Schema\JsonSchemaWriter.cs" />
<Compile Include="Schema\UndefinedSchemaIdHandling.cs" />
<Compile Include="Schema\ValidationEventArgs.cs" />
<Compile Include="Schema\ValidationEventHandler.cs" />
<Compile Include="Schema\JsonSchema.cs" />
<Compile Include="Schema\JsonSchemaBuilder.cs" />
<Compile Include="Schema\JsonSchemaConstants.cs" />
<Compile Include="Schema\JsonSchemaGenerator.cs" />
<Compile Include="Schema\JsonSchemaResolver.cs" />
<Compile Include="Schema\JsonSchemaType.cs" />
<Compile Include="Serialization\JsonTypeReflector.cs" />
<Compile Include="WriteState.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
<ProjectExtensions />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -32,12 +32,7 @@ using System.Security;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
#if WINDOWS_PHONE #if PORTABLE40
[assembly: AssemblyTitle("Json.NET Windows Phone")]
#elif SILVERLIGHT
[assembly: AssemblyTitle("Json.NET Silverlight")]
#elif PORTABLE40
[assembly: AssemblyTitle("Json.NET Portable .NET 4.0")] [assembly: AssemblyTitle("Json.NET Portable .NET 4.0")]
#elif PORTABLE #elif PORTABLE
[assembly: AssemblyTitle("Json.NET Portable")] [assembly: AssemblyTitle("Json.NET Portable")]
@@ -53,7 +48,6 @@ using System.Security;
[assembly: AssemblyTitle("Json.NET .NET 4.0")] [assembly: AssemblyTitle("Json.NET .NET 4.0")]
[assembly: AllowPartiallyTrustedCallers] [assembly: AllowPartiallyTrustedCallers]
#else #else
[assembly: AssemblyTitle("Json.NET")] [assembly: AssemblyTitle("Json.NET")]
[assembly: AllowPartiallyTrustedCallers] [assembly: AllowPartiallyTrustedCallers]
#endif #endif
@@ -31,7 +31,7 @@ namespace Newtonsoft.Json.Schema
/// <summary> /// <summary>
/// Returns detailed information about the schema exception. /// Returns detailed information about the schema exception.
/// </summary> /// </summary>
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
[Serializable] [Serializable]
#endif #endif
public class JsonSchemaException : JsonException 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)
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="JsonSchemaException"/> class. /// Initializes a new instance of the <see cref="JsonSchemaException"/> class.
/// </summary> /// </summary>
@@ -329,14 +329,14 @@ namespace Newtonsoft.Json.Schema
} }
} }
break; break;
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
case JsonContractType.Serializable: case JsonContractType.Serializable:
CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired); CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired);
CurrentSchema.Id = GetTypeId(type, false); CurrentSchema.Id = GetTypeId(type, false);
GenerateISerializableContract(type, (JsonISerializableContract)contract); GenerateISerializableContract(type, (JsonISerializableContract)contract);
break; break;
#endif #endif
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE40)
case JsonContractType.Dynamic: case JsonContractType.Dynamic:
#endif #endif
case JsonContractType.Linq: case JsonContractType.Linq:
@@ -388,7 +388,7 @@ namespace Newtonsoft.Json.Schema
CurrentSchema.AllowAdditionalProperties = false; CurrentSchema.AllowAdditionalProperties = false;
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
private void GenerateISerializableContract(Type type, JsonISerializableContract contract) private void GenerateISerializableContract(Type type, JsonISerializableContract contract)
{ {
CurrentSchema.AllowAdditionalProperties = true; CurrentSchema.AllowAdditionalProperties = true;
@@ -445,7 +445,7 @@ namespace Newtonsoft.Json.Schema
case PrimitiveTypeCode.UInt32: case PrimitiveTypeCode.UInt32:
case PrimitiveTypeCode.Int64: case PrimitiveTypeCode.Int64:
case PrimitiveTypeCode.UInt64: case PrimitiveTypeCode.UInt64:
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) #if !(PORTABLE || NET35 || NET20)
case PrimitiveTypeCode.BigInteger: case PrimitiveTypeCode.BigInteger:
#endif #endif
return schemaType | JsonSchemaType.Integer; return schemaType | JsonSchemaType.Integer;
@@ -25,7 +25,7 @@
using System; using System;
using System.Collections; using System.Collections;
#if !(NET35 || NET20 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET35 || NET20 || PORTABLE || PORTABLE40)
using System.Collections.Concurrent; using System.Collections.Concurrent;
#endif #endif
using System.Collections.Generic; using System.Collections.Generic;
@@ -97,16 +97,16 @@ namespace Newtonsoft.Json.Serialization
private static readonly IList<JsonConverter> BuiltInConverters = new List<JsonConverter> private static readonly IList<JsonConverter> BuiltInConverters = new List<JsonConverter>
{ {
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
new EntityKeyMemberConverter(), new EntityKeyMemberConverter(),
#endif #endif
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20 || PORTABLE40)
new ExpandoObjectConverter(), new ExpandoObjectConverter(),
#endif #endif
#if (!(SILVERLIGHT || PORTABLE40) || WINDOWS_PHONE) #if (!(PORTABLE40))
new XmlNodeConverter(), new XmlNodeConverter(),
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
new BinaryConverter(), new BinaryConverter(),
new DataSetConverter(), new DataSetConverter(),
new DataTableConverter(), new DataTableConverter(),
@@ -155,7 +155,7 @@ namespace Newtonsoft.Json.Serialization
/// </value> /// </value>
public bool SerializeCompilerGeneratedMembers { get; set; } public bool SerializeCompilerGeneratedMembers { get; set; }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
/// <summary> /// <summary>
/// Gets or sets a value indicating whether to ignore the <see cref="ISerializable"/> interface when serializing and deserializing types. /// Gets or sets a value indicating whether to ignore the <see cref="ISerializable"/> interface when serializing and deserializing types.
/// </summary> /// </summary>
@@ -195,7 +195,7 @@ namespace Newtonsoft.Json.Serialization
#if !NETFX_CORE #if !NETFX_CORE
DefaultMembersSearchFlags = BindingFlags.Public | BindingFlags.Instance; DefaultMembersSearchFlags = BindingFlags.Public | BindingFlags.Instance;
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
IgnoreSerializableAttribute = true; IgnoreSerializableAttribute = true;
#endif #endif
@@ -260,7 +260,7 @@ namespace Newtonsoft.Json.Serialization
protected virtual List<MemberInfo> GetSerializableMembers(Type objectType) protected virtual List<MemberInfo> GetSerializableMembers(Type objectType)
{ {
bool ignoreSerializableAttribute; bool ignoreSerializableAttribute;
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
ignoreSerializableAttribute = IgnoreSerializableAttribute; ignoreSerializableAttribute = IgnoreSerializableAttribute;
#else #else
ignoreSerializableAttribute = true; ignoreSerializableAttribute = true;
@@ -308,7 +308,7 @@ namespace Newtonsoft.Json.Serialization
} }
} }
#if !SILVERLIGHT && !NET20 #if !NET20
Type match; Type match;
// don't include EntityKey on entities objects... this is a bit hacky // don't include EntityKey on entities objects... this is a bit hacky
if (objectType.AssignableToTypeName("System.Data.Objects.DataClasses.EntityObject", out match)) if (objectType.AssignableToTypeName("System.Data.Objects.DataClasses.EntityObject", out match))
@@ -329,7 +329,7 @@ namespace Newtonsoft.Json.Serialization
return serializableMembers; return serializableMembers;
} }
#if !SILVERLIGHT && !NET20 #if !NET20
private bool ShouldSerializeEntityMember(MemberInfo memberInfo) private bool ShouldSerializeEntityMember(MemberInfo memberInfo)
{ {
PropertyInfo propertyInfo = memberInfo as PropertyInfo; PropertyInfo propertyInfo = memberInfo as PropertyInfo;
@@ -354,7 +354,7 @@ namespace Newtonsoft.Json.Serialization
InitializeContract(contract); InitializeContract(contract);
bool ignoreSerializableAttribute; bool ignoreSerializableAttribute;
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
ignoreSerializableAttribute = IgnoreSerializableAttribute; ignoreSerializableAttribute = IgnoreSerializableAttribute;
#else #else
ignoreSerializableAttribute = true; ignoreSerializableAttribute = true;
@@ -377,7 +377,7 @@ namespace Newtonsoft.Json.Serialization
} }
else if (contract.MemberSerialization == MemberSerialization.Fields) 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 // 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 // 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) if (JsonTypeReflector.FullyTrusted)
@@ -732,7 +732,7 @@ namespace Newtonsoft.Json.Serialization
if (onDeserialized != null) if (onDeserialized != null)
{ {
// ConcurrentDictionary throws an error here so don't use its OnDeserialized - http://json.codeplex.com/discussions/257093 // 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<,>))) if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>)))
contract.OnDeserializedCallbacks.AddRange(onDeserialized); contract.OnDeserializedCallbacks.AddRange(onDeserialized);
#else #else
@@ -875,7 +875,7 @@ namespace Newtonsoft.Json.Serialization
return contract; return contract;
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
/// <summary> /// <summary>
/// Creates a <see cref="JsonISerializableContract"/> for the given type. /// Creates a <see cref="JsonISerializableContract"/> for the given type.
/// </summary> /// </summary>
@@ -962,7 +962,7 @@ namespace Newtonsoft.Json.Serialization
if (CanConvertToString(t)) if (CanConvertToString(t))
return CreateStringContract(objectType); return CreateStringContract(objectType);
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
if (!IgnoreSerializableInterface && typeof(ISerializable).IsAssignableFrom(t)) if (!IgnoreSerializableInterface && typeof(ISerializable).IsAssignableFrom(t))
return CreateISerializableContract(objectType); return CreateISerializableContract(objectType);
#endif #endif
@@ -1008,10 +1008,8 @@ namespace Newtonsoft.Json.Serialization
// use the objectType's TypeConverter if it has one and can convert to a string // use the objectType's TypeConverter if it has one and can convert to a string
if (converter != null if (converter != null
#if !SILVERLIGHT
&& !(converter is ComponentConverter) && !(converter is ComponentConverter)
&& !(converter is ReferenceConverter) && !(converter is ReferenceConverter)
#endif
&& converter.GetType() != typeof(TypeConverter)) && converter.GetType() != typeof(TypeConverter))
{ {
if (converter.CanConvertTo(typeof(string))) if (converter.CanConvertTo(typeof(string)))
@@ -1022,11 +1020,6 @@ namespace Newtonsoft.Json.Serialization
if (type == typeof(Type) || type.IsSubclassOf(typeof(Type))) if (type == typeof(Type) || type.IsSubclassOf(typeof(Type)))
return true; return true;
#if SILVERLIGHT
if (type == typeof(Guid) || type == typeof(Uri) || type == typeof(TimeSpan))
return true;
#endif
return false; 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 // warning - this method use to cause errors with Intellitrace. Retest in VS Ultimate after changes
IValueProvider valueProvider; IValueProvider valueProvider;
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) #if !(PORTABLE40 || PORTABLE || NETFX_CORE)
if (DynamicCodeGeneration) if (DynamicCodeGeneration)
valueProvider = new DynamicValueProvider(member); valueProvider = new DynamicValueProvider(member);
else else
@@ -1208,7 +1201,7 @@ namespace Newtonsoft.Json.Serialization
JsonTypeReflector.GetAttribute<JsonIgnoreAttribute>(attributeProvider) != null JsonTypeReflector.GetAttribute<JsonIgnoreAttribute>(attributeProvider) != null
// automatically ignore extension data dictionary property if it is public // automatically ignore extension data dictionary property if it is public
|| JsonTypeReflector.GetAttribute<JsonExtensionDataAttribute>(attributeProvider) != null || JsonTypeReflector.GetAttribute<JsonExtensionDataAttribute>(attributeProvider) != null
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|| JsonTypeReflector.GetAttribute<NonSerializedAttribute>(attributeProvider) != null || JsonTypeReflector.GetAttribute<NonSerializedAttribute>(attributeProvider) != null
#endif #endif
; ;
@@ -49,7 +49,7 @@ namespace Newtonsoft.Json.Serialization
{ {
Assembly assembly; 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 // 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 // Assembly.Load won't check the GAC for a partial name
#pragma warning disable 618,612 #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) public override void BindToName(Type serializedType, out string assemblyName, out string typeName)
{ {
#if NETFX_CORE || PORTABLE #if NETFX_CORE || PORTABLE
assemblyName = serializedType.GetTypeInfo().Assembly.FullName; assemblyName = serializedType.GetTypeInfo().Assembly.FullName;
typeName = serializedType.FullName;
#elif !SILVERLIGHT
assemblyName = serializedType.Assembly.FullName;
typeName = serializedType.FullName; typeName = serializedType.FullName;
#else #else
assemblyName = null; assemblyName = serializedType.Assembly.FullName;
typeName = serializedType.AssemblyQualifiedName; typeName = serializedType.FullName;
#endif #endif
} }
#endif #endif
@@ -1,4 +1,4 @@
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) #if !(PORTABLE40 || PORTABLE || NETFX_CORE)
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using DiagnosticsTrace = System.Diagnostics.Trace; using DiagnosticsTrace = System.Diagnostics.Trace;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) #if !(PORTABLE40 || PORTABLE || NETFX_CORE)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20 #if NET20
@@ -124,7 +124,7 @@ namespace Newtonsoft.Json.Serialization
canDeserialize = true; canDeserialize = true;
ShouldCreateWrapper = 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)) else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyCollection<>), out tempCollectionType))
{ {
CollectionItemType = underlyingType.GetGenericArguments()[0]; CollectionItemType = underlyingType.GetGenericArguments()[0];
@@ -44,7 +44,7 @@ namespace Newtonsoft.Json.Serialization
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20 || PORTABLE40)
Dynamic, Dynamic,
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
Serializable, Serializable,
#endif #endif
Linq Linq
@@ -92,11 +92,11 @@ namespace Newtonsoft.Json.Serialization
if (ReflectionUtils.IsGenericDefinition(UnderlyingType, typeof(IDictionary<,>))) if (ReflectionUtils.IsGenericDefinition(UnderlyingType, typeof(IDictionary<,>)))
CreatedType = typeof(Dictionary<,>).MakeGenericType(keyType, valueType); 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<,>)); IsReadOnlyOrFixedSize = ReflectionUtils.InheritsGenericDefinition(underlyingType, typeof(ReadOnlyDictionary<,>));
#endif #endif
} }
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyDictionary<,>), out _genericCollectionDefinitionType)) else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyDictionary<,>), out _genericCollectionDefinitionType))
{ {
keyType = _genericCollectionDefinitionType.GetGenericArguments()[0]; keyType = _genericCollectionDefinitionType.GetGenericArguments()[0];
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
using System; using System;
using System.Globalization; using System.Globalization;
using System.Runtime.Serialization; using System.Runtime.Serialization;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
using System; using System;
namespace Newtonsoft.Json.Serialization namespace Newtonsoft.Json.Serialization
@@ -130,7 +130,7 @@ namespace Newtonsoft.Json.Serialization
ConstructorParameters = new JsonPropertyCollection(UnderlyingType); ConstructorParameters = new JsonPropertyCollection(UnderlyingType);
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
#if !(NET20 || NET35) #if !(NET20 || NET35)
[SecuritySafeCritical] [SecuritySafeCritical]
#endif #endif
@@ -33,7 +33,7 @@ using System.Dynamic;
#endif #endif
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || SILVERLIGHT) #if !(PORTABLE || PORTABLE40 || NET35 || NET20)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Reflection; using System.Reflection;
@@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Serialization
} }
private JsonSerializerProxy _internalSerializer; private JsonSerializerProxy _internalSerializer;
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
private JsonFormatterConverter _formatterConverter; private JsonFormatterConverter _formatterConverter;
#endif #endif
@@ -188,7 +188,7 @@ namespace Newtonsoft.Json.Serialization
return _internalSerializer; return _internalSerializer;
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
private JsonFormatterConverter GetFormatterConverter() private JsonFormatterConverter GetFormatterConverter()
{ {
if (_formatterConverter == null) if (_formatterConverter == null)
@@ -304,7 +304,7 @@ namespace Newtonsoft.Json.Serialization
{ {
case JsonContractType.Object: case JsonContractType.Object:
case JsonContractType.Dictionary: case JsonContractType.Dictionary:
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
case JsonContractType.Serializable: case JsonContractType.Serializable:
#endif #endif
#if !(NET35 || NET20 || PORTABLE40) #if !(NET35 || NET20 || PORTABLE40)
@@ -458,7 +458,7 @@ namespace Newtonsoft.Json.Serialization
JsonDynamicContract dynamicContract = (JsonDynamicContract)contract; JsonDynamicContract dynamicContract = (JsonDynamicContract)contract;
return CreateDynamic(reader, dynamicContract, member, id); return CreateDynamic(reader, dynamicContract, member, id);
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
case JsonContractType.Serializable: case JsonContractType.Serializable:
JsonISerializableContract serializableContract = (JsonISerializableContract)contract; JsonISerializableContract serializableContract = (JsonISerializableContract)contract;
return CreateISerializable(reader, serializableContract, member, id); 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); return Enum.ToObject(contract.NonNullableUnderlyingType, value);
} }
#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || SILVERLIGHT) #if !(PORTABLE || PORTABLE40 || NET35 || NET20)
if (value is BigInteger) if (value is BigInteger)
return ConvertUtils.FromBigInteger((BigInteger)value, targetType); return ConvertUtils.FromBigInteger((BigInteger)value, targetType);
#endif #endif
@@ -1286,7 +1286,7 @@ To fix this error either change the JSON to a {1} or change the deserialized typ
return underlyingList; return underlyingList;
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
private object CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, string id) private object CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, string id)
{ {
Type objectType = contract.UnderlyingType; Type objectType = contract.UnderlyingType;
@@ -154,7 +154,7 @@ namespace Newtonsoft.Json.Serialization
SerializeDynamic(writer, (IDynamicMetaObjectProvider)value, (JsonDynamicContract)valueContract, member, containerContract, containerProperty); SerializeDynamic(writer, (IDynamicMetaObjectProvider)value, (JsonDynamicContract)valueContract, member, containerContract, containerProperty);
break; break;
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
case JsonContractType.Serializable: case JsonContractType.Serializable:
SerializeISerializable(writer, (ISerializable)value, (JsonISerializableContract)valueContract, member, containerContract, containerProperty); SerializeISerializable(writer, (ISerializable)value, (JsonISerializableContract)valueContract, member, containerContract, containerProperty);
break; break;
@@ -298,25 +298,18 @@ namespace Newtonsoft.Json.Serialization
// use the objectType's TypeConverter if it has one and can convert to a string // use the objectType's TypeConverter if it has one and can convert to a string
if (converter != null if (converter != null
#if !SILVERLIGHT
&& !(converter is ComponentConverter) && !(converter is ComponentConverter)
#endif
&& converter.GetType() != typeof(TypeConverter)) && converter.GetType() != typeof(TypeConverter))
{ {
if (converter.CanConvertTo(typeof(string))) if (converter.CanConvertTo(typeof(string)))
{ {
#if !SILVERLIGHT
s = converter.ConvertToInvariantString(value); s = converter.ConvertToInvariantString(value);
#else
s = converter.ConvertToString(value);
#endif
return true; return true;
} }
} }
#endif #endif
#if SILVERLIGHT || NETFX_CORE || PORTABLE #if NETFX_CORE || PORTABLE
if (value is Guid || value is Uri || value is TimeSpan) if (value is Guid || value is Uri || value is TimeSpan)
{ {
s = value.ToString(); s = value.ToString();
@@ -704,7 +697,7 @@ namespace Newtonsoft.Json.Serialization
return writeMetadataObject; return writeMetadataObject;
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
#if !(NET20 || NET35) #if !(NET20 || NET35)
[SecuritySafeCritical] [SecuritySafeCritical]
#endif #endif
@@ -41,7 +41,7 @@ using System.Runtime.Serialization;
namespace Newtonsoft.Json.Serialization namespace Newtonsoft.Json.Serialization
{ {
#if !SILVERLIGHT && !NET20 && !NETFX_CORE #if !NET20 && !NETFX_CORE
internal interface IMetadataTypeAttribute internal interface IMetadataTypeAttribute
{ {
Type MetadataClassType { get; } Type MetadataClassType { get; }
@@ -63,7 +63,7 @@ namespace Newtonsoft.Json.Serialization
public const string SpecifiedPostfix = "Specified"; public const string SpecifiedPostfix = "Specified";
private static readonly ThreadSafeStore<object, Type> JsonConverterTypeCache = new ThreadSafeStore<object, Type>(GetJsonConverterTypeFromAttribute); private static readonly ThreadSafeStore<object, Type> JsonConverterTypeCache = new ThreadSafeStore<object, Type>(GetJsonConverterTypeFromAttribute);
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
private static readonly ThreadSafeStore<Type, Type> AssociatedMetadataTypesCache = new ThreadSafeStore<Type, Type>(GetAssociateMetadataTypeFromAttribute); private static readonly ThreadSafeStore<Type, Type> AssociatedMetadataTypesCache = new ThreadSafeStore<Type, Type>(GetAssociateMetadataTypeFromAttribute);
private const string MetadataTypeAttributeTypeName = private const string MetadataTypeAttributeTypeName =
@@ -71,23 +71,6 @@ namespace Newtonsoft.Json.Serialization
private static Type _cachedMetadataTypeAttributeType; private static Type _cachedMetadataTypeAttributeType;
#endif #endif
#if SILVERLIGHT
private static readonly ThreadSafeStore<object, Type> TypeConverterTypeCache = new ThreadSafeStore<object, Type>(GetTypeConverterTypeFromAttribute);
private static Type GetTypeConverterTypeFromAttribute(object attributeProvider)
{
TypeConverterAttribute converterAttribute = GetAttribute<TypeConverterAttribute>(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) public static JsonContainerAttribute GetJsonContainerAttribute(Type type)
{ {
@@ -109,7 +92,7 @@ namespace Newtonsoft.Json.Serialization
return GetJsonContainerAttribute(type) as JsonDictionaryAttribute; return GetJsonContainerAttribute(type) as JsonDictionaryAttribute;
} }
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40) #if !(NETFX_CORE || PORTABLE || PORTABLE40)
public static SerializableAttribute GetSerializableAttribute(Type type) public static SerializableAttribute GetSerializableAttribute(Type type)
{ {
return CachedAttributeGetter<SerializableAttribute>.GetAttribute(type); return CachedAttributeGetter<SerializableAttribute>.GetAttribute(type);
@@ -178,7 +161,7 @@ namespace Newtonsoft.Json.Serialization
return MemberSerialization.OptIn; return MemberSerialization.OptIn;
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
if (!ignoreSerializableAttribute) if (!ignoreSerializableAttribute)
{ {
SerializableAttribute serializableAttribute = GetSerializableAttribute(objectType); SerializableAttribute serializableAttribute = GetSerializableAttribute(objectType);
@@ -221,20 +204,11 @@ namespace Newtonsoft.Json.Serialization
#if !(NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
public static TypeConverter GetTypeConverter(Type type) public static TypeConverter GetTypeConverter(Type type)
{ {
#if !SILVERLIGHT
return TypeDescriptor.GetConverter(type); return TypeDescriptor.GetConverter(type);
#else
Type converterType = GetTypeConverterType(type);
if (converterType != null)
return (TypeConverter)Activator.CreateInstance(converterType);
return null;
#endif
} }
#endif #endif
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
private static Type GetAssociatedMetadataType(Type type) private static Type GetAssociatedMetadataType(Type type)
{ {
return AssociatedMetadataTypesCache.Get(type); return AssociatedMetadataTypesCache.Get(type);
@@ -279,7 +253,7 @@ namespace Newtonsoft.Json.Serialization
{ {
T attribute; T attribute;
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
Type metadataType = GetAssociatedMetadataType(type); Type metadataType = GetAssociatedMetadataType(type);
if (metadataType != null) if (metadataType != null)
{ {
@@ -307,7 +281,7 @@ namespace Newtonsoft.Json.Serialization
{ {
T attribute; T attribute;
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
Type metadataType = GetAssociatedMetadataType(memberInfo.DeclaringType); Type metadataType = GetAssociatedMetadataType(memberInfo.DeclaringType);
if (metadataType != null) if (metadataType != null)
{ {
@@ -371,14 +345,14 @@ namespace Newtonsoft.Json.Serialization
public static bool DynamicCodeGeneration public static bool DynamicCodeGeneration
{ {
#if !(NET20 || NET35 || SILVERLIGHT || NETFX_CORE || PORTABLE) #if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
[SecuritySafeCritical] [SecuritySafeCritical]
#endif #endif
get get
{ {
if (_dynamicCodeGeneration == null) if (_dynamicCodeGeneration == null)
{ {
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
try try
{ {
new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Demand(); new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Demand();
@@ -407,7 +381,7 @@ namespace Newtonsoft.Json.Serialization
{ {
if (_fullyTrusted == null) if (_fullyTrusted == null)
{ {
#if (NETFX_CORE || SILVERLIGHT || PORTABLE || PORTABLE40) #if (NETFX_CORE || PORTABLE || PORTABLE40)
_fullyTrusted = false; _fullyTrusted = false;
#elif !(NET20 || NET35 || PORTABLE40) #elif !(NET20 || NET35 || PORTABLE40)
AppDomain appDomain = AppDomain.CurrentDomain; AppDomain appDomain = AppDomain.CurrentDomain;
@@ -434,7 +408,7 @@ namespace Newtonsoft.Json.Serialization
{ {
get get
{ {
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE) #if !(PORTABLE40 || PORTABLE || NETFX_CORE)
if (DynamicCodeGeneration) if (DynamicCodeGeneration)
return DynamicReflectionDelegateFactory.Instance; return DynamicReflectionDelegateFactory.Instance;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !SILVERLIGHT && !NET20 && !NETFX_CORE #if !NET20 && !NETFX_CORE
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
using System.Numerics; using System.Numerics;
#endif #endif
using System.Text; using System.Text;
@@ -143,7 +143,7 @@ namespace Newtonsoft.Json.Serialization
public override void WriteValue(object value) public override void WriteValue(object value)
{ {
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
if (value is BigInteger) if (value is BigInteger)
{ {
_textWriter.WriteValue(value); _textWriter.WriteValue(value);
+1 -1
View File
@@ -1,5 +1,5 @@
 
#if SILVERLIGHT || PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE #if PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE
using System; using System;
using System.Reflection; using System.Reflection;
+1 -1
View File
@@ -1,5 +1,5 @@
 
#if (NETFX_CORE || SILVERLIGHT || PORTABLE40 || PORTABLE) #if (NETFX_CORE || PORTABLE40 || PORTABLE)
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
namespace Newtonsoft.Json namespace Newtonsoft.Json
@@ -76,7 +76,7 @@ namespace Newtonsoft.Json.Utilities
} }
} }
#if (NET20 || NET35 || SILVERLIGHT || PORTABLE40) #if (NET20 || NET35 || PORTABLE40)
public static void AddRange<T>(this IList<T> initial, IEnumerable collection) public static void AddRange<T>(this IList<T> initial, IEnumerable collection)
{ {
ValidationUtils.ArgumentNotNull(initial, "initial"); ValidationUtils.ArgumentNotNull(initial, "initial");
@@ -94,7 +94,7 @@ namespace Newtonsoft.Json.Utilities
return true; return true;
if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IDictionary<,>))) if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IDictionary<,>)))
return true; return true;
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IReadOnlyDictionary<,>))) if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IReadOnlyDictionary<,>)))
return true; return true;
#endif #endif
+8 -20
View File
@@ -27,7 +27,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.ComponentModel; using System.ComponentModel;
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics; using System.Numerics;
#endif #endif
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
@@ -35,7 +35,7 @@ using System.Reflection;
#if NET20 #if NET20
using Newtonsoft.Json.Utilities.LinqBridge; using Newtonsoft.Json.Utilities.LinqBridge;
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
using System.Data.SqlTypes; using System.Data.SqlTypes;
#endif #endif
@@ -82,7 +82,7 @@ namespace Newtonsoft.Json.Utilities
GuidNullable, GuidNullable,
TimeSpan, TimeSpan,
TimeSpanNullable, TimeSpanNullable,
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) #if !(PORTABLE || NET35 || NET20)
BigInteger, BigInteger,
BigIntegerNullable, BigIntegerNullable,
#endif #endif
@@ -147,7 +147,7 @@ namespace Newtonsoft.Json.Utilities
{ typeof(Guid?), PrimitiveTypeCode.GuidNullable }, { typeof(Guid?), PrimitiveTypeCode.GuidNullable },
{ typeof(TimeSpan), PrimitiveTypeCode.TimeSpan }, { typeof(TimeSpan), PrimitiveTypeCode.TimeSpan },
{ typeof(TimeSpan?), PrimitiveTypeCode.TimeSpanNullable }, { typeof(TimeSpan?), PrimitiveTypeCode.TimeSpanNullable },
#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT) #if !(PORTABLE || PORTABLE40 || NET35 || NET20)
{ typeof(BigInteger), PrimitiveTypeCode.BigInteger }, { typeof(BigInteger), PrimitiveTypeCode.BigInteger },
{ typeof(BigInteger?), PrimitiveTypeCode.BigIntegerNullable }, { typeof(BigInteger?), PrimitiveTypeCode.BigIntegerNullable },
#endif #endif
@@ -295,7 +295,7 @@ namespace Newtonsoft.Json.Utilities
return o => call(null, o); return o => call(null, o);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40) #if !(NET20 || NET35 || PORTABLE || PORTABLE40)
internal static BigInteger ToBigInteger(object value) internal static BigInteger ToBigInteger(object value)
{ {
if (value is BigInteger) if (value is BigInteger)
@@ -399,7 +399,7 @@ namespace Newtonsoft.Json.Utilities
return Type.GetType((string)initialValue, true); return Type.GetType((string)initialValue, true);
} }
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE) #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
if (targetType == typeof(BigInteger)) if (targetType == typeof(BigInteger))
return ToBigInteger(initialValue); return ToBigInteger(initialValue);
if (initialValue is BigInteger) if (initialValue is BigInteger)
@@ -411,24 +411,12 @@ namespace Newtonsoft.Json.Utilities
TypeConverter toConverter = GetConverter(initialType); TypeConverter toConverter = GetConverter(initialType);
if (toConverter != null && toConverter.CanConvertTo(targetType)) if (toConverter != null && toConverter.CanConvertTo(targetType))
{
#if !SILVERLIGHT
return toConverter.ConvertTo(null, culture, initialValue, targetType); return toConverter.ConvertTo(null, culture, initialValue, targetType);
#else
return toConverter.ConvertTo(initialValue, targetType);
#endif
}
TypeConverter fromConverter = GetConverter(targetType); TypeConverter fromConverter = GetConverter(targetType);
if (fromConverter != null && fromConverter.CanConvertFrom(initialType)) if (fromConverter != null && fromConverter.CanConvertFrom(initialType))
{
#if !SILVERLIGHT
return fromConverter.ConvertFrom(null, culture, initialValue); return fromConverter.ConvertFrom(null, culture, initialValue);
#else
return fromConverter.ConvertFrom(initialValue);
#endif
}
#endif #endif
#if !(NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
// handle DBNull and INullable // 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)); throw new Exception("Can not convert null {0} into non-nullable {1}.".FormatWith(CultureInfo.InvariantCulture, initialType, targetType));
} }
#endif #endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE) #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
if (initialValue is INullable) if (initialValue is INullable)
return EnsureTypeAssignable(ToValue((INullable)initialValue), initialType, targetType); return EnsureTypeAssignable(ToValue((INullable)initialValue), initialType, targetType);
#endif #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)); 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) public static object ToValue(INullable nullableValue)
{ {
if (nullableValue == null) if (nullableValue == null)
@@ -46,7 +46,7 @@ namespace Newtonsoft.Json.Utilities
{ {
private readonly IDictionary _dictionary; private readonly IDictionary _dictionary;
private readonly IDictionary<TKey, TValue> _genericDictionary; private readonly IDictionary<TKey, TValue> _genericDictionary;
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
private readonly IReadOnlyDictionary<TKey, TValue> _readOnlyDictionary; private readonly IReadOnlyDictionary<TKey, TValue> _readOnlyDictionary;
#endif #endif
private object _syncRoot; private object _syncRoot;
@@ -65,7 +65,7 @@ namespace Newtonsoft.Json.Utilities
_genericDictionary = dictionary; _genericDictionary = dictionary;
} }
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
public DictionaryWrapper(IReadOnlyDictionary<TKey, TValue> dictionary) public DictionaryWrapper(IReadOnlyDictionary<TKey, TValue> dictionary)
{ {
ValidationUtils.ArgumentNotNull(dictionary, "dictionary"); ValidationUtils.ArgumentNotNull(dictionary, "dictionary");
@@ -88,7 +88,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return _dictionary.Contains(key); return _dictionary.Contains(key);
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary.ContainsKey(key); return _readOnlyDictionary.ContainsKey(key);
#endif #endif
@@ -102,7 +102,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return _dictionary.Keys.Cast<TKey>().ToList(); return _dictionary.Keys.Cast<TKey>().ToList();
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary.Keys.ToList(); return _readOnlyDictionary.Keys.ToList();
#endif #endif
@@ -125,7 +125,7 @@ namespace Newtonsoft.Json.Utilities
return false; return false;
} }
} }
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
{ {
throw new NotSupportedException(); throw new NotSupportedException();
@@ -152,7 +152,7 @@ namespace Newtonsoft.Json.Utilities
return true; return true;
} }
} }
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
{ {
throw new NotSupportedException(); throw new NotSupportedException();
@@ -170,7 +170,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return _dictionary.Values.Cast<TValue>().ToList(); return _dictionary.Values.Cast<TValue>().ToList();
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary.Values.ToList(); return _readOnlyDictionary.Values.ToList();
#endif #endif
@@ -185,7 +185,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return (TValue)_dictionary[key]; return (TValue)_dictionary[key];
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary[key]; return _readOnlyDictionary[key];
#endif #endif
@@ -196,7 +196,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
_dictionary[key] = value; _dictionary[key] = value;
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
throw new NotSupportedException(); throw new NotSupportedException();
#endif #endif
@@ -209,7 +209,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
((IList)_dictionary).Add(item); ((IList)_dictionary).Add(item);
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
throw new NotSupportedException(); throw new NotSupportedException();
#endif #endif
@@ -221,7 +221,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
_dictionary.Clear(); _dictionary.Clear();
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
throw new NotSupportedException(); throw new NotSupportedException();
#endif #endif
@@ -233,7 +233,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return ((IList)_dictionary).Contains(item); return ((IList)_dictionary).Contains(item);
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary.Contains(item); return _readOnlyDictionary.Contains(item);
#endif #endif
@@ -250,7 +250,7 @@ namespace Newtonsoft.Json.Utilities
array[arrayIndex++] = new KeyValuePair<TKey, TValue>((TKey)item.Key, (TValue)item.Value); array[arrayIndex++] = new KeyValuePair<TKey, TValue>((TKey)item.Key, (TValue)item.Value);
} }
} }
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
{ {
throw new NotSupportedException(); throw new NotSupportedException();
@@ -268,7 +268,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return _dictionary.Count; return _dictionary.Count;
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary.Count; return _readOnlyDictionary.Count;
#endif #endif
@@ -283,7 +283,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return _dictionary.IsReadOnly; return _dictionary.IsReadOnly;
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return true; return true;
#endif #endif
@@ -315,7 +315,7 @@ namespace Newtonsoft.Json.Utilities
return true; return true;
} }
} }
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
{ {
throw new NotSupportedException(); throw new NotSupportedException();
@@ -331,7 +331,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return _dictionary.Cast<DictionaryEntry>().Select(de => new KeyValuePair<TKey, TValue>((TKey)de.Key, (TValue)de.Value)).GetEnumerator(); return _dictionary.Cast<DictionaryEntry>().Select(de => new KeyValuePair<TKey, TValue>((TKey)de.Key, (TValue)de.Value)).GetEnumerator();
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary.GetEnumerator(); return _readOnlyDictionary.GetEnumerator();
#endif #endif
@@ -348,7 +348,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
_dictionary.Add(key, value); _dictionary.Add(key, value);
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
throw new NotSupportedException(); throw new NotSupportedException();
#endif #endif
@@ -362,7 +362,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return _dictionary[key]; return _dictionary[key];
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary[(TKey)key]; return _readOnlyDictionary[(TKey)key];
#endif #endif
@@ -373,7 +373,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
_dictionary[key] = value; _dictionary[key] = value;
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
throw new NotSupportedException(); throw new NotSupportedException();
#endif #endif
@@ -427,7 +427,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return _dictionary.GetEnumerator(); return _dictionary.GetEnumerator();
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return new DictionaryEnumerator<TKey, TValue>(_readOnlyDictionary.GetEnumerator()); return new DictionaryEnumerator<TKey, TValue>(_readOnlyDictionary.GetEnumerator());
#endif #endif
@@ -439,7 +439,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_genericDictionary != null) if (_genericDictionary != null)
return _genericDictionary.ContainsKey((TKey)key); return _genericDictionary.ContainsKey((TKey)key);
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary.ContainsKey((TKey)key); return _readOnlyDictionary.ContainsKey((TKey)key);
#endif #endif
@@ -453,7 +453,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_genericDictionary != null) if (_genericDictionary != null)
return false; return false;
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return true; return true;
#endif #endif
@@ -468,7 +468,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_genericDictionary != null) if (_genericDictionary != null)
return _genericDictionary.Keys.ToList(); return _genericDictionary.Keys.ToList();
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary.Keys.ToList(); return _readOnlyDictionary.Keys.ToList();
#endif #endif
@@ -481,7 +481,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
_dictionary.Remove(key); _dictionary.Remove(key);
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
throw new NotSupportedException(); throw new NotSupportedException();
#endif #endif
@@ -495,7 +495,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_genericDictionary != null) if (_genericDictionary != null)
return _genericDictionary.Values.ToList(); return _genericDictionary.Values.ToList();
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary.Values.ToList(); return _readOnlyDictionary.Values.ToList();
#endif #endif
@@ -508,7 +508,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
_dictionary.CopyTo(array, index); _dictionary.CopyTo(array, index);
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
throw new NotSupportedException(); throw new NotSupportedException();
#endif #endif
@@ -544,7 +544,7 @@ namespace Newtonsoft.Json.Utilities
{ {
if (_dictionary != null) if (_dictionary != null)
return _dictionary; return _dictionary;
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40) #if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (_readOnlyDictionary != null) else if (_readOnlyDictionary != null)
return _readOnlyDictionary; return _readOnlyDictionary;
#endif #endif
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
#endregion #endregion
#if !(SILVERLIGHT || PORTABLE || NETFX_CORE || PORTABLE40) #if !(PORTABLE || NETFX_CORE || PORTABLE40)
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
#if NET20 #if NET20
@@ -29,7 +29,7 @@ using System.Collections.Generic;
using System.Dynamic; using System.Dynamic;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
#if !(PORTABLE || WINDOWS_PHONE) #if !(PORTABLE)
using System.Reflection; using System.Reflection;
#else #else
using Microsoft.CSharp.RuntimeBinder; using Microsoft.CSharp.RuntimeBinder;
@@ -45,12 +45,8 @@ namespace Newtonsoft.Json.Utilities
{ {
internal static class BinderWrapper internal static class BinderWrapper
{ {
#if !(PORTABLE || WINDOWS_PHONE) #if !(PORTABLE)
#if !SILVERLIGHT
public const string CSharpAssemblyName = "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; 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 BinderTypeName = "Microsoft.CSharp.RuntimeBinder.Binder, " + CSharpAssemblyName;
private const string CSharpArgumentInfoTypeName = "Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo, " + 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) public static CallSiteBinder GetMember(string name, Type context)
{ {
#if !(PORTABLE || WINDOWS_PHONE) #if !(PORTABLE)
Init(); Init();
return (CallSiteBinder)_getMemberCall(null, 0, name, context, _getCSharpArgumentInfoArray); return (CallSiteBinder)_getMemberCall(null, 0, name, context, _getCSharpArgumentInfoArray);
#else #else
@@ -127,7 +123,7 @@ namespace Newtonsoft.Json.Utilities
public static CallSiteBinder SetMember(string name, Type context) public static CallSiteBinder SetMember(string name, Type context)
{ {
#if !(PORTABLE || WINDOWS_PHONE) #if !(PORTABLE)
Init(); Init();
return (CallSiteBinder)_setMemberCall(null, 0, name, context, _setCSharpArgumentInfoArray); return (CallSiteBinder)_setMemberCall(null, 0, name, context, _setCSharpArgumentInfoArray);
#else #else

Some files were not shown because too many files have changed in this diff Show More