-Added Portable Class Library build

This commit is contained in:
James Newton-King
2012-04-18 21:02:34 +12:00
parent 6725edb75c
commit 10256fcf68
85 changed files with 1005 additions and 344 deletions
@@ -27,7 +27,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE)
using System.Dynamic;
#endif
using System.Globalization;
@@ -135,12 +135,12 @@ namespace Newtonsoft.Json.Serialization
JsonDictionaryContract dictionaryContract = (JsonDictionaryContract) valueContract;
SerializeDictionary(writer, dictionaryContract.CreateWrapper(value), dictionaryContract, member, collectionValueContract);
break;
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE)
case JsonContractType.Dynamic:
SerializeDynamic(writer, (IDynamicMetaObjectProvider) value, (JsonDynamicContract) valueContract, member, collectionValueContract);
break;
#endif
#if !SILVERLIGHT && !PocketPC && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
case JsonContractType.Serializable:
SerializeISerializable(writer, (ISerializable) value, (JsonISerializableContract) valueContract, member, collectionValueContract);
break;
@@ -248,7 +248,7 @@ namespace Newtonsoft.Json.Serialization
internal static bool TryConvertToString(object value, Type type, out string s)
{
#if !(PocketPC || NETFX_CORE)
#if !(PocketPC || NETFX_CORE || PORTABLE)
TypeConverter converter = ConvertUtils.GetConverter(type);
// use the objectType's TypeConverter if it has one and can convert to a string
@@ -484,7 +484,7 @@ namespace Newtonsoft.Json.Serialization
return writeMetadataObject;
}
#if !SILVERLIGHT && !PocketPC && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
#if !NET20
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Portability", "CA1903:UseOnlyApiFromTargetedFramework", MessageId = "System.Security.SecuritySafeCriticalAttribute")]
[SecuritySafeCritical]
@@ -518,7 +518,7 @@ To fix this error either change the environment to be fully trusted, change the
}
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE)
private void SerializeDynamic(JsonWriter writer, IDynamicMetaObjectProvider value, JsonDynamicContract contract, JsonProperty member, JsonContract collectionValueContract)
{
contract.InvokeOnSerializing(value, Serializer.Context);