-Removed SL/WP code and fiels

This commit is contained in:
James Newton-King
2013-10-20 16:41:15 +13:00
parent bcd6982419
commit 44bc7ea246
104 changed files with 371 additions and 1633 deletions
+33 -33
View File
@@ -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();