-Readded .NET 4, SL4, WP7, Win8 portable library
-Disable SL library build
This commit is contained in:
@@ -25,12 +25,12 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if !(NET35 || NET20)
|
||||
#if !(NET35 || NET20 || PORTABLE40)
|
||||
using System.Dynamic;
|
||||
using System.Linq.Expressions;
|
||||
#endif
|
||||
using System.IO;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
using System.Numerics;
|
||||
#endif
|
||||
using System.Text;
|
||||
@@ -50,11 +50,11 @@ namespace Newtonsoft.Json.Linq
|
||||
/// Represents an abstract JSON token.
|
||||
/// </summary>
|
||||
public abstract class JToken : IJEnumerable<JToken>, IJsonLineInfo
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
, ICloneable
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE40 || PORTABLE)
|
||||
, ICloneable
|
||||
#endif
|
||||
#if !(NET35 || NET20)
|
||||
, IDynamicMetaObjectProvider
|
||||
#if !(NET35 || NET20 || PORTABLE40)
|
||||
, IDynamicMetaObjectProvider
|
||||
#endif
|
||||
{
|
||||
private JContainer _parent;
|
||||
@@ -455,7 +455,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return Convert.ToBoolean((int)(BigInteger)v.Value);
|
||||
#endif
|
||||
@@ -497,7 +497,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return Convert.ToBoolean((int)(BigInteger)v.Value);
|
||||
#endif
|
||||
@@ -516,7 +516,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (long)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -585,7 +585,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (decimal?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -607,7 +607,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (double?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -629,7 +629,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (char?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -648,7 +648,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (int)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -667,7 +667,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (short)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -687,7 +687,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (ushort)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -707,7 +707,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (char)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -726,7 +726,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (byte)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -748,7 +748,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (int?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -770,7 +770,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (short?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -793,7 +793,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (ushort?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -815,7 +815,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (byte?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -856,7 +856,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (long?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -878,7 +878,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (float?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -897,7 +897,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (decimal)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -920,7 +920,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (uint?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -943,7 +943,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (ulong?)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -962,7 +962,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (double) (BigInteger) v.Value;
|
||||
#endif
|
||||
@@ -981,7 +981,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (float)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -1007,7 +1007,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return null;
|
||||
if (v.Value is byte[])
|
||||
return Convert.ToBase64String((byte[]) v.Value);
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return ((BigInteger)v.Value).ToString(CultureInfo.InvariantCulture);
|
||||
#endif
|
||||
@@ -1027,7 +1027,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (uint)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -1047,7 +1047,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return (ulong)(BigInteger)v.Value;
|
||||
#endif
|
||||
@@ -1071,7 +1071,7 @@ namespace Newtonsoft.Json.Linq
|
||||
|
||||
if (v.Value is string)
|
||||
return Convert.FromBase64String(Convert.ToString(v.Value, CultureInfo.InvariantCulture));
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
if (v.Value is BigInteger)
|
||||
return ((BigInteger)v.Value).ToByteArray();
|
||||
#endif
|
||||
@@ -1170,7 +1170,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 || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Performs an explicit conversion from <see cref="Newtonsoft.Json.Linq.JToken"/> to <see cref="System.Numerics.BigInteger"/>.
|
||||
/// </summary>
|
||||
@@ -1415,7 +1415,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return new JValue(value);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Performs an implicit conversion from <see cref="Nullable{BigInteger}"/> to <see cref="Newtonsoft.Json.Linq.JToken"/>.
|
||||
/// </summary>
|
||||
@@ -1489,7 +1489,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return new JValue(value);
|
||||
}
|
||||
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
/// <summary>
|
||||
/// Performs an implicit conversion from <see cref="T:System.Numerics.BigInteger"/> to <see cref="Newtonsoft.Json.Linq.JToken"/>.
|
||||
/// </summary>
|
||||
@@ -1714,7 +1714,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return (TimeSpan?)this;
|
||||
case PrimitiveTypeCode.TimeSpan:
|
||||
return (TimeSpan)this;
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE40 || PORTABLE)
|
||||
case PrimitiveTypeCode.BigIntegerNullable:
|
||||
return (BigInteger?)this;
|
||||
case PrimitiveTypeCode.BigInteger:
|
||||
@@ -1881,7 +1881,7 @@ namespace Newtonsoft.Json.Linq
|
||||
return p.Evaluate(this, errorWhenNoMatch);
|
||||
}
|
||||
|
||||
#if !(NET35 || NET20)
|
||||
#if !(NET35 || NET20 || PORTABLE40)
|
||||
/// <summary>
|
||||
/// Returns the <see cref="T:System.Dynamic.DynamicMetaObject"/> responsible for binding operations performed on this object.
|
||||
/// </summary>
|
||||
@@ -1907,7 +1907,7 @@ namespace Newtonsoft.Json.Linq
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
|
||||
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE || PORTABLE40)
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return DeepClone();
|
||||
|
||||
Reference in New Issue
Block a user