-Removed SL/WP code and fiels
This commit is contained in:
@@ -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.Collections.Generic;
|
||||
using System.Globalization;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -1428,7 +1428,7 @@ namespace Newtonsoft.Json.Tests.Bson
|
||||
}
|
||||
}
|
||||
|
||||
#if !(WINDOWS_PHONE || SILVERLIGHT || NET20 || NET35 || NETFX_CORE)
|
||||
#if !(NET20 || NET35 || NETFX_CORE)
|
||||
public void Utf8Text()
|
||||
{
|
||||
string badText = System.IO.File.ReadAllText(@"PoisonText.txt");
|
||||
@@ -1447,7 +1447,7 @@ namespace Newtonsoft.Json.Tests.Bson
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
public class BigIntegerTestClass
|
||||
{
|
||||
public BigInteger Blah { get; set; }
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -747,7 +747,7 @@ namespace Newtonsoft.Json.Tests.Bson
|
||||
//}
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void WriteBigInteger()
|
||||
{
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !SILVERLIGHT && !NET20 && !NETFX_CORE
|
||||
#if !NET20 && !NETFX_CORE
|
||||
using System.Data.Linq;
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
using System.Data.SqlTypes;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -55,7 +55,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
public byte[] NullByteArray { get; set; }
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void DeserializeBinaryClass()
|
||||
{
|
||||
@@ -121,7 +121,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
}", json);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
public class SqlBinaryClass
|
||||
{
|
||||
public SqlBinary SqlBinary { get; set; }
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
using System;
|
||||
using Newtonsoft.Json.Converters;
|
||||
#if !NETFX_CORE
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !NETFX_CORE
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !SILVERLIGHT && !NET20 && !NETFX_CORE
|
||||
#if !NET20 && !NETFX_CORE
|
||||
using System.Data.Linq;
|
||||
#endif
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
using System.Data.SqlTypes;
|
||||
#endif
|
||||
using System.Dynamic;
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
Assert.AreEqual(2006, d.Year);
|
||||
}
|
||||
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
[Test]
|
||||
public void SerializeFormattedDateTimeNewZealandCulture()
|
||||
{
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !SILVERLIGHT && !NET20 && !NETFX_CORE
|
||||
#if !NET20 && !NETFX_CORE
|
||||
using System.Data.Linq;
|
||||
#endif
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
using System.Data.SqlTypes;
|
||||
#endif
|
||||
using System.IO;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Tests.Serialization;
|
||||
@@ -1879,7 +1879,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
|
||||
Assert.AreEqual(@"{""root"":{""@xmlns"":""http://www.example.com/ns"",""a"":null,""bns:b"":{""@xmlns:bns"":""http://www.example.com/ns""},""c"":null}}", json1);
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
var xml1 = new XmlDocument();
|
||||
xml1.LoadXml(xmlString);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT)
|
||||
#if !(NET20 || NET35)
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
using System.Xml;
|
||||
@@ -873,7 +873,7 @@ now brown cow?", '"', true);
|
||||
return (T)converter.ReadJson(reader, typeof(T), null, null);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
[Test]
|
||||
public void Async()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -832,7 +832,7 @@ Parameter name: reader",
|
||||
}
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
[Test]
|
||||
public void ReadInt64Overflow()
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ using System.IO;
|
||||
#if NET20
|
||||
using Newtonsoft.Json.Utilities.LinqBridge;
|
||||
#endif
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -352,7 +352,7 @@ namespace Newtonsoft.Json.Tests
|
||||
Assert.IsNotNull(validationEventArgs);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void IntegerGreaterThanMaximumValue_BigInteger()
|
||||
{
|
||||
@@ -606,7 +606,7 @@ namespace Newtonsoft.Json.Tests
|
||||
Assert.IsNotNull(validationEventArgs);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void BigIntegerDivisibleBy_Success()
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
using NUnit.Framework;
|
||||
using System.Web.UI;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
using NUnit.Framework;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -178,7 +178,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
new JProperty("Uri", new Uri("http://json.codeplex.com/")),
|
||||
new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")),
|
||||
new JProperty("TimeSpan", TimeSpan.FromDays(1))
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
, new JProperty("BigInteger", BigInteger.Parse("1"))
|
||||
#endif
|
||||
);
|
||||
@@ -211,7 +211,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.IsTrue(d.Decimal == 1.1m);
|
||||
Assert.IsTrue(d.Decimal != 1.0f);
|
||||
Assert.IsTrue(d.Decimal != 1.0d);
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
Assert.IsTrue(d.Decimal > new BigInteger(0));
|
||||
#endif
|
||||
|
||||
@@ -227,11 +227,11 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.IsTrue(d.Float == 1.1m);
|
||||
Assert.IsTrue(d.Float != 1.0f);
|
||||
Assert.IsTrue(d.Float != 1.0d);
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
Assert.IsTrue(d.Float > new BigInteger(0));
|
||||
#endif
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
Assert.IsTrue(d.BigInteger == d.BigInteger);
|
||||
Assert.IsTrue(d.BigInteger > 0);
|
||||
Assert.IsTrue(d.BigInteger > 0.0m);
|
||||
@@ -287,7 +287,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
new JProperty("Uri", new Uri("http://json.codeplex.com/")),
|
||||
new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")),
|
||||
new JProperty("TimeSpan", TimeSpan.FromDays(1))
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
, new JProperty("BigInteger", new BigInteger(100))
|
||||
#endif
|
||||
);
|
||||
@@ -366,7 +366,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
r += 2;
|
||||
Assert.AreEqual(null, r.Value);
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
r = d.BigInteger + null;
|
||||
Assert.AreEqual(null, r.Value);
|
||||
r += 2;
|
||||
@@ -445,7 +445,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
r -= 2;
|
||||
Assert.AreEqual(null, r.Value);
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
r = d.BigInteger - null;
|
||||
Assert.AreEqual(null, r.Value);
|
||||
r -= 2;
|
||||
@@ -519,7 +519,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
r *= 2;
|
||||
Assert.AreEqual(null, r.Value);
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
r = d.BigInteger * 1.1d;
|
||||
Assert.AreEqual(100m, (decimal)r);
|
||||
r *= 2;
|
||||
@@ -593,7 +593,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
r /= 2;
|
||||
Assert.AreEqual(null, r.Value);
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
r = d.BigInteger / 1.1d;
|
||||
Assert.AreEqual(100m, (decimal)r);
|
||||
r /= 2;
|
||||
@@ -621,7 +621,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
new JProperty("Uri", new Uri("http://json.codeplex.com/")),
|
||||
new JProperty("Guid", new Guid("EA27FE1D-0D80-44F2-BF34-4654156FA7AF")),
|
||||
new JProperty("TimeSpan", TimeSpan.FromDays(1))
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
, new JProperty("BigInteger", new BigInteger(100))
|
||||
#endif
|
||||
);
|
||||
@@ -638,7 +638,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.AreEqual("http://json.codeplex.com/", d.Uri.ToString());
|
||||
Assert.AreEqual("ea27fe1d-0d80-44f2-bf34-4654156fa7af", d.Guid.ToString());
|
||||
Assert.AreEqual("1.00:00:00", d.TimeSpan.ToString());
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
Assert.AreEqual("100", d.BigInteger.ToString());
|
||||
#endif
|
||||
}
|
||||
@@ -722,7 +722,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
AssertValueConverted<Guid?>(null);
|
||||
AssertValueConverted<Uri>(new Uri("http://json.codeplex.com/"));
|
||||
AssertValueConverted<Uri>(null);
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
AssertValueConverted<BigInteger>(new BigInteger(100));
|
||||
AssertValueConverted<BigInteger?>(null);
|
||||
#endif
|
||||
|
||||
@@ -450,7 +450,7 @@ Parameter name: index",
|
||||
}
|
||||
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void ITypedListGetItemProperties()
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using Newtonsoft.Json.Serialization;
|
||||
@@ -42,7 +42,7 @@ using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAtt
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
using System.Web.UI;
|
||||
#endif
|
||||
#if NET20
|
||||
@@ -684,7 +684,7 @@ Parameter name: arrayIndex",
|
||||
Assert.AreEqual(p4, l[1]);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void PropertyChanging()
|
||||
{
|
||||
@@ -1241,7 +1241,7 @@ Parameter name: arrayIndex",
|
||||
});
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void IBindingListSortDirection()
|
||||
{
|
||||
@@ -1444,7 +1444,7 @@ Parameter name: arrayIndex",
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
[Test]
|
||||
public void CollectionChanged()
|
||||
{
|
||||
@@ -1690,7 +1690,7 @@ Parameter name: arrayIndex",
|
||||
});
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void GetProperties()
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.AreEqual(p, p.Value.Parent);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void ListChanged()
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -355,7 +355,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
|
||||
Assert.AreEqual(5, (int)(new JValue(StringComparison.OrdinalIgnoreCase)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
string bigIntegerText = "1234567899999999999999999999999999999999999999999999999999999999999990";
|
||||
|
||||
Assert.AreEqual(BigInteger.Parse(bigIntegerText), (new JValue(BigInteger.Parse(bigIntegerText))).Value);
|
||||
@@ -435,7 +435,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
#endif
|
||||
ExceptionAssert.Throws<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 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>(); });
|
||||
@@ -449,7 +449,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
[Test]
|
||||
public void ToObject()
|
||||
{
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
Assert.AreEqual((BigInteger)1, (new JValue(1).ToObject(typeof(BigInteger))));
|
||||
Assert.AreEqual((BigInteger)1, (new JValue(1).ToObject(typeof(BigInteger?))));
|
||||
Assert.AreEqual((BigInteger?)null, (new JValue((object)null).ToObject(typeof(BigInteger?))));
|
||||
@@ -503,7 +503,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.IsTrue(JToken.DeepEquals(new JValue((DateTimeOffset?)null), (JValue)(DateTimeOffset?)null));
|
||||
#endif
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
// had to remove implicit casting to avoid user reference to System.Numerics.dll
|
||||
Assert.IsTrue(JToken.DeepEquals(new JValue(new BigInteger(1)), new JValue(new BigInteger(1))));
|
||||
Assert.IsTrue(JToken.DeepEquals(new JValue((BigInteger?)null), new JValue((BigInteger?)null)));
|
||||
@@ -945,7 +945,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.IsTrue(a.DeepEquals(a2));
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void Clone()
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -120,7 +120,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
jsonWriter.WriteValue("DVD read/writer");
|
||||
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
jsonWriter.WriteValue(new BigInteger(123));
|
||||
Assert.AreEqual(WriteState.Array, jsonWriter.WriteState);
|
||||
#endif
|
||||
@@ -149,7 +149,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
/*fail*/]", writer.Token.ToString());
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void WriteBigInteger()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -140,7 +140,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.AreEqual(g, v.Value);
|
||||
Assert.AreEqual(JTokenType.Guid, v.Type);
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
BigInteger i = BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990");
|
||||
v.Value = i;
|
||||
Assert.AreEqual(i, v.Value);
|
||||
@@ -200,13 +200,13 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
v = new JValue(new Guid("B282ADE7-C520-496C-A448-4084F6803DE5"));
|
||||
Assert.AreEqual("b282ade7-c520-496c-a448-4084f6803de5", v.ToString(null, CultureInfo.InvariantCulture));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
v = new JValue(BigInteger.Parse("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990"));
|
||||
Assert.AreEqual("123456789999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990", v.ToString(null, CultureInfo.InvariantCulture));
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void JValueParse()
|
||||
{
|
||||
@@ -481,7 +481,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.AreEqual(Int32.MaxValue, Convert.ToInt32(new JValue(Int32.MaxValue)));
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void ConvertsToInt32_BigInteger()
|
||||
{
|
||||
@@ -618,7 +618,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
v = new JValue(new Uri("http://www.google.com"));
|
||||
Assert.AreEqual(TypeCode.Object, v.GetTypeCode());
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
v = new JValue(new BigInteger(3));
|
||||
Assert.AreEqual(TypeCode.Object, v.GetTypeCode());
|
||||
#endif
|
||||
@@ -632,7 +632,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
int i = (int)v.ToType(typeof(int), CultureInfo.InvariantCulture);
|
||||
Assert.AreEqual(9, i);
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
BigInteger bi = (BigInteger)v.ToType(typeof(BigInteger), CultureInfo.InvariantCulture);
|
||||
Assert.AreEqual(new BigInteger(9), bi);
|
||||
#endif
|
||||
@@ -647,7 +647,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
Assert.AreEqual("2013", v.ToString("yyyy"));
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void ToStringNewTypes()
|
||||
{
|
||||
|
||||
@@ -732,7 +732,7 @@ keyword such as type of business.""
|
||||
Assert.AreEqual(new DateTime(2000, 10, 15, 5, 5, 5, DateTimeKind.Utc), d);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
[Test]
|
||||
public void CovariantIJEnumerable()
|
||||
{
|
||||
@@ -892,7 +892,7 @@ keyword such as type of business.""
|
||||
Assert.AreEqual("hi!", (string)a[0]);
|
||||
}
|
||||
|
||||
#if !(NET35 || NET20 || WINDOWS_PHONE)
|
||||
#if !(NET35 || NET20)
|
||||
[Test]
|
||||
public void ExceptionFromOverloadWithJValue()
|
||||
{
|
||||
|
||||
@@ -232,7 +232,6 @@
|
||||
<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\TypeClass.cs" />
|
||||
|
||||
@@ -276,7 +276,6 @@
|
||||
<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\TypeClass.cs" />
|
||||
|
||||
@@ -394,7 +394,6 @@
|
||||
<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\TypeClass.cs" />
|
||||
|
||||
@@ -276,7 +276,6 @@
|
||||
<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\TypeClass.cs" />
|
||||
|
||||
@@ -271,7 +271,6 @@
|
||||
<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\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\TypeNameHandlingTests.cs" />
|
||||
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
|
||||
<Compile Include="SilverlightTests.cs" />
|
||||
<Compile Include="TestFixtureBase.cs" />
|
||||
<Compile Include="TestObjects\AbstractGenericBase.cs" />
|
||||
<Compile Include="TestObjects\ArgumentConverterPrecedenceClassConverter.cs" />
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE)
|
||||
#if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -31,11 +31,7 @@ using System.Security;
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
|
||||
#if WINDOWS_PHONE
|
||||
[assembly: AssemblyTitle("Json.NET Tests Windows Phone")]
|
||||
#elif SILVERLIGHT
|
||||
[assembly: AssemblyTitle("Json.NET Tests Silverlight")]
|
||||
#elif PORTABLE
|
||||
#if PORTABLE
|
||||
[assembly: AssemblyTitle("Json.NET Tests Portable")]
|
||||
#elif NETFX_CORE
|
||||
[assembly: AssemblyTitle("Json.NET Tests WinRT")]
|
||||
@@ -79,4 +75,4 @@ using System.Security;
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("4.5.0.0")]
|
||||
[assembly: AssemblyFileVersion("5.0.8.16620")]
|
||||
[assembly: AssemblyFileVersion("5.0.8.16620")]
|
||||
|
||||
@@ -36,7 +36,7 @@ using Newtonsoft.Json.Schema;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json.Tests.TestObjects;
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
using System.Data;
|
||||
|
||||
#endif
|
||||
@@ -200,7 +200,7 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
#if !NET20
|
||||
GenerateSchemaAndSerializeFromType(new NullableDateTimeTestClass());
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
GenerateSchemaAndSerializeFromType(new DataSet());
|
||||
#endif
|
||||
GenerateSchemaAndSerializeFromType(new object());
|
||||
|
||||
@@ -311,7 +311,7 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
Assert.IsTrue(v.IsValid(schema));
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void GenerateSchemaForISerializable()
|
||||
{
|
||||
@@ -371,7 +371,7 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName;
|
||||
generator.ContractResolver = new CustomDirectoryInfoMapper
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
IgnoreSerializableAttribute = true
|
||||
#endif
|
||||
};
|
||||
@@ -455,7 +455,7 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
serializer.Converters.Add(new IsoDateTimeConverter());
|
||||
serializer.ContractResolver = new CustomDirectoryInfoMapper
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
IgnoreSerializableInterface = true
|
||||
#endif
|
||||
};
|
||||
@@ -475,7 +475,7 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName;
|
||||
generator.ContractResolver = new CamelCasePropertyNamesContractResolver()
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
IgnoreSerializableAttribute = true
|
||||
#endif
|
||||
};
|
||||
@@ -520,7 +520,7 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
}", json);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void GenerateSchemaSerializable()
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE)
|
||||
#if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
|
||||
using System.Runtime.Serialization.Json;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -237,7 +237,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
{
|
||||
EmitDefaultValueClass c = new EmitDefaultValueClass();
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE)
|
||||
#if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
|
||||
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(EmitDefaultValueClass));
|
||||
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(NET35 || NET20 || SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NET35 || NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
#if !(NET35 || NET20 || SILVERLIGHT)
|
||||
#if !(NET35 || NET20)
|
||||
using System.Collections.Concurrent;
|
||||
#endif
|
||||
using System.Collections.Generic;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
#if !SILVERLIGHT && !NET20 && !NETFX_CORE
|
||||
#if !NET20 && !NETFX_CORE
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Configuration;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -68,7 +68,7 @@ using System.Runtime.Serialization;
|
||||
using System.Globalization;
|
||||
using Newtonsoft.Json.Utilities;
|
||||
using System.Reflection;
|
||||
#if !NET20 && !SILVERLIGHT
|
||||
#if !NET20
|
||||
using System.Xml.Linq;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq.Expressions;
|
||||
@@ -81,7 +81,7 @@ using Newtonsoft.Json.Utilities.LinqBridge;
|
||||
#else
|
||||
using System.Linq;
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
using System.Drawing;
|
||||
using System.Diagnostics;
|
||||
|
||||
@@ -1291,7 +1291,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
Assert.AreEqual(executorObject2.clientGetResultFunction, "ClientBanSubsCB");
|
||||
}
|
||||
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
[Test]
|
||||
public void HashtableDeserialization()
|
||||
{
|
||||
@@ -1535,7 +1535,7 @@ keyword such as type of business.""
|
||||
{
|
||||
string json = @"[""vvv\/vvv\tvvv\""vvv\bvvv\nvvv\rvvv\\vvv\fvvv""]";
|
||||
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
|
||||
List<string> javaScriptSerializerResult = javaScriptSerializer.Deserialize<List<string>>(json);
|
||||
#endif
|
||||
@@ -1547,7 +1547,7 @@ keyword such as type of business.""
|
||||
|
||||
Assert.AreEqual(1, jsonNetResult.Count);
|
||||
Assert.AreEqual(dataContractResult[0], jsonNetResult[0]);
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
Assert.AreEqual(javaScriptSerializerResult[0], jsonNetResult[0]);
|
||||
#endif
|
||||
}
|
||||
@@ -1904,7 +1904,7 @@ keyword such as type of business.""
|
||||
Assert.AreEqual(99, c.Field);
|
||||
}
|
||||
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
[Test]
|
||||
public void SerializeArrayAsArrayList()
|
||||
{
|
||||
@@ -2704,7 +2704,7 @@ keyword such as type of business.""
|
||||
Assert.AreEqual("titleId", n.FidOrder[n.FidOrder.Count - 1]);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[MetadataType(typeof(OptInClassMetadata))]
|
||||
public class OptInClass
|
||||
{
|
||||
@@ -3214,7 +3214,7 @@ Path '', line 1, position 1.",
|
||||
() => { JsonConvert.DeserializeObject<Dictionary<string, string>>(json); });
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
[Test]
|
||||
public void CannotDeserializeArrayIntoSerializable()
|
||||
{
|
||||
@@ -3336,7 +3336,7 @@ Path '', line 1, position 2.",
|
||||
{
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
IgnoreSerializableAttribute = true
|
||||
#endif
|
||||
}
|
||||
@@ -3355,7 +3355,7 @@ Path '', line 1, position 2.",
|
||||
{
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
IgnoreSerializableAttribute = true
|
||||
#endif
|
||||
}
|
||||
@@ -3374,7 +3374,7 @@ Path '', line 1, position 2.",
|
||||
{
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
IgnoreSerializableAttribute = true
|
||||
#endif
|
||||
}
|
||||
@@ -3393,7 +3393,7 @@ Path '', line 1, position 2.",
|
||||
{
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
IgnoreSerializableAttribute = true
|
||||
#endif
|
||||
}
|
||||
@@ -4063,7 +4063,7 @@ Path '', line 1, position 2.",
|
||||
Assert.AreEqual("value", newModelStateDictionary["key"]);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
public class ISerializableTestObject : ISerializable
|
||||
{
|
||||
internal string _stringValue;
|
||||
@@ -4547,7 +4547,7 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
}
|
||||
}
|
||||
|
||||
#if !NET20 && !SILVERLIGHT
|
||||
#if !NET20
|
||||
public class XNodeTestObject
|
||||
{
|
||||
public XDocument Document { get; set; }
|
||||
@@ -4555,14 +4555,14 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
public class XmlNodeTestObject
|
||||
{
|
||||
public XmlDocument Document { get; set; }
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(NET20 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NET20 || PORTABLE40)
|
||||
[Test]
|
||||
public void SerializeDeserializeXNodeProperties()
|
||||
{
|
||||
@@ -4593,7 +4593,7 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void SerializeDeserializeXmlNodeProperties()
|
||||
{
|
||||
@@ -5260,7 +5260,7 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
Assert.AreEqual(null, d[2]);
|
||||
}
|
||||
|
||||
#if !SILVERLIGHT && !NET20
|
||||
#if !NET20
|
||||
[Test]
|
||||
public void SerializeHashSet()
|
||||
{
|
||||
@@ -5313,7 +5313,7 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
Assert.AreEqual(0, z[1].Prop1.Length);
|
||||
}
|
||||
|
||||
#if !NET20 && !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NET20 && !NETFX_CORE
|
||||
public class StringDictionaryTestClass
|
||||
{
|
||||
public StringDictionary StringDictionaryProperty { get; set; }
|
||||
@@ -5605,7 +5605,7 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
Assert.AreEqual(meh.IDontWork, "meh");
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE)
|
||||
#if !(NET20 || NETFX_CORE)
|
||||
[DataContract]
|
||||
public struct StructISerializable : ISerializable
|
||||
{
|
||||
@@ -6025,7 +6025,7 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
JsonConvert.DeserializeObject<EnumerableArrayPropertyClass>(json);
|
||||
}
|
||||
|
||||
#if !(NET20 || SILVERLIGHT)
|
||||
#if !(NET20)
|
||||
[DataContract]
|
||||
public class BaseDataContract
|
||||
{
|
||||
@@ -6452,7 +6452,7 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
}
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void SerializeException1()
|
||||
{
|
||||
@@ -6582,7 +6582,7 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
}
|
||||
}
|
||||
|
||||
#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE || PORTABLE40)
|
||||
#if !(NET35 || NET20 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void DeserializeConcurrentDictionary()
|
||||
{
|
||||
@@ -6713,7 +6713,7 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
}
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || WINDOWS_PHONE || NET20 || NETFX_CORE)
|
||||
#if !(NET20 || NETFX_CORE)
|
||||
[Test]
|
||||
public void DeserializeDecimalsWithCulture()
|
||||
{
|
||||
@@ -7177,7 +7177,7 @@ Parameter name: value",
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
[Test]
|
||||
public void MetroBlogPost()
|
||||
{
|
||||
@@ -7509,7 +7509,7 @@ Parameter name: value",
|
||||
Assert.AreEqual("", s);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void SerializeAndDeserializeWithAttributes()
|
||||
{
|
||||
@@ -7672,7 +7672,7 @@ Parameter name: value",
|
||||
() => { s.Deserialize<Dictionary<string, int>>(new JsonTextReader(new StringReader(json))); });
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void DeserializeException()
|
||||
{
|
||||
@@ -7928,7 +7928,7 @@ Parameter name: value",
|
||||
Assert.AreEqual("[1.1,0.0,0.0]", json);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || NET40 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NET20 || NET35 || NET40 || PORTABLE40)
|
||||
#if !PORTABLE
|
||||
[Test]
|
||||
public void DeserializeReadOnlyListWithBigInteger()
|
||||
@@ -7987,7 +7987,7 @@ Parameter name: value",
|
||||
|
||||
Action doStuff = () => { obj = JsonConvert.DeserializeObject<MyTuple<int>>(json); };
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
doStuff();
|
||||
Assert.AreEqual(500, obj.Item1);
|
||||
#else
|
||||
@@ -8020,7 +8020,7 @@ Parameter name: value",
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || NET35 || NET20 || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || NET35 || NET20 || PORTABLE40)
|
||||
[Test]
|
||||
public void SerializeTupleWithSerializableAttribute()
|
||||
{
|
||||
@@ -8047,7 +8047,7 @@ Parameter name: value",
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
public class PopulateReadOnlyTestClass
|
||||
{
|
||||
public IList<int> NonReadOnlyList { get; set; }
|
||||
@@ -8888,7 +8888,7 @@ Parameter name: value",
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(PORTABLE || NET35 || NET20 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(PORTABLE || NET35 || NET20 || PORTABLE40)
|
||||
[Test]
|
||||
public void ReadTooLargeInteger()
|
||||
{
|
||||
@@ -9055,7 +9055,7 @@ Parameter name: value",
|
||||
Assert.AreEqual(1234567890.123456m, d);
|
||||
}
|
||||
|
||||
#if !(PORTABLE || SILVERLIGHT || NETFX_CORE || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(PORTABLE || NETFX_CORE || PORTABLE40)
|
||||
[Test]
|
||||
public void DontSerializeStaticFields()
|
||||
{
|
||||
@@ -9089,7 +9089,7 @@ Parameter name: value",
|
||||
Assert.AreEqual("string!", l[0]);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void SerializeBigInteger()
|
||||
{
|
||||
@@ -9103,7 +9103,7 @@ Parameter name: value",
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
[Test]
|
||||
public void DeserializeReadOnlyListInterface()
|
||||
{
|
||||
@@ -9853,7 +9853,7 @@ Parameter name: value",
|
||||
public bool Selected { get; set; }
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
[Serializable]
|
||||
public class AnswerFilterModel
|
||||
{
|
||||
@@ -10086,7 +10086,7 @@ Parameter name: value",
|
||||
public new bool no;
|
||||
}
|
||||
|
||||
#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE)
|
||||
#if !(NET35 || NET20)
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class GameObject
|
||||
{
|
||||
@@ -10161,7 +10161,7 @@ Parameter name: value",
|
||||
{
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
writer.WriteValue(":::" + value.ToString().ToUpper(CultureInfo.InvariantCulture) + ":::");
|
||||
#else
|
||||
writer.WriteValue(":::" + value.ToString().ToUpper() + ":::");
|
||||
@@ -10174,7 +10174,7 @@ Parameter name: value",
|
||||
if (s == null)
|
||||
return null;
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
return s.ToLower(CultureInfo.InvariantCulture).Trim(new[] { ':' });
|
||||
#else
|
||||
return s.ToLower().Trim(new[] { ':' });
|
||||
@@ -10191,7 +10191,7 @@ Parameter name: value",
|
||||
{
|
||||
protected internal override string ResolvePropertyName(string propertyName)
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
return ":::" + propertyName.ToUpper(CultureInfo.InvariantCulture) + ":::";
|
||||
#else
|
||||
return ":::" + propertyName.ToUpper() + ":::";
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
}", json);
|
||||
}
|
||||
|
||||
#if !(PORTABLE || SILVERLIGHT || NETFX_CORE || PORTABLE40)
|
||||
#if !(PORTABLE || NETFX_CORE || PORTABLE40)
|
||||
public class MainClass : ISerializable
|
||||
{
|
||||
public ChildClass Child { get; set; }
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
Assert.AreEqual(new DateTime(2000, 12, 1, 0, 0, 0, DateTimeKind.Utc), c[2]);
|
||||
|
||||
Assert.AreEqual(3, errors.Count);
|
||||
#if !(NET20 || NET35 || WINDOWS_PHONE)
|
||||
#if !(NET20 || NET35)
|
||||
Assert.AreEqual("[1] - 1 - The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.", errors[0]);
|
||||
#else
|
||||
Assert.AreEqual("[1] - 1 - The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.", errors[0]);
|
||||
|
||||
@@ -282,7 +282,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
}", json);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
public class SerializationEventContextTestObject
|
||||
{
|
||||
public string TestMember { get; set; }
|
||||
@@ -400,7 +400,7 @@ OnSerialized_Derived
|
||||
OnSerialized_Derived_Derived", string.Join(Environment.NewLine, e.ToArray()));
|
||||
}
|
||||
|
||||
#if !(NET20 || SILVERLIGHT)
|
||||
#if !(NET20)
|
||||
[Test]
|
||||
public void DerivedDerivedSerializationEvents_DataContractSerializer()
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Runtime.Serialization;
|
||||
@@ -38,7 +38,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
[TestFixture]
|
||||
public class TraceWriterTests : TestFixtureBase
|
||||
{
|
||||
#if !(SILVERLIGHT || PORTABLE || NETFX_CORE || PORTABLE40)
|
||||
#if !(PORTABLE || NETFX_CORE || PORTABLE40)
|
||||
[Test]
|
||||
public void DiagnosticsTraceWriterTest()
|
||||
{
|
||||
@@ -531,7 +531,7 @@ Newtonsoft.Json Error: 0 : Error!
|
||||
Assert.AreEqual("Finished deserializing System.Collections.Generic.List`1[System.Object]. Path '$values', line 17, position 4.", traceWriter.TraceRecords[9].Message);
|
||||
}
|
||||
|
||||
#if !(NETFX_CORE || PORTABLE || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void DeserializeISerializable()
|
||||
{
|
||||
@@ -718,7 +718,7 @@ Newtonsoft.Json Error: 0 : Error!
|
||||
Assert.AreEqual(23, deserialized.FavoriteNumber);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void TraceJsonWriterTest()
|
||||
{
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
Assert.AreEqual("Name!", ((EmployeeReference)employee).Name);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
[Test]
|
||||
public void DeserializeTypeNameFromGacAssembly()
|
||||
{
|
||||
@@ -977,7 +977,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
CollectionAssert.AreEquivalent(data, d);
|
||||
}
|
||||
|
||||
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
[Test]
|
||||
public void ISerializableTypeNameHandlingTest()
|
||||
{
|
||||
@@ -1043,7 +1043,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
Binder = new MetroBinder(),
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
IgnoreSerializableAttribute = true
|
||||
#endif
|
||||
}
|
||||
@@ -1723,7 +1723,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
|
||||
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE)
|
||||
#if !(NETFX_CORE)
|
||||
public class SerializableWrapper
|
||||
{
|
||||
public object Content { get; set; }
|
||||
|
||||
@@ -37,7 +37,7 @@ using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
|
||||
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
|
||||
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || NET20)
|
||||
#if !(NETFX_CORE || NET20)
|
||||
using System.Runtime.Serialization.Json;
|
||||
#endif
|
||||
using Newtonsoft.Json.Serialization;
|
||||
@@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
nonSerializedField = "Error"
|
||||
};
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || NET20 || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || NET20 || PORTABLE || PORTABLE40)
|
||||
MemoryStream ms = new MemoryStream();
|
||||
DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(SerializableType));
|
||||
dataContractJsonSerializer.WriteObject(ms, serializableType);
|
||||
@@ -75,7 +75,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
{
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
IgnoreSerializableAttribute = false
|
||||
#endif
|
||||
}
|
||||
@@ -84,7 +84,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
Assert.AreEqual(expected, json);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Test]
|
||||
public void SerializeInheritedType()
|
||||
{
|
||||
@@ -114,7 +114,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
}
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Serializable]
|
||||
#else
|
||||
[JsonObject(MemberSerialization.Fields)]
|
||||
@@ -138,7 +138,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
set { privateField = value; }
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[NonSerialized]
|
||||
#else
|
||||
[JsonIgnore]
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -152,11 +152,9 @@ namespace Newtonsoft.Json.Tests
|
||||
{
|
||||
public static void IsInstanceOfType(Type t, object instance)
|
||||
{
|
||||
#if (WINDOWS_PHONE || SILVERLIGHT)
|
||||
Assert.IsInstanceOfType(t, instance);
|
||||
#elif NETFX_CORE
|
||||
if (!instance.GetType().IsAssignableFrom(t))
|
||||
throw new Exception("Not instance of type");
|
||||
#if NETFX_CORE
|
||||
if (!instance.GetType().IsAssignableFrom(t))
|
||||
throw new Exception("Not instance of type");
|
||||
#else
|
||||
Assert.IsInstanceOf(t, instance);
|
||||
#endif
|
||||
@@ -167,8 +165,8 @@ namespace Newtonsoft.Json.Tests
|
||||
#if !NETFX_CORE
|
||||
Assert.Contains(value, collection);
|
||||
#else
|
||||
if (!collection.Cast<object>().Any(i => i.Equals(value)))
|
||||
throw new Exception("Value not found in collection.");
|
||||
if (!collection.Cast<object>().Any(i => i.Equals(value)))
|
||||
throw new Exception("Value not found in collection.");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
@@ -27,7 +27,7 @@ using System.Collections;
|
||||
|
||||
namespace Newtonsoft.Json.Tests.TestObjects
|
||||
{
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
#if !NETFX_CORE
|
||||
public class TypedSubHashtable
|
||||
{
|
||||
public string Name;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || PORTABLE || NETFX_CORE || PORTABLE40)
|
||||
#if !(PORTABLE || NETFX_CORE || PORTABLE40)
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
|
||||
@@ -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
|
||||
@@ -27,7 +27,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -228,7 +228,7 @@ namespace Newtonsoft.Json.Bson
|
||||
/// <param name="value">The <see cref="Object"/> value to write.</param>
|
||||
public override void WriteValue(object value)
|
||||
{
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
if (value is BigInteger)
|
||||
{
|
||||
InternalWriteValue(JsonToken.Integer);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
using System;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Globalization;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
using System;
|
||||
using System.Data;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
using System;
|
||||
using System.Data;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
using System;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Globalization;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if (!(SILVERLIGHT) || WINDOWS_PHONE) && !PORTABLE40
|
||||
#if !PORTABLE40
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
@@ -43,7 +43,7 @@ namespace Newtonsoft.Json.Converters
|
||||
{
|
||||
|
||||
#region XmlNodeWrappers
|
||||
#if !SILVERLIGHT && !NETFX_CORE && !PORTABLE && !PORTABLE40
|
||||
#if !NETFX_CORE && !PORTABLE && !PORTABLE40
|
||||
internal class XmlDocumentWrapper : XmlNodeWrapper, IXmlDocument
|
||||
{
|
||||
private readonly XmlDocument _document;
|
||||
@@ -799,7 +799,7 @@ namespace Newtonsoft.Json.Converters
|
||||
if (value is XObject)
|
||||
return XContainerWrapper.WrapNode((XObject)value);
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
if (value is XmlNode)
|
||||
return new XmlNodeWrapper((XmlNode)value);
|
||||
#endif
|
||||
@@ -1092,7 +1092,7 @@ namespace Newtonsoft.Json.Converters
|
||||
rootNode = document;
|
||||
}
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
if (typeof(XmlNode).IsAssignableFrom(objectType))
|
||||
{
|
||||
if (objectType != typeof(XmlDocument))
|
||||
@@ -1555,7 +1555,7 @@ namespace Newtonsoft.Json.Converters
|
||||
if (typeof(XObject).IsAssignableFrom(valueType))
|
||||
return true;
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE)
|
||||
if (typeof(XmlNode).IsAssignableFrom(valueType))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
#if SILVERLIGHT || PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE
|
||||
#if PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE
|
||||
|
||||
namespace System.Runtime.Serialization.Formatters
|
||||
{
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Globalization;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -38,7 +38,7 @@ using System.Xml;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Text;
|
||||
#if !NET20 && (!SILVERLIGHT || WINDOWS_PHONE) && !PORTABLE40
|
||||
#if !(NET20 || PORTABLE40)
|
||||
using System.Xml.Linq;
|
||||
|
||||
#endif
|
||||
@@ -238,7 +238,7 @@ namespace Newtonsoft.Json
|
||||
return value.ToString(null, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
private static string ToStringInternal(BigInteger value)
|
||||
{
|
||||
return value.ToString(null, CultureInfo.InvariantCulture);
|
||||
@@ -482,7 +482,7 @@ namespace Newtonsoft.Json
|
||||
return ToString((Uri)value);
|
||||
case PrimitiveTypeCode.TimeSpan:
|
||||
return ToString((TimeSpan)value);
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
case PrimitiveTypeCode.BigInteger:
|
||||
return ToStringInternal((BigInteger)value);
|
||||
#endif
|
||||
@@ -602,7 +602,7 @@ namespace Newtonsoft.Json
|
||||
return sw.ToString();
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
/// <summary>
|
||||
/// Asynchronously serializes the specified object to a JSON string.
|
||||
/// Serialization will happen on a new thread.
|
||||
@@ -798,7 +798,7 @@ namespace Newtonsoft.Json
|
||||
return jsonSerializer.Deserialize(new JsonTextReader(sr), type);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
/// <summary>
|
||||
/// Asynchronously deserializes the JSON to the specified .NET type.
|
||||
/// Deserialization will happen on a new thread.
|
||||
@@ -897,7 +897,7 @@ namespace Newtonsoft.Json
|
||||
}
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
/// <summary>
|
||||
/// Asynchronously populates the object with values from the JSON string using <see cref="JsonSerializerSettings"/>.
|
||||
/// </summary>
|
||||
@@ -916,7 +916,7 @@ namespace Newtonsoft.Json
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
#if !(PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
/// <summary>
|
||||
/// Serializes the XML node to a JSON string.
|
||||
/// </summary>
|
||||
@@ -996,7 +996,7 @@ namespace Newtonsoft.Json
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !NET20 && (!(SILVERLIGHT) || WINDOWS_PHONE) && !PORTABLE40
|
||||
#if !NET20 && !PORTABLE40
|
||||
/// <summary>
|
||||
/// Serializes the <see cref="XNode"/> to a JSON string.
|
||||
/// </summary>
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Newtonsoft.Json
|
||||
/// <summary>
|
||||
/// The exception thrown when an error occurs during Json serialization or deserialization.
|
||||
/// </summary>
|
||||
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
[Serializable]
|
||||
#endif
|
||||
public class JsonException : Exception
|
||||
@@ -68,7 +68,7 @@ namespace Newtonsoft.Json
|
||||
{
|
||||
}
|
||||
|
||||
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JsonException"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Newtonsoft.Json
|
||||
/// <summary>
|
||||
/// The exception thrown when an error occurs while reading Json text.
|
||||
/// </summary>
|
||||
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
[Serializable]
|
||||
#endif
|
||||
public class JsonReaderException : JsonException
|
||||
@@ -84,7 +84,7 @@ namespace Newtonsoft.Json
|
||||
{
|
||||
}
|
||||
|
||||
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JsonReaderException"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Newtonsoft.Json
|
||||
/// <summary>
|
||||
/// The exception thrown when an error occurs during Json serialization or deserialization.
|
||||
/// </summary>
|
||||
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
[Serializable]
|
||||
#endif
|
||||
public class JsonSerializationException : JsonException
|
||||
@@ -66,7 +66,7 @@ namespace Newtonsoft.Json
|
||||
{
|
||||
}
|
||||
|
||||
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JsonSerializationException"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -1266,7 +1266,7 @@ namespace Newtonsoft.Json
|
||||
}
|
||||
else if (parseResult == ParseResult.Overflow)
|
||||
{
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
string number = _stringReference.ToString();
|
||||
numberValue = BigInteger.Parse(number, CultureInfo.InvariantCulture);
|
||||
numberType = JsonToken.Integer;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -311,7 +311,7 @@ namespace Newtonsoft.Json
|
||||
/// <param name="value">The <see cref="Object"/> value to write.</param>
|
||||
public override void WriteValue(object value)
|
||||
{
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
if (value is BigInteger)
|
||||
{
|
||||
InternalWriteValue(JsonToken.Integer);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -735,7 +735,7 @@ namespace Newtonsoft.Json
|
||||
if (schema.DivisibleBy != null)
|
||||
{
|
||||
bool notDivisible;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (value is BigInteger)
|
||||
{
|
||||
// not that this will lose any decimal point on DivisibleBy
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using Newtonsoft.Json.Utilities;
|
||||
@@ -493,7 +493,7 @@ namespace Newtonsoft.Json
|
||||
WriteComment((reader.Value != null) ? reader.Value.ToString() : null);
|
||||
break;
|
||||
case JsonToken.Integer:
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
if (reader.Value is BigInteger)
|
||||
{
|
||||
WriteValue((BigInteger)reader.Value);
|
||||
@@ -1219,7 +1219,7 @@ namespace Newtonsoft.Json
|
||||
}
|
||||
else
|
||||
{
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
// this is here because adding a WriteValue(BigInteger) to JsonWriter will
|
||||
// mean the user has to add a reference to System.Numerics.dll
|
||||
if (value is BigInteger)
|
||||
@@ -1368,7 +1368,7 @@ namespace Newtonsoft.Json
|
||||
case PrimitiveTypeCode.TimeSpanNullable:
|
||||
writer.WriteValue((value == null) ? (TimeSpan?)null : (TimeSpan)value);
|
||||
break;
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20)
|
||||
case PrimitiveTypeCode.BigInteger:
|
||||
// this will call to WriteValue(object)
|
||||
writer.WriteValue((BigInteger)value);
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Newtonsoft.Json
|
||||
/// <summary>
|
||||
/// The exception thrown when an error occurs while reading Json text.
|
||||
/// </summary>
|
||||
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
[Serializable]
|
||||
#endif
|
||||
public class JsonWriterException : JsonException
|
||||
@@ -72,7 +72,7 @@ namespace Newtonsoft.Json
|
||||
{
|
||||
}
|
||||
|
||||
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JsonWriterException"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Newtonsoft.Json.Linq
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of token</typeparam>
|
||||
public interface IJEnumerable<
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
out
|
||||
#endif
|
||||
T> : IEnumerable<T> where T : JToken
|
||||
|
||||
@@ -46,17 +46,17 @@ namespace Newtonsoft.Json.Linq
|
||||
/// Represents a token that can contain other tokens.
|
||||
/// </summary>
|
||||
public abstract class JContainer : JToken, IList<JToken>
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
, ITypedList, IBindingList
|
||||
#elif PORTABLE
|
||||
, INotifyCollectionChanged
|
||||
#endif
|
||||
, IList
|
||||
#if !(SILVERLIGHT || NET20 || NET35 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
, INotifyCollectionChanged
|
||||
#endif
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
internal ListChangedEventHandler _listChanged;
|
||||
internal AddingNewEventHandler _addingNew;
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Newtonsoft.Json.Linq
|
||||
remove { _addingNew -= value; }
|
||||
}
|
||||
#endif
|
||||
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
internal NotifyCollectionChangedEventHandler _collectionChanged;
|
||||
|
||||
/// <summary>
|
||||
@@ -130,7 +130,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return new List<JToken>();
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Raises the <see cref="AddingNew"/> event.
|
||||
/// </summary>
|
||||
@@ -164,7 +164,7 @@ namespace Newtonsoft.Json.Linq
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
/// <summary>
|
||||
/// Raises the <see cref="CollectionChanged"/> event.
|
||||
/// </summary>
|
||||
@@ -357,11 +357,11 @@ namespace Newtonsoft.Json.Linq
|
||||
|
||||
ChildrenTokens.Insert(index, item);
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
if (_listChanged != null)
|
||||
OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
|
||||
#endif
|
||||
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
if (_collectionChanged != null)
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index));
|
||||
#endif
|
||||
@@ -391,11 +391,11 @@ namespace Newtonsoft.Json.Linq
|
||||
|
||||
ChildrenTokens.RemoveAt(index);
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
if (_listChanged != null)
|
||||
OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
|
||||
#endif
|
||||
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
if (_collectionChanged != null)
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index));
|
||||
#endif
|
||||
@@ -455,11 +455,11 @@ namespace Newtonsoft.Json.Linq
|
||||
existing.Previous = null;
|
||||
existing.Next = null;
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
if (_listChanged != null)
|
||||
OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
|
||||
#endif
|
||||
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
if (_collectionChanged != null)
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, item, existing, index));
|
||||
#endif
|
||||
@@ -478,11 +478,11 @@ namespace Newtonsoft.Json.Linq
|
||||
|
||||
ChildrenTokens.Clear();
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
if (_listChanged != null)
|
||||
OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
|
||||
#endif
|
||||
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
if (_collectionChanged != null)
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
||||
#endif
|
||||
@@ -751,7 +751,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return hashCode;
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
string ITypedList.GetListName(PropertyDescriptor[] listAccessors)
|
||||
{
|
||||
return string.Empty;
|
||||
@@ -920,7 +920,7 @@ namespace Newtonsoft.Json.Linq
|
||||
#endregion
|
||||
|
||||
#region IBindingList Members
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
void IBindingList.AddIndex(PropertyDescriptor property)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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" />
|
||||
/// </example>
|
||||
public class JObject : JContainer, IDictionary<string, JToken>, INotifyPropertyChanged
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
, ICustomTypeDescriptor
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
, INotifyPropertyChanging
|
||||
#endif
|
||||
{
|
||||
@@ -76,7 +76,7 @@ namespace Newtonsoft.Json.Linq
|
||||
/// </summary>
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
/// <summary>
|
||||
/// Occurs when a property value is changing.
|
||||
/// </summary>
|
||||
@@ -159,11 +159,11 @@ namespace Newtonsoft.Json.Linq
|
||||
internal void InternalPropertyChanged(JProperty childProperty)
|
||||
{
|
||||
OnPropertyChanged(childProperty.Name);
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
if (_listChanged != null)
|
||||
OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, IndexOfItem(childProperty)));
|
||||
#endif
|
||||
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
if (_collectionChanged != null)
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, childProperty, childProperty, IndexOfItem(childProperty)));
|
||||
#endif
|
||||
@@ -171,7 +171,7 @@ namespace Newtonsoft.Json.Linq
|
||||
|
||||
internal void InternalPropertyChanging(JProperty childProperty)
|
||||
{
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
OnPropertyChanging(childProperty.Name);
|
||||
#endif
|
||||
}
|
||||
@@ -274,7 +274,7 @@ namespace Newtonsoft.Json.Linq
|
||||
}
|
||||
else
|
||||
{
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
OnPropertyChanging(propertyName);
|
||||
#endif
|
||||
Add(new JProperty(propertyName, value));
|
||||
@@ -584,7 +584,7 @@ namespace Newtonsoft.Json.Linq
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE || NET20)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE || NET20)
|
||||
/// <summary>
|
||||
/// Raises the <see cref="PropertyChanging"/> event with the provided arguments.
|
||||
/// </summary>
|
||||
@@ -596,7 +596,7 @@ namespace Newtonsoft.Json.Linq
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
// include custom type descriptor on JObject rather than use a provider because the properties are specific to a type
|
||||
|
||||
#region ICustomTypeDescriptor
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Newtonsoft.Json.Utilities;
|
||||
|
||||
@@ -30,7 +30,7 @@ using System.Dynamic;
|
||||
using System.Linq.Expressions;
|
||||
#endif
|
||||
using System.IO;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -51,7 +51,7 @@ namespace Newtonsoft.Json.Linq
|
||||
/// Represents an abstract JSON token.
|
||||
/// </summary>
|
||||
public abstract class JToken : IJEnumerable<JToken>, IJsonLineInfo
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
, ICloneable
|
||||
#endif
|
||||
#if !(NET35 || NET20 || PORTABLE40)
|
||||
@@ -456,7 +456,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, BooleanTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to Boolean.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return Convert.ToBoolean((int)(BigInteger)v.Value);
|
||||
#endif
|
||||
@@ -498,7 +498,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, BooleanTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to Boolean.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return Convert.ToBoolean((int)(BigInteger)v.Value);
|
||||
#endif
|
||||
@@ -517,7 +517,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to Int64.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (long)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -586,7 +586,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to Decimal.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (decimal?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -608,7 +608,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to Double.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (double?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -630,7 +630,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, CharTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to Char.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (char?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -649,7 +649,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to Int32.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (int)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -668,7 +668,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to Int16.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (short)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -688,7 +688,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to UInt16.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (ushort)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -708,7 +708,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, CharTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to Char.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (char)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -727,7 +727,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to Byte.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (byte)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -747,7 +747,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to SByte.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (sbyte)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -769,7 +769,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to Int32.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (int?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -791,7 +791,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to Int16.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (short?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -814,7 +814,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to UInt16.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (ushort?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -836,7 +836,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to Byte.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (byte?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -859,7 +859,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to SByte.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (sbyte?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -900,7 +900,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to Int64.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (long?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -922,7 +922,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to Single.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (float?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -941,7 +941,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to Decimal.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (decimal)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -964,7 +964,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to UInt32.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (uint?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -987,7 +987,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, true))
|
||||
throw new ArgumentException("Can not convert {0} to UInt64.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (ulong?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -1006,7 +1006,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to Double.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (double)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -1025,7 +1025,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to Single.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (float)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -1051,7 +1051,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return null;
|
||||
if (v.Value is byte[])
|
||||
return Convert.ToBase64String((byte[])v.Value);
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return ((BigInteger)v.Value).ToString(CultureInfo.InvariantCulture);
|
||||
#endif
|
||||
@@ -1071,7 +1071,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to UInt32.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (uint)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -1091,7 +1091,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (v == null || !ValidateToken(v, NumberTypes, false))
|
||||
throw new ArgumentException("Can not convert {0} to UInt64.".FormatWith(CultureInfo.InvariantCulture, GetType(value)));
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (ulong)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -1115,7 +1115,7 @@ namespace Newtonsoft.Json.Linq
|
||||
|
||||
if (v.Value is string)
|
||||
return Convert.FromBase64String(Convert.ToString(v.Value, CultureInfo.InvariantCulture));
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return ((BigInteger)v.Value).ToByteArray();
|
||||
#endif
|
||||
@@ -1220,7 +1220,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return (v.Value is Uri) ? (Uri)v.Value : new Uri(Convert.ToString(v.Value, CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
private static BigInteger ToBigInteger(JToken value)
|
||||
{
|
||||
JValue v = EnsureValue(value);
|
||||
@@ -1769,7 +1769,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return (TimeSpan?)this;
|
||||
case PrimitiveTypeCode.TimeSpan:
|
||||
return (TimeSpan)this;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
case PrimitiveTypeCode.BigIntegerNullable:
|
||||
return ToBigIntegerNullable(this);
|
||||
case PrimitiveTypeCode.BigInteger:
|
||||
@@ -1963,7 +1963,7 @@ namespace Newtonsoft.Json.Linq
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return DeepClone();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using Newtonsoft.Json.Utilities;
|
||||
@@ -188,7 +188,7 @@ namespace Newtonsoft.Json.Linq
|
||||
/// <param name="value">The <see cref="Object"/> value to write.</param>
|
||||
public override void WriteValue(object value)
|
||||
{
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
if (value is BigInteger)
|
||||
{
|
||||
InternalWriteValue(JsonToken.Integer);
|
||||
|
||||
@@ -31,7 +31,7 @@ using System.Globalization;
|
||||
using System.Dynamic;
|
||||
using System.Linq.Expressions;
|
||||
#endif
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
|
||||
#endif
|
||||
@@ -195,7 +195,7 @@ namespace Newtonsoft.Json.Linq
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
private static int CompareBigInteger(BigInteger i1, object i2)
|
||||
{
|
||||
int result = i1.CompareTo(ConvertUtils.ToBigInteger(i2));
|
||||
@@ -232,7 +232,7 @@ namespace Newtonsoft.Json.Linq
|
||||
switch (valueType)
|
||||
{
|
||||
case JTokenType.Integer:
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (objA is BigInteger)
|
||||
return CompareBigInteger((BigInteger)objA, objB);
|
||||
if (objB is BigInteger)
|
||||
@@ -245,7 +245,7 @@ namespace Newtonsoft.Json.Linq
|
||||
else
|
||||
return Convert.ToInt64(objA, CultureInfo.InvariantCulture).CompareTo(Convert.ToInt64(objB, CultureInfo.InvariantCulture));
|
||||
case JTokenType.Float:
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (objA is BigInteger)
|
||||
return CompareBigInteger((BigInteger)objA, objB);
|
||||
if (objB is BigInteger)
|
||||
@@ -360,7 +360,7 @@ namespace Newtonsoft.Json.Linq
|
||||
}
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (objA is BigInteger || objB is BigInteger)
|
||||
{
|
||||
if (objA == null || objB == null)
|
||||
@@ -536,7 +536,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return JTokenType.Integer;
|
||||
else if (value is Enum)
|
||||
return JTokenType.Integer;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
else if (value is BigInteger)
|
||||
return JTokenType.Integer;
|
||||
#endif
|
||||
@@ -638,7 +638,7 @@ namespace Newtonsoft.Json.Linq
|
||||
writer.WriteUndefined();
|
||||
return;
|
||||
case JTokenType.Integer:
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (_value is BigInteger)
|
||||
writer.WriteValue((BigInteger)_value);
|
||||
else
|
||||
@@ -930,7 +930,7 @@ namespace Newtonsoft.Json.Linq
|
||||
if (_value is DateTimeOffset)
|
||||
return TypeCode.DateTime;
|
||||
#endif
|
||||
#if !(NET20 || NET35 || PORTABLE40 || SILVERLIGHT)
|
||||
#if !(NET20 || NET35 || PORTABLE40)
|
||||
if (_value is BigInteger)
|
||||
return TypeCode.Object;
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
#if WINDOWS_PHONE
|
||||
[assembly: AssemblyTitle("Json.NET Windows Phone")]
|
||||
#elif SILVERLIGHT
|
||||
[assembly: AssemblyTitle("Json.NET Silverlight")]
|
||||
#elif PORTABLE40
|
||||
|
||||
#if PORTABLE40
|
||||
[assembly: AssemblyTitle("Json.NET Portable .NET 4.0")]
|
||||
#elif PORTABLE
|
||||
[assembly: AssemblyTitle("Json.NET Portable")]
|
||||
@@ -53,7 +48,6 @@ using System.Security;
|
||||
[assembly: AssemblyTitle("Json.NET .NET 4.0")]
|
||||
[assembly: AllowPartiallyTrustedCallers]
|
||||
#else
|
||||
|
||||
[assembly: AssemblyTitle("Json.NET")]
|
||||
[assembly: AllowPartiallyTrustedCallers]
|
||||
#endif
|
||||
@@ -98,4 +92,4 @@ using System.Security;
|
||||
|
||||
[assembly: AssemblyVersion("4.5.0.0")]
|
||||
[assembly: AssemblyFileVersion("5.0.8.16620")]
|
||||
[assembly: CLSCompliant(true)]
|
||||
[assembly: CLSCompliant(true)]
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Newtonsoft.Json.Schema
|
||||
/// <summary>
|
||||
/// Returns detailed information about the schema exception.
|
||||
/// </summary>
|
||||
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
[Serializable]
|
||||
#endif
|
||||
public class JsonSchemaException : JsonException
|
||||
@@ -83,7 +83,7 @@ namespace Newtonsoft.Json.Schema
|
||||
{
|
||||
}
|
||||
|
||||
#if !(WINDOWS_PHONE || SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JsonSchemaException"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -329,14 +329,14 @@ namespace Newtonsoft.Json.Schema
|
||||
}
|
||||
}
|
||||
break;
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
case JsonContractType.Serializable:
|
||||
CurrentSchema.Type = AddNullType(JsonSchemaType.Object, valueRequired);
|
||||
CurrentSchema.Id = GetTypeId(type, false);
|
||||
GenerateISerializableContract(type, (JsonISerializableContract)contract);
|
||||
break;
|
||||
#endif
|
||||
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET35 || NET20 || PORTABLE40)
|
||||
case JsonContractType.Dynamic:
|
||||
#endif
|
||||
case JsonContractType.Linq:
|
||||
@@ -388,7 +388,7 @@ namespace Newtonsoft.Json.Schema
|
||||
CurrentSchema.AllowAdditionalProperties = false;
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
private void GenerateISerializableContract(Type type, JsonISerializableContract contract)
|
||||
{
|
||||
CurrentSchema.AllowAdditionalProperties = true;
|
||||
@@ -445,7 +445,7 @@ namespace Newtonsoft.Json.Schema
|
||||
case PrimitiveTypeCode.UInt32:
|
||||
case PrimitiveTypeCode.Int64:
|
||||
case PrimitiveTypeCode.UInt64:
|
||||
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
|
||||
#if !(PORTABLE || NET35 || NET20)
|
||||
case PrimitiveTypeCode.BigInteger:
|
||||
#endif
|
||||
return schemaType | JsonSchemaType.Integer;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
#if !(NET35 || NET20 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET35 || NET20 || PORTABLE || PORTABLE40)
|
||||
using System.Collections.Concurrent;
|
||||
#endif
|
||||
using System.Collections.Generic;
|
||||
@@ -97,16 +97,16 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
private static readonly IList<JsonConverter> BuiltInConverters = new List<JsonConverter>
|
||||
{
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
new EntityKeyMemberConverter(),
|
||||
#endif
|
||||
#if !(NET35 || NET20 || PORTABLE40)
|
||||
new ExpandoObjectConverter(),
|
||||
#endif
|
||||
#if (!(SILVERLIGHT || PORTABLE40) || WINDOWS_PHONE)
|
||||
#if (!(PORTABLE40))
|
||||
new XmlNodeConverter(),
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
new BinaryConverter(),
|
||||
new DataSetConverter(),
|
||||
new DataTableConverter(),
|
||||
@@ -155,7 +155,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
/// </value>
|
||||
public bool SerializeCompilerGeneratedMembers { get; set; }
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to ignore the <see cref="ISerializable"/> interface when serializing and deserializing types.
|
||||
/// </summary>
|
||||
@@ -195,7 +195,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
#if !NETFX_CORE
|
||||
DefaultMembersSearchFlags = BindingFlags.Public | BindingFlags.Instance;
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
IgnoreSerializableAttribute = true;
|
||||
#endif
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
protected virtual List<MemberInfo> GetSerializableMembers(Type objectType)
|
||||
{
|
||||
bool ignoreSerializableAttribute;
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
ignoreSerializableAttribute = IgnoreSerializableAttribute;
|
||||
#else
|
||||
ignoreSerializableAttribute = true;
|
||||
@@ -308,7 +308,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
}
|
||||
}
|
||||
|
||||
#if !SILVERLIGHT && !NET20
|
||||
#if !NET20
|
||||
Type match;
|
||||
// don't include EntityKey on entities objects... this is a bit hacky
|
||||
if (objectType.AssignableToTypeName("System.Data.Objects.DataClasses.EntityObject", out match))
|
||||
@@ -329,7 +329,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
return serializableMembers;
|
||||
}
|
||||
|
||||
#if !SILVERLIGHT && !NET20
|
||||
#if !NET20
|
||||
private bool ShouldSerializeEntityMember(MemberInfo memberInfo)
|
||||
{
|
||||
PropertyInfo propertyInfo = memberInfo as PropertyInfo;
|
||||
@@ -354,7 +354,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
InitializeContract(contract);
|
||||
|
||||
bool ignoreSerializableAttribute;
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
ignoreSerializableAttribute = IgnoreSerializableAttribute;
|
||||
#else
|
||||
ignoreSerializableAttribute = true;
|
||||
@@ -377,7 +377,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
}
|
||||
else if (contract.MemberSerialization == MemberSerialization.Fields)
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
// mimic DataContractSerializer behaviour when populating fields by overriding default creator to create an uninitialized object
|
||||
// note that this is only possible when the application is fully trusted so fall back to using the default constructor (if available) in partial trust
|
||||
if (JsonTypeReflector.FullyTrusted)
|
||||
@@ -732,7 +732,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
if (onDeserialized != null)
|
||||
{
|
||||
// ConcurrentDictionary throws an error here so don't use its OnDeserialized - http://json.codeplex.com/discussions/257093
|
||||
#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE || PORTABLE40)
|
||||
#if !(NET35 || NET20 || PORTABLE || PORTABLE40)
|
||||
if (!t.IsGenericType() || (t.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>)))
|
||||
contract.OnDeserializedCallbacks.AddRange(onDeserialized);
|
||||
#else
|
||||
@@ -875,7 +875,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
return contract;
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Creates a <see cref="JsonISerializableContract"/> for the given type.
|
||||
/// </summary>
|
||||
@@ -962,7 +962,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
if (CanConvertToString(t))
|
||||
return CreateStringContract(objectType);
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
if (!IgnoreSerializableInterface && typeof(ISerializable).IsAssignableFrom(t))
|
||||
return CreateISerializableContract(objectType);
|
||||
#endif
|
||||
@@ -1008,10 +1008,8 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
// use the objectType's TypeConverter if it has one and can convert to a string
|
||||
if (converter != null
|
||||
#if !SILVERLIGHT
|
||||
&& !(converter is ComponentConverter)
|
||||
&& !(converter is ReferenceConverter)
|
||||
#endif
|
||||
&& converter.GetType() != typeof(TypeConverter))
|
||||
{
|
||||
if (converter.CanConvertTo(typeof(string)))
|
||||
@@ -1022,11 +1020,6 @@ namespace Newtonsoft.Json.Serialization
|
||||
if (type == typeof(Type) || type.IsSubclassOf(typeof(Type)))
|
||||
return true;
|
||||
|
||||
#if SILVERLIGHT
|
||||
if (type == typeof(Guid) || type == typeof(Uri) || type == typeof(TimeSpan))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1107,7 +1100,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
// warning - this method use to cause errors with Intellitrace. Retest in VS Ultimate after changes
|
||||
IValueProvider valueProvider;
|
||||
|
||||
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
#if !(PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
if (DynamicCodeGeneration)
|
||||
valueProvider = new DynamicValueProvider(member);
|
||||
else
|
||||
@@ -1208,7 +1201,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
JsonTypeReflector.GetAttribute<JsonIgnoreAttribute>(attributeProvider) != null
|
||||
// automatically ignore extension data dictionary property if it is public
|
||||
|| JsonTypeReflector.GetAttribute<JsonExtensionDataAttribute>(attributeProvider) != null
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
|| JsonTypeReflector.GetAttribute<NonSerializedAttribute>(attributeProvider) != null
|
||||
#endif
|
||||
;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
{
|
||||
Assembly assembly;
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
// look, I don't like using obsolete methods as much as you do but this is the only way
|
||||
// Assembly.Load won't check the GAC for a partial name
|
||||
#pragma warning disable 618,612
|
||||
@@ -145,14 +145,11 @@ namespace Newtonsoft.Json.Serialization
|
||||
public override void BindToName(Type serializedType, out string assemblyName, out string typeName)
|
||||
{
|
||||
#if NETFX_CORE || PORTABLE
|
||||
assemblyName = serializedType.GetTypeInfo().Assembly.FullName;
|
||||
typeName = serializedType.FullName;
|
||||
#elif !SILVERLIGHT
|
||||
assemblyName = serializedType.Assembly.FullName;
|
||||
assemblyName = serializedType.GetTypeInfo().Assembly.FullName;
|
||||
typeName = serializedType.FullName;
|
||||
#else
|
||||
assemblyName = null;
|
||||
typeName = serializedType.AssemblyQualifiedName;
|
||||
assemblyName = serializedType.Assembly.FullName;
|
||||
typeName = serializedType.FullName;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
#if !(PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using DiagnosticsTrace = System.Diagnostics.Trace;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
#if !(PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if NET20
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
canDeserialize = true;
|
||||
ShouldCreateWrapper = true;
|
||||
}
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyCollection<>), out tempCollectionType))
|
||||
{
|
||||
CollectionItemType = underlyingType.GetGenericArguments()[0];
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
#if !(NET35 || NET20 || PORTABLE40)
|
||||
Dynamic,
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
Serializable,
|
||||
#endif
|
||||
Linq
|
||||
|
||||
@@ -92,11 +92,11 @@ namespace Newtonsoft.Json.Serialization
|
||||
if (ReflectionUtils.IsGenericDefinition(UnderlyingType, typeof(IDictionary<,>)))
|
||||
CreatedType = typeof(Dictionary<,>).MakeGenericType(keyType, valueType);
|
||||
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
IsReadOnlyOrFixedSize = ReflectionUtils.InheritsGenericDefinition(underlyingType, typeof(ReadOnlyDictionary<,>));
|
||||
#endif
|
||||
}
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyDictionary<,>), out _genericCollectionDefinitionType))
|
||||
{
|
||||
keyType = _genericCollectionDefinitionType.GetGenericArguments()[0];
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
using System;
|
||||
|
||||
namespace Newtonsoft.Json.Serialization
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
ConstructorParameters = new JsonPropertyCollection(UnderlyingType);
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35)
|
||||
[SecuritySafeCritical]
|
||||
#endif
|
||||
|
||||
@@ -33,7 +33,7 @@ using System.Dynamic;
|
||||
#endif
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || SILVERLIGHT)
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Reflection;
|
||||
@@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
}
|
||||
|
||||
private JsonSerializerProxy _internalSerializer;
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
private JsonFormatterConverter _formatterConverter;
|
||||
#endif
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
return _internalSerializer;
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
private JsonFormatterConverter GetFormatterConverter()
|
||||
{
|
||||
if (_formatterConverter == null)
|
||||
@@ -304,7 +304,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
{
|
||||
case JsonContractType.Object:
|
||||
case JsonContractType.Dictionary:
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
case JsonContractType.Serializable:
|
||||
#endif
|
||||
#if !(NET35 || NET20 || PORTABLE40)
|
||||
@@ -458,7 +458,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
JsonDynamicContract dynamicContract = (JsonDynamicContract)contract;
|
||||
return CreateDynamic(reader, dynamicContract, member, id);
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
case JsonContractType.Serializable:
|
||||
JsonISerializableContract serializableContract = (JsonISerializableContract)contract;
|
||||
return CreateISerializable(reader, serializableContract, member, id);
|
||||
@@ -720,7 +720,7 @@ To fix this error either change the JSON to a {1} or change the deserialized typ
|
||||
return Enum.ToObject(contract.NonNullableUnderlyingType, value);
|
||||
}
|
||||
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || SILVERLIGHT)
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20)
|
||||
if (value is BigInteger)
|
||||
return ConvertUtils.FromBigInteger((BigInteger)value, targetType);
|
||||
#endif
|
||||
@@ -1286,7 +1286,7 @@ To fix this error either change the JSON to a {1} or change the deserialized typ
|
||||
return underlyingList;
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
private object CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, string id)
|
||||
{
|
||||
Type objectType = contract.UnderlyingType;
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
SerializeDynamic(writer, (IDynamicMetaObjectProvider)value, (JsonDynamicContract)valueContract, member, containerContract, containerProperty);
|
||||
break;
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
case JsonContractType.Serializable:
|
||||
SerializeISerializable(writer, (ISerializable)value, (JsonISerializableContract)valueContract, member, containerContract, containerProperty);
|
||||
break;
|
||||
@@ -298,25 +298,18 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
// use the objectType's TypeConverter if it has one and can convert to a string
|
||||
if (converter != null
|
||||
#if !SILVERLIGHT
|
||||
&& !(converter is ComponentConverter)
|
||||
#endif
|
||||
&& converter.GetType() != typeof(TypeConverter))
|
||||
{
|
||||
if (converter.CanConvertTo(typeof(string)))
|
||||
{
|
||||
#if !SILVERLIGHT
|
||||
s = converter.ConvertToInvariantString(value);
|
||||
#else
|
||||
s = converter.ConvertToString(value);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SILVERLIGHT || NETFX_CORE || PORTABLE
|
||||
#if NETFX_CORE || PORTABLE
|
||||
if (value is Guid || value is Uri || value is TimeSpan)
|
||||
{
|
||||
s = value.ToString();
|
||||
@@ -704,7 +697,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
return writeMetadataObject;
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35)
|
||||
[SecuritySafeCritical]
|
||||
#endif
|
||||
|
||||
@@ -41,7 +41,7 @@ using System.Runtime.Serialization;
|
||||
|
||||
namespace Newtonsoft.Json.Serialization
|
||||
{
|
||||
#if !SILVERLIGHT && !NET20 && !NETFX_CORE
|
||||
#if !NET20 && !NETFX_CORE
|
||||
internal interface IMetadataTypeAttribute
|
||||
{
|
||||
Type MetadataClassType { get; }
|
||||
@@ -63,7 +63,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
public const string SpecifiedPostfix = "Specified";
|
||||
|
||||
private static readonly ThreadSafeStore<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 const string MetadataTypeAttributeTypeName =
|
||||
@@ -71,23 +71,6 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
private static Type _cachedMetadataTypeAttributeType;
|
||||
#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)
|
||||
{
|
||||
@@ -109,7 +92,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
return GetJsonContainerAttribute(type) as JsonDictionaryAttribute;
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
#if !(NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
public static SerializableAttribute GetSerializableAttribute(Type type)
|
||||
{
|
||||
return CachedAttributeGetter<SerializableAttribute>.GetAttribute(type);
|
||||
@@ -178,7 +161,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
return MemberSerialization.OptIn;
|
||||
#endif
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
if (!ignoreSerializableAttribute)
|
||||
{
|
||||
SerializableAttribute serializableAttribute = GetSerializableAttribute(objectType);
|
||||
@@ -221,20 +204,11 @@ namespace Newtonsoft.Json.Serialization
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
public static TypeConverter GetTypeConverter(Type type)
|
||||
{
|
||||
#if !SILVERLIGHT
|
||||
return TypeDescriptor.GetConverter(type);
|
||||
#else
|
||||
Type converterType = GetTypeConverterType(type);
|
||||
|
||||
if (converterType != null)
|
||||
return (TypeConverter)Activator.CreateInstance(converterType);
|
||||
|
||||
return null;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
private static Type GetAssociatedMetadataType(Type type)
|
||||
{
|
||||
return AssociatedMetadataTypesCache.Get(type);
|
||||
@@ -279,7 +253,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
{
|
||||
T attribute;
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
Type metadataType = GetAssociatedMetadataType(type);
|
||||
if (metadataType != null)
|
||||
{
|
||||
@@ -307,7 +281,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
{
|
||||
T attribute;
|
||||
|
||||
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
Type metadataType = GetAssociatedMetadataType(memberInfo.DeclaringType);
|
||||
if (metadataType != null)
|
||||
{
|
||||
@@ -371,14 +345,14 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
public static bool DynamicCodeGeneration
|
||||
{
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
|
||||
[SecuritySafeCritical]
|
||||
#endif
|
||||
get
|
||||
{
|
||||
if (_dynamicCodeGeneration == null)
|
||||
{
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
try
|
||||
{
|
||||
new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Demand();
|
||||
@@ -407,7 +381,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
{
|
||||
if (_fullyTrusted == null)
|
||||
{
|
||||
#if (NETFX_CORE || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if (NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
_fullyTrusted = false;
|
||||
#elif !(NET20 || NET35 || PORTABLE40)
|
||||
AppDomain appDomain = AppDomain.CurrentDomain;
|
||||
@@ -434,7 +408,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
{
|
||||
get
|
||||
{
|
||||
#if !(SILVERLIGHT || PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
#if !(PORTABLE40 || PORTABLE || NETFX_CORE)
|
||||
if (DynamicCodeGeneration)
|
||||
return DynamicReflectionDelegateFactory.Instance;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !SILVERLIGHT && !NET20 && !NETFX_CORE
|
||||
#if !NET20 && !NETFX_CORE
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -143,7 +143,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
public override void WriteValue(object value)
|
||||
{
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
if (value is BigInteger)
|
||||
{
|
||||
_textWriter.WriteValue(value);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
#if SILVERLIGHT || PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE
|
||||
#if PocketPC || NETFX_CORE || PORTABLE40 || PORTABLE
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
#if (NETFX_CORE || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if (NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
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)
|
||||
{
|
||||
ValidationUtils.ArgumentNotNull(initial, "initial");
|
||||
@@ -94,7 +94,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
return true;
|
||||
if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IDictionary<,>)))
|
||||
return true;
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
if (ReflectionUtils.ImplementsGenericDefinition(type, typeof(IReadOnlyDictionary<,>)))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
@@ -27,7 +27,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.ComponentModel;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using Newtonsoft.Json.Serialization;
|
||||
@@ -35,7 +35,7 @@ using System.Reflection;
|
||||
#if NET20
|
||||
using Newtonsoft.Json.Utilities.LinqBridge;
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
using System.Data.SqlTypes;
|
||||
|
||||
#endif
|
||||
@@ -82,7 +82,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
GuidNullable,
|
||||
TimeSpan,
|
||||
TimeSpanNullable,
|
||||
#if !(PORTABLE || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
|
||||
#if !(PORTABLE || NET35 || NET20)
|
||||
BigInteger,
|
||||
BigIntegerNullable,
|
||||
#endif
|
||||
@@ -147,7 +147,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{ typeof(Guid?), PrimitiveTypeCode.GuidNullable },
|
||||
{ typeof(TimeSpan), PrimitiveTypeCode.TimeSpan },
|
||||
{ typeof(TimeSpan?), PrimitiveTypeCode.TimeSpanNullable },
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20 || WINDOWS_PHONE || SILVERLIGHT)
|
||||
#if !(PORTABLE || PORTABLE40 || NET35 || NET20)
|
||||
{ typeof(BigInteger), PrimitiveTypeCode.BigInteger },
|
||||
{ typeof(BigInteger?), PrimitiveTypeCode.BigIntegerNullable },
|
||||
#endif
|
||||
@@ -295,7 +295,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
return o => call(null, o);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE || PORTABLE40)
|
||||
#if !(NET20 || NET35 || PORTABLE || PORTABLE40)
|
||||
internal static BigInteger ToBigInteger(object value)
|
||||
{
|
||||
if (value is BigInteger)
|
||||
@@ -399,7 +399,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
return Type.GetType((string)initialValue, true);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
|
||||
if (targetType == typeof(BigInteger))
|
||||
return ToBigInteger(initialValue);
|
||||
if (initialValue is BigInteger)
|
||||
@@ -411,24 +411,12 @@ namespace Newtonsoft.Json.Utilities
|
||||
TypeConverter toConverter = GetConverter(initialType);
|
||||
|
||||
if (toConverter != null && toConverter.CanConvertTo(targetType))
|
||||
{
|
||||
#if !SILVERLIGHT
|
||||
return toConverter.ConvertTo(null, culture, initialValue, targetType);
|
||||
#else
|
||||
return toConverter.ConvertTo(initialValue, targetType);
|
||||
#endif
|
||||
}
|
||||
|
||||
TypeConverter fromConverter = GetConverter(targetType);
|
||||
|
||||
if (fromConverter != null && fromConverter.CanConvertFrom(initialType))
|
||||
{
|
||||
#if !SILVERLIGHT
|
||||
return fromConverter.ConvertFrom(null, culture, initialValue);
|
||||
#else
|
||||
return fromConverter.ConvertFrom(initialValue);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
// handle DBNull and INullable
|
||||
@@ -440,7 +428,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
throw new Exception("Can not convert null {0} into non-nullable {1}.".FormatWith(CultureInfo.InvariantCulture, initialType, targetType));
|
||||
}
|
||||
#endif
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
if (initialValue is INullable)
|
||||
return EnsureTypeAssignable(ToValue((INullable)initialValue), initialType, targetType);
|
||||
#endif
|
||||
@@ -529,7 +517,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
throw new ArgumentException("Could not cast or convert from {0} to {1}.".FormatWith(CultureInfo.InvariantCulture, (initialType != null) ? initialType.ToString() : "{null}", targetType));
|
||||
}
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
public static object ToValue(INullable nullableValue)
|
||||
{
|
||||
if (nullableValue == null)
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
private readonly IDictionary _dictionary;
|
||||
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;
|
||||
#endif
|
||||
private object _syncRoot;
|
||||
@@ -65,7 +65,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
_genericDictionary = dictionary;
|
||||
}
|
||||
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
public DictionaryWrapper(IReadOnlyDictionary<TKey, TValue> dictionary)
|
||||
{
|
||||
ValidationUtils.ArgumentNotNull(dictionary, "dictionary");
|
||||
@@ -88,7 +88,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return _dictionary.Contains(key);
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary.ContainsKey(key);
|
||||
#endif
|
||||
@@ -102,7 +102,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return _dictionary.Keys.Cast<TKey>().ToList();
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary.Keys.ToList();
|
||||
#endif
|
||||
@@ -125,7 +125,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
@@ -152,7 +152,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
@@ -170,7 +170,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return _dictionary.Values.Cast<TValue>().ToList();
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary.Values.ToList();
|
||||
#endif
|
||||
@@ -185,7 +185,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return (TValue)_dictionary[key];
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary[key];
|
||||
#endif
|
||||
@@ -196,7 +196,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
_dictionary[key] = value;
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
throw new NotSupportedException();
|
||||
#endif
|
||||
@@ -209,7 +209,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
((IList)_dictionary).Add(item);
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
throw new NotSupportedException();
|
||||
#endif
|
||||
@@ -221,7 +221,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
_dictionary.Clear();
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
throw new NotSupportedException();
|
||||
#endif
|
||||
@@ -233,7 +233,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return ((IList)_dictionary).Contains(item);
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary.Contains(item);
|
||||
#endif
|
||||
@@ -250,7 +250,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
array[arrayIndex++] = new KeyValuePair<TKey, TValue>((TKey)item.Key, (TValue)item.Value);
|
||||
}
|
||||
}
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
@@ -268,7 +268,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return _dictionary.Count;
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary.Count;
|
||||
#endif
|
||||
@@ -283,7 +283,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return _dictionary.IsReadOnly;
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return true;
|
||||
#endif
|
||||
@@ -315,7 +315,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
@@ -331,7 +331,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return _dictionary.Cast<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)
|
||||
return _readOnlyDictionary.GetEnumerator();
|
||||
#endif
|
||||
@@ -348,7 +348,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
_dictionary.Add(key, value);
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
throw new NotSupportedException();
|
||||
#endif
|
||||
@@ -362,7 +362,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return _dictionary[key];
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary[(TKey)key];
|
||||
#endif
|
||||
@@ -373,7 +373,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
_dictionary[key] = value;
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
throw new NotSupportedException();
|
||||
#endif
|
||||
@@ -427,7 +427,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return _dictionary.GetEnumerator();
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return new DictionaryEnumerator<TKey, TValue>(_readOnlyDictionary.GetEnumerator());
|
||||
#endif
|
||||
@@ -439,7 +439,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_genericDictionary != null)
|
||||
return _genericDictionary.ContainsKey((TKey)key);
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary.ContainsKey((TKey)key);
|
||||
#endif
|
||||
@@ -453,7 +453,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_genericDictionary != null)
|
||||
return false;
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return true;
|
||||
#endif
|
||||
@@ -468,7 +468,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_genericDictionary != null)
|
||||
return _genericDictionary.Keys.ToList();
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary.Keys.ToList();
|
||||
#endif
|
||||
@@ -481,7 +481,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
_dictionary.Remove(key);
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
throw new NotSupportedException();
|
||||
#endif
|
||||
@@ -495,7 +495,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_genericDictionary != null)
|
||||
return _genericDictionary.Values.ToList();
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary.Values.ToList();
|
||||
#endif
|
||||
@@ -508,7 +508,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
_dictionary.CopyTo(array, index);
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
throw new NotSupportedException();
|
||||
#endif
|
||||
@@ -544,7 +544,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
if (_dictionary != null)
|
||||
return _dictionary;
|
||||
#if !(NET40 || NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE40)
|
||||
#if !(NET40 || NET35 || NET20 || PORTABLE40)
|
||||
else if (_readOnlyDictionary != null)
|
||||
return _readOnlyDictionary;
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !(SILVERLIGHT || PORTABLE || NETFX_CORE || PORTABLE40)
|
||||
#if !(PORTABLE || NETFX_CORE || PORTABLE40)
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if NET20
|
||||
|
||||
@@ -29,7 +29,7 @@ using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
#if !(PORTABLE || WINDOWS_PHONE)
|
||||
#if !(PORTABLE)
|
||||
using System.Reflection;
|
||||
#else
|
||||
using Microsoft.CSharp.RuntimeBinder;
|
||||
@@ -45,12 +45,8 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
internal static class BinderWrapper
|
||||
{
|
||||
#if !(PORTABLE || WINDOWS_PHONE)
|
||||
#if !SILVERLIGHT
|
||||
#if !(PORTABLE)
|
||||
public const string CSharpAssemblyName = "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
|
||||
#else
|
||||
public const string CSharpAssemblyName = "Microsoft.CSharp, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
|
||||
#endif
|
||||
|
||||
private const string BinderTypeName = "Microsoft.CSharp.RuntimeBinder.Binder, " + CSharpAssemblyName;
|
||||
private const string CSharpArgumentInfoTypeName = "Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo, " + CSharpAssemblyName;
|
||||
@@ -116,7 +112,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
|
||||
public static CallSiteBinder GetMember(string name, Type context)
|
||||
{
|
||||
#if !(PORTABLE || WINDOWS_PHONE)
|
||||
#if !(PORTABLE)
|
||||
Init();
|
||||
return (CallSiteBinder)_getMemberCall(null, 0, name, context, _getCSharpArgumentInfoArray);
|
||||
#else
|
||||
@@ -127,7 +123,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
|
||||
public static CallSiteBinder SetMember(string name, Type context)
|
||||
{
|
||||
#if !(PORTABLE || WINDOWS_PHONE)
|
||||
#if !(PORTABLE)
|
||||
Init();
|
||||
return (CallSiteBinder)_setMemberCall(null, 0, name, context, _setCSharpArgumentInfoArray);
|
||||
#else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user