Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

42
external/aspnetwebstack/.gitattributes vendored Normal file
View File

@@ -0,0 +1,42 @@
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.bmp binary
*.gif binary
*.jpg binary
*.png binary
*.ascx text
*.cmd text
*.coffee text
*.config text
*.cs text diff=csharp
*.csproj text merge=union
*.css text
*.cshtml text
*.htm text
*.html text
*.htm text
*.js text
*.msbuild text
*.resx text merge=union
*.ruleset text
*.Stylecop text
*.targets text
*.tt text
*.txt text
*.vb text
*.vbhtml text
*.vbproj text merge=union
*.xml text
*.xunit text
*.sln text eol=crlf merge=union

12
external/aspnetwebstack/.gitignore vendored Normal file
View File

@@ -0,0 +1,12 @@
[Bb]in
[Oo]bj
*.suo
*.user
*.[Cc]ache
*[Rr]esharper*
packages
NuGet.exe
_[Ss]cripts
*.exe
*.dll
*.nupkg

15
external/aspnetwebstack/License.txt vendored Normal file
View File

@@ -0,0 +1,15 @@
Copyright (c) Microsoft Corporation. All rights reserved.
Microsoft would like to thank its contributors, a list of whom
are at http://aspnetwebstack.codeplex.com/wikipage?title=Contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing permissions
and limitations under the License.

53
external/aspnetwebstack/README.md vendored Normal file
View File

@@ -0,0 +1,53 @@
Clone of https://git01.codeplex.com/aspnetwebstack.git
======================================================
This is a Mono copy of the Microsoft ASP.NET Web Stack (MVC, Razor etc) in order to
make maintenance of the Mono version of those libraries easier.
Mono git submodules maintenance
==============================
Please read http://mono-project.com/Git_Submodules_Maintenance
Maintenance and development
===========================
These instructions are for developers working on code in this repository. End users do not need to be
concerned with the procedures described below.
First clone the repository (do not do any development in the submodule directory in mono source tree).
In order to modify the upstream source code you need a way to interact with the upstream repository in order
to fetch updates, cherry pick or merge them etc. To make it possible you need to add the upstream remote to
your clone of the repository:
git remote add upstream https://git01.codeplex.com/aspnetwebstack.git
When there are upstream changes you're interested in merging, fetch them but do not apply them to the tree:
git fetch upstream/master
You can replace 'master' with name of the remote branch you need to update from.
To merge all upstream updates, do:
git merge upstream/master
followed by
git push origin/master
After that is done and you're ready to make the changes visible to mono, go to your mono repository clone,
make sure the submodules are initialized and up to date:
git submodule init
git submodule update
then go to he external/aspnetwebstack directory and get the changes:
git pull
Then go back to the top of your copy of mono repository and update the submodule reference:
git add external/aspnetwebstack
git push

85
external/aspnetwebstack/Runtime.msbuild vendored Normal file
View File

@@ -0,0 +1,85 @@
<Project DefaultTargets="UnitTest" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<!-- TODO: CodeAnalysis is off by default in VS11 because FxCop cannot load custom rules built against Dev10 -->
<CodeAnalysis Condition=" '$(CodeAnalysis)' == '' and '$(VS110COMNTOOLS)' == ''">true</CodeAnalysis>
<StyleCopEnabled Condition=" '$(StyleCopEnabled)' == '' ">true</StyleCopEnabled>
<BuildInParallel Condition=" '$(BuildInParallel)' == '' And $(MSBuildNodeCount) &gt; 1 ">true</BuildInParallel>
<BuildInParallel Condition=" '$(BuildInParallel)' == '' ">false</BuildInParallel>
<TestResultsDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\test\TestResults\</TestResultsDirectory>
</PropertyGroup>
<Target Name="Integration" DependsOnTargets="Clean;Build;UnitTest" />
<Target Name="Clean">
<MSBuild
Projects="Runtime.sln"
Targets="Clean"
Properties="Configuration=$(Configuration)" />
<RemoveDir Directories="bin\$(Configuration)" />
</Target>
<Target Name="Prereq">
<MSBuild
Projects="tools\WebStack.NuGet.targets"
Targets="VerifyPackages"
Properties="CompactMessage=false"
Condition=" '$(EnableNuGetPackageRestore)' != 'true' " />
<CallTarget Targets="RestorePackages" Condition=" '$(EnableNuGetPackageRestore)' == 'true' " />
</Target>
<Target Name="RestorePackages">
<!--
This can't build in parallel because of NuGet package restore race conditions.
When this is fixed in NuGet, we can remove the CSPROJ part of this target
(we will continue to need the NuGet install for StyleCop and FxCop tasks).
NOTE: These projects are hand selected to be the minimum # of CSPROJ files that
ensure we've restored every remote package. If another collision is found,
please review the project list as appropriate.
-->
<ItemGroup>
<RestoreCsProjFiles
Include="test\Microsoft.Web.Http.Data.Test\*.csproj;
src\System.Web.WebPages.Administration\*.csproj;
src\System.Web.WebPages.Deployment\*.csproj;
src\Microsoft.Web.WebPages.OAuth\*.csproj" />
</ItemGroup>
<Message Text="Restoring NuGet packages..." Importance="High" />
<!-- Download NuGet.exe -->
<MSBuild
Projects="tools\WebStack.NuGet.targets"
Targets="CheckPrerequisites" />
<!-- Restore the things the CSPROJ files need -->
<MSBuild
Projects="@(RestoreCsProjFiles)"
BuildInParallel="false"
Targets="RestorePackages" />
<!-- Hand restore packages with binaries that this MSBuild process needs -->
<MSBuild
Projects="tools\WebStack.NuGet.targets"
Targets="RestoreBinaryDependencies" />
</Target>
<Target Name="Build" DependsOnTargets="Prereq">
<MakeDir Directories="bin\$(Configuration)" />
<MSBuild
Projects="Runtime.sln"
BuildInParallel="$(BuildInParallel)"
Targets="Build"
Properties="Configuration=$(Configuration);CodeAnalysis=$(CodeAnalysis);StyleCopEnabled=$(StyleCopEnabled)" />
</Target>
<Target Name="UnitTest" DependsOnTargets="Build">
<ItemGroup>
<TestDLLsXunit Include="bin\$(Configuration)\test\*.Test.dll;bin\$(Configuration)\test\*.Test.*.dll" Exclude="**\SPA.Test.dll" />
<XunitProject Include="tools\WebStack.xunit.targets">
<Properties>TestAssembly=%(TestDLLsXunit.FullPath);XmlPath=$(TestResultsDirectory)%(TestDLLsXunit.FileName)-XunitResults.xml</Properties>
</XunitProject>
</ItemGroup>
<MakeDir Directories="$(TestResultsDirectory)" />
<MSBuild Projects="@(XunitProject)" BuildInParallel="$(BuildInParallel)" Targets="Xunit" />
</Target>
</Project>

329
external/aspnetwebstack/Runtime.sln vendored Normal file
View File

@@ -0,0 +1,329 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C40883CD-366D-4534-8B58-3EA0D13136DF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Razor", "src\System.Web.Razor\System.Web.Razor.csproj", "{8F18041B-9410-4C36-A9C5-067813DF5F31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.WebPages.Deployment", "src\System.Web.WebPages.Deployment\System.Web.WebPages.Deployment.csproj", "{22BABB60-8F02-4027-AFFC-ACF069954536}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.WebPages", "src\System.Web.WebPages\System.Web.WebPages.csproj", "{76EFA9C5-8D7E-4FDF-B710-E20F8B6B00D2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Helpers", "src\System.Web.Helpers\System.Web.Helpers.csproj", "{9B7E3740-6161-4548-833C-4BBCA43B970E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.WebPages.Razor", "src\System.Web.WebPages.Razor\System.Web.WebPages.Razor.csproj", "{0939B11A-FE4E-4BA1-8AD6-D97741EE314F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebMatrix.Data", "src\WebMatrix.Data\WebMatrix.Data.csproj", "{4D39BAAF-8A96-473E-AB79-C8A341885137}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebMatrix.WebData", "src\WebMatrix.WebData\WebMatrix.WebData.csproj", "{55A15F40-1435-4248-A7F2-2A146BB83586}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.Helpers", "src\Microsoft.Web.Helpers\Microsoft.Web.Helpers.csproj", "{0C7CE809-0F72-4C19-8C64-D6573E4D9521}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.WebPages.Administration", "src\System.Web.WebPages.Administration\System.Web.WebPages.Administration.csproj", "{C23F02FC-4538-43F5-ABBA-38BA069AEA8F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Mvc", "src\System.Web.Mvc\System.Web.Mvc.csproj", "{3D3FFD8A-624D-4E9B-954B-E1C105507975}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.Mvc", "src\Microsoft.Web.Mvc\Microsoft.Web.Mvc.csproj", "{D3CF7430-6DA4-42B0-BD90-CA39D16687B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Razor.Test", "test\System.Web.Razor.Test\System.Web.Razor.Test.csproj", "{0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.WebPages.Deployment.Test", "test\System.Web.WebPages.Deployment.Test\System.Web.WebPages.Deployment.Test.csproj", "{268DEE9D-F323-4A00-8ED8-3784388C3E3A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.WebPages.Test", "test\System.Web.WebPages.Test\System.Web.WebPages.Test.csproj", "{0F4870DB-A799-4DBA-99DF-0D74BB52FEC2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Helpers.Test", "test\System.Web.Helpers.Test\System.Web.Helpers.Test.csproj", "{D3313BDF-8071-4AC8-9D98-ABF7F9E88A57}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.WebPages.Razor.Test", "test\System.Web.WebPages.Razor.Test\System.Web.WebPages.Razor.Test.csproj", "{66A74F3C-A106-4C1E-BAA0-001908FEA2CA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebMatrix.Data.Test", "test\WebMatrix.Data.Test\WebMatrix.Data.Test.csproj", "{E2D008A9-4D1D-4F6B-8325-4ED717D6EA0A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebMatrix.WebData.Test", "test\WebMatrix.WebData.Test\WebMatrix.WebData.Test.csproj", "{CD48EB41-92A5-4628-A0F7-6A43DF58827E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.Helpers.Test", "test\Microsoft.Web.Helpers.Test\Microsoft.Web.Helpers.Test.csproj", "{2C653A66-8159-4A41-954F-A67915DFDA87}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.WebPages.Administration.Test", "test\System.Web.WebPages.Administration.Test\System.Web.WebPages.Administration.Test.csproj", "{21C729D6-ECF8-47EF-A236-7C6A4272EAF0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Mvc.Test", "test\System.Web.Mvc.Test\System.Web.Mvc.Test.csproj", "{8AC2A2E4-2F11-4D40-A887-62E2583A65E6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.Mvc.Test", "test\Microsoft.Web.Mvc.Test\Microsoft.Web.Mvc.Test.csproj", "{6C28DA70-60F1-4442-967F-591BF3962EC5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http", "src\System.Web.Http\System.Web.Http.csproj", "{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.Test", "test\System.Web.Http.Test\System.Web.Http.Test.csproj", "{7F2C796F-43B2-4F8F-ABFF-A154EC8AAFA1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Json", "src\System.Json\System.Json.csproj", "{F0441BE9-BDC0-4629-BE5A-8765FFAA2481}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting", "src\System.Net.Http.Formatting\System.Net.Http.Formatting.csproj", "{668E9021-CE84-49D9-98FB-DF125A9FCDB0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.TestCommon", "test\Microsoft.TestCommon\Microsoft.TestCommon.csproj", "{FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Json.Test.Unit", "test\System.Json.Test.Unit\System.Json.Test.Unit.csproj", "{EB09CD33-992B-4A31-AB95-8673BA90F1CD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting.Test.Unit", "test\System.Net.Http.Formatting.Test.Unit\System.Net.Http.Formatting.Test.Unit.csproj", "{7AF77741-9158-4D5F-8782-8F21FADF025F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Json.Test.Integration", "test\System.Json.Test.Integration\System.Json.Test.Integration.csproj", "{A7B1264E-BCE5-42A8-8B5E-001A5360B128}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting.Test.Integration", "test\System.Net.Http.Formatting.Test.Integration\System.Net.Http.Formatting.Test.Integration.csproj", "{6C18CC83-1E4C-42D2-B93E-55D6C363850C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.SelfHost", "src\System.Web.Http.SelfHost\System.Web.Http.SelfHost.csproj", "{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.WebHost", "src\System.Web.Http.WebHost\System.Web.Http.WebHost.csproj", "{A0187BC2-8325-4BB2-8697-7F955CF4173E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.Http.Data", "src\Microsoft.Web.Http.Data\Microsoft.Web.Http.Data.csproj", "{ACE91549-D86E-4EB6-8C2A-5FF51386BB68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.Http.Data.EntityFramework", "src\Microsoft.Web.Http.Data.EntityFramework\Microsoft.Web.Http.Data.EntityFramework.csproj", "{653F3946-541C-42D3-BBC1-CE89B392BDA9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.Http.Data.Test", "test\Microsoft.Web.Http.Data.Test\Microsoft.Web.Http.Data.Test.csproj", "{81876811-6C36-492A-9609-F0E85990FBC9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.Integration.Test", "test\System.Web.Http.Integration.Test\System.Web.Http.Integration.Test.csproj", "{3267DFC6-B34D-4011-BC0F-D3B56AF6F608}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.WebHost.Test", "test\System.Web.Http.WebHost.Test\System.Web.Http.WebHost.Test.csproj", "{EA62944F-BD25-4730-9405-9BE8FF5BEACD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.Http.Data.Helpers", "src\Microsoft.Web.Http.Data.Helpers\Microsoft.Web.Http.Data.Helpers.csproj", "{B6895A1B-382F-4A69-99EC-E965E19B0AB3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPA", "src\SPA\SPA.csproj", "{1ACEF677-B6A0-4680-A076-7893DE176D6B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPA.Test", "test\SPA.Test\SPA.Test.csproj", "{7B8601F8-8D1F-4B9C-8C20-772B673A2FA6}"
ProjectSection(ProjectDependencies) = postProject
{1ACEF677-B6A0-4680-A076-7893DE176D6B} = {1ACEF677-B6A0-4680-A076-7893DE176D6B}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.WebPages.OAuth", "src\Microsoft.Web.WebPages.OAuth\Microsoft.Web.WebPages.OAuth.csproj", "{4CBFC7D3-1600-4CE5-BC6B-AC7BC2D6F853}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.WebPages.OAuth.Test", "test\Microsoft.Web.WebPages.OAuth.Test\Microsoft.Web.WebPages.OAuth.Test.csproj", "{694C6EDF-EA52-438F-B745-82B025ECC0E7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.SelfHost.Test", "test\System.Web.Http.SelfHost.Test\System.Web.Http.SelfHost.Test.csproj", "{7F29EE87-6A63-43C6-B7FF-74DD06815830}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F18041B-9410-4C36-A9C5-067813DF5F31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F18041B-9410-4C36-A9C5-067813DF5F31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F18041B-9410-4C36-A9C5-067813DF5F31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F18041B-9410-4C36-A9C5-067813DF5F31}.Release|Any CPU.Build.0 = Release|Any CPU
{22BABB60-8F02-4027-AFFC-ACF069954536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22BABB60-8F02-4027-AFFC-ACF069954536}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22BABB60-8F02-4027-AFFC-ACF069954536}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22BABB60-8F02-4027-AFFC-ACF069954536}.Release|Any CPU.Build.0 = Release|Any CPU
{76EFA9C5-8D7E-4FDF-B710-E20F8B6B00D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76EFA9C5-8D7E-4FDF-B710-E20F8B6B00D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76EFA9C5-8D7E-4FDF-B710-E20F8B6B00D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76EFA9C5-8D7E-4FDF-B710-E20F8B6B00D2}.Release|Any CPU.Build.0 = Release|Any CPU
{9B7E3740-6161-4548-833C-4BBCA43B970E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B7E3740-6161-4548-833C-4BBCA43B970E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B7E3740-6161-4548-833C-4BBCA43B970E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B7E3740-6161-4548-833C-4BBCA43B970E}.Release|Any CPU.Build.0 = Release|Any CPU
{0939B11A-FE4E-4BA1-8AD6-D97741EE314F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0939B11A-FE4E-4BA1-8AD6-D97741EE314F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0939B11A-FE4E-4BA1-8AD6-D97741EE314F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0939B11A-FE4E-4BA1-8AD6-D97741EE314F}.Release|Any CPU.Build.0 = Release|Any CPU
{4D39BAAF-8A96-473E-AB79-C8A341885137}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D39BAAF-8A96-473E-AB79-C8A341885137}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D39BAAF-8A96-473E-AB79-C8A341885137}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D39BAAF-8A96-473E-AB79-C8A341885137}.Release|Any CPU.Build.0 = Release|Any CPU
{55A15F40-1435-4248-A7F2-2A146BB83586}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55A15F40-1435-4248-A7F2-2A146BB83586}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55A15F40-1435-4248-A7F2-2A146BB83586}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55A15F40-1435-4248-A7F2-2A146BB83586}.Release|Any CPU.Build.0 = Release|Any CPU
{0C7CE809-0F72-4C19-8C64-D6573E4D9521}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C7CE809-0F72-4C19-8C64-D6573E4D9521}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C7CE809-0F72-4C19-8C64-D6573E4D9521}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C7CE809-0F72-4C19-8C64-D6573E4D9521}.Release|Any CPU.Build.0 = Release|Any CPU
{C23F02FC-4538-43F5-ABBA-38BA069AEA8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C23F02FC-4538-43F5-ABBA-38BA069AEA8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C23F02FC-4538-43F5-ABBA-38BA069AEA8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C23F02FC-4538-43F5-ABBA-38BA069AEA8F}.Release|Any CPU.Build.0 = Release|Any CPU
{3D3FFD8A-624D-4E9B-954B-E1C105507975}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D3FFD8A-624D-4E9B-954B-E1C105507975}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D3FFD8A-624D-4E9B-954B-E1C105507975}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D3FFD8A-624D-4E9B-954B-E1C105507975}.Release|Any CPU.Build.0 = Release|Any CPU
{D3CF7430-6DA4-42B0-BD90-CA39D16687B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3CF7430-6DA4-42B0-BD90-CA39D16687B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3CF7430-6DA4-42B0-BD90-CA39D16687B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3CF7430-6DA4-42B0-BD90-CA39D16687B2}.Release|Any CPU.Build.0 = Release|Any CPU
{0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE}.Release|Any CPU.Build.0 = Release|Any CPU
{268DEE9D-F323-4A00-8ED8-3784388C3E3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{268DEE9D-F323-4A00-8ED8-3784388C3E3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{268DEE9D-F323-4A00-8ED8-3784388C3E3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{268DEE9D-F323-4A00-8ED8-3784388C3E3A}.Release|Any CPU.Build.0 = Release|Any CPU
{0F4870DB-A799-4DBA-99DF-0D74BB52FEC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F4870DB-A799-4DBA-99DF-0D74BB52FEC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F4870DB-A799-4DBA-99DF-0D74BB52FEC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F4870DB-A799-4DBA-99DF-0D74BB52FEC2}.Release|Any CPU.Build.0 = Release|Any CPU
{D3313BDF-8071-4AC8-9D98-ABF7F9E88A57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3313BDF-8071-4AC8-9D98-ABF7F9E88A57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3313BDF-8071-4AC8-9D98-ABF7F9E88A57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3313BDF-8071-4AC8-9D98-ABF7F9E88A57}.Release|Any CPU.Build.0 = Release|Any CPU
{66A74F3C-A106-4C1E-BAA0-001908FEA2CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66A74F3C-A106-4C1E-BAA0-001908FEA2CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66A74F3C-A106-4C1E-BAA0-001908FEA2CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66A74F3C-A106-4C1E-BAA0-001908FEA2CA}.Release|Any CPU.Build.0 = Release|Any CPU
{E2D008A9-4D1D-4F6B-8325-4ED717D6EA0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2D008A9-4D1D-4F6B-8325-4ED717D6EA0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2D008A9-4D1D-4F6B-8325-4ED717D6EA0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2D008A9-4D1D-4F6B-8325-4ED717D6EA0A}.Release|Any CPU.Build.0 = Release|Any CPU
{CD48EB41-92A5-4628-A0F7-6A43DF58827E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CD48EB41-92A5-4628-A0F7-6A43DF58827E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD48EB41-92A5-4628-A0F7-6A43DF58827E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD48EB41-92A5-4628-A0F7-6A43DF58827E}.Release|Any CPU.Build.0 = Release|Any CPU
{2C653A66-8159-4A41-954F-A67915DFDA87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C653A66-8159-4A41-954F-A67915DFDA87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C653A66-8159-4A41-954F-A67915DFDA87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C653A66-8159-4A41-954F-A67915DFDA87}.Release|Any CPU.Build.0 = Release|Any CPU
{21C729D6-ECF8-47EF-A236-7C6A4272EAF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21C729D6-ECF8-47EF-A236-7C6A4272EAF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21C729D6-ECF8-47EF-A236-7C6A4272EAF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21C729D6-ECF8-47EF-A236-7C6A4272EAF0}.Release|Any CPU.Build.0 = Release|Any CPU
{8AC2A2E4-2F11-4D40-A887-62E2583A65E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8AC2A2E4-2F11-4D40-A887-62E2583A65E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8AC2A2E4-2F11-4D40-A887-62E2583A65E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AC2A2E4-2F11-4D40-A887-62E2583A65E6}.Release|Any CPU.Build.0 = Release|Any CPU
{6C28DA70-60F1-4442-967F-591BF3962EC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6C28DA70-60F1-4442-967F-591BF3962EC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C28DA70-60F1-4442-967F-591BF3962EC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C28DA70-60F1-4442-967F-591BF3962EC5}.Release|Any CPU.Build.0 = Release|Any CPU
{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440}.Release|Any CPU.Build.0 = Release|Any CPU
{7F2C796F-43B2-4F8F-ABFF-A154EC8AAFA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F2C796F-43B2-4F8F-ABFF-A154EC8AAFA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F2C796F-43B2-4F8F-ABFF-A154EC8AAFA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F2C796F-43B2-4F8F-ABFF-A154EC8AAFA1}.Release|Any CPU.Build.0 = Release|Any CPU
{F0441BE9-BDC0-4629-BE5A-8765FFAA2481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0441BE9-BDC0-4629-BE5A-8765FFAA2481}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0441BE9-BDC0-4629-BE5A-8765FFAA2481}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0441BE9-BDC0-4629-BE5A-8765FFAA2481}.Release|Any CPU.Build.0 = Release|Any CPU
{668E9021-CE84-49D9-98FB-DF125A9FCDB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{668E9021-CE84-49D9-98FB-DF125A9FCDB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{668E9021-CE84-49D9-98FB-DF125A9FCDB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{668E9021-CE84-49D9-98FB-DF125A9FCDB0}.Release|Any CPU.Build.0 = Release|Any CPU
{FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0}.Release|Any CPU.Build.0 = Release|Any CPU
{EB09CD33-992B-4A31-AB95-8673BA90F1CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB09CD33-992B-4A31-AB95-8673BA90F1CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB09CD33-992B-4A31-AB95-8673BA90F1CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB09CD33-992B-4A31-AB95-8673BA90F1CD}.Release|Any CPU.Build.0 = Release|Any CPU
{7AF77741-9158-4D5F-8782-8F21FADF025F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7AF77741-9158-4D5F-8782-8F21FADF025F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7AF77741-9158-4D5F-8782-8F21FADF025F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7AF77741-9158-4D5F-8782-8F21FADF025F}.Release|Any CPU.Build.0 = Release|Any CPU
{A7B1264E-BCE5-42A8-8B5E-001A5360B128}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A7B1264E-BCE5-42A8-8B5E-001A5360B128}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7B1264E-BCE5-42A8-8B5E-001A5360B128}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7B1264E-BCE5-42A8-8B5E-001A5360B128}.Release|Any CPU.Build.0 = Release|Any CPU
{6C18CC83-1E4C-42D2-B93E-55D6C363850C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6C18CC83-1E4C-42D2-B93E-55D6C363850C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C18CC83-1E4C-42D2-B93E-55D6C363850C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C18CC83-1E4C-42D2-B93E-55D6C363850C}.Release|Any CPU.Build.0 = Release|Any CPU
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.Release|Any CPU.Build.0 = Release|Any CPU
{A0187BC2-8325-4BB2-8697-7F955CF4173E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0187BC2-8325-4BB2-8697-7F955CF4173E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0187BC2-8325-4BB2-8697-7F955CF4173E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0187BC2-8325-4BB2-8697-7F955CF4173E}.Release|Any CPU.Build.0 = Release|Any CPU
{ACE91549-D86E-4EB6-8C2A-5FF51386BB68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACE91549-D86E-4EB6-8C2A-5FF51386BB68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACE91549-D86E-4EB6-8C2A-5FF51386BB68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACE91549-D86E-4EB6-8C2A-5FF51386BB68}.Release|Any CPU.Build.0 = Release|Any CPU
{653F3946-541C-42D3-BBC1-CE89B392BDA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{653F3946-541C-42D3-BBC1-CE89B392BDA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{653F3946-541C-42D3-BBC1-CE89B392BDA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{653F3946-541C-42D3-BBC1-CE89B392BDA9}.Release|Any CPU.Build.0 = Release|Any CPU
{81876811-6C36-492A-9609-F0E85990FBC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81876811-6C36-492A-9609-F0E85990FBC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81876811-6C36-492A-9609-F0E85990FBC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81876811-6C36-492A-9609-F0E85990FBC9}.Release|Any CPU.Build.0 = Release|Any CPU
{3267DFC6-B34D-4011-BC0F-D3B56AF6F608}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3267DFC6-B34D-4011-BC0F-D3B56AF6F608}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3267DFC6-B34D-4011-BC0F-D3B56AF6F608}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3267DFC6-B34D-4011-BC0F-D3B56AF6F608}.Release|Any CPU.Build.0 = Release|Any CPU
{EA62944F-BD25-4730-9405-9BE8FF5BEACD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA62944F-BD25-4730-9405-9BE8FF5BEACD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA62944F-BD25-4730-9405-9BE8FF5BEACD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA62944F-BD25-4730-9405-9BE8FF5BEACD}.Release|Any CPU.Build.0 = Release|Any CPU
{B6895A1B-382F-4A69-99EC-E965E19B0AB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6895A1B-382F-4A69-99EC-E965E19B0AB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6895A1B-382F-4A69-99EC-E965E19B0AB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6895A1B-382F-4A69-99EC-E965E19B0AB3}.Release|Any CPU.Build.0 = Release|Any CPU
{1ACEF677-B6A0-4680-A076-7893DE176D6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1ACEF677-B6A0-4680-A076-7893DE176D6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1ACEF677-B6A0-4680-A076-7893DE176D6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1ACEF677-B6A0-4680-A076-7893DE176D6B}.Release|Any CPU.Build.0 = Release|Any CPU
{7B8601F8-8D1F-4B9C-8C20-772B673A2FA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B8601F8-8D1F-4B9C-8C20-772B673A2FA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CBFC7D3-1600-4CE5-BC6B-AC7BC2D6F853}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CBFC7D3-1600-4CE5-BC6B-AC7BC2D6F853}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CBFC7D3-1600-4CE5-BC6B-AC7BC2D6F853}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CBFC7D3-1600-4CE5-BC6B-AC7BC2D6F853}.Release|Any CPU.Build.0 = Release|Any CPU
{694C6EDF-EA52-438F-B745-82B025ECC0E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{694C6EDF-EA52-438F-B745-82B025ECC0E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{694C6EDF-EA52-438F-B745-82B025ECC0E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{694C6EDF-EA52-438F-B745-82B025ECC0E7}.Release|Any CPU.Build.0 = Release|Any CPU
{7F29EE87-6A63-43C6-B7FF-74DD06815830}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F29EE87-6A63-43C6-B7FF-74DD06815830}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F29EE87-6A63-43C6-B7FF-74DD06815830}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F29EE87-6A63-43C6-B7FF-74DD06815830}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8F18041B-9410-4C36-A9C5-067813DF5F31} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{22BABB60-8F02-4027-AFFC-ACF069954536} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{76EFA9C5-8D7E-4FDF-B710-E20F8B6B00D2} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{9B7E3740-6161-4548-833C-4BBCA43B970E} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{0939B11A-FE4E-4BA1-8AD6-D97741EE314F} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{4D39BAAF-8A96-473E-AB79-C8A341885137} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{55A15F40-1435-4248-A7F2-2A146BB83586} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{0C7CE809-0F72-4C19-8C64-D6573E4D9521} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{C23F02FC-4538-43F5-ABBA-38BA069AEA8F} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{3D3FFD8A-624D-4E9B-954B-E1C105507975} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{D3CF7430-6DA4-42B0-BD90-CA39D16687B2} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{F0441BE9-BDC0-4629-BE5A-8765FFAA2481} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{668E9021-CE84-49D9-98FB-DF125A9FCDB0} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{A0187BC2-8325-4BB2-8697-7F955CF4173E} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{ACE91549-D86E-4EB6-8C2A-5FF51386BB68} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{653F3946-541C-42D3-BBC1-CE89B392BDA9} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{B6895A1B-382F-4A69-99EC-E965E19B0AB3} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{1ACEF677-B6A0-4680-A076-7893DE176D6B} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{4CBFC7D3-1600-4CE5-BC6B-AC7BC2D6F853} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
{0BB62A1D-E6B5-49FA-9E3C-6AF679A66DFE} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{268DEE9D-F323-4A00-8ED8-3784388C3E3A} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{0F4870DB-A799-4DBA-99DF-0D74BB52FEC2} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{D3313BDF-8071-4AC8-9D98-ABF7F9E88A57} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{66A74F3C-A106-4C1E-BAA0-001908FEA2CA} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{E2D008A9-4D1D-4F6B-8325-4ED717D6EA0A} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{CD48EB41-92A5-4628-A0F7-6A43DF58827E} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{2C653A66-8159-4A41-954F-A67915DFDA87} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{21C729D6-ECF8-47EF-A236-7C6A4272EAF0} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{8AC2A2E4-2F11-4D40-A887-62E2583A65E6} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{6C28DA70-60F1-4442-967F-591BF3962EC5} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{7F2C796F-43B2-4F8F-ABFF-A154EC8AAFA1} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{EB09CD33-992B-4A31-AB95-8673BA90F1CD} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{7AF77741-9158-4D5F-8782-8F21FADF025F} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{A7B1264E-BCE5-42A8-8B5E-001A5360B128} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{6C18CC83-1E4C-42D2-B93E-55D6C363850C} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{81876811-6C36-492A-9609-F0E85990FBC9} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{3267DFC6-B34D-4011-BC0F-D3B56AF6F608} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{EA62944F-BD25-4730-9405-9BE8FF5BEACD} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{7B8601F8-8D1F-4B9C-8C20-772B673A2FA6} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{694C6EDF-EA52-438F-B745-82B025ECC0E7} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
{7F29EE87-6A63-43C6-B7FF-74DD06815830} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
EndGlobalSection
EndGlobal

18
external/aspnetwebstack/Runtime.xunit vendored Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<xunit>
<assemblies>
<assembly filename="bin\Debug\Test\Microsoft.Web.Helpers.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\System.Web.Http.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\Microsoft.Web.Mvc.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\System.Web.Helpers.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\System.Web.Mvc.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\System.Web.Razor.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\System.Web.WebPages.Administration.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\System.Web.WebPages.Deployment.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\System.Web.WebPages.Razor.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\System.Web.WebPages.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\WebMatrix.Data.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\Test\WebMatrix.WebData.Test.dll" shadow-copy="true" />
<assembly filename="bin\Debug\System.Web.Http.Test.Sample.dll" shadow-copy="true" />
</assemblies>
</xunit>

View File

@@ -0,0 +1,109 @@
<StyleCopSettings Version="4.3">
<!--
This file was cloned directly from ndp\cdf\src
to apply ADP conventions to all product source.
-->
<GlobalSettings>
<StringProperty Name="MergeSettingsFiles">NoMerge</StringProperty>
</GlobalSettings>
<Analyzers>
<Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.NamingRules">
<AnalyzerSettings>
<CollectionProperty Name="Hungarian">
<Value>as</Value>
<Value>db</Value>
<Value>dc</Value>
<Value>do</Value>
<Value>ef</Value>
<Value>id</Value>
<Value>if</Value>
<Value>in</Value>
<Value>is</Value>
<Value>my</Value>
<Value>no</Value>
<Value>on</Value>
<Value>sl</Value>
<Value>to</Value>
<Value>ui</Value>
<Value>vs</Value>
</CollectionProperty>
</AnalyzerSettings>
</Analyzer>
<Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.DocumentationRules">
<AnalyzerSettings>
<BooleanProperty Name="IgnorePrivates">True</BooleanProperty>
<BooleanProperty Name="IgnoreInternals">True</BooleanProperty>
<StringProperty Name="Copyright">Copyright (c) Microsoft Corporation. All rights reserved.</StringProperty>
</AnalyzerSettings>
<Rules>
<Rule Name="FileMustHaveHeader">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<!-- Per ADP guidelines, the file header does not need to contain the name of the file. -->
<Rule Name="FileHeaderMustContainFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<!-- Per ADP guidelines, the file header does not need to contain a Company attribute. -->
<Rule Name="FileHeaderMustHaveValidCompanyText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<!-- Per ADP guidelines, constructor summary documentation does not have to match a specific format, since they are not directly consumed for external documentation. -->
<Rule Name="ConstructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<!-- Per ADP guidelines, destructor summary documentation does not have to match a specific format, since they are not directly consumed for external documentation. -->
<Rule Name="DestructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<!-- Per ADP guidelines, documentation headers can contain blank lines, since they are not directly consumed for external documentation. -->
<Rule Name="DocumentationHeadersMustNotContainBlankLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
</Analyzer>
<Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.ReadabilityRules">
<Rules>
<!-- Per ADP guidelines, the use of regions is not allowed (copied from CSD guidelines doc) -->
<Rule Name="DoNotUseRegions">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<!-- Per ADP guidelines, method parameter are allowed to span across multiple lines (rather than having to be assigned to a temporary variable). -->
<Rule Name="ParameterMustNotSpanMultipleLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
</Analyzer>
</Analyzers>
</StyleCopSettings>

30
external/aspnetwebstack/build.cmd vendored Normal file
View File

@@ -0,0 +1,30 @@
@echo off
pushd %~dp0
if exist bin goto build
mkdir bin
:Build
if "%1" == "" goto BuildDefaults
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild Runtime.msbuild /m /nr:false /t:%* /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
if errorlevel 1 goto BuildFail
goto BuildSuccess
:BuildDefaults
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild Runtime.msbuild /m /nr:false /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
if errorlevel 1 goto BuildFail
goto BuildSuccess
:BuildFail
echo.
echo *** BUILD FAILED ***
goto End
:BuildSuccess
echo.
echo **** BUILD SUCCESSFUL ***
goto end
:End
popd

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\src\Microsoft.Web.Http.Data.EntityFramework\packages.config" />
<repository path="..\src\Microsoft.Web.Http.Data.Helpers\packages.config" />
<repository path="..\src\Microsoft.Web.Http.Data\packages.config" />
<repository path="..\src\Microsoft.Web.WebPages.OAuth\packages.config" />
<repository path="..\src\System.Net.Http.Formatting\packages.config" />
<repository path="..\src\System.Web.Http.SelfHost\packages.config" />
<repository path="..\src\System.Web.Http.WebHost\packages.config" />
<repository path="..\src\System.Web.Http\packages.config" />
<repository path="..\src\System.Web.Mvc\packages.config" />
<repository path="..\src\System.Web.WebPages.Administration\packages.config" />
<repository path="..\src\System.Web.WebPages.Deployment\packages.config" />
<repository path="..\src\System.Web.WebPages\packages.config" />
<repository path="..\test\Microsoft.TestCommon\packages.config" />
<repository path="..\test\Microsoft.Web.Helpers.Test\packages.config" />
<repository path="..\test\Microsoft.Web.Http.Data.Test\packages.config" />
<repository path="..\test\Microsoft.Web.Mvc.Test\packages.config" />
<repository path="..\test\Microsoft.Web.WebPages.OAuth.Test\packages.config" />
<repository path="..\test\System.Json.Test.Integration\packages.config" />
<repository path="..\test\System.Json.Test.Unit\packages.config" />
<repository path="..\test\System.Net.Http.Formatting.Test.Integration\packages.config" />
<repository path="..\test\System.Net.Http.Formatting.Test.Unit\packages.config" />
<repository path="..\test\System.Web.Helpers.Test\packages.config" />
<repository path="..\test\System.Web.Http.Integration.Test\packages.config" />
<repository path="..\test\System.Web.Http.SelfHost.Test\packages.config" />
<repository path="..\test\System.Web.Http.Test\packages.config" />
<repository path="..\test\System.Web.Http.WebHost.Test\packages.config" />
<repository path="..\test\System.Web.Mvc.Test\packages.config" />
<repository path="..\test\System.Web.Razor.Test\packages.config" />
<repository path="..\test\System.Web.WebPages.Administration.Test\packages.config" />
<repository path="..\test\System.Web.WebPages.Deployment.Test\packages.config" />
<repository path="..\test\System.Web.WebPages.Razor.Test\packages.config" />
<repository path="..\test\System.Web.WebPages.Test\packages.config" />
<repository path="..\test\WebMatrix.Data.Test\packages.config" />
<repository path="..\test\WebMatrix.WebData.Test\packages.config" />
</repositories>

View File

@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Security;
//// REVIEW: RonCain -- This version is used by the WebStackRuntime assemblies that use types
//// from System.ComponentModelDataAnnotations which is not [SecurityTransparent]
//// in .Net 4.0. Attempting to make the WebStackRuntime assemblies be
//// [SecurityTransparent] results in security exceptions on any type reference
//// to DataAnnotations.
//// Search for [SecuritySafeCritical] in WebStackRuntime
//// assemblies to find the places that rely on this use of [Aptca]
[assembly: AllowPartiallyTrustedCallers]

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8" ?>
<Dictionary>
<Words>
<Recognized>
<Word>Multi</Word>
<Word>Bitly</Word>
<Word>Digg</Word>
<Word>Facebook</Word>
<Word>Reddit</Word>
<Word>Captcha</Word>
<Word>Facebook</Word>
<Word>Gravatar</Word>
<Word>JSON</Word>
<Word>Lookahead</Word>
<Word>MVC</Word>
<Word>Param</Word>
<Word>Params</Word>
<Word>Pluralizer</Word>
<Word>Pragma</Word>
<Word>Pragmas</Word>
<Word>Templating</Word>
<Word>Unvalidated</Word>
<Word>Validator</Word>
<Word>Validators</Word>
<Word>Validatable</Word>
<Word>WebPage</Word>
<Word>cshtml</Word>
<Word>vbhtml</Word>
<Word>asax</Word>
<Word>Eval</Word>
<Word>Src</Word>
<Word>Charset</Word>
<Word>Coords</Word>
<Word>Rel</Word>
<Word>Dto</Word>
<Word>Tokenizer</Word>
<Word>ReDim</Word>
<Word>OAuth</Word>
<Word>OpenID</Word>
<Word>Yadis</Word>
</Recognized>
<Compound>
<Term CompoundAlternate="WebPage">WebPage</Term>
<Term CompoundAlternate="TimeLine">TimeLine</Term>
<Term CompoundAlternate="OAuth">oAuth</Term>
<Term CompoundAlternate="UserName">userName</Term>
</Compound>
</Words>
<Acronyms>
<CasingExceptions>
<Acronym>ID</Acronym>
<Acronym>Db</Acronym>
<Acronym>Dto</Acronym>
</CasingExceptions>
</Acronyms>
</Dictionary>

View File

@@ -0,0 +1,134 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17613
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace System.Web.Http.Properties {
using System;
using System.Linq;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class CommonWebApiResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal CommonWebApiResources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
// Find the CommonResources.resources file's full resource name in this assembly
string commonResourcesName = global::System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames().Where(s => s.EndsWith("CommonWebApiResources.resources", StringComparison.OrdinalIgnoreCase)).Single();
// Trim off the ".resources"
commonResourcesName = commonResourcesName.Substring(0, commonResourcesName.Length - 10);
// Load the resource manager
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(commonResourcesName, typeof(CommonWebApiResources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Relative URI values are not supported: &apos;{0}&apos;. The URI must be absolute..
/// </summary>
internal static string ArgumentInvalidAbsoluteUri {
get {
return ResourceManager.GetString("ArgumentInvalidAbsoluteUri", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unsupported URI scheme: &apos;{0}&apos;. The URI scheme must be either &apos;{1}&apos; or &apos;{2}&apos;..
/// </summary>
internal static string ArgumentInvalidHttpUriScheme {
get {
return ResourceManager.GetString("ArgumentInvalidHttpUriScheme", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Value must be greater than or equal to {0}..
/// </summary>
internal static string ArgumentMustBeGreaterThanOrEqualTo {
get {
return ResourceManager.GetString("ArgumentMustBeGreaterThanOrEqualTo", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Value must be less than or equal to {0}..
/// </summary>
internal static string ArgumentMustBeLessThanOrEqualTo {
get {
return ResourceManager.GetString("ArgumentMustBeLessThanOrEqualTo", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The argument &apos;{0}&apos; is null or empty..
/// </summary>
internal static string ArgumentNullOrEmpty {
get {
return ResourceManager.GetString("ArgumentNullOrEmpty", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to URI must not contain a query component or a fragment identifier..
/// </summary>
internal static string ArgumentUriHasQueryOrFragment {
get {
return ResourceManager.GetString("ArgumentUriHasQueryOrFragment", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The &apos;{0}&apos; must contain an item named &apos;{1}&apos; with a value of type &apos;{2}&apos;..
/// </summary>
internal static string DictionaryMissingRequiredValue {
get {
return ResourceManager.GetString("DictionaryMissingRequiredValue", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ArgumentInvalidAbsoluteUri" xml:space="preserve">
<value>Relative URI values are not supported: '{0}'. The URI must be absolute.</value>
</data>
<data name="ArgumentInvalidHttpUriScheme" xml:space="preserve">
<value>Unsupported URI scheme: '{0}'. The URI scheme must be either '{1}' or '{2}'.</value>
</data>
<data name="ArgumentMustBeGreaterThanOrEqualTo" xml:space="preserve">
<value>Value must be greater than or equal to {0}.</value>
</data>
<data name="ArgumentMustBeLessThanOrEqualTo" xml:space="preserve">
<value>Value must be less than or equal to {0}.</value>
</data>
<data name="ArgumentNullOrEmpty" xml:space="preserve">
<value>The argument '{0}' is null or empty.</value>
</data>
<data name="ArgumentUriHasQueryOrFragment" xml:space="preserve">
<value>URI must not contain a query component or a fragment identifier.</value>
</data>
<data name="DictionaryMissingRequiredValue" xml:space="preserve">
<value>The '{0}' must contain an item named '{1}' with a value of type '{2}'.</value>
</data>
</root>

View File

@@ -0,0 +1,149 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Web.Http.Properties;
namespace System.Web.Http
{
/// <summary>
/// Extension methods for <see cref="IDictionary{TKey,TValue}"/>.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
internal static class DictionaryExtensions
{
/// <summary>
/// Gets the value of <typeparamref name="T"/> associated with the specified key or <c>default</c> value if
/// either the key is not present or the value is not of type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of the value associated with the specified key.</typeparam>
/// <param name="collection">The <see cref="IDictionary{TKey,TValue}"/> instance where <c>TValue</c> is <c>object</c>.</param>
/// <param name="key">The key whose value to get.</param>
/// <param name="value">When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter.</param>
/// <returns><c>true</c> if key was found, value is non-null, and value is of type <typeparamref name="T"/>; otherwise false.</returns>
public static bool TryGetValue<T>(this IDictionary<string, object> collection, string key, out T value)
{
if (collection == null)
{
throw Error.ArgumentNull("collection");
}
object valueObj;
if (collection.TryGetValue(key, out valueObj))
{
if (valueObj is T)
{
value = (T)valueObj;
return true;
}
}
value = default(T);
return false;
}
/// <summary>
/// Gets the value of <typeparamref name="T"/> associated with the specified key or throw an <see cref="T:System.InvalidOperationException"/>
/// if either the key is not present or the value is not of type <typeparamref name="T"/>.
/// </summary>
/// <param name="collection">The <see cref="IDictionary{TKey,TValue}"/> instance where <c>TValue</c> is <c>object</c>.</param>
/// <param name="key">The key whose value to get.</param>
/// <returns>An instance of type <typeparam name="T"/>.</returns>
public static T GetValue<T>(this IDictionary<string, object> collection, string key)
{
if (collection == null)
{
throw Error.ArgumentNull("collection");
}
T value;
if (collection.TryGetValue(key, out value))
{
return value;
}
throw Error.InvalidOperation(CommonWebApiResources.DictionaryMissingRequiredValue, collection.GetType().Name, key, typeof(T).Name);
}
internal static IEnumerable<KeyValuePair<string, TValue>> FindKeysWithPrefix<TValue>(this IDictionary<string, TValue> dictionary, string prefix)
{
if (dictionary == null)
{
throw Error.ArgumentNull("dictionary");
}
if (prefix == null)
{
throw Error.ArgumentNull("prefix");
}
TValue exactMatchValue;
if (dictionary.TryGetValue(prefix, out exactMatchValue))
{
yield return new KeyValuePair<string, TValue>(prefix, exactMatchValue);
}
foreach (var entry in dictionary)
{
string key = entry.Key;
if (key.Length <= prefix.Length)
{
continue;
}
if (!key.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
{
continue;
}
// Everything is prefixed by the empty string
if (prefix.Length == 0)
{
yield return entry;
}
else
{
char charAfterPrefix = key[prefix.Length];
switch (charAfterPrefix)
{
case '[':
case '.':
yield return entry;
break;
}
}
}
}
internal static bool DoesAnyKeyHavePrefix<TValue>(this IDictionary<string, TValue> dictionary, string prefix)
{
return FindKeysWithPrefix(dictionary, prefix).Any();
}
/// <summary>
/// Adds a key/value pair of type <typeparamref name="T"/> to the <see cref="T:System.Collections.Concurrent.ConcurrentDictionary{object, object}"/>
/// if the key does not already exist.
/// </summary>
/// <typeparam name="T">The actual type of the dictionary value.</typeparam>
/// <param name="concurrentPropertyBag">A dictionary.</param>
/// <param name="key">The key of the element to add.</param>
/// <param name="factory">The function used to generate a value for the <paramref name="key"/>.</param>
/// <returns> The value for the key. This will be either the existing value for the <paramref name="key"/> if the key is already in the dictionary,
/// or the new value for the key as returned by <paramref name="factory"/> if the key was not in the dictionary.</returns>
internal static T GetOrAdd<T>(this ConcurrentDictionary<object, object> concurrentPropertyBag, object key, Func<object, T> factory)
{
Contract.Assert(concurrentPropertyBag != null);
Contract.Assert(key != null);
Contract.Assert(factory != null);
// SIMPLIFYING ASSUMPTION: this method is internal and keys are private so it's assumed that client code won't be able to
// replace the value with an object of a different type.
return (T)concurrentPropertyBag.GetOrAdd(key, valueFactory: k => factory(k));
}
}
}

View File

@@ -0,0 +1,263 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Web.Http.Properties;
namespace System.Web.Http
{
/// <summary>
/// Utility class for creating and unwrapping <see cref="Exception"/> instances.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error", Justification = "This usage is okay.")]
internal static class Error
{
/// <summary>
/// Formats the specified resource string using <see cref="M:CultureInfo.CurrentCulture"/>.
/// </summary>
/// <param name="format">A composite format string.</param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
/// <returns>The formatted string.</returns>
[SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = "0#", Justification = "Standard String.Format pattern and names.")]
internal static string Format(string format, params object[] args)
{
return String.Format(CultureInfo.CurrentCulture, format, args);
}
/// <summary>
/// Creates an <see cref="ArgumentException"/> with the provided properties.
/// </summary>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentException Argument(string messageFormat, params object[] messageArgs)
{
return new ArgumentException(Error.Format(messageFormat, messageArgs));
}
/// <summary>
/// Creates an <see cref="ArgumentException"/> with the provided properties.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentException Argument(string parameterName, string messageFormat, params object[] messageArgs)
{
return new ArgumentException(Error.Format(messageFormat, messageArgs), parameterName);
}
/// <summary>
/// Creates an <see cref="ArgumentException"/> with a message saying that the argument must be an "http" or "https" URI.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <param name="actualValue">The value of the argument that causes this exception.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentException ArgumentUriNotHttpOrHttpsScheme(string parameterName, Uri actualValue)
{
return new ArgumentException(Error.Format(CommonWebApiResources.ArgumentInvalidHttpUriScheme, actualValue, Uri.UriSchemeHttp, Uri.UriSchemeHttps), parameterName);
}
/// <summary>
/// Creates an <see cref="ArgumentException"/> with a message saying that the argument must be an absolute URI.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <param name="actualValue">The value of the argument that causes this exception.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentException ArgumentUriNotAbsolute(string parameterName, Uri actualValue)
{
return new ArgumentException(Error.Format(CommonWebApiResources.ArgumentInvalidAbsoluteUri, actualValue), parameterName);
}
/// <summary>
/// Creates an <see cref="ArgumentException"/> with a message saying that the argument must be an absolute URI
/// without a query or fragment identifier and then logs it with <see cref="F:TraceLevel.Error"/>.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <param name="actualValue">The value of the argument that causes this exception.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentException ArgumentUriHasQueryOrFragment(string parameterName, Uri actualValue)
{
return new ArgumentException(Error.Format(CommonWebApiResources.ArgumentUriHasQueryOrFragment, actualValue), parameterName);
}
/// <summary>
/// Creates an <see cref="ArgumentNullException"/> with the provided properties.
/// </summary>
/// <returns>The logged <see cref="Exception"/>.</returns>
[SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly", Justification = "The purpose of this API is to return an error for properties")]
internal static ArgumentNullException PropertyNull()
{
return new ArgumentNullException("value");
}
/// <summary>
/// Creates an <see cref="ArgumentNullException"/> with the provided properties.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentNullException ArgumentNull(string parameterName)
{
return new ArgumentNullException(parameterName);
}
/// <summary>
/// Creates an <see cref="ArgumentNullException"/> with the provided properties.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentNullException ArgumentNull(string parameterName, string messageFormat, params object[] messageArgs)
{
return new ArgumentNullException(parameterName, Error.Format(messageFormat, messageArgs));
}
/// <summary>
/// Creates an <see cref="ArgumentException"/> with a default message.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentException ArgumentNullOrEmpty(string parameterName)
{
return Error.Argument(parameterName, CommonWebApiResources.ArgumentNullOrEmpty, parameterName);
}
/// <summary>
/// Creates an <see cref="ArgumentOutOfRangeException"/> with the provided properties.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <param name="actualValue">The value of the argument that causes this exception.</param>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentOutOfRangeException ArgumentOutOfRange(string parameterName, object actualValue, string messageFormat, params object[] messageArgs)
{
return new ArgumentOutOfRangeException(parameterName, actualValue, Error.Format(messageFormat, messageArgs));
}
/// <summary>
/// Creates an <see cref="ArgumentOutOfRangeException"/> with a message saying that the argument must be greater than or equal to <paramref name="minValue"/>.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <param name="actualValue">The value of the argument that causes this exception.</param>
/// <param name="minValue">The minimum size of the argument.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentOutOfRangeException ArgumentGreaterThanOrEqualTo(string parameterName, object actualValue, object minValue)
{
return new ArgumentOutOfRangeException(parameterName, actualValue, Error.Format(CommonWebApiResources.ArgumentMustBeGreaterThanOrEqualTo, minValue));
}
/// <summary>
/// Creates an <see cref="ArgumentOutOfRangeException"/> with a message saying that the argument must be less than or equal to <paramref name="maxValue"/>.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <param name="actualValue">The value of the argument that causes this exception.</param>
/// <param name="maxValue">The maximum size of the argument.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ArgumentOutOfRangeException ArgumentMustBeLessThanOrEqualTo(string parameterName, object actualValue, object maxValue)
{
return new ArgumentOutOfRangeException(parameterName, actualValue, Error.Format(CommonWebApiResources.ArgumentMustBeLessThanOrEqualTo, maxValue));
}
/// <summary>
/// Creates an <see cref="KeyNotFoundException"/> with a message saying that the key was not found.
/// </summary>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static KeyNotFoundException KeyNotFound()
{
return new KeyNotFoundException();
}
/// <summary>
/// Creates an <see cref="KeyNotFoundException"/> with a message saying that the key was not found.
/// </summary>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static KeyNotFoundException KeyNotFound(string messageFormat, params object[] messageArgs)
{
return new KeyNotFoundException(Error.Format(messageFormat, messageArgs));
}
/// <summary>
/// Creates an <see cref="ObjectDisposedException"/> initialized according to guidelines.
/// </summary>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static ObjectDisposedException ObjectDisposed(string messageFormat, params object[] messageArgs)
{
// Pass in null, not disposedObject.GetType().FullName as per the above guideline
return new ObjectDisposedException(null, Error.Format(messageFormat, messageArgs));
}
/// <summary>
/// Creates an <see cref="OperationCanceledException"/> initialized with the provided parameters.
/// </summary>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static OperationCanceledException OperationCanceled()
{
return new OperationCanceledException();
}
/// <summary>
/// Creates an <see cref="OperationCanceledException"/> initialized with the provided parameters.
/// </summary>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static OperationCanceledException OperationCanceled(string messageFormat, params object[] messageArgs)
{
return new OperationCanceledException(Error.Format(messageFormat, messageArgs));
}
/// <summary>
/// Creates an <see cref="InvalidEnumArgumentException"/>.
/// </summary>
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
/// <param name="invalidValue">The value of the argument that failed.</param>
/// <param name="enumClass">A <see cref="Type"/> that represents the enumeration class with the valid values.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static InvalidEnumArgumentException InvalidEnumArgument(string parameterName, int invalidValue, Type enumClass)
{
return new InvalidEnumArgumentException(parameterName, invalidValue, enumClass);
}
/// <summary>
/// Creates an <see cref="InvalidOperationException"/>.
/// </summary>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static InvalidOperationException InvalidOperation(string messageFormat, params object[] messageArgs)
{
return new InvalidOperationException(Error.Format(messageFormat, messageArgs));
}
/// <summary>
/// Creates an <see cref="InvalidOperationException"/>.
/// </summary>
/// <param name="innerException">Inner exception</param>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static InvalidOperationException InvalidOperation(Exception innerException, string messageFormat, params object[] messageArgs)
{
return new InvalidOperationException(Error.Format(messageFormat, messageArgs), innerException);
}
/// <summary>
/// Creates an <see cref="NotSupportedException"/>.
/// </summary>
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
/// <returns>The logged <see cref="Exception"/>.</returns>
internal static NotSupportedException NotSupported(string messageFormat, params object[] messageArgs)
{
return new NotSupportedException(Error.Format(messageFormat, messageArgs));
}
}
}

View File

@@ -0,0 +1,62 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Net.Http;
namespace System.Web.Http
{
/// <summary>
/// Various helper methods for the static members of <see cref="HttpMethod"/>.
/// </summary>
internal static class HttpMethodHelper
{
/// <summary>
/// Gets the static <see cref="HttpMethod"/> instance for any given HTTP method name.
/// </summary>
/// <param name="method">The HTTP request method.</param>
/// <returns>An existing static <see cref="HttpMethod"/> or a new instance if the method was not found.</returns>
internal static HttpMethod GetHttpMethod(string method)
{
if (String.IsNullOrEmpty(method))
{
return null;
}
if (String.Equals("GET", method, StringComparison.OrdinalIgnoreCase))
{
return HttpMethod.Get;
}
if (String.Equals("POST", method, StringComparison.OrdinalIgnoreCase))
{
return HttpMethod.Post;
}
if (String.Equals("PUT", method, StringComparison.OrdinalIgnoreCase))
{
return HttpMethod.Put;
}
if (String.Equals("DELETE", method, StringComparison.OrdinalIgnoreCase))
{
return HttpMethod.Delete;
}
if (String.Equals("HEAD", method, StringComparison.OrdinalIgnoreCase))
{
return HttpMethod.Head;
}
if (String.Equals("OPTIONS", method, StringComparison.OrdinalIgnoreCase))
{
return HttpMethod.Options;
}
if (String.Equals("TRACE", method, StringComparison.OrdinalIgnoreCase))
{
return HttpMethod.Trace;
}
return new HttpMethod(method);
}
}
}

View File

@@ -0,0 +1,208 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Linq;
namespace System.Web
{
/// <summary>
/// This is a container for prefix values. It normalizes all the values into dotted-form and then stores
/// them in a sorted array. All queries for prefixes are also normalized to dotted-form, and searches
/// for ContainsPrefix are done with a binary search.
/// </summary>
internal class PrefixContainer
{
private readonly ICollection<string> _originalValues;
private readonly string[] _sortedValues;
internal PrefixContainer(ICollection<string> values)
{
if (values == null)
{
throw new ArgumentNullException("values");
}
_originalValues = values;
_sortedValues = values.Where(val => val != null).ToArray();
Array.Sort(_sortedValues, StringComparer.OrdinalIgnoreCase);
}
internal bool ContainsPrefix(string prefix)
{
if (prefix == null)
{
throw new ArgumentNullException("prefix");
}
if (prefix.Length == 0)
{
return _sortedValues.Length > 0; // only match empty string when we have some value
}
return Array.BinarySearch(_sortedValues, prefix, new PrefixComparer(prefix)) > -1;
}
// Given "foo.bar", "foo.hello", "something.other", foo[abc].baz and asking for prefix "foo" will return:
// - "bar"/"foo.bar"
// - "hello"/"foo.hello"
// - "abc"/"foo[abc]"
internal IDictionary<string, string> GetKeysFromPrefix(string prefix)
{
IDictionary<string, string> result = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
foreach (var entry in _originalValues)
{
if (entry != null)
{
if (entry.Length == prefix.Length)
{
// No key in this entry
continue;
}
if (prefix.Length == 0)
{
GetKeyFromEmptyPrefix(entry, result);
}
else if (entry.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
{
GetKeyFromNonEmptyPrefix(prefix, entry, result);
}
}
}
return result;
}
private static void GetKeyFromEmptyPrefix(string entry, IDictionary<string, string> results)
{
string key;
int dotPosition = entry.IndexOf('.');
int bracketPosition = entry.IndexOf('[');
int delimiterPosition = -1;
if (dotPosition == -1)
{
if (bracketPosition != -1)
{
delimiterPosition = bracketPosition;
}
}
else
{
if (bracketPosition == -1)
{
delimiterPosition = dotPosition;
}
else
{
delimiterPosition = Math.Min(dotPosition, bracketPosition);
}
}
key = delimiterPosition == -1 ? entry : entry.Substring(0, delimiterPosition);
results[key] = key;
}
private static void GetKeyFromNonEmptyPrefix(string prefix, string entry, IDictionary<string, string> results)
{
string key = null;
string fullName = null;
int keyPosition = prefix.Length + 1;
switch (entry[prefix.Length])
{
case '.':
int dotPosition = entry.IndexOf('.', keyPosition);
if (dotPosition == -1)
{
dotPosition = entry.Length;
}
key = entry.Substring(keyPosition, dotPosition - keyPosition);
fullName = entry.Substring(0, dotPosition);
break;
case '[':
int bracketPosition = entry.IndexOf(']', keyPosition);
if (bracketPosition == -1)
{
// Malformed for dictionary
return;
}
key = entry.Substring(keyPosition, bracketPosition - keyPosition);
fullName = entry.Substring(0, bracketPosition + 1);
break;
default:
return;
}
if (!results.ContainsKey(key))
{
results.Add(key, fullName);
}
}
internal static bool IsPrefixMatch(string prefix, string testString)
{
if (testString == null)
{
return false;
}
if (prefix.Length == 0)
{
return true; // shortcut - non-null testString matches empty prefix
}
if (prefix.Length > testString.Length)
{
return false; // not long enough
}
if (!testString.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
{
return false; // prefix doesn't match
}
if (testString.Length == prefix.Length)
{
return true; // exact match
}
// invariant: testString.Length > prefix.Length
switch (testString[prefix.Length])
{
case '.':
case '[':
return true; // known delimiters
default:
return false; // not known delimiter
}
}
private class PrefixComparer : IComparer<String>
{
private string _prefix;
public PrefixComparer(string prefix)
{
_prefix = prefix;
}
public int Compare(string x, string y)
{
string testString = Object.ReferenceEquals(x, _prefix) ? y : x;
if (IsPrefixMatch(_prefix, testString))
{
return 0;
}
return StringComparer.OrdinalIgnoreCase.Compare(x, y);
}
}
}
}

View File

@@ -0,0 +1,387 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Contracts;
namespace System.Threading.Tasks
{
/// <summary>
/// Helpers for safely using Task libraries.
/// </summary>
internal static class TaskHelpers
{
private static Task _defaultCompleted = FromResult<AsyncVoid>(default(AsyncVoid));
/// <summary>
/// Returns a canceled Task. The task is completed, IsCanceled = True, IsFaulted = False.
/// </summary>
internal static Task Canceled()
{
return CancelCache<AsyncVoid>.Canceled;
}
/// <summary>
/// Returns a canceled Task of the given type. The task is completed, IsCanceled = True, IsFaulted = False.
/// </summary>
internal static Task<TResult> Canceled<TResult>()
{
return CancelCache<TResult>.Canceled;
}
/// <summary>
/// Returns a completed task that has no result.
/// </summary>
internal static Task Completed()
{
return _defaultCompleted;
}
/// <summary>
/// Returns an error task. The task is Completed, IsCanceled = False, IsFaulted = True
/// </summary>
internal static Task FromError(Exception exception)
{
return FromError<AsyncVoid>(exception);
}
/// <summary>
/// Returns an error task of the given type. The task is Completed, IsCanceled = False, IsFaulted = True
/// </summary>
/// <typeparam name="TResult"></typeparam>
internal static Task<TResult> FromError<TResult>(Exception exception)
{
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
tcs.SetException(exception);
return tcs.Task;
}
/// <summary>
/// Returns an error task of the given type. The task is Completed, IsCanceled = False, IsFaulted = True
/// </summary>
internal static Task FromErrors(IEnumerable<Exception> exceptions)
{
return FromErrors<AsyncVoid>(exceptions);
}
/// <summary>
/// Returns an error task of the given type. The task is Completed, IsCanceled = False, IsFaulted = True
/// </summary>
internal static Task<TResult> FromErrors<TResult>(IEnumerable<Exception> exceptions)
{
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
tcs.SetException(exceptions);
return tcs.Task;
}
/// <summary>
/// Returns a successful completed task with the given result.
/// </summary>
internal static Task<TResult> FromResult<TResult>(TResult result)
{
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
tcs.SetResult(result);
return tcs.Task;
}
/// <summary>
/// Return a task that runs all the tasks inside the iterator sequentially. It stops as soon
/// as one of the tasks fails or cancels, or after all the tasks have run succesfully.
/// </summary>
/// <param name="asyncIterator">collection of tasks to wait on</param>
/// <param name="cancellationToken">cancellation token</param>
/// <returns>a task that signals completed when all the incoming tasks are finished.</returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is propagated in a Task.")]
internal static Task Iterate(IEnumerable<Task> asyncIterator, CancellationToken cancellationToken = default(CancellationToken))
{
Contract.Assert(asyncIterator != null);
IEnumerator<Task> enumerator = null;
try
{
enumerator = asyncIterator.GetEnumerator();
Task task = IterateImpl(enumerator, cancellationToken);
return (enumerator != null) ? task.Finally(enumerator.Dispose) : task;
}
catch (Exception ex)
{
return TaskHelpers.FromError(ex);
}
}
/// <summary>
/// Provides the implementation of the Iterate method.
/// Contains special logic to help speed up common cases.
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is propagated in a Task.")]
internal static Task IterateImpl(IEnumerator<Task> enumerator, CancellationToken cancellationToken)
{
try
{
while (true)
{
// short-circuit: iteration canceled
if (cancellationToken.IsCancellationRequested)
{
return TaskHelpers.Canceled();
}
// short-circuit: iteration complete
if (!enumerator.MoveNext())
{
return TaskHelpers.Completed();
}
// fast case: Task completed synchronously & successfully
Task currentTask = enumerator.Current;
if (currentTask.Status == TaskStatus.RanToCompletion)
{
continue;
}
// fast case: Task completed synchronously & unsuccessfully
if (currentTask.IsCanceled || currentTask.IsFaulted)
{
return currentTask;
}
// slow case: Task isn't yet complete
return IterateImplIncompleteTask(enumerator, currentTask, cancellationToken);
}
}
catch (Exception ex)
{
return TaskHelpers.FromError(ex);
}
}
/// <summary>
/// Fallback for IterateImpl when the antecedent Task isn't yet complete.
/// </summary>
internal static Task IterateImplIncompleteTask(IEnumerator<Task> enumerator, Task currentTask, CancellationToken cancellationToken)
{
// There's a race condition here, the antecedent Task could complete between
// the check in Iterate and the call to Then below. If this happens, we could
// end up growing the stack indefinitely. But the chances of (a) even having
// enough Tasks in the enumerator in the first place and of (b) *every* one
// of them hitting this race condition are so extremely remote that it's not
// worth worrying about.
return currentTask.Then(() => IterateImpl(enumerator, cancellationToken));
}
/// <summary>
/// Replacement for Task.Factory.StartNew when the code can run synchronously.
/// We run the code immediately and avoid the thread switch.
/// This is used to help synchronous code implement task interfaces.
/// </summary>
/// <param name="action">action to run synchronouslyt</param>
/// <param name="token">cancellation token. This is only checked before we run the task, and if cancelled, we immediately return a cancelled task.</param>
/// <returns>a task who result is the result from Func()</returns>
/// <remarks>
/// Avoid calling Task.Factory.StartNew.
/// This avoids gotchas with StartNew:
/// - ensures cancellation token is checked (StartNew doesn't check cancellation tokens).
/// - Keeps on the same thread.
/// - Avoids switching synchronization contexts.
/// Also take in a lambda so that we can wrap in a try catch and honor task failure semantics.
/// </remarks>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
public static Task RunSynchronously(Action action, CancellationToken token = default(CancellationToken))
{
if (token.IsCancellationRequested)
{
return Canceled();
}
try
{
action();
return Completed();
}
catch (Exception e)
{
return FromError(e);
}
}
/// <summary>
/// Replacement for Task.Factory.StartNew when the code can run synchronously.
/// We run the code immediately and avoid the thread switch.
/// This is used to help synchronous code implement task interfaces.
/// </summary>
/// <typeparam name="TResult">type of result that task will return.</typeparam>
/// <param name="func">function to run synchronously and produce result</param>
/// <param name="cancellationToken">cancellation token. This is only checked before we run the task, and if cancelled, we immediately return a cancelled task.</param>
/// <returns>a task who result is the result from Func()</returns>
/// <remarks>
/// Avoid calling Task.Factory.StartNew.
/// This avoids gotchas with StartNew:
/// - ensures cancellation token is checked (StartNew doesn't check cancellation tokens).
/// - Keeps on the same thread.
/// - Avoids switching synchronization contexts.
/// Also take in a lambda so that we can wrap in a try catch and honor task failure semantics.
/// </remarks>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
internal static Task<TResult> RunSynchronously<TResult>(Func<TResult> func, CancellationToken cancellationToken = default(CancellationToken))
{
if (cancellationToken.IsCancellationRequested)
{
return Canceled<TResult>();
}
try
{
return FromResult(func());
}
catch (Exception e)
{
return FromError<TResult>(e);
}
}
/// <summary>
/// Overload of RunSynchronously that avoids a call to Unwrap().
/// This overload is useful when func() starts doing some synchronous work and then hits IO and
/// needs to create a task to finish the work.
/// </summary>
/// <typeparam name="TResult">type of result that Task will return</typeparam>
/// <param name="func">function that returns a task</param>
/// <param name="cancellationToken">cancellation token. This is only checked before we run the task, and if cancelled, we immediately return a cancelled task.</param>
/// <returns>a task, created by running func().</returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
internal static Task<TResult> RunSynchronously<TResult>(Func<Task<TResult>> func, CancellationToken cancellationToken = default(CancellationToken))
{
if (cancellationToken.IsCancellationRequested)
{
return Canceled<TResult>();
}
try
{
return func();
}
catch (Exception e)
{
return FromError<TResult>(e);
}
}
/// <summary>
/// Update the completion source if the task failed (cancelled or faulted). No change to completion source if the task succeeded.
/// </summary>
/// <typeparam name="TResult">result type of completion source</typeparam>
/// <param name="tcs">completion source to update</param>
/// <param name="source">task to update from.</param>
/// <returns>true on success</returns>
internal static bool SetIfTaskFailed<TResult>(this TaskCompletionSource<TResult> tcs, Task source)
{
switch (source.Status)
{
case TaskStatus.Canceled:
case TaskStatus.Faulted:
return tcs.TrySetFromTask(source);
}
return false;
}
/// <summary>
/// Set a completion source from the given Task.
/// </summary>
/// <typeparam name="TResult">result type for completion source.</typeparam>
/// <param name="tcs">completion source to set</param>
/// <param name="source">Task to get values from.</param>
/// <returns>true if this successfully sets the completion source.</returns>
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "This is a known safe usage of Task.Result, since it only occurs when we know the task's state to be completed.")]
internal static bool TrySetFromTask<TResult>(this TaskCompletionSource<TResult> tcs, Task source)
{
if (source.Status == TaskStatus.Canceled)
{
return tcs.TrySetCanceled();
}
if (source.Status == TaskStatus.Faulted)
{
return tcs.TrySetException(source.Exception.InnerExceptions);
}
if (source.Status == TaskStatus.RanToCompletion)
{
Task<TResult> taskOfResult = source as Task<TResult>;
return tcs.TrySetResult(taskOfResult == null ? default(TResult) : taskOfResult.Result);
}
return false;
}
/// <summary>
/// Set a completion source from the given Task. If the task ran to completion and the result type doesn't match
/// the type of the completion source, then a default value will be used. This is useful for converting Task into
/// Task{AsyncVoid}, but it can also accidentally be used to introduce data loss (by passing the wrong
/// task type), so please execute this method with care.
/// </summary>
/// <typeparam name="TResult">result type for completion source.</typeparam>
/// <param name="tcs">completion source to set</param>
/// <param name="source">Task to get values from.</param>
/// <returns>true if this successfully sets the completion source.</returns>
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "This is a known safe usage of Task.Result, since it only occurs when we know the task's state to be completed.")]
internal static bool TrySetFromTask<TResult>(this TaskCompletionSource<Task<TResult>> tcs, Task source)
{
if (source.Status == TaskStatus.Canceled)
{
return tcs.TrySetCanceled();
}
if (source.Status == TaskStatus.Faulted)
{
return tcs.TrySetException(source.Exception.InnerExceptions);
}
if (source.Status == TaskStatus.RanToCompletion)
{
// Sometimes the source task is Task<Task<TResult>>, and sometimes it's Task<TResult>.
// The latter usually happens when we're in the middle of a sync-block postback where
// the continuation is a function which returns Task<TResult> rather than just TResult,
// but the originating task was itself just Task<TResult>. An example of this can be
// found in TaskExtensions.CatchImpl().
Task<Task<TResult>> taskOfTaskOfResult = source as Task<Task<TResult>>;
if (taskOfTaskOfResult != null)
{
return tcs.TrySetResult(taskOfTaskOfResult.Result);
}
Task<TResult> taskOfResult = source as Task<TResult>;
if (taskOfResult != null)
{
return tcs.TrySetResult(taskOfResult);
}
return tcs.TrySetResult(TaskHelpers.FromResult(default(TResult)));
}
return false;
}
/// <summary>
/// Used as the T in a "conversion" of a Task into a Task{T}
/// </summary>
private struct AsyncVoid
{
}
/// <summary>
/// This class is a convenient cache for per-type cancelled tasks
/// </summary>
private static class CancelCache<TResult>
{
public static readonly Task<TResult> Canceled = GetCancelledTask();
private static Task<TResult> GetCancelledTask()
{
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
tcs.SetCanceled();
return tcs.Task;
}
}
}
}

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More