-Upgraded Windows Phone project to WP8

This commit is contained in:
James Newton-King
2013-03-11 20:14:24 +13:00
parent 0e753888d0
commit 4d291cfc3d
26 changed files with 89 additions and 97 deletions
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System;
using System.Collections.Generic;
@@ -14,7 +14,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json.Tests</RootNamespace>
<AssemblyName>Newtonsoft.Json.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<SilverlightApplication>false</SilverlightApplication>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -52,6 +52,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -63,10 +64,12 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<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>
@@ -11,13 +11,16 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json.Tests</RootNamespace>
<AssemblyName>Newtonsoft.Json.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<TargetFrameworkProfile>WindowsPhone</TargetFrameworkProfile>
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
<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>
@@ -29,6 +32,7 @@
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -39,29 +43,12 @@
<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>
<Reference Include="System.Runtime.Serialization">
<Private>True</Private>
</Reference>
<Reference Include="System.Windows">
<Private>True</Private>
</Reference>
<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.Net">
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Bson\BsonReaderTests.cs" />
@@ -79,6 +66,7 @@
<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" />
@@ -235,8 +223,8 @@
<Name>Newtonsoft.Json.WindowsPhone</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
<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.
@@ -177,7 +177,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", json);
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
[Test]
public void DynamicCamelCasePropertyNames()
{
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System;
using System.Collections;
using System.Collections.Generic;
@@ -24,7 +24,7 @@
#endregion
using System;
#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE)
#if !(NET35 || NET20 || SILVERLIGHT)
using System.Collections.Concurrent;
#endif
using System.Collections.Generic;
@@ -53,7 +53,7 @@ using System.Collections.ObjectModel;
using Newtonsoft.Json.Bson;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
#if !NET20 && !WINDOWS_PHONE
#if !NET20
using System.Runtime.Serialization.Json;
#endif
using Newtonsoft.Json.Serialization;
@@ -69,7 +69,7 @@ using System.Text.RegularExpressions;
using System.Collections.Specialized;
using System.Linq.Expressions;
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System.Dynamic;
using System.ComponentModel;
#endif
@@ -173,7 +173,7 @@ namespace Newtonsoft.Json.Tests.Serialization
string jsonText = JsonConvert.SerializeObject(testDictionary);
#if !NET20 && !WINDOWS_PHONE
#if !NET20
MemoryStream ms = new MemoryStream();
DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(Dictionary<string, object>));
serializer.WriteObject(ms, testDictionary);
@@ -432,7 +432,7 @@ keyword such as type of business.""
CollectionAssert.AreEqual(r1, r2);
}
#if !NET20 && !WINDOWS_PHONE
#if !NET20
[Test]
public void Unicode()
{
@@ -2123,7 +2123,7 @@ Path '', line 1, position 1.",
});
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
[Test]
public void CannotDeserializeArrayIntoDynamic()
{
@@ -2783,7 +2783,7 @@ Path '', line 1, position 2.",
public string Ethnicity { get; set; }
}
#if !NET20 && !WINDOWS_PHONE
#if !NET20
public class DataContractJsonSerializerTestClass
{
public TimeSpan TimeSpanProperty { get; set; }
@@ -4318,7 +4318,7 @@ To fix this error either change the environment to be fully trusted, change the
}", json);
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
[Test]
public void SerializeExpandoObject()
{
@@ -7395,7 +7395,7 @@ Parameter name: value",
}
#endif
#if !(PORTABLE || NET20 || NET35 || WINDOWS_PHONE)
#if !(PORTABLE || NET20 || NET35)
[Test]
public void HashSetInterface()
{
@@ -32,7 +32,7 @@ using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#endif
#if !(NET20 || NET35 || WINDOWS_PHONE)
#if !(NET20 || NET35)
using System.Dynamic;
#endif
using System.Runtime.Serialization;
@@ -210,7 +210,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
#endif
#if !(NET20 || NET35 || WINDOWS_PHONE)
#if !(NET20 || NET35)
public class DictionaryDynamicObject : DynamicObject
{
public IDictionary<string, object> Values { get; private set; }
@@ -612,7 +612,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(@"Unexpected end when deserializing object. Path 'events2.code', line 1, position 49.", errors[1]);
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
[Test]
public void ErrorHandlingEndOfContentDynamic()
{
@@ -24,7 +24,7 @@
#endregion
#if !PORTABLE
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE)
#if !(NET35 || NET20 || PORTABLE)
using System.Dynamic;
#endif
using System.Text;
@@ -1445,7 +1445,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(1, (int)j["MyProperty"]);
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
[Test]
public void PropertyItemTypeNameHandlingDynamic()
{
@@ -1651,7 +1651,7 @@ namespace Newtonsoft.Json.Tests.Serialization
public TypeNameHandlingTestObject Data { get; set; }
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
public class PropertyItemTypeNameHandlingDynamic
{
[JsonProperty(ItemTypeNameHandling = TypeNameHandling.All)]
+2 -2
View File
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
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
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System;
using System.Collections.Generic;
+2 -2
View File
@@ -28,7 +28,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System.Dynamic;
using System.Linq.Expressions;
#endif
@@ -755,7 +755,7 @@ namespace Newtonsoft.Json.Linq
#endregion
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
/// <summary>
/// Returns the <see cref="T:System.Dynamic.DynamicMetaObject"/> responsible for binding operations performed on this object.
/// </summary>
+3 -3
View File
@@ -25,7 +25,7 @@
using System;
using System.Collections.Generic;
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System.Dynamic;
using System.Linq.Expressions;
#endif
@@ -50,7 +50,7 @@ namespace Newtonsoft.Json.Linq
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
, ICloneable
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
, IDynamicMetaObjectProvider
#endif
{
@@ -1704,7 +1704,7 @@ namespace Newtonsoft.Json.Linq
return p.Evaluate(this, errorWhenNoMatch);
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
/// <summary>
/// Returns the <see cref="T:System.Dynamic.DynamicMetaObject"/> responsible for binding operations performed on this object.
/// </summary>
+3 -3
View File
@@ -27,7 +27,7 @@ using System;
using System.Collections.Generic;
using Newtonsoft.Json.Utilities;
using System.Globalization;
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System.Dynamic;
using System.Linq.Expressions;
#endif
@@ -304,7 +304,7 @@ namespace Newtonsoft.Json.Linq
return d1.CompareTo(d2);
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
private static bool Operation(ExpressionType operation, object objA, object objB, out object result)
{
if (objA is string || objB is string)
@@ -714,7 +714,7 @@ namespace Newtonsoft.Json.Linq
return _value.ToString();
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
/// <summary>
/// Returns the <see cref="T:System.Dynamic.DynamicMetaObject"/> responsible for binding operations performed on this object.
/// </summary>
@@ -14,7 +14,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json</RootNamespace>
<AssemblyName>Newtonsoft.Json</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<SilverlightApplication>false</SilverlightApplication>
<ValidateXaml>true</ValidateXaml>
<ThrowErrorsInValidation>false</ThrowErrorsInValidation>
@@ -56,6 +56,7 @@
<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>
@@ -69,6 +70,7 @@
<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" />
@@ -11,13 +11,16 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json</RootNamespace>
<AssemblyName>Newtonsoft.Json</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<TargetFrameworkProfile>WindowsPhone</TargetFrameworkProfile>
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
<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>
@@ -33,6 +36,7 @@
</DocumentationFile>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>Newtonsoft.Json.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -46,16 +50,8 @@
<DocumentationFile>Bin\Release\WindowsPhone\Newtonsoft.Json.xml</DocumentationFile>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>Newtonsoft.Json.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Windows" />
<Reference Include="system" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="System.Net" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Bson\BsonBinaryType.cs" />
<Compile Include="Bson\BsonBinaryWriter.cs" />
@@ -185,7 +181,10 @@
<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" />
@@ -224,8 +223,8 @@
<Compile Include="Serialization\JsonTypeReflector.cs" />
<Compile Include="WriteState.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
<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.
@@ -25,12 +25,12 @@
using System;
using System.Collections;
#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE)
#if !(NET35 || NET20 || SILVERLIGHT || PORTABLE)
using System.Collections.Concurrent;
#endif
using System.Collections.Generic;
using System.ComponentModel;
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System.Dynamic;
#endif
using System.Globalization;
@@ -100,7 +100,7 @@ namespace Newtonsoft.Json.Serialization
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE)
new EntityKeyMemberConverter(),
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
new ExpandoObjectConverter(),
#endif
#if (!(SILVERLIGHT) || WINDOWS_PHONE)
@@ -748,7 +748,7 @@ namespace Newtonsoft.Json.Serialization
}
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
/// <summary>
/// Creates a <see cref="JsonDynamicContract"/> for the given type.
/// </summary>
@@ -817,7 +817,7 @@ namespace Newtonsoft.Json.Serialization
return CreateISerializableContract(objectType);
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
if (typeof(IDynamicMetaObjectProvider).IsAssignableFrom(t))
return CreateDynamicContract(objectType);
#endif
@@ -86,8 +86,8 @@ namespace Newtonsoft.Json.Serialization
if (IsTypeGenericCollectionInterface(UnderlyingType))
CreatedType = ReflectionUtils.MakeGenericType(typeof(List<>), CollectionItemType);
#if !(NET20 || NET35 || WINDOWS_PHONE)
else if (IsTypeGenericSetnterface(UnderlyingType))
#if !(NET20 || NET35)
else if (IsTypeGenericSetInterface(UnderlyingType))
CreatedType = ReflectionUtils.MakeGenericType(typeof(HashSet<>), CollectionItemType);
#endif
@@ -155,8 +155,8 @@ namespace Newtonsoft.Json.Serialization
|| genericDefinition == typeof(IEnumerable<>));
}
#if !(NET20 || NET35 || WINDOWS_PHONE)
private bool IsTypeGenericSetnterface(Type type)
#if !(NET20 || NET35)
private bool IsTypeGenericSetInterface(Type type)
{
if (!type.IsGenericType())
return false;
@@ -42,7 +42,7 @@ namespace Newtonsoft.Json.Serialization
Primitive,
String,
Dictionary,
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
Dynamic,
#endif
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System;
using System.Collections.Generic;
using System.Dynamic;
@@ -27,7 +27,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System.ComponentModel;
using System.Dynamic;
#endif
@@ -288,7 +288,7 @@ namespace Newtonsoft.Json.Serialization
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
case JsonContractType.Serializable:
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
case JsonContractType.Dynamic:
#endif
return @"JSON object (e.g. {""name"":""value""})";
@@ -393,7 +393,7 @@ namespace Newtonsoft.Json.Serialization
targetDictionary = CreateNewDictionary(reader, dictionaryContract);
return PopulateDictionary(dictionaryContract.CreateWrapper(targetDictionary), reader, dictionaryContract, member, id);
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
case JsonContractType.Dynamic:
JsonDynamicContract dynamicContract = (JsonDynamicContract) contract;
return CreateDynamic(reader, dynamicContract, member, id);
@@ -490,7 +490,7 @@ To fix this error either change the JSON to a {1} or change the deserialized typ
TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, "Resolved type '{0}' to {1}.".FormatWith(CultureInfo.InvariantCulture, qualifiedTypeName, specifiedType)), null);
if (objectType != null
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
&& objectType != typeof (IDynamicMetaObjectProvider)
#endif
&& !objectType.IsAssignableFrom(specifiedType))
@@ -621,7 +621,7 @@ To fix this error either change the JSON to a {1} or change the deserialized typ
private bool HasDefinedType(Type type)
{
return (type != null && type != typeof (object) && !typeof (JToken).IsSubclassOf(type)
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
&& type != typeof (IDynamicMetaObjectProvider)
#endif
);
@@ -1209,7 +1209,7 @@ To fix this error either change the environment to be fully trusted, change the
}
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
private object CreateDynamic(JsonReader reader, JsonDynamicContract contract, JsonProperty member, string id)
{
IDynamicMetaObjectProvider newObject;
@@ -27,7 +27,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System.Dynamic;
#endif
using System.Diagnostics;
@@ -152,7 +152,7 @@ namespace Newtonsoft.Json.Serialization
JsonDictionaryContract dictionaryContract = (JsonDictionaryContract) valueContract;
SerializeDictionary(writer, dictionaryContract.CreateWrapper(value), dictionaryContract, member, containerContract, containerProperty);
break;
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
case JsonContractType.Dynamic:
SerializeDynamic(writer, (IDynamicMetaObjectProvider)value, (JsonDynamicContract)valueContract, member, containerContract, containerProperty);
break;
@@ -710,7 +710,7 @@ To fix this error either change the environment to be fully trusted, change the
}
#endif
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
private void SerializeDynamic(JsonWriter writer, IDynamicMetaObjectProvider value, JsonDynamicContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
{
OnSerializing(writer, contract, value);
@@ -224,7 +224,7 @@ namespace Newtonsoft.Json.Utilities
public static TimeSpan ParseTimeSpan(string input)
{
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
return TimeSpan.Parse((string) input, CultureInfo.InvariantCulture);
#else
return TimeSpan.Parse((string)input);
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System;
using System.Collections.Generic;
using System.Dynamic;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System;
using System.Collections.Generic;
using System.Dynamic;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20)
using System;
using System.Collections.Generic;
using System.Dynamic;
@@ -44,7 +44,7 @@ namespace Newtonsoft.Json.Utilities
#if !SILVERLIGHT
public const string CSharpAssemblyName = "Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
#else
public const string CSharpAssemblyName = "Microsoft.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
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;