From e459cbc94332f423bb2dae11dbfc884b7aaf9c53 Mon Sep 17 00:00:00 2001 From: Eli Brody Date: Mon, 16 Sep 2013 17:45:28 +0300 Subject: [PATCH 1/5] Enabled Task<> asynchronous methods in Windows Phone 8 assembly. (Added new assembly for this purpose.) Updated NuGet package accordingly. --- .../Properties/AssemblyInfo.cs | 16 + .../RestSharp.WindowsPhone8.csproj | 353 ++++++++++++++++++ RestSharp.WindowsPhone8/packages.config | 3 + RestSharp.sln | 31 ++ RestSharp/IRestClient.cs | 6 +- RestSharp/RestClient.Async.cs | 6 +- package.cmd | 8 + 7 files changed, 415 insertions(+), 8 deletions(-) create mode 100644 RestSharp.WindowsPhone8/Properties/AssemblyInfo.cs create mode 100644 RestSharp.WindowsPhone8/RestSharp.WindowsPhone8.csproj create mode 100644 RestSharp.WindowsPhone8/packages.config diff --git a/RestSharp.WindowsPhone8/Properties/AssemblyInfo.cs b/RestSharp.WindowsPhone8/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..9258331a1 --- /dev/null +++ b/RestSharp.WindowsPhone8/Properties/AssemblyInfo.cs @@ -0,0 +1,16 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("RestSharp.WindowsPhone8")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d6e5e03c-bbac-4d6a-8170-051b8225147c")] \ No newline at end of file diff --git a/RestSharp.WindowsPhone8/RestSharp.WindowsPhone8.csproj b/RestSharp.WindowsPhone8/RestSharp.WindowsPhone8.csproj new file mode 100644 index 000000000..10a9cccb2 --- /dev/null +++ b/RestSharp.WindowsPhone8/RestSharp.WindowsPhone8.csproj @@ -0,0 +1,353 @@ + + + + Debug + AnyCPU + 10.0.20506 + 2.0 + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34} + {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + RestSharp.WindowsPhone + RestSharp.WindowsPhone8 + v8.0 + + + + + WindowsPhone + false + true + true + ..\ + true + 11.0 + + + true + full + false + Bin\Debug + TRACE;DEBUG;WINDOWS_PHONE;WP8 + true + true + prompt + 4 + Bin\Debug\RestSharp.WindowsPhone8.xml + false + + + pdbonly + true + Bin\Release + TRACE;WINDOWS_PHONE;WP8 + true + true + prompt + 4 + Bin\Release\RestSharp.WindowsPhone8.xml + 1591,1573,1658,1584,1574,1572 + true + false + + + true + Bin\x86\Debug + TRACE;DEBUG;WINDOWS_PHONE + Bin\Debug\RestSharp.WindowsPhone.xml + true + full + + + prompt + MinimumRecommendedRules.ruleset + false + + + Bin\x86\Release + TRACE;WINDOWS_PHONE + Bin\Release\RestSharp.WindowsPhone.xml + true + true + 1591,1573,1658,1584,1574,1572 + true + pdbonly + + + prompt + MinimumRecommendedRules.ruleset + + + true + Bin\ARM\Debug + TRACE;DEBUG;WINDOWS_PHONE + Bin\Debug\RestSharp.WindowsPhone.xml + true + full + + + prompt + MinimumRecommendedRules.ruleset + false + + + Bin\ARM\Release + TRACE;WINDOWS_PHONE + Bin\Release\RestSharp.WindowsPhone.xml + true + true + 1591,1573,1658,1584,1574,1572 + true + pdbonly + + + prompt + MinimumRecommendedRules.ruleset + + + + Extensions\ResponseStatusExtensions.cs + + + Authenticators\HttpBasicAuthenticator.cs + + + Authenticators\IAuthenticator.cs + + + Authenticators\NtlmAuthenticator.cs + + + Authenticators\OAuth1Authenticator.cs + + + Authenticators\OAuth2Authenticator.cs + + + Authenticators\OAuth\Extensions\CollectionExtensions.cs + + + Authenticators\OAuth\Extensions\OAuthExtensions.cs + + + Authenticators\OAuth\Extensions\StringExtensions.cs + + + Authenticators\OAuth\Extensions\TimeExtensions.cs + + + Authenticators\OAuth\HttpPostParameter.cs + + + Authenticators\OAuth\HttpPostParameterType.cs + + + Authenticators\OAuth\OAuthParameterHandling.cs + + + Authenticators\OAuth\OAuthSignatureMethod.cs + + + Authenticators\OAuth\OAuthSignatureTreatment.cs + + + Authenticators\OAuth\OAuthTools.cs + + + Authenticators\OAuth\OAuthType.cs + + + Authenticators\OAuth\OAuthWebQueryInfo.cs + + + Authenticators\OAuth\OAuthWorkflow.cs + + + Authenticators\OAuth\WebPair.cs + + + Authenticators\OAuth\WebPairCollection.cs + + + Authenticators\OAuth\WebParameter.cs + + + Authenticators\OAuth\WebParameterCollection.cs + + + Authenticators\SimpleAuthenticator.cs + + + Compression\ZLib\Crc32.cs + + + Compression\ZLib\FlushType.cs + + + Compression\ZLib\GZipStream.cs + + + Compression\ZLib\Inflate.cs + + + Compression\ZLib\InfTree.cs + + + Compression\ZLib\ZLib.cs + + + Compression\ZLib\ZLibCodec.cs + + + Compression\ZLib\ZLibConstants.cs + + + Compression\ZLib\ZLibStream.cs + + + Deserializers\DeserializeAsAttribute.cs + + + Deserializers\DotNetXmlDeserializer.cs + + + Deserializers\IDeserializer.cs + + + Deserializers\JsonDeserializer.cs + + + Deserializers\XmlAttributeDeserializer.cs + + + Deserializers\XmlDeserializer.cs + + + Enum.cs + + + Extensions\MiscExtensions.cs + + + Extensions\ReflectionExtensions.cs + + + Extensions\ResponseExtensions.cs + + + Extensions\StringExtensions.cs + + + Extensions\XmlExtensions.cs + + + FileParameter.cs + + + Http.Async.cs + + + Http.cs + + + HttpCookie.cs + + + HttpFile.cs + + + HttpHeader.cs + + + HttpParameter.cs + + + HttpResponse.cs + + + IHttp.cs + + + IHttpFactory.cs + + + IHttpResponse.cs + + + IRestClient.cs + + + IRestRequest.cs + + + IRestResponse.cs + + + Parameter.cs + + + RestClient.Async.cs + + + RestClient.cs + + + RestClientExtensions.cs + + + RestRequest.cs + + + RestResponse.cs + + + Serializers\DotNetXmlSerializer.cs + + + Serializers\ISerializer.cs + + + Serializers\JsonSerializer.cs + + + Serializers\SerializeAsAttribute.cs + + + Serializers\XmlSerializer.cs + + + SharedAssemblyInfo.cs + + + SimpleJson.cs + + + Validation\Require.cs + + + Validation\Validate.cs + + + RestResponseCookie.cs + + + RestRequestAsyncHandle.cs + + + + + + + + + + + + \ No newline at end of file diff --git a/RestSharp.WindowsPhone8/packages.config b/RestSharp.WindowsPhone8/packages.config new file mode 100644 index 000000000..6b8deb9c9 --- /dev/null +++ b/RestSharp.WindowsPhone8/packages.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/RestSharp.sln b/RestSharp.sln index ffe12b3a3..a99307932 100644 --- a/RestSharp.sln +++ b/RestSharp.sln @@ -35,87 +35,118 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Meta", "Meta", "{C5B02FAA-6 readme.txt = readme.txt releasenotes.markdown = releasenotes.markdown EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp.WindowsPhone8", "RestSharp.WindowsPhone8\RestSharp.WindowsPhone8.csproj", "{35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM Debug|Mixed Platforms = Debug|Mixed Platforms Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM Release|Mixed Platforms = Release|Mixed Platforms Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|ARM.ActiveCfg = Debug|Any CPU {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|x86.ActiveCfg = Debug|Any CPU {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.ActiveCfg = Release|Any CPU {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.Build.0 = Release|Any CPU + {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|ARM.ActiveCfg = Release|Any CPU {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.Build.0 = Release|Any CPU {2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|x86.ActiveCfg = Release|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|ARM.ActiveCfg = Debug|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|x86.ActiveCfg = Debug|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.ActiveCfg = Release|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.Build.0 = Release|Any CPU + {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|ARM.ActiveCfg = Release|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.Build.0 = Release|Any CPU {1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|x86.ActiveCfg = Release|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Debug|ARM.ActiveCfg = Debug|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Debug|x86.ActiveCfg = Debug|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Release|Any CPU.ActiveCfg = Release|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Release|Any CPU.Build.0 = Release|Any CPU + {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Release|ARM.ActiveCfg = Release|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Release|Mixed Platforms.Build.0 = Release|Any CPU {47D3EBB9-0300-4AF8-BAC5-740D51454A63}.Release|x86.ActiveCfg = Release|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11F84600-0978-48B9-A28F-63B3781E54B3}.Debug|ARM.ActiveCfg = Debug|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Debug|x86.ActiveCfg = Debug|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Release|Any CPU.ActiveCfg = Release|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Release|Any CPU.Build.0 = Release|Any CPU + {11F84600-0978-48B9-A28F-63B3781E54B3}.Release|ARM.ActiveCfg = Release|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Release|Mixed Platforms.Build.0 = Release|Any CPU {11F84600-0978-48B9-A28F-63B3781E54B3}.Release|x86.ActiveCfg = Release|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Debug|ARM.ActiveCfg = Debug|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Debug|x86.ActiveCfg = Debug|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Release|Any CPU.ActiveCfg = Release|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Release|Any CPU.Build.0 = Release|Any CPU + {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Release|ARM.ActiveCfg = Release|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Release|Mixed Platforms.Build.0 = Release|Any CPU {F4D48DF6-316E-4963-B5C1-59CA39B431B7}.Release|x86.ActiveCfg = Release|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Debug|ARM.ActiveCfg = Debug|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Debug|x86.ActiveCfg = Debug|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Release|Any CPU.ActiveCfg = Release|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Release|Any CPU.Build.0 = Release|Any CPU + {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Release|ARM.ActiveCfg = Release|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Release|Mixed Platforms.Build.0 = Release|Any CPU {5FF943A5-260F-4042-B4CE-C4977BAD4EBB}.Release|x86.ActiveCfg = Release|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Debug|ARM.ActiveCfg = Debug|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Debug|x86.ActiveCfg = Debug|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Release|ARM.ActiveCfg = Release|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Release|Mixed Platforms.Build.0 = Release|Any CPU {CCC30138-3D68-44D8-AF1A-D22F769EE8DC}.Release|x86.ActiveCfg = Release|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Debug|ARM.ActiveCfg = Debug|ARM + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Debug|ARM.Build.0 = Debug|ARM + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Debug|x86.ActiveCfg = Debug|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Release|Any CPU.Build.0 = Release|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Release|ARM.ActiveCfg = Release|ARM + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Release|ARM.Build.0 = Release|ARM + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {35B2AFEA-0A2A-4E13-B946-60B7DD0D0B34}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/RestSharp/IRestClient.cs b/RestSharp/IRestClient.cs index 8dcc0e2c5..f6e88d5cc 100644 --- a/RestSharp/IRestClient.cs +++ b/RestSharp/IRestClient.cs @@ -18,8 +18,7 @@ using System.Net; using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; -#if NET4 || MONODROID || MONOTOUCH -using System.Threading; +#if NET4 || WP8 || MONODROID || MONOTOUCHusing System.Threading; using System.Threading.Tasks; #endif @@ -123,8 +122,7 @@ public interface IRestClient IRestResponse ExecuteAsPost(IRestRequest request, string httpMethod) where T : new(); #endif -#if NET4 || MONODROID || MONOTOUCH - /// +#if NET4 || WP8 || MONODROID || MONOTOUCH /// /// Executes the request and callback asynchronously, authenticating if needed /// /// Target deserialization type diff --git a/RestSharp/RestClient.Async.cs b/RestSharp/RestClient.Async.cs index ce19f7054..d18211b23 100644 --- a/RestSharp/RestClient.Async.cs +++ b/RestSharp/RestClient.Async.cs @@ -18,8 +18,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading; -#if NET4 || MONODROID || MONOTOUCH -using System.Threading.Tasks; +#if NET4 || WP8 || MONODROID || MONOTOUCHusing System.Threading.Tasks; #endif using System.Text; using System.Net; @@ -158,8 +157,7 @@ private void DeserializeResponse(IRestRequest request, Action +#if NET4 || WP8 || MONODROID || MONOTOUCH /// /// Executes a GET-style request asynchronously, authenticating if needed /// /// Target deserialization type diff --git a/package.cmd b/package.cmd index 41e87ed16..608defba2 100644 --- a/package.cmd +++ b/package.cmd @@ -3,12 +3,14 @@ if not exist Download\Net4 mkdir Download\Net4\ if not exist Download\Silverlight mkdir Download\Silverlight\ if not exist Download\WindowsPhone mkdir Download\WindowsPhone\ +if not exist Download\WindowsPhone8 mkdir Download\WindowsPhone8\ if not exist Download\package\lib\net35 mkdir Download\package\lib\net35\ if not exist Download\package\lib\net35-client mkdir Download\package\lib\net35-client\ if not exist Download\package\lib\net4 mkdir Download\package\lib\net4\ if not exist Download\package\lib\net4-client mkdir Download\package\lib\net4-client\ if not exist Download\package\lib\sl4-wp71 mkdir Download\package\lib\sl4-wp71\ if not exist Download\package\lib\sl4 mkdir Download\package\lib\sl4\ +if not exist Download\package\lib\wp8 mkdir Download\package\lib\wp8\ copy RestSharp\bin\Release\RestSharp.dll Download\ copy RestSharp\bin\Release\RestSharp.xml Download\ @@ -22,6 +24,9 @@ copy RestSharp.Silverlight\bin\Release\RestSharp.Silverlight.xml Download\Silver copy RestSharp.WindowsPhone\bin\Release\RestSharp.WindowsPhone.dll Download\WindowsPhone\ copy RestSharp.WindowsPhone\bin\Release\RestSharp.WindowsPhone.xml Download\WindowsPhone\ +copy RestSharp.WindowsPhone8\bin\Release\RestSharp.WindowsPhone8.dll Download\WindowsPhone8\ +copy RestSharp.WindowsPhone8\bin\Release\RestSharp.WindowsPhone8.xml Download\WindowsPhone8\ + copy LICENSE.txt Download\ copy readme.txt Download\ copy readme.txt Download\package\ @@ -34,6 +39,7 @@ copy RestSharp.Net4\bin\Release\RestSharp.dll Download\Package\lib\net4-client\ copy RestSharp.Silverlight\bin\Release\RestSharp.Silverlight.dll Download\Package\lib\sl4\ copy RestSharp.WindowsPhone\bin\Release\RestSharp.WindowsPhone.dll Download\Package\lib\sl4-wp71\ +copy RestSharp.WindowsPhone8\bin\Release\RestSharp.WindowsPhone8.dll Download\Package\lib\wp8\ copy RestSharp\bin\Release\RestSharp.xml Download\Package\lib\net35\ copy RestSharp\bin\Release\RestSharp.xml Download\Package\lib\net35-client\ @@ -44,6 +50,8 @@ copy RestSharp.Net4\bin\Release\RestSharp.xml Download\Package\lib\net4-client\ copy RestSharp.Silverlight\bin\Release\RestSharp.Silverlight.xml Download\Package\lib\sl4\ copy RestSharp.WindowsPhone\bin\Release\RestSharp.WindowsPhone.xml Download\Package\lib\sl4-wp71\ +copy RestSharp.WindowsPhone8\bin\Release\RestSharp.WindowsPhone8.xml Download\Package\lib\wp8\ + tools\nuget.exe update -self tools\nuget.exe pack restsharp-computed.nuspec -BasePath Download\Package -Output Download rm restsharp-computed.nuspec \ No newline at end of file From e9bc3e1fdfa25c5806bc488513d17627365e5f4c Mon Sep 17 00:00:00 2001 From: Eli Brody Date: Wed, 18 Sep 2013 12:05:49 +0300 Subject: [PATCH 2/5] Prepared for NuGet package (including version number). Added some precompiler stuff to be more inclusive for WP8. Added compilation options for ARM. --- RestSharp.WindowsPhone8/RestSharp.WindowsPhone8.csproj | 4 ++-- RestSharp/Http.Async.cs | 10 +++++----- RestSharp/RestClient.cs | 2 +- package.cmd | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/RestSharp.WindowsPhone8/RestSharp.WindowsPhone8.csproj b/RestSharp.WindowsPhone8/RestSharp.WindowsPhone8.csproj index 10a9cccb2..66966882e 100644 --- a/RestSharp.WindowsPhone8/RestSharp.WindowsPhone8.csproj +++ b/RestSharp.WindowsPhone8/RestSharp.WindowsPhone8.csproj @@ -54,7 +54,7 @@ true Bin\x86\Debug - TRACE;DEBUG;WINDOWS_PHONE + TRACE;DEBUG;WINDOWS_PHONE;WP8 Bin\Debug\RestSharp.WindowsPhone.xml true full @@ -81,7 +81,7 @@ true Bin\ARM\Debug - TRACE;DEBUG;WINDOWS_PHONE + TRACE;DEBUG;WINDOWS_PHONE;WP8 Bin\Debug\RestSharp.WindowsPhone.xml true full diff --git a/RestSharp/Http.Async.cs b/RestSharp/Http.Async.cs index 69f4a6a33..dec08f26a 100644 --- a/RestSharp/Http.Async.cs +++ b/RestSharp/Http.Async.cs @@ -144,7 +144,7 @@ private HttpWebRequest PutPostInternalAsync(string method, Action { ExecuteCallback(CreateErrorResponse(ex), callback); } - + return webRequest; } @@ -155,7 +155,7 @@ private void WriteRequestBodyAsync(HttpWebRequest webRequest, Action RequestStreamCallback(result, callback), webRequest); @@ -238,7 +238,7 @@ private void RequestStreamCallback(IAsyncResult result, Action cal private void SetTimeout(IAsyncResult asyncResult, TimeOutState timeOutState) { -#if FRAMEWORK +#if FRAMEWORK || WP8 if (Timeout != 0) { ThreadPool.RegisterWaitForSingleObject(asyncResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), timeOutState, Timeout, true); @@ -343,7 +343,7 @@ partial void AddAsyncHeaderActions() #if SILVERLIGHT _restrictedHeaderActions.Add("Content-Length", (r, v) => r.ContentLength = Convert.ToInt64(v)); #endif -#if WINDOWS_PHONE +#if WINDOWS_PHONE && !WP8 // WP7 doesn't as of Beta doesn't support a way to set Content-Length either directly // or indirectly _restrictedHeaderActions.Add("Content-Length", (r, v) => { }); @@ -365,7 +365,7 @@ private HttpWebRequest ConfigureAsyncWebRequest(string method, Uri url) webRequest.Method = method; // make sure Content-Length header is always sent since default is -1 -#if !WINDOWS_PHONE +#if !WINDOWS_PHONE || WP8 // WP7 doesn't as of Beta doesn't support a way to set this value either directly // or indirectly if(!HasFiles && !AlwaysMultipartFormData) diff --git a/RestSharp/RestClient.cs b/RestSharp/RestClient.cs index 5e00ebb10..ef8abaf4b 100644 --- a/RestSharp/RestClient.cs +++ b/RestSharp/RestClient.cs @@ -41,7 +41,7 @@ public partial class RestClient : IRestClient /// public RestClient() { -#if WINDOWS_PHONE +#if WINDOWS_PHONE && !WP8 UseSynchronizationContext = true; #endif ContentHandlers = new Dictionary(); diff --git a/package.cmd b/package.cmd index 608defba2..33b544013 100644 --- a/package.cmd +++ b/package.cmd @@ -54,4 +54,4 @@ copy RestSharp.WindowsPhone8\bin\Release\RestSharp.WindowsPhone8.xml Download\Pa tools\nuget.exe update -self tools\nuget.exe pack restsharp-computed.nuspec -BasePath Download\Package -Output Download -rm restsharp-computed.nuspec \ No newline at end of file +del restsharp-computed.nuspec \ No newline at end of file From 37c780da5bac3cccff84e07262df289253a8aed9 Mon Sep 17 00:00:00 2001 From: Eli Brody Date: Tue, 29 Oct 2013 12:22:53 +0200 Subject: [PATCH 3/5] Fix line breaks. --- RestSharp/IRestClient.cs | 6 ++++-- RestSharp/RestClient.Async.cs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/RestSharp/IRestClient.cs b/RestSharp/IRestClient.cs index f6e88d5cc..004d8923e 100644 --- a/RestSharp/IRestClient.cs +++ b/RestSharp/IRestClient.cs @@ -18,7 +18,8 @@ using System.Net; using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; -#if NET4 || WP8 || MONODROID || MONOTOUCHusing System.Threading; +#if NET4 || WP8 || MONODROID || MONOTOUCH +using System.Threading; using System.Threading.Tasks; #endif @@ -122,7 +123,8 @@ public interface IRestClient IRestResponse ExecuteAsPost(IRestRequest request, string httpMethod) where T : new(); #endif -#if NET4 || WP8 || MONODROID || MONOTOUCH /// +#if NET4 || WP8 || MONODROID || MONOTOUCH + /// /// Executes the request and callback asynchronously, authenticating if needed /// /// Target deserialization type diff --git a/RestSharp/RestClient.Async.cs b/RestSharp/RestClient.Async.cs index d18211b23..8547aad13 100644 --- a/RestSharp/RestClient.Async.cs +++ b/RestSharp/RestClient.Async.cs @@ -18,7 +18,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading; -#if NET4 || WP8 || MONODROID || MONOTOUCHusing System.Threading.Tasks; +#if NET4 || WP8 || MONODROID || MONOTOUCH +using System.Threading.Tasks; #endif using System.Text; using System.Net; @@ -157,7 +158,8 @@ private void DeserializeResponse(IRestRequest request, Action +#if NET4 || WP8 || MONODROID || MONOTOUCH + /// /// Executes a GET-style request asynchronously, authenticating if needed /// /// Target deserialization type From c8ccbbb9efa17b80015bb39425cebe29f0d3da75 Mon Sep 17 00:00:00 2001 From: Eli Brody Date: Tue, 29 Oct 2013 12:32:35 +0200 Subject: [PATCH 4/5] Temporary update of assembly version for local nuget package. --- RestSharp/SharedAssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RestSharp/SharedAssemblyInfo.cs b/RestSharp/SharedAssemblyInfo.cs index 9afbe11c7..4667029c8 100644 --- a/RestSharp/SharedAssemblyInfo.cs +++ b/RestSharp/SharedAssemblyInfo.cs @@ -30,5 +30,5 @@ class SharedAssembylInfo { - public const string Version = "104.3.3"; + public const string Version = "104.3.4"; } From 21c5c870dcf1edecbd4d004dcf04d70ae2d2bea6 Mon Sep 17 00:00:00 2001 From: Eli Brody Date: Tue, 29 Oct 2013 16:31:39 +0200 Subject: [PATCH 5/5] Add TaskContinuationOptions.HideScheduler to TaskCompletionSources in order to help prevent deadlocks. --- RestSharp/RestClient.Async.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RestSharp/RestClient.Async.cs b/RestSharp/RestClient.Async.cs index 8547aad13..5cb850fe3 100644 --- a/RestSharp/RestClient.Async.cs +++ b/RestSharp/RestClient.Async.cs @@ -236,7 +236,7 @@ public virtual Task> ExecuteTaskAsync(IRestRequest request, throw new ArgumentNullException("request"); } - var taskCompletionSource = new TaskCompletionSource>(); + var taskCompletionSource = new TaskCompletionSource>(TaskContinuationOptions.HideScheduler); try { @@ -345,7 +345,7 @@ public virtual Task ExecuteTaskAsync(IRestRequest request, Cancel throw new ArgumentNullException("request"); } - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskContinuationOptions.HideScheduler); try {