-Added Newtonsoft.Json.Metro build (whew, what a pain!)
-Added .gitignore file
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
#if !SILVERLIGHT
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
using System.Data.SqlTypes;
|
||||
#endif
|
||||
using System.Globalization;
|
||||
@@ -70,14 +70,14 @@ namespace Newtonsoft.Json.Converters
|
||||
|
||||
private byte[] GetByteArray(object value)
|
||||
{
|
||||
#if !SILVERLIGHT && !PocketPC && !NET20
|
||||
#if !SILVERLIGHT && !PocketPC && !NET20 && !NETFX_CORE
|
||||
if (value.GetType().AssignableToTypeName(BinaryTypeName))
|
||||
{
|
||||
IBinary binary = DynamicWrapper.CreateWrapper<IBinary>(value);
|
||||
return binary.ToArray();
|
||||
}
|
||||
#endif
|
||||
#if !SILVERLIGHT
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
if (value is SqlBinary)
|
||||
return ((SqlBinary) value).Value;
|
||||
#endif
|
||||
@@ -129,7 +129,7 @@ namespace Newtonsoft.Json.Converters
|
||||
if (t.AssignableToTypeName(BinaryTypeName))
|
||||
return Activator.CreateInstance(t, data);
|
||||
#endif
|
||||
#if !SILVERLIGHT
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
if (t == typeof(SqlBinary))
|
||||
return new SqlBinary(data);
|
||||
#endif
|
||||
@@ -173,7 +173,7 @@ namespace Newtonsoft.Json.Converters
|
||||
if (objectType.AssignableToTypeName(BinaryTypeName))
|
||||
return true;
|
||||
#endif
|
||||
#if !SILVERLIGHT
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
if (objectType == typeof(SqlBinary) || objectType == typeof(SqlBinary?))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using Newtonsoft.Json.Utilities;
|
||||
|
||||
namespace Newtonsoft.Json.Converters
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !SILVERLIGHT
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
using System;
|
||||
using System.Data;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !SILVERLIGHT
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
using System;
|
||||
using System.Data;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !PocketPC && !SILVERLIGHT && !NET20
|
||||
#if !PocketPC && !SILVERLIGHT && !NET20 && !NETFX_CORE
|
||||
using System;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Globalization;
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace Newtonsoft.Json.Converters
|
||||
? Nullable.GetUnderlyingType(objectType)
|
||||
: objectType;
|
||||
|
||||
if (t.IsValueType && t.IsGenericType)
|
||||
if (t.IsValueType() && t.IsGenericType())
|
||||
return (t.GetGenericTypeDefinition() == typeof(KeyValuePair<,>));
|
||||
|
||||
return false;
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace Newtonsoft.Json.Converters
|
||||
? Nullable.GetUnderlyingType(objectType)
|
||||
: objectType;
|
||||
|
||||
return t.IsEnum;
|
||||
return t.IsEnum();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#if !SILVERLIGHT || WINDOWS_PHONE
|
||||
#if (!SILVERLIGHT || WINDOWS_PHONE)
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
@@ -37,7 +37,7 @@ using System.Linq;
|
||||
namespace Newtonsoft.Json.Converters
|
||||
{
|
||||
#region XmlNodeWrappers
|
||||
#if !SILVERLIGHT
|
||||
#if !SILVERLIGHT && !NETFX_CORE
|
||||
internal class XmlDocumentWrapper : XmlNodeWrapper, IXmlDocument
|
||||
{
|
||||
private readonly XmlDocument _document;
|
||||
@@ -803,7 +803,7 @@ namespace Newtonsoft.Json.Converters
|
||||
if (value is XObject)
|
||||
return XContainerWrapper.WrapNode((XObject)value);
|
||||
#endif
|
||||
#if !SILVERLIGHT
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
if (value is XmlNode)
|
||||
return new XmlNodeWrapper((XmlNode)value);
|
||||
#endif
|
||||
@@ -1088,7 +1088,7 @@ namespace Newtonsoft.Json.Converters
|
||||
rootNode = document;
|
||||
}
|
||||
#endif
|
||||
#if !SILVERLIGHT
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
if (typeof(XmlNode).IsAssignableFrom(objectType))
|
||||
{
|
||||
if (objectType != typeof (XmlDocument))
|
||||
@@ -1242,7 +1242,11 @@ namespace Newtonsoft.Json.Converters
|
||||
else if (reader.TokenType == JsonToken.Date)
|
||||
{
|
||||
DateTime d = Convert.ToDateTime(reader.Value, CultureInfo.InvariantCulture);
|
||||
#if !NETFX_CORE
|
||||
return XmlConvert.ToString(d, DateTimeUtils.ToSerializationMode(d.Kind));
|
||||
#else
|
||||
return XmlConvert.ToString(d);
|
||||
#endif
|
||||
}
|
||||
else if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
@@ -1531,7 +1535,7 @@ namespace Newtonsoft.Json.Converters
|
||||
if (typeof(XObject).IsAssignableFrom(valueType))
|
||||
return true;
|
||||
#endif
|
||||
#if !SILVERLIGHT
|
||||
#if !(SILVERLIGHT || NETFX_CORE)
|
||||
if (typeof(XmlNode).IsAssignableFrom(valueType))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user