Compare commits
369 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1628dfaa2f | |||
| 3ff888f77a | |||
| 9af3a10da8 | |||
| 0470a0ca51 | |||
| 7b6cda6b44 | |||
| 332d91b6dc | |||
| b4d88b0361 | |||
| b41cf37dd5 | |||
| 7ecbc3b391 | |||
| 13a86624ff | |||
| f36ab37f6a | |||
| aeff33d0a6 | |||
| d3ed90c23e | |||
| db4b93dbc3 | |||
| 562851b93e | |||
| f5bf05a6f5 | |||
| e50569597b | |||
| 071f3dcc01 | |||
| 834d04f8ed | |||
| 4863e657df | |||
| 53e4308c29 | |||
| 41e87fca98 | |||
| f23c6c53cc | |||
| 25be0621b2 | |||
| d5d00553b4 | |||
| ca99319ead | |||
| 09e31d6595 | |||
| 6d66fc6cb8 | |||
| f0cacf0d52 | |||
| d501fcb679 | |||
| f5994d8442 | |||
| 4295cba915 | |||
| 2170380f7b | |||
| 43b2a2185e | |||
| bcb90d64a5 | |||
| 6d994f48ac | |||
| ad06aded1b | |||
| 25eea8d599 | |||
| 22498649b1 | |||
| 25ce7baa7d | |||
| 528209f8da | |||
| 385d6396b0 | |||
| 46858af1ed | |||
| 34163625fe | |||
| 461f032777 | |||
| a3347c0037 | |||
| f3835d1ca3 | |||
| d30c4791fe | |||
| 7ee9b9ebcc | |||
| b4caf109f7 | |||
| 0e8ffe528a | |||
| a8029d1dc5 | |||
| 1e0a4690fc | |||
| 52163494db | |||
| 8416764a83 | |||
| 2d3eb8c208 | |||
| 3594693f4b | |||
| b99de245bf | |||
| 82fc1a5304 | |||
| f0aab6ae81 | |||
| 721f813d1e | |||
| 6c9e82e735 | |||
| f7ddb1ed49 | |||
| c0fd974cc1 | |||
| e9c4a031c9 | |||
| a159b50c05 | |||
| 3891e46549 | |||
| e7bcc642a9 | |||
| 4983990d39 | |||
| 2f6dada481 | |||
| ff5dc324fe | |||
| 096c5ad69f | |||
| 77ee87178e | |||
| a6997a5cb7 | |||
| 3b9bf7b0f9 | |||
| 158f4d0614 | |||
| 7a38970cf4 | |||
| 26a7bf8187 | |||
| 3ff1b01e46 | |||
| 36e803713c | |||
| a3e7f644de | |||
| 809badd1cf | |||
| da92ece774 | |||
| a531afb819 | |||
| 8dfeb1e616 | |||
| 1012a4814d | |||
| bae41cde14 | |||
| b3260f05c0 | |||
| e33a79ac65 | |||
| c4dbabf654 | |||
| 423643d66c | |||
| 4ccb655f73 | |||
| c8330d60f9 | |||
| a9aa3a04b5 | |||
| 0bffa8e3f4 | |||
| 436322f58c | |||
| e90c46dd78 | |||
| deda2534f8 | |||
| 8112c13857 | |||
| 57792de185 | |||
| e1f93029a5 | |||
| f64e0c7eb7 | |||
| bf024e9011 | |||
| 036b888d30 | |||
| 1838a8dac5 | |||
| 205bf5fe4e | |||
| a50e192ab7 | |||
| 9684255e6e | |||
| 72790d74f5 | |||
| bb70bee6ae | |||
| 0430e7966c | |||
| 2e9a52b1f8 | |||
| e6ccd8a5b5 | |||
| 7ae8b28466 | |||
| 527375b238 | |||
| 1929f60ea8 | |||
| b9cc2efc8c | |||
| bad284515c | |||
| 5b660d95f1 | |||
| 106ac44e64 | |||
| 64bb7e1db0 | |||
| 25b9ca3b0e | |||
| b928170103 | |||
| e25ee246fb | |||
| 8e8ec41dae | |||
| fb34c4716a | |||
| 29bf61b1f2 | |||
| 9803309e34 | |||
| 3a539629dc | |||
| 74b970d586 | |||
| 518898b04b | |||
| 99fe89addc | |||
| 668d4f9f91 | |||
| 90e73cb89f | |||
| dcd6477030 | |||
| 7d5589118f | |||
| 103efbdc27 | |||
| 9736aaafaa | |||
| bf3fa20a53 | |||
| f936f8b0dd | |||
| 1bd20c9b06 | |||
| 099b713947 | |||
| 165d9c7dff | |||
| 7934ba7ec4 | |||
| 60b6608289 | |||
| de0e6f3179 | |||
| 39edb9b7e2 | |||
| a638488eb7 | |||
| a2a539f7db | |||
| 6768bb4793 | |||
| 71aa248a4e | |||
| bea50f4562 | |||
| 55c7f72d8e | |||
| 5f4eaef4a2 | |||
| 27c0c4d64e | |||
| 52cf559536 | |||
| 3d0be3836c | |||
| 2bc33e0115 | |||
| 8576d9c67e | |||
| 9452d5fd09 | |||
| 1f40d726de | |||
| 2699611ba3 | |||
| b1fa06bfe8 | |||
| 4dc22b6ce4 | |||
| 883277125a | |||
| ff961abaab | |||
| b2414c1ab8 | |||
| 0e392b398c | |||
| 5914690ad8 | |||
| dbbdd16bb9 | |||
| 762cca145f | |||
| 5cd2d568e3 | |||
| 259fbcb8f0 | |||
| db3f21429e | |||
| 04b9607741 | |||
| 5bd2571395 | |||
| c0cd157e60 | |||
| ac2f9b172c | |||
| b8e4a73c3b | |||
| 68c4255a51 | |||
| d07212c89b | |||
| 28c55320a1 | |||
| fd58017e97 | |||
| 09408b898e | |||
| d1b05332c5 | |||
| caad0afed8 | |||
| 62d365573f | |||
| f3b7a8a581 | |||
| a765f36d24 | |||
| 046da1a8ce | |||
| ca7abd6c78 | |||
| 7cc0f2a514 | |||
| 4882df43bd | |||
| ee2943b9fb | |||
| c250fa560e | |||
| b017e8690a | |||
| 8a9680e75c | |||
| 36c66e676a | |||
| ba530061a0 | |||
| 89ae3bc143 | |||
| 3951f59d09 | |||
| cd8c998ebf | |||
| 2cb544591b | |||
| 1b1b5c047c | |||
| fa5b9e5689 | |||
| c26df8da6f | |||
| 1e02d85fca | |||
| d1dc2331f8 | |||
| d503deb8c5 | |||
| 0859b92aaf | |||
| 695d26434c | |||
| a19de645e4 | |||
| de9a27db10 | |||
| b6d5b7d603 | |||
| 93d7cf4dc3 | |||
| 0c42596dc8 | |||
| 8cf9c1ba97 | |||
| 7a47d63b48 | |||
| 4648a8c103 | |||
| 87947871d1 | |||
| 87fee572ff | |||
| 89f7a3ec63 | |||
| 7092a9ccbb | |||
| e9ea9b5e1b | |||
| fd1efb29ec | |||
| cf4781153e | |||
| ebed142cd5 | |||
| d162aba14a | |||
| ec075f5807 | |||
| dca90e6316 | |||
| df31fafec5 | |||
| 828dc64035 | |||
| 0b74164a8e | |||
| 62be1b1267 | |||
| 85ae7e764f | |||
| 3daa624627 | |||
| d8af1aaf7b | |||
| f2d105d8b9 | |||
| 5b0a8c0668 | |||
| c3ccf3a609 | |||
| 60bbede408 | |||
| 1d0299af89 | |||
| c2d0e255df | |||
| 005d3e7d64 | |||
| 12f8638223 | |||
| e3f9e8c842 | |||
| a475f72d50 | |||
| a559ef9f90 | |||
| be83302b14 | |||
| 83d7ea9ef1 | |||
| 95024442de | |||
| 69f54b5f22 | |||
| 3404f95b2e | |||
| e56738481b | |||
| cb59dc353b | |||
| d1b75eac08 | |||
| 8fabd4e4ed | |||
| 564d92bed7 | |||
| 95f103ccc2 | |||
| 0ace2fdae7 | |||
| 5da3541584 | |||
| ef86d2f1f1 | |||
| a10a6d1af8 | |||
| 6d87174cc1 | |||
| 9af9c3fe77 | |||
| 9cedf5da4c | |||
| 906d675dca | |||
| f1b3105202 | |||
| 3ebb213916 | |||
| a65ca205de | |||
| 3e1120612b | |||
| 8d06d39a62 | |||
| da7fea47c6 | |||
| f2442b25f6 | |||
| 300d3ff09b | |||
| e6337b8f14 | |||
| 2be785ace3 | |||
| 5e2d991fab | |||
| 536cb4caf1 | |||
| 27745ea141 | |||
| 5289c55740 | |||
| 791773fc8a | |||
| 1da27e6c2b | |||
| a909b7904e | |||
| 1b1abce7da | |||
| fbc10be381 | |||
| 61f2647b62 | |||
| a5bea7fc59 | |||
| b9be5c2561 | |||
| 97556de447 | |||
| d5bde0d8df | |||
| cc5ca0b5fe | |||
| 0cb9cc6840 | |||
| d38d7b1ff4 | |||
| 2d87f933d5 | |||
| a734a0cff7 | |||
| d0ace55d03 | |||
| 3fda0308ac | |||
| d796b2afc1 | |||
| f95cfc2ee0 | |||
| c5d1439422 | |||
| 5e9f4559b6 | |||
| 4bbb0441a6 | |||
| 4cf1d7d9a4 | |||
| a6a3ddca75 | |||
| 27cfa85d3a | |||
| a9e1e7b634 | |||
| 9f5f920c81 | |||
| f9a0d91299 | |||
| 82c2560822 | |||
| f467b8cb6c | |||
| aea1a03453 | |||
| 1568e5f19c | |||
| 8dff47db78 | |||
| 987e48733a | |||
| ac5142443a | |||
| 44360d83aa | |||
| 021cb817d4 | |||
| f4f91fba78 | |||
| dec5e8ad6c | |||
| a6b2196c10 | |||
| 4321c8d24e | |||
| 4cff3a3c28 | |||
| 5458c9a310 | |||
| 0045ec353f | |||
| 716d3e95f1 | |||
| beeb28f390 | |||
| 080e8816a5 | |||
| f7eb323bd5 | |||
| 0f484fdf49 | |||
| d779422bf4 | |||
| 11ea698969 | |||
| 0e0e6b5c41 | |||
| 4c218621c6 | |||
| c150a91e50 | |||
| 7be9a0a987 | |||
| 50589c0911 | |||
| e61ae618e8 | |||
| 930e6a0989 | |||
| 7c50b32684 | |||
| 0f7daf7ebd | |||
| 12cbc2a9c5 | |||
| 959d263619 | |||
| 6a1fb52b25 | |||
| 18cd043421 | |||
| ddb2f82aba | |||
| 6c99e7951f | |||
| e44e745761 | |||
| 30c11439e4 | |||
| 0883f621f6 | |||
| 2d0784d1e5 | |||
| af0011f32a | |||
| 6cb3fcf9ad | |||
| e5878554bd | |||
| 44c8c4b5b8 | |||
| c0b5525dd7 | |||
| 36f8a8e1dd | |||
| 16f73b56ab | |||
| 47dc2e6214 | |||
| c6483f0380 | |||
| 168b38b2a3 | |||
| 70ca4ac913 | |||
| 72099192b5 | |||
| ea48128869 | |||
| f0b22146c8 | |||
| fe0d94687a | |||
| 238c3d38e8 | |||
| 6af4f1f2c6 | |||
| e215fb056f |
+80
@@ -0,0 +1,80 @@
|
||||
*.obj
|
||||
*.pdb
|
||||
*.user
|
||||
*.aps
|
||||
*.pch
|
||||
*.vspscc
|
||||
[Bb]in
|
||||
[Db]ebug*/
|
||||
obj/
|
||||
[Rr]elease*/
|
||||
_ReSharper*/
|
||||
_NCrunch_*/
|
||||
*.ncrunchsolution
|
||||
*.ncrunchsolution.user
|
||||
*.ncrunchproject
|
||||
*.crunchsolution.cache
|
||||
[Tt]est[Rr]esult*
|
||||
[Bb]uild[Ll]og.*
|
||||
*.[Pp]ublish.xml
|
||||
*.suo
|
||||
[sS]ource
|
||||
[sS]andbox
|
||||
umbraco.config
|
||||
*.vs10x
|
||||
App_Data/TEMP/*
|
||||
[Uu]mbraco/[Pp]resentation/[Uu]mbraco/[Pp]lugins/*
|
||||
[Uu]mbraco/[Pp]resentation/[Uu]ser[Cc]ontrols/*
|
||||
[Uu]mbraco/[Pp]resentation/[Ss]cripts/*
|
||||
[Uu]mbraco/[Pp]resentation/[Ff]onts/*
|
||||
[Uu]mbraco/[Pp]resentation/[Cc]ss/*
|
||||
|
||||
src/Umbraco.Web.UI/[Cc]ss/*
|
||||
src/Umbraco.Web.UI/App_Code/*
|
||||
src/Umbraco.Web.UI/App_Data/*
|
||||
src/Umbraco.Tests/App_Data/*
|
||||
src/Umbraco.Web.UI/[Mm]edia/*
|
||||
src/Umbraco.Web.UI/[Mm]aster[Pp]ages/*
|
||||
src/Umbraco.Web.UI/[Mm]acro[Ss]cripts/*
|
||||
src/Umbraco.Web.UI/[Xx]slt/*
|
||||
src/Umbraco.Web.UI/[Ii]mages/*
|
||||
src/Umbraco.Web.UI/[Ss]cripts/*
|
||||
src/Umbraco.Web.UI/Web.*.config.transformed
|
||||
|
||||
umbraco/presentation/umbraco/plugins/uComponents/uComponentsInstaller.ascx
|
||||
umbraco/presentation/packages/uComponents/MultiNodePicker/CustomTreeService.asmx
|
||||
_BuildOutput/*
|
||||
build/UmbracoCms.AllBinaries*zip
|
||||
build/UmbracoCms.WebPI*zip
|
||||
build/UmbracoCms*zip
|
||||
build/*.nupkg
|
||||
src/Umbraco.Tests/config/applications.config
|
||||
src/Umbraco.Tests/config/trees.config
|
||||
src/Umbraco.Web.UI/web.config
|
||||
*.orig
|
||||
src/Umbraco.Tests/config/404handlers.config
|
||||
src/Umbraco.Web.UI/[Vv]iews/*.cshtml
|
||||
src/Umbraco.Web.UI/[Vv]iews/*.vbhtml
|
||||
src/Umbraco.Tests/[Cc]onfig/umbracoSettings.config
|
||||
src/Umbraco.Web.UI/[Vv]iews/*
|
||||
src/packages/
|
||||
src/packages/repositories.config
|
||||
|
||||
src/Umbraco.Web.UI/[Ww]eb.config
|
||||
*.transformed
|
||||
webpihash.txt
|
||||
|
||||
node_modules
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Ll]ib/*
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/umbraco.*
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/routes.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/main.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/app.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.css
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.html
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Aa]ssets/*
|
||||
src/Umbraco.Web.UI.Client/[Bb]uild/*
|
||||
src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/
|
||||
src/Umbraco.Web.UI/[Uu]ser[Cc]ontrols/
|
||||
build/_BuildOutput/
|
||||
@@ -2,7 +2,6 @@
|
||||
syntax: glob
|
||||
|
||||
*.obj
|
||||
*.exe
|
||||
*.pdb
|
||||
*.user
|
||||
*.aps
|
||||
@@ -38,6 +37,7 @@ src\Umbraco.Web.UI\macroScripts\*
|
||||
src\Umbraco.Web.UI\xslt\*
|
||||
src\Umbraco.Web.UI\images\*
|
||||
src\Umbraco.Web.UI\scripts\*
|
||||
src\Umbraco.Web.UI\Web.*.config.transformed
|
||||
|
||||
umbraco\presentation\umbraco\plugins\uComponents\uComponentsInstaller.ascx
|
||||
umbraco\presentation\packages\uComponents\MultiNodePicker\CustomTreeService.asmx
|
||||
@@ -58,4 +58,6 @@ src/Umbraco.Tests/config/umbracoSettings.config
|
||||
src/Umbraco.Web.UI/App_Plugins/*
|
||||
src/Umbraco.Web.UI/Views/*
|
||||
|
||||
src\Umbraco.Web.UI\[W]eb.config
|
||||
src\Umbraco.Web.UI\[W]eb.config
|
||||
src/packages/
|
||||
build/*.zip
|
||||
|
||||
@@ -20,3 +20,13 @@ f6da531fbb4c251ff61d314e2a7effb13c71e74a Release-4.10.0
|
||||
73711b806a4044dbf0d7d7c095ddfdda23b09932 4.11.2
|
||||
0000000000000000000000000000000000000000 4.11.2
|
||||
73711b806a4044dbf0d7d7c095ddfdda23b09932 Release-4.11.2
|
||||
77db220b89e166b3c0736ed321ecfd6416cddbcd Release-4.11.2.1
|
||||
54cde33b809dcb3a1f7e7ae0d5375f6dd0d89c8d Release-4.11.2.2
|
||||
baa44b79cf90a60631e38e11f771c200b08a4583 Release-4.11.3
|
||||
e4d0c7e740555d8707ba71f55a623a3f96da8e65 Release-4.11.3.1
|
||||
e4d0c7e740555d8707ba71f55a623a3f96da8e65 Release-4.11.3.1
|
||||
0000000000000000000000000000000000000000 Release-4.11.3.1
|
||||
e02f5aebb87e3f07d27376647756caa9762931d8 Release-4.11.4
|
||||
14338b0ab1738fbd8987677ecdb9a73d79fc229d release-4.11.6
|
||||
ce47176bc6b9298741783e20f1fe2672c811f744 release-4.11.7
|
||||
fb8fd83e8e706f8249f423e8acf52f5c12aa9f73 release-4.11.9
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
NuGet.exe pack NuSpecs\UmbracoCms.Core.nuspec
|
||||
NuGet.exe pack NuSpecs\UmbracoCms.nuspec
|
||||
REM pause
|
||||
+17
-1
@@ -1,5 +1,21 @@
|
||||
@ECHO OFF
|
||||
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj"
|
||||
set version=4.11.10
|
||||
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%version%
|
||||
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Code\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Data\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Plugins\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\css\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\macroScripts\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\masterpages\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\media\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\scripts\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\usercontrols\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\xslt\dummy.txt
|
||||
|
||||
NuGet.exe pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%
|
||||
NuGet.exe pack NuSpecs\UmbracoCms.nuspec -Version %version%
|
||||
|
||||
|
||||
if ERRORLEVEL 1 goto :showerror
|
||||
|
||||
|
||||
+12
-29
@@ -24,6 +24,9 @@
|
||||
<PropertyGroup Condition="'$(BUILD_NUMBER)'!=''">
|
||||
<DECIMAL_BUILD_NUMBER>.$(BUILD_NUMBER)</DECIMAL_BUILD_NUMBER>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(BUILD_RELEASE)'!=''">
|
||||
<DECIMAL_BUILD_NUMBER>.$(BUILD_RELEASE)</DECIMAL_BUILD_NUMBER>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<BuildConfiguration>Release</BuildConfiguration>
|
||||
@@ -160,7 +163,7 @@
|
||||
<Message Text="Finished offsetting timestamps" Importance="high" />
|
||||
</Target>
|
||||
|
||||
<Target Name="CompileProjects">
|
||||
<Target Name="CompileProjects" DependsOnTargets="SetVersionNumber">
|
||||
|
||||
<Message Text="Compiling web project to build\$(BuildFolder)" Importance="high" />
|
||||
<!-- For UseWPP_CopyWebApplication=True see http://stackoverflow.com/questions/1983575/copywebapplication-with-web-config-transformations -->
|
||||
@@ -169,7 +172,7 @@
|
||||
|
||||
<!--
|
||||
Now, because of all the circular dependencies we need to build those projects and have them dump their DLLs/assets out to the same folder. Really wish this wasn't the case!
|
||||
These are: umbraco.editorControls umbraco.webservices umbraco.MacroEngines
|
||||
These are: umbraco.editorControls umbraco.MacroEngines
|
||||
|
||||
Each of these projects has a post build to put their stuff in the correct location based on the solution and unfortunately for us each
|
||||
of these projects references the web application! So if we specify an OutDir parameter it will also trigger a web deploy and chuck another
|
||||
@@ -201,37 +204,17 @@
|
||||
<Copy SourceFiles="@(EditorControlsDll)"
|
||||
DestinationFolder="$(WebAppFolder)\bin" OverwriteReadOnlyFiles="True"/>
|
||||
|
||||
<!-- WEBSERVICES -->
|
||||
<Message Text="Compiling webservices project" Importance="high" />
|
||||
<MSBuild Projects="..\src\umbraco.webservices\umbraco.webservices.csproj" Properties="WarningLevel=0;Configuration=$(BuildConfiguration);" Targets="Clean;Build;" BuildInParallel="False" ToolsVersion="4.0" UnloadProjectsOnCompletion="False">
|
||||
</MSBuild>
|
||||
<ItemGroup>
|
||||
<WebServicesDll Include="..\src\umbraco.webservices\bin\$(BuildConfiguration)\umbraco.webservices.dll"/>
|
||||
<WebServicesASMX Include="..\src\umbraco.webservices\*.asmx"/>
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(WebServicesDll)"
|
||||
DestinationFolder="$(SolutionBinFolder)" OverwriteReadOnlyFiles="True"/>
|
||||
<Copy SourceFiles="@(WebServicesDll)"
|
||||
DestinationFolder="$(WebAppFolder)\bin" OverwriteReadOnlyFiles="True"/>
|
||||
<Copy SourceFiles="@(WebServicesASMX)"
|
||||
DestinationFolder="$(WebAppFolder)\umbraco\webservices\api" OverwriteReadOnlyFiles="True"/>
|
||||
|
||||
<!-- SQLCE4UMBRACO -->
|
||||
<!--<Message Text="Compiling SQLCE4Umbraco project" Importance="high" />
|
||||
<MSBuild Projects="..\src\SQLCE4Umbraco\SQLCE4Umbraco.csproj" Properties="WarningLevel=0;Configuration=$(BuildConfiguration);" Targets="Clean;Build;" BuildInParallel="False" ToolsVersion="4.0" UnloadProjectsOnCompletion="False">
|
||||
</MSBuild>
|
||||
<ItemGroup>
|
||||
<SQLCE4UmbracoDll Include="..\src\SQLCE4Umbraco\bin\$(BuildConfiguration)\SQLCE4Umbraco.dll" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(SQLCE4UmbracoDll)"
|
||||
DestinationFolder="$(SolutionBinFolder)" OverwriteReadOnlyFiles="True"/>
|
||||
<Copy SourceFiles="@(SQLCE4UmbracoDll)"
|
||||
DestinationFolder="$(WebAppFolder)\bin" OverwriteReadOnlyFiles="True"/>-->
|
||||
|
||||
<!-- DONE -->
|
||||
<Message Text="Finished compiling projects" Importance="high" />
|
||||
</Target>
|
||||
|
||||
<Target Name="SetVersionNumber" Condition="'$(BUILD_RELEASE)'!=''">
|
||||
<!-- Match & replace 3 and 4 digit version numbers and -beta (if it's there) -->
|
||||
<FileUpdate Files="..\src\Umbraco.Core\Configuration\GlobalSettings.cs"
|
||||
Regex="(\d+)\.(\d+)\.(\d+)(.(\d+))?(-([a-zA-Z]+))?"
|
||||
ReplacementText="$(BUILD_RELEASE)"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="AfterBuild">
|
||||
<Message Text="Hi" />
|
||||
</Target>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>UmbracoCms.Core</id>
|
||||
<version>4.11.2</version>
|
||||
<version>$version$</version>
|
||||
<title>Umbraco Cms Core Binaries</title>
|
||||
<authors>Morten Christensen</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
@@ -26,6 +26,7 @@
|
||||
<file src="..\_BuildOutput\WebApp\bin\ICSharpCode.SharpZipLib.dll" target="lib\ICSharpCode.SharpZipLib.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\interfaces.dll" target="lib\interfaces.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Lucene.Net.dll" target="lib\Lucene.Net.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\log4net.dll" target="lib\log4net.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\Microsoft.ApplicationBlocks.Data.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Microsoft.Web.Helpers.dll" target="lib\Microsoft.Web.Helpers.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Microsoft.Web.Infrastructure.dll" target="lib\Microsoft.Web.Infrastructure.dll" />
|
||||
@@ -50,7 +51,6 @@
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.macroRenderings.dll" target="lib\umbraco.macroRenderings.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.dll" target="lib\umbraco.providers.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.dll" target="lib\Umbraco.Web.UI.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.webservices.dll" target="lib\umbraco.webservices.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.XmlSerializers.dll" target="lib\umbraco.XmlSerializers.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.dll" target="lib\UmbracoExamine.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\UrlRewritingNet.UrlRewriter.dll" target="lib\UrlRewritingNet.UrlRewriter.dll" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>UmbracoCms</id>
|
||||
<version>4.11.2</version>
|
||||
<version>$version$</version>
|
||||
<title>Umbraco Cms</title>
|
||||
<authors>Morten Christensen</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
@@ -15,7 +15,7 @@
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<dependencies>
|
||||
<dependency id="UmbracoCms.Core" version="4.11.2" />
|
||||
<dependency id="UmbracoCms.Core" version="[$version$]" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
@@ -27,16 +27,19 @@
|
||||
<file src="..\_BuildOutput\WebApp\scripts\**" target="Content\scripts" />
|
||||
<file src="..\_BuildOutput\WebApp\usercontrols\**" target="Content\usercontrols" />
|
||||
<file src="..\_BuildOutput\WebApp\xslt\**" target="Content\xslt" />
|
||||
<file src="..\_BuildOutput\WebApp\Views\**" target="Content\Views" />
|
||||
<file src="..\_BuildOutput\WebApp\default.aspx" target="Content\default.aspx" />
|
||||
<file src="..\_BuildOutput\WebApp\Web.config" target="Content\Web.config" />
|
||||
<file src="..\_BuildOutput\WebApp\App_Browsers\**" target="UmbracoFiles\App_Browsers" />
|
||||
<file src="..\_BuildOutput\WebApp\App_Code\**" target="UmbracoFiles\App_Code" />
|
||||
<file src="..\_BuildOutput\WebApp\App_Data\**" target="UmbracoFiles\App_Data" />
|
||||
<file src="..\_BuildOutput\WebApp\App_Plugins\**" target="UmbracoFiles\App_Plugins" />
|
||||
<file src="..\_BuildOutput\WebApp\config\**" target="UmbracoFiles\config" />
|
||||
<file src="..\_BuildOutput\WebApp\install\**" target="UmbracoFiles\install" />
|
||||
<file src="..\_BuildOutput\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
|
||||
<file src="..\_BuildOutput\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
|
||||
<file src="..\_BuildOutput\WebApp\Web.config" target="UmbracoFiles\Web.config" />
|
||||
<file src="..\_BuildOutput\WebApp\Global.asax" target="UmbracoFiles\Global.asax" />
|
||||
<file src="tools\install.ps1" target="tools\install.ps1" />
|
||||
<file src="tools\Readme.txt" target="tools\Readme.txt" />
|
||||
</files>
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
@ECHO OFF
|
||||
|
||||
:choice
|
||||
set /P c=WARNING! Are you sure you want to continue, this will remove all package files, view files, sqlce database, etc... Press 'Y' to auto-remove all files/folders, 'N' to cancel or 'C' to prompt for each folder removal?
|
||||
if /I "%c%" EQU "C" goto :prompt
|
||||
if /I "%c%" EQU "Y" goto :auto
|
||||
if /I "%c%" EQU "N" goto :exit
|
||||
goto :choice
|
||||
|
||||
|
||||
:prompt
|
||||
|
||||
echo Current folder: %CD%
|
||||
|
||||
echo Removing sqlce database
|
||||
del ..\src\Umbraco.Web.UI\App_Data\Umbraco.sdf
|
||||
|
||||
echo Resetting installedPackages.config
|
||||
echo ^<?xml version="1.0" encoding="utf-8"?^>^<packages^>^</packages^> >..\src\Umbraco.Web.UI\App_Data\packages\installed\installedPackages.config
|
||||
|
||||
echo Removing plugin cache files
|
||||
del ..\src\Umbraco.Web.UI\App_Data\TEMP\PluginCache\*.*
|
||||
|
||||
echo Removing cache files and examine index
|
||||
del ..\src\Umbraco.Web.UI\App_Data\TEMP\*.*
|
||||
|
||||
echo Removing log files
|
||||
del ..\src\Umbraco.Web.UI\App_Data\Logs\*.*
|
||||
|
||||
echo Removing packages
|
||||
del ..\src\Umbraco.Web.UI\App_Data\packages\*.*
|
||||
|
||||
echo Removing previews
|
||||
del ..\src\Umbraco.Web.UI\App_Data\preview\*.*
|
||||
|
||||
echo Removing app code files (typically added by starterkits)
|
||||
del ..\src\Umbraco.Web.UI\App_Code\*.*
|
||||
|
||||
echo Removing xslt files
|
||||
del ..\src\Umbraco.Web.UI\xslt\*.*
|
||||
|
||||
echo Removing user control files
|
||||
del ..\src\Umbraco.Web.UI\UserControls\*.*
|
||||
|
||||
echo Removing masterpage files
|
||||
del ..\src\Umbraco.Web.UI\masterpages\*.*
|
||||
|
||||
echo Removing view files
|
||||
del ..\src\Umbraco.Web.UI\Views\*.*
|
||||
|
||||
echo Removing razor files
|
||||
del ..\src\Umbraco.Web.UI\macroScripts\*.*
|
||||
|
||||
echo Removing media files
|
||||
del ..\src\Umbraco.Web.UI\media\*.*
|
||||
|
||||
echo Removing script files
|
||||
del ..\src\Umbraco.Web.UI\scripts\*.*
|
||||
|
||||
echo Removing css files
|
||||
del ..\src\Umbraco.Web.UI\css\*.*
|
||||
|
||||
echo "Umbraco install reverted to clean install"
|
||||
pause
|
||||
exit
|
||||
|
||||
|
||||
|
||||
:auto
|
||||
|
||||
echo Current folder: %CD%
|
||||
|
||||
echo Removing sqlce database
|
||||
del ..\src\Umbraco.Web.UI\App_Data\Umbraco.sdf
|
||||
|
||||
echo Resetting installedPackages.config
|
||||
echo ^<?xml version="1.0" encoding="utf-8"?^>^<packages^>^</packages^> >..\src\Umbraco.Web.UI\App_Data\packages\installed\installedPackages.config
|
||||
|
||||
echo Removing plugin cache files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\TEMP\PluginCache\*.*) DO DEL %%A
|
||||
|
||||
echo Removing cache files and examine index
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\TEMP\*.*) DO DEL %%A
|
||||
|
||||
echo Removing log files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\Logs\*.*) DO DEL %%A
|
||||
|
||||
echo Removing packages
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\packages\*.*) DO DEL %%A
|
||||
|
||||
echo Removing previews
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\preview\*.*) DO DEL %%A
|
||||
|
||||
echo Removing app code files (typically added by starterkits)
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\App_Code\*.*) DO DEL %%A
|
||||
|
||||
echo Removing xslt files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\xslt\*.*) DO DEL %%A
|
||||
|
||||
echo Removing masterpage files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\masterpages\*.*) DO DEL %%A
|
||||
|
||||
echo Removing user control files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\usercontrols\*.*) DO DEL %%A
|
||||
|
||||
echo Removing view files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\Views\*.*) DO DEL %%A
|
||||
|
||||
echo Removing razor files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\macroScripts\*.*) DO DEL %%A
|
||||
|
||||
echo Removing media files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\media\*.*) DO DEL %%A
|
||||
|
||||
echo Removing script files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\scripts\*.*) DO DEL %%A
|
||||
|
||||
echo Removing css files
|
||||
FOR %%A IN (..\src\Umbraco.Web.UI\css\*.*) DO DEL %%A
|
||||
|
||||
echo "Umbraco install reverted to clean install"
|
||||
pause
|
||||
exit
|
||||
|
||||
|
||||
|
||||
:exit
|
||||
exit
|
||||
Binary file not shown.
@@ -1,24 +0,0 @@
|
||||
Hi! Thanks for grabbing the Umbraco sourcecode.
|
||||
|
||||
===========================================
|
||||
NOTE - DEFAULT BRANCH EMPTY - December 2010
|
||||
===========================================
|
||||
|
||||
|
||||
- With the help of CodePlex we have migrated much of our previous changesets (as of Dec 13th 2010) from TFS to Mercurial.
|
||||
|
||||
- However, not everything could be migrated to our new branching workflow. So for each nominal group of 4.x changes, we've created named branches. For upcoming 5.x changesets, we'll adhere to our new workflow which we'll describe on the Wiki for contributors.
|
||||
|
||||
- FOR THE MOMENT, the 'default' branch is empty - pending the addition of the 5.0 changesets
|
||||
|
||||
- To switch to the codebase on which you want to work, 'hg update' to the named branch (e.g. "4.6.0") or tag (e.g. "Release-4.5.2") and browse or work from that point.
|
||||
|
||||
|
||||
Thanks to Matt Hawley at CodePlex for his help in our migration!
|
||||
|
||||
Cheers,
|
||||
The Umbraco Team
|
||||
|
||||
http://umbraco.org
|
||||
http://our.umbraco.org
|
||||
http://umbraco.codeplex.com
|
||||
@@ -1,82 +0,0 @@
|
||||
{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f36\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
|
||||
{\f39\froman\fcharset238\fprq2 Times New Roman CE;}{\f40\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f42\froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\froman\fcharset162\fprq2 Times New Roman Tur;}
|
||||
{\f44\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f45\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f46\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\f399\fswiss\fcharset238\fprq2 Tahoma CE;}{\f400\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f402\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f403\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f404\fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
|
||||
{\f405\fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f406\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f407\fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f408\fswiss\fcharset222\fprq2 Tahoma (Thai);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
|
||||
\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
|
||||
\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive
|
||||
\ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
|
||||
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
|
||||
\f36\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext15 \ssemihidden \styrsid668380 Balloon Text;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable{\list\listtemplateid130696116{\listlevel\levelnfc0\levelnfcn0\leveljc0
|
||||
\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
|
||||
{\leveltext\'02\'01.;}{\levelnumbers\'01;}\fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\fi-360\li2160
|
||||
\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
|
||||
\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
|
||||
{\leveltext\'02\'05.;}{\levelnumbers\'01;}\fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\fi-360\li5040
|
||||
\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
|
||||
\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid723138990}}{\*\listoverridetable{\listoverride\listid723138990\listoverridecount0\ls1}}
|
||||
{\*\pgptbl {\pgp\ipgp2\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp4\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}}{\*\rsidtbl \rsid288726\rsid668380\rsid1077358\rsid1250157\rsid1778664
|
||||
\rsid2232581\rsid3018318\rsid3766585\rsid4417501\rsid4531485\rsid4807452\rsid5341002\rsid7018004\rsid7880391\rsid10749719\rsid12150908\rsid12939982\rsid13596669\rsid15149892\rsid15551579\rsid16128754\rsid16674677}{\*\generator Microsoft Word 11.0.6359;}
|
||||
{\info{\title Shared Source License for Software included in Workspaces}{\author suev}{\operator Martin Maly}{\creatim\yr2005\mo3\dy22\hr10\min45}{\revtim\yr2005\mo3\dy22\hr15\min54}{\printim\yr2002\mo9\dy20\hr15\min39}{\version3}{\edmins1}{\nofpages1}
|
||||
{\nofwords672}{\nofchars3837}{\*\company Microsoft}{\nofcharsws4501}{\vern24703}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1701\dgvorigin1984
|
||||
\dghshow1\dgvshow1\jexpand\viewkind5\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
|
||||
\asianbrkrule\nojkernpunct\rsidroot15149892 \fet0\sectd \linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3
|
||||
\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
|
||||
{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain
|
||||
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\fs28\insrsid1250157\charrsid1250157 Shared Source License for }{\b\fs28\insrsid16674677 IronPython}{
|
||||
\b\fs28\insrsid1250157
|
||||
\par }{\b\fs28\insrsid5341002
|
||||
\par }{\b\insrsid5341002\charrsid5341002 This license governs use of the accompanying software}{\b\insrsid5341002 (\'93Software\'94)}{\b\insrsid5341002\charrsid5341002 , and your use of the }{\b\insrsid5341002 S}{\b\insrsid5341002\charrsid5341002
|
||||
oftware constitutes acceptance of this license.
|
||||
\par }{\insrsid1250157\charrsid5341002
|
||||
\par }{\b\insrsid1250157\charrsid1250157 You }{\b\insrsid5341002 may}{\b\insrsid1250157\charrsid1250157 use }{\b\insrsid5341002 the}{\b\insrsid1250157\charrsid1250157 Software for any }{\b\insrsid1250157 commercial or }{\b\insrsid1250157\charrsid1250157
|
||||
noncommercial purpose, including distributing derivative}{\b\insrsid4417501 work}{\b\insrsid1250157\charrsid1250157 s}{\b\insrsid1250157 .
|
||||
\par }{\insrsid1250157
|
||||
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1250157 {\insrsid1250157\charrsid1250157 In return, we simply require that you agree:
|
||||
\par {\listtext\pard\plain\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 1.\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0\pararsid1250157 {\insrsid1250157\charrsid1250157
|
||||
Not to remove any copyright}{\insrsid5341002 or other}{\insrsid1250157\charrsid1250157 notices from the Software.
|
||||
\par {\listtext\pard\plain\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 2.\tab}That if you distribute the Software in source code form you do so only under this }{\insrsid5341002 l}{\insrsid1250157\charrsid1250157
|
||||
icense (i.e. you must include a complete copy of this }{\insrsid5341002 l}{\insrsid1250157\charrsid1250157 icense with your distribution), and if you distribute the Software solely in object form you only do so under a license that complies with this }{
|
||||
\insrsid5341002 l}{\insrsid1250157\charrsid1250157 icense.
|
||||
\par {\listtext\pard\plain\b\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 3.\tab}}{\b\insrsid1250157\charrsid1250157
|
||||
That the Software comes "as is", with no warranties. None whatsoever. This means no express, implied or statutory warranty, including without limitation, warranties of merchantability or fitness for a particular purpose or any warranty of }{
|
||||
\b\insrsid5341002 title or }{\b\insrsid1250157\charrsid1250157 non}{\b\insrsid5341002 -}{\b\insrsid1250157\charrsid1250157 infringement. Also, you must pass this disclaimer on whenever you distribute the Software}{\b\insrsid5341002 or derivative works}{
|
||||
\b\insrsid1250157\charrsid1250157 .}{\insrsid1250157\charrsid1250157
|
||||
\par {\listtext\pard\plain\b\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 4.\tab}}{\b\insrsid1250157\charrsid1250157 That neither Microsoft nor }{\b\insrsid1250157 any contributor to the Software}{\b\insrsid1250157\charrsid1250157
|
||||
will be liable for any of those types of damages known as}{\b\insrsid5341002 }{\b\insrsid1250157\charrsid1250157 indirect, special, consequential, or incidental related to the Software or this }{\b\insrsid5341002 l}{\b\insrsid1250157\charrsid1250157
|
||||
icense, to the maximum extent the law permits, no matter what legal theory it\rquote s based on. Also, you must pass this limitation of liability on whenever you distribute the Software}{\b\insrsid5341002 or derivative works}{
|
||||
\b\insrsid1250157\charrsid1250157 .}{\insrsid1250157\charrsid1250157
|
||||
\par {\listtext\pard\plain\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 5.\tab}That if you sue anyone over patents that you think may apply to the Software for a person's use of the Software, your license to the Software ends automatically.
|
||||
|
||||
\par {\listtext\pard\plain\insrsid1250157 \hich\af0\dbch\af0\loch\f0 6.\tab}}{\insrsid1250157 That the patent rights, if any, }{\insrsid288726 granted in this license}{\insrsid1250157\charrsid1250157 only apply to the Software, not to any derivative}{
|
||||
\insrsid4417501 work}{\insrsid1250157\charrsid1250157 s you make.}{\insrsid3018318
|
||||
\par {\listtext\pard\plain\insrsid3018318\charrsid3018318 \hich\af0\dbch\af0\loch\f0 7.\tab}}{\insrsid3018318\charrsid3018318 That if you are an agency of the U.S. Government, (i) Software provided pursuant to a solicitation issued on or after Dece
|
||||
mber 1, 1995, is provided with the commercial license rights set forth in this license, and (ii) Software provided pursuant to a solicitation issued prior to December 1, 1995, is provided with \'93Restricted Rights\'94
|
||||
as set forth in FAR, 48 C.F.R. 52.227-14 (June 1987) or DFAR, 48 C.F.R. 252.227-7013 (Oct 1988), as applicable.}{\insrsid1250157
|
||||
\par {\listtext\pard\plain\insrsid1250157 \hich\af0\dbch\af0\loch\f0 8.\tab}That your rights under this License end automatically if you breach it in any way.
|
||||
\par {\listtext\pard\plain\insrsid5341002 \hich\af0\dbch\af0\loch\f0 9.\tab}}{\insrsid5341002 That all rights not expressly granted to you in this license are reserved.
|
||||
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1778664 {\insrsid1778664
|
||||
\par }{\insrsid12150908 Read below}{\insrsid1778664 for answers to frequently asked questions about this license.
|
||||
\par }{\insrsid12150908
|
||||
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12150908 {\b\insrsid12150908\charrsid12150908 Q: Is this license OSI compliant?
|
||||
\par }{\insrsid12150908
|
||||
A: This license has not been submitted to OSI, but it allows developers to take full advantage of a dynamic language on the CLR and to have the freedom to distribute their works for the benefit of the community at large. The license is half of a
|
||||
page long and very straight forward. We believe it stands up to what developers demand of an "open" license.
|
||||
\par
|
||||
\par }{\b\insrsid12150908\charrsid12150908 Q: What copyright rights does the license grant me?
|
||||
\par }{\insrsid12150908 A: The license grants you a copyright license to make unlimited copies of the Software in sour
|
||||
ce or object code form, as well as to create Derivative Works (as that term is defined under US copyright law). This means that in addition to making unlimited copies of the Software, you have a copyright license to modify the Software and to use all or p
|
||||
art of the Software to create a Derivative Work.
|
||||
\par
|
||||
\par }{\b\insrsid12150908\charrsid12150908 Q: What patent rights does the license grant me?
|
||||
\par }{\insrsid12150908 A: This license grants you a patent license to use and distribute the Software under any Microsoft patent claims that read on the Software itself. In other wo
|
||||
rds, if you create a modified version of the Software, you still retain the patent license to use and distribute the original portions of the Software under the specific Microsoft patent claims that read on the Software, but you do not have a patent licen
|
||||
s
|
||||
e as to the new functionality you may have added by modifying the Software. This result is typical of many common open source licenses, including the Common Public License (CPL) and the Mozilla Public License (MPL). In addition, this license grants no rig
|
||||
h
|
||||
ts to any Microsoft patents that read on other components or files not included in the Software. This means that no patent license is granted to use or distribute any other software or technology that may be needed to use the Software or was created from
|
||||
t
|
||||
he Software (for example, any compiled output of the Software, the combination of the Software with other hardware or other software, or any additional enabling technologies that may be necessary to make or use the Software or any final product that inclu
|
||||
des the Software).}{\insrsid12150908
|
||||
\par }{\insrsid12150908\charrsid1250157
|
||||
\par }}
|
||||
+30
-6
@@ -1,9 +1,33 @@
|
||||
!! Umbraco - the simple, flexible and friendly ASP.NET CMS
|
||||
Umbraco - the simple, flexible and friendly ASP.NET CMS
|
||||
=======================================================
|
||||
For the first time on the Microsoft platform a free user and developer friendly cms that makes it quick and easy to create websites - or a breeze to build complex web applications. umbraco got award-winning integration capabilities and supports your ASP.NET User and Custom Controls out of the box. It's a developers dream and your users will love it too. Used by more than 57.000 active websites including Heinz.com, Peugeot.com, NAIAS.com and Microsofts documentinteropinitiative.org website you can be sure that the technology is proven, stable and scales.
|
||||
[url:More info at http://umbraco.org|http://umbraco.org]
|
||||
|
||||
!! Forums
|
||||
We have a forum running on [url:http://our.umbraco.org]. The discussions area on CodePlex will be for discussions on developing the core, and not on Umbraco-implementations or extensions in general. For those topics, please use [url:http://our.umbraco.org].
|
||||
More info at http://umbraco.com
|
||||
|
||||
!! Submitting Issues
|
||||
Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our [url:online guide|http://our.umbraco.org/wiki/how-tos/submitting-bug-reports].
|
||||
Exploring the repository
|
||||
========================
|
||||
Most contributors will work on their own fork and should pick the branch in which they need their fix. For more information see:
|
||||
http://our.umbraco.org/contribute/guidelines-for-core-contribution
|
||||
|
||||
Exploring the source
|
||||
====================
|
||||
The Umbraco source code is never required for you to start building sites. If you are not using the source code for debugging purposes or to contribute to the source then please download the binaries listed at http://umbraco.codeplex.com
|
||||
|
||||
With that said, the Umbraco solution can be opened in Visual Studio 2010 with SP1 installed or Visual Studio 2012.
|
||||
|
||||
Contributing
|
||||
============
|
||||
Umbraco is Open Source which means you can contribute to make it great!
|
||||
Read all about it at http://our.umbraco.org/contribute
|
||||
|
||||
Forums
|
||||
======
|
||||
We have a forum running on http://our.umbraco.org for friendly community support.
|
||||
|
||||
Documentation
|
||||
=============
|
||||
Our documentation section provides help on installing and using Umbraco including API reference documentation: http://our.umbraco.org/documentation
|
||||
|
||||
Submitting Issues
|
||||
=================
|
||||
Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our online guide at http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<solution>
|
||||
<add key="disableSourceControlIntegration" value="true" />
|
||||
</solution>
|
||||
</configuration>
|
||||
Binary file not shown.
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
|
||||
|
||||
<!-- Enable the restore command to run before builds -->
|
||||
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
|
||||
|
||||
<!-- Property that enables building a package from a project -->
|
||||
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
|
||||
|
||||
<!-- Determines if package restore consent is required to restore packages -->
|
||||
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
|
||||
|
||||
<!-- Download NuGet.exe if it does not already exist -->
|
||||
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(PackageSources)' == '' ">
|
||||
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
|
||||
<!--
|
||||
<PackageSource Include="https://nuget.org/api/v2/" />
|
||||
<PackageSource Include="https://my-nuget-source/nuget/" />
|
||||
-->
|
||||
<PackageSource Include="https://nuget.org/api/v2/" />
|
||||
<PackageSource Include="http://www.myget.org/F/umbracocore/" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
|
||||
<!-- Windows specific commands -->
|
||||
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
|
||||
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
|
||||
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
|
||||
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
|
||||
<PackagesConfig>packages.config</PackagesConfig>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- NuGet command -->
|
||||
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\nuget.exe</NuGetExePath>
|
||||
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
|
||||
|
||||
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
|
||||
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
|
||||
|
||||
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
|
||||
|
||||
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
|
||||
<!-- Commands -->
|
||||
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) "</RestoreCommand>
|
||||
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
|
||||
|
||||
<!-- We need to ensure packages are restored prior to assembly resolve -->
|
||||
<ResolveReferencesDependsOn Condition="$(RestorePackages) == 'true'">
|
||||
RestorePackages;
|
||||
$(ResolveReferencesDependsOn);
|
||||
</ResolveReferencesDependsOn>
|
||||
|
||||
<!-- Make the build depend on restore packages -->
|
||||
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
|
||||
$(BuildDependsOn);
|
||||
BuildPackage;
|
||||
</BuildDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CheckPrerequisites">
|
||||
<!-- Raise an error if we're unable to locate nuget.exe -->
|
||||
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
|
||||
<SetEnvironmentVariable EnvKey="VisualStudioVersion" EnvValue="$(VisualStudioVersion)" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " />
|
||||
<!--
|
||||
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
|
||||
This effectively acts as a lock that makes sure that the download operation will only happen once and all
|
||||
parallel builds will have to wait for it to complete.
|
||||
-->
|
||||
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_DownloadNuGet">
|
||||
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(BuildCommand)"
|
||||
Condition=" '$(OS)' != 'Windows_NT' " />
|
||||
|
||||
<Exec Command="$(BuildCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" '$(OS)' == 'Windows_NT' " />
|
||||
</Target>
|
||||
|
||||
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
||||
<ParameterGroup>
|
||||
<OutputFilename ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Reference Include="System.Core" />
|
||||
<Using Namespace="System" />
|
||||
<Using Namespace="System.IO" />
|
||||
<Using Namespace="System.Net" />
|
||||
<Using Namespace="Microsoft.Build.Framework" />
|
||||
<Using Namespace="Microsoft.Build.Utilities" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
try {
|
||||
OutputFilename = Path.GetFullPath(OutputFilename);
|
||||
|
||||
Log.LogMessage("Downloading latest version of NuGet.exe...");
|
||||
WebClient webClient = new WebClient();
|
||||
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Log.LogErrorFromException(ex);
|
||||
return false;
|
||||
}
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
|
||||
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
||||
<ParameterGroup>
|
||||
<EnvKey ParameterType="System.String" Required="true" />
|
||||
<EnvValue ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Using Namespace="System" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
try {
|
||||
Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
|
||||
}
|
||||
catch {
|
||||
}
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
</Project>
|
||||
@@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestSettings name="INDIGO64 Tests" id="338122db-6049-471e-b696-cbaf25469edc" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
|
||||
<Description>This is a default test run configuration for a local test run.</Description>
|
||||
<Execution>
|
||||
<Hosts type="ASP.NET" skipUnhostableTests="false">
|
||||
<AspNet name="ASP.NET" executionType="Iis" urlToTest="http://sandbox1.umbraco.local">
|
||||
<DevelopmentServer pathToWebSite="C:\Development\CodePlex\Umbraco\branches\4.1.0\umbraco\presentation" webApplicationRoot="/" />
|
||||
</AspNet>
|
||||
</Hosts>
|
||||
<TestTypeSpecific>
|
||||
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
|
||||
<AssemblyResolution>
|
||||
<TestDirectory useLoadContext="true" />
|
||||
</AssemblyResolution>
|
||||
</UnitTestRunConfig>
|
||||
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207">
|
||||
<Browser name="Internet Explorer 7.0">
|
||||
<Headers>
|
||||
<Header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" />
|
||||
<Header name="Accept" value="*/*" />
|
||||
<Header name="Accept-Language" value="{{$IEAcceptLanguage}}" />
|
||||
<Header name="Accept-Encoding" value="GZIP" />
|
||||
</Headers>
|
||||
</Browser>
|
||||
</WebTestRunConfiguration>
|
||||
</TestTypeSpecific>
|
||||
<AgentRule name="LocalMachineDefaultRole">
|
||||
<DataCollectors>
|
||||
<DataCollector uri="datacollector://microsoft/TraceDebugger/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TraceDebuggerDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="IntelliTrace">
|
||||
</DataCollector>
|
||||
<DataCollector uri="datacollector://microsoft/HttpProxy/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.HttpProxyCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="ASP.NET Client Proxy for IntelliTrace and Test Impact">
|
||||
</DataCollector>
|
||||
<DataCollector uri="datacollector://microsoft/AspNetProfiler/1.0" assemblyQualifiedName="Microsoft.VisualStudio.PerformanceTools.DataCollection.AspNetProfileDataCollector, Microsoft.VisualStudio.PerformanceTools.DataCollection, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="ASP.NET Profiler">
|
||||
</DataCollector>
|
||||
</DataCollectors>
|
||||
</AgentRule>
|
||||
</Execution>
|
||||
</TestSettings>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,83 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--Created with Liquid XML Studio - FREE Community Edition 7.0.5.906 (http://www.liquid-technologies.com)-->
|
||||
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="DocumentTypes">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="DocumentType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Repesents an Umbraco Document Type and its known properties</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:complexContent mixed="false">
|
||||
<xs:extension base="BaseStructure">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="xs:string" />
|
||||
<xs:element name="Properties">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="Property">
|
||||
<xs:complexType>
|
||||
<xs:complexContent mixed="false">
|
||||
<xs:extension base="BaseStructure">
|
||||
<xs:sequence>
|
||||
<xs:element name="Mandatory" type="xs:boolean" />
|
||||
<xs:element name="RegularExpression" type="xs:string" />
|
||||
<xs:element name="Type" type="xs:string" />
|
||||
<xs:element name="ControlId" type="xs:string" />
|
||||
<xs:element name="Description" type="xs:string" />
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Associations">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="Association" type="xs:string" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="ParentId" type="xs:int" use="required" />
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="DataContextName" use="required">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Name prefix for the DataContext that will be generated</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string" />
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="Serialization" use="required">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Serialization mode of the generated classes</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="None" />
|
||||
<xs:enumeration value="Unidirectional" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="PluralizeCollections" type="xs:boolean" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:complexType name="BaseStructure">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Pairing of ID and Name</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:sequence>
|
||||
<xs:element name="Id" type="xs:int" />
|
||||
<xs:element name="Name" type="xs:string" />
|
||||
<xs:element name="Alias" type="xs:string" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:complexType name="nodeType">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="data">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="alias" type="xs:string" use="required" />
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" name="node" type="nodeType" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="id" type="xs:int" use="required" />
|
||||
<xs:attribute name="version" type="xs:string" use="required" />
|
||||
<xs:attribute name="parentID" type="xs:int" use="required" />
|
||||
<xs:attribute name="level" type="xs:int" use="required" />
|
||||
<xs:attribute name="writerID" type="xs:int" use="required" />
|
||||
<xs:attribute name="creatorID" type="xs:int" use="required" />
|
||||
<xs:attribute name="nodeType" type="xs:int" use="required" />
|
||||
<xs:attribute name="template" type="xs:int" use="required" />
|
||||
<xs:attribute name="sortOrder" type="xs:int" use="required" />
|
||||
<xs:attribute name="createDate" type="xs:dateTime" use="required" />
|
||||
<xs:attribute name="updateDate" type="xs:dateTime" use="required" />
|
||||
<xs:attribute name="nodeName" type="xs:string" use="required" />
|
||||
<xs:attribute name="urlName" type="xs:string" use="required" />
|
||||
<xs:attribute name="writerName" type="xs:string" use="required" />
|
||||
<xs:attribute name="creatorName" type="xs:string" use="required" />
|
||||
<xs:attribute name="nodeTypeAlias" type="xs:string" use="required" />
|
||||
<xs:attribute name="path" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
<xs:element name="root">
|
||||
<xs:complexType>
|
||||
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="node" type="nodeType" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="id" type="xs:int" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -1,83 +0,0 @@
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{324A7FA9-8F19-4D4D-B96A-6F673C82BC92}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>umbraco.LinqCore.Mockable.Tests</RootNamespace>
|
||||
<AssemblyName>umbraco.LinqCore.Mockable.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug - Fixed Version|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug - Fixed Version\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
|
||||
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\dep\Reference Assemblies\Mocking\Rhino.Mocks.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Solution Items\SolutionInfo.cs">
|
||||
<Link>Properties\SolutionInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="DataContextMockTest.cs" />
|
||||
<Compile Include="MyUmbraco.designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Core\umbraco.Linq.Core.csproj">
|
||||
<Project>{31CAEC36-0C3D-4D69-B092-84866811EA07}</Project>
|
||||
<Name>umbraco.Linq.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,84 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Rhino.Mocks;
|
||||
using umbraco.Linq.Core;
|
||||
using umbraco.Test;
|
||||
|
||||
namespace umbraco.LinqCore.Mockable.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for DataContextMockTest
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public class DataContextMockTest
|
||||
{
|
||||
public DataContextMockTest()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod]
|
||||
public void DataContextMockTest_MockProvider()
|
||||
{
|
||||
var dataProvider = MockRepository.GenerateMock<UmbracoDataProvider>();
|
||||
using (var ctx = new MyUmbracoDataContext(dataProvider))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, ExpectedException(typeof(NotImplementedException))]
|
||||
public void DataContextMockTest_MockProviderThrowsException()
|
||||
{
|
||||
var dataProvider = MockRepository.GenerateMock<UmbracoDataProvider>();
|
||||
|
||||
dataProvider.Stub(d => d.LoadTree<CwsHome>()).Throw(new NotImplementedException());
|
||||
using (var ctx = new MyUmbracoDataContext(dataProvider))
|
||||
{
|
||||
var homes = ctx.CwsHomes;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-3868
File diff suppressed because it is too large
Load Diff
@@ -1,9 +0,0 @@
|
||||
using System.Reflection;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Core")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Core")]
|
||||
@@ -1,118 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using umbraco.Test;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for AncestorTest
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class AncestorTest
|
||||
{
|
||||
public AncestorTest()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void AncestorTest_NoWhereCondition_Exists()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var textPage = ctx.CWSTextpages.First();
|
||||
|
||||
var hp = textPage.AncestorOrDefault<CWSHome>();
|
||||
|
||||
Assert.IsNotNull(hp);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void AncestorTest_NoWhereCondition_NotExists()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var textPage = ctx.CWSTextpages.First();
|
||||
|
||||
var a = textPage.AncestorOrDefault<CWSPhoto>();
|
||||
|
||||
Assert.IsNull(a);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void AncestorTest_Where_Exists()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var photo = ctx.CWSPhotos.First(p => p.Name.Contains("Umbraco"));
|
||||
var gallery = photo.AncestorOrDefault<CWSGallery>(g => g.Name.Contains("Codegarden"));
|
||||
|
||||
Assert.IsNotNull(gallery);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void AncestorTest_Where_NotExists()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var photo = ctx.CWSPhotos.First(p => p.Name.Contains("Umbraco"));
|
||||
var gallery = photo.AncestorOrDefault<CWSGallery>(g => g.Name.Contains("Bookhouses"));
|
||||
|
||||
Assert.IsNull(gallery);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="umbracoPath" value="umbraco.config"/>
|
||||
</appSettings>
|
||||
</configuration>
|
||||
@@ -1,136 +0,0 @@
|
||||
==========================================================================
|
||||
Visual Studio Team System: Overview of Authoring and Running Tests
|
||||
==========================================================================
|
||||
|
||||
This overview describes the features for authoring and running tests in
|
||||
Visual Studio Team System and Visual Studio Team Edition for Software Testers.
|
||||
|
||||
Opening Tests
|
||||
-------------
|
||||
To open a test, open a test project or a test metadata file (a file with
|
||||
extension .vsmdi) that contains the definition of the test. You can find
|
||||
test projects and metadata files in Solution Explorer.
|
||||
|
||||
Viewing Tests
|
||||
-------------
|
||||
To see which tests are available to you, open the Test View window. Or,
|
||||
if you have installed Team Edition for Software Testers, you can also open
|
||||
the Test List Editor window to view tests.
|
||||
|
||||
To open the Test View window, click the Test menu, point to Windows, and
|
||||
then click Test View. To open the Test List Editor window (if you have
|
||||
installed Team Edition for Software Testers), click Test, point to Windows,
|
||||
and then click Test List Editor.
|
||||
|
||||
Running Tests
|
||||
-------------
|
||||
You can run tests from the Test View window and the Test List Editor window.
|
||||
See Viewing Tests to learn how to open these windows. To run one or more
|
||||
tests displayed in the Test View window, first select the tests in that
|
||||
window; to select multiple tests, hold either the Shift or CTRL key while
|
||||
clicking tests. Then click the Run Tests button in the Test View window
|
||||
toolbar.
|
||||
|
||||
If you have installed Visual Studio Team Edition for Software Testers, you can
|
||||
also use the Test List Editor window to run tests. To run tests in Test List Editor,
|
||||
select the check box next to each test that you want to run. Then click the
|
||||
Run Tests button in the Test List Editor window toolbar.
|
||||
|
||||
Viewing Test Results
|
||||
--------------------
|
||||
When you run a test or a series of tests, the results of the test run will be
|
||||
shown in the Test Results window. Each individual test in the run is shown on
|
||||
a separate line so that you can see its status. The window contains an
|
||||
embedded status bar in the top half of the window that provides you with
|
||||
summary details of the complete test run.
|
||||
|
||||
To see more detailed results for a particular test result, double-click it in
|
||||
the Test Results window. This opens a window that provides more information
|
||||
about the particular test result, such as any specific error messages returned
|
||||
by the test.
|
||||
|
||||
Changing the way that tests are run
|
||||
-----------------------------------
|
||||
Each time you run one or more tests, a collection of settings is used to
|
||||
determine how those tests are run. These settings are contained in a “test
|
||||
run configuration” file.
|
||||
|
||||
Here is a partial list of the changes you can make with a test run
|
||||
configuration file:
|
||||
|
||||
- Change the naming scheme for each test run.
|
||||
- Change the test controller that the tests are run on so that you can run
|
||||
tests remotely.
|
||||
- Gather code coverage data for the code being tested so that you can see
|
||||
which lines of code are covered by your tests.
|
||||
- Enable and disable test deployment.
|
||||
- Specify additional files to deploy before tests are run.
|
||||
- Select a different host, ASP.NET, for running ASP.NET unit tests.
|
||||
- Select a different host, the smart device test host, for running smart device unit tests.
|
||||
- Set various properties for the test agents that run your tests.
|
||||
- Run custom scripts at the start and end of each test run so that you can
|
||||
set up the test environment exactly as required each time tests are run.
|
||||
- Set time limits for tests and test runs.
|
||||
- Set the browser mix and the number of times to repeat Web tests in the
|
||||
test run.
|
||||
|
||||
By default, a test run configuration file is created whenever you create a
|
||||
new test project. You make changes to this file by double-clicking it in
|
||||
Solution Explorer and then changing its settings. (Test run configuration
|
||||
files have the extension .testrunconfig.)
|
||||
|
||||
A solution can contain multiple test run configuration files. Only one of
|
||||
those files, known as the “Active” test run configuration file, is used to
|
||||
determine the settings that are currently used for test runs. You select
|
||||
the active test run configuration by clicking Select Active Test Run
|
||||
Configuration on the Test menu.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Test Types
|
||||
----------
|
||||
Using Visual Studio Team Edition for Software Testers, you can create a number
|
||||
of different test types:
|
||||
|
||||
Unit test: Use a unit test to create a programmatic test in C++, Visual C# or
|
||||
Visual Basic that exercises source code. A unit test calls the methods of a
|
||||
class, passing suitable parameters, and verifies that the returned value is
|
||||
what you expect.
|
||||
There are three specialized variants of unit tests:
|
||||
- Data-driven unit tests are created when you configure a unit test to be
|
||||
called repeatedly for each row of a data source. The data from each row
|
||||
is used by the unit test as input data.
|
||||
- ASP.NET unit tests are unit tests that exercise code in an ASP.NET Web
|
||||
application.
|
||||
- Smart device unit tests are unit tests that are deployed to a smart device
|
||||
or emulator and then executed by the smart device test host.
|
||||
|
||||
Web Test: Web tests consist of an ordered series of HTTP requests that you
|
||||
record in a browser session using Microsoft Internet Explorer. You can have
|
||||
the test report specific details about the pages or sites it requests, such
|
||||
as whether a particular page contains a specified string.
|
||||
|
||||
Load Test: You use a load test to encapsulate non-manual tests, such as
|
||||
unit, Web, and generic tests, and then run them simultaneously by using
|
||||
virtual users. Running these tests under load generates test results,
|
||||
including performance and other counters, in tables and in graphs.
|
||||
|
||||
Generic test: A generic test is an existing program wrapped to function as a
|
||||
test in Visual Studio. The following are examples of tests or programs that
|
||||
you can turn into generic tests:
|
||||
- An existing test that uses process exit codes to communicate whether the
|
||||
test passed or failed. 0 indicates passing and any other value indicates
|
||||
a failure.
|
||||
- A general program to obtain specific functionality during a test scenario.
|
||||
- A test or program that uses a special XML file (called a “summary results
|
||||
file”), to communicate detailed results.
|
||||
|
||||
Manual test: The manual test type is used when the test tasks are to be
|
||||
completed by a test engineer as opposed to an automated script.
|
||||
|
||||
Ordered test: Use an ordered test to execute a set of tests in an order you
|
||||
specify.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using umbraco.Test;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for CacheTest
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class CacheTest
|
||||
{
|
||||
public CacheTest()
|
||||
{
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void CacheTest_ForcedRefresh()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var hps = ctx.CWSHomes;
|
||||
|
||||
ctx.CWSHomes.ReloadCache();
|
||||
|
||||
var reloadedHps = ctx.CWSHomes;
|
||||
|
||||
Assert.AreNotSame(reloadedHps, hps, "Force reload should result in a different object");
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void CacheTest_RequeryLoadFromCache()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var hps = ctx.CWSHomes;
|
||||
|
||||
var requeriedHps = ctx.CWSHomes;
|
||||
|
||||
Assert.AreSame(requeriedHps, hps, "Requeried objects should result in the same collection");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using umbraco.Test;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for ChildTest
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class ChildTest
|
||||
{
|
||||
public ChildTest()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void ChildTest_ChildExist()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var pages = ctx.CWSHomes.First().CWSTextpages;
|
||||
|
||||
Assert.AreNotEqual(0, pages.Count());
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void ChildTest_ChildToParent()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var page = ctx.CWSHomes.First().CWSTextpages.First();
|
||||
|
||||
Assert.AreEqual(ctx.CWSHomes.First().Id, page.Parent<CWSHome>().Id);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void ChildTest_AllChildren()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var hp = ctx.CWSHomes.First();
|
||||
|
||||
Assert.IsTrue(hp.Children.Count() > 0);
|
||||
Assert.IsInstanceOfType(hp.Children.First(), typeof(CWSTextpage));
|
||||
Assert.IsInstanceOfType(hp.Children.Skip(1).First(), typeof(CWSGalleryList));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A80528D0-E68C-4A94-9489-C712216665B0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>umbraco.Linq.Core.Tests</RootNamespace>
|
||||
<AssemblyName>umbraco.Linq.Core.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug - Fixed Version|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug - Fixed Version\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
|
||||
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="TypeMock, Version=5.3.0.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\dep\Reference Assemblies\Mocking\TypeMock.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Typemock.ArrangeActAssert, Version=5.3.0.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\dep\Reference Assemblies\Mocking\Typemock.ArrangeActAssert.Dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Solution Items\SolutionInfo.cs">
|
||||
<Link>Properties\SolutionInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="AncestorTest.cs" />
|
||||
<Compile Include="CacheTest.cs" />
|
||||
<Compile Include="ChildTest.cs" />
|
||||
<Compile Include="CwsReplicationTest.cs" />
|
||||
<Compile Include="DataContextTest.cs" />
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="InheritanceTest.cs" />
|
||||
<Compile Include="MockHelpers.cs" />
|
||||
<Compile Include="MyUmbraco.Abstractions.cs" />
|
||||
<Compile Include="MyUmbraco.designer.cs" />
|
||||
<Compile Include="OrderingTest.cs" />
|
||||
<Compile Include="ParentTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SelectTest.cs" />
|
||||
<Compile Include="WhereTest.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="AuthoringTests.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\..\..\dep\Test Helpers\umbraco.config">
|
||||
<Link>umbraco.config</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\umbraco\businesslogic\umbraco.businesslogic.csproj">
|
||||
<Project>{E469A9CE-1BEC-423F-AC44-713CD72457EA}</Project>
|
||||
<Name>umbraco.businesslogic</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\umbraco\datalayer\umbraco.datalayer.csproj">
|
||||
<Project>{C7CB79F0-1C97-4B33-BFA7-00731B579AE2}</Project>
|
||||
<Name>umbraco.datalayer</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\umbraco\presentation\umbraco.presentation.csproj">
|
||||
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
|
||||
<Name>umbraco.presentation</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Core\umbraco.Linq.Core.csproj">
|
||||
<Project>{31CAEC36-0C3D-4D69-B092-84866811EA07}</Project>
|
||||
<Name>umbraco.Linq.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,85 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using umbraco.Test;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests to replicate the functionality of the CWS2 xslt's
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class CwsReplicationTest
|
||||
{
|
||||
public CwsReplicationTest()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void CwsReplicationTest_ListGalleries()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var galleryList = ctx.CWSGalleryLists.First(); //this would really be a Where(g => g.Id == umbracoContext.Current.PageId.Value) but since I'm not really on a page...
|
||||
|
||||
var galleries = from g in galleryList.CWSGalleries
|
||||
where g.CWSPhotos.Count() >= 1
|
||||
orderby g.Name
|
||||
select new
|
||||
{
|
||||
g.Name,
|
||||
Url = umbraco.library.NiceUrl(g.Id),
|
||||
Thumbnail = (string.IsNullOrEmpty(g.GalleryThumbnail) ? "/Assets/Placeholders/gallery_placeholder.gif" : g.GalleryThumbnail),
|
||||
PhotoCount = g.CWSPhotos.Count(),
|
||||
};
|
||||
|
||||
Assert.AreEqual(3, galleries.Count());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using umbraco.Linq.Core.Node;
|
||||
using umbraco.Test;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for DataContextTest
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class DataContextTest
|
||||
{
|
||||
public DataContextTest()
|
||||
{
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod, ExpectedException(typeof(ArgumentNullException))]
|
||||
public void DataContextTest_FileNameRequired()
|
||||
{
|
||||
var nodeProvider = new NodeDataProvider(string.Empty);
|
||||
}
|
||||
|
||||
[TestMethod, ExpectedException(typeof(FileNotFoundException))]
|
||||
public void DataContextTest_FileMustExist()
|
||||
{
|
||||
var nodeProvider = new NodeDataProvider(@"C:\fakeFile.config");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DataContextTest_ConstructFromExistingProvider()
|
||||
{
|
||||
var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config"));
|
||||
|
||||
MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DataContextTest_EnsureSchemaValidation()
|
||||
{
|
||||
var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config"), true);
|
||||
|
||||
MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider);
|
||||
|
||||
var hp = ctx.CWSHomes.First();
|
||||
|
||||
Assert.IsNotNull(hp);
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void DataContextTest_DefaultConstructorIsNodeProvider()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
var ctx = new MyUmbracoDataContext();
|
||||
|
||||
Assert.IsInstanceOfType(ctx.DataProvider, typeof(NodeDataProvider));
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void DataContextTest_NodeCached()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var hp = ctx.CWSHomes.First();
|
||||
var hp2 = ctx.CWSHomes.First();
|
||||
|
||||
Assert.AreSame(hp, hp2);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void DataContextTest_FullCache()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var one = ctx.CWSHomes;
|
||||
var two = ctx.CWSHomes;
|
||||
|
||||
Assert.AreSame(one, two);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void DataContextTest_OfNodeTypes()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var tree = ctx.CWSHomes;
|
||||
|
||||
Assert.IsInstanceOfType(tree, typeof(NodeTree<CWSHome>));
|
||||
Assert.IsInstanceOfType(tree.First().CWSTextpages, typeof(NodeAssociationTree<CWSTextpage>));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
public static ActionRepeater<TReturn> WillReturnRepeat<TReturn>(this IPublicNonVoidMethodHandler<TReturn> ret, TReturn value, int numberOfReturns)
|
||||
{
|
||||
for (var i = 0; i < numberOfReturns; i++)
|
||||
ret.WillReturn(value);
|
||||
|
||||
return new ActionRepeater<TReturn>(ret);
|
||||
}
|
||||
|
||||
public static ActionRepeater<TReturn> CallOriginalRepeat<TReturn>(this IPublicNonVoidMethodHandler<TReturn> ret, int numberOfReturns)
|
||||
{
|
||||
for (var i = 0; i < numberOfReturns; i++)
|
||||
ret.CallOriginal();
|
||||
|
||||
return new ActionRepeater<TReturn>(ret);
|
||||
}
|
||||
}
|
||||
|
||||
public class ActionRepeater<TReturn>
|
||||
{
|
||||
private IPublicNonVoidMethodHandler<TReturn> _actionRepeater;
|
||||
public ActionRepeater(IPublicNonVoidMethodHandler<TReturn> actionRepeater)
|
||||
{
|
||||
_actionRepeater = actionRepeater;
|
||||
}
|
||||
|
||||
public IPublicNonVoidMethodHandler<TReturn> AndThen()
|
||||
{
|
||||
return _actionRepeater;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using umbraco.Test;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for InheritanceTest
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class InheritanceTest
|
||||
{
|
||||
public InheritanceTest()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod]
|
||||
public void InheritanceTest_ImplementsBaseClass()
|
||||
{
|
||||
var tmp = new TextPageThreeCol();
|
||||
|
||||
Assert.AreEqual(typeof(CWSTextpageTwoCol), tmp.GetType().BaseType);
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void InheritanceTest_PropertyFromBase()
|
||||
{
|
||||
var fake = Isolate.Fake.Instance<TextPageThreeCol>();
|
||||
|
||||
Assert.AreEqual(typeof(CWSTextpageTwoCol), fake.GetType().GetProperties().Single(p => p.Name == "Headertext").DeclaringType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using System.Web;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using System.IO;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
internal class MockHelpers
|
||||
{
|
||||
public static void SetupFakeHttpContext()
|
||||
{
|
||||
HttpContext fakeHttpContext = Isolate.Fake.Instance<HttpContext>(Members.MustSpecifyReturnValues);
|
||||
HttpServerUtility fakeServer = Isolate.Fake.Instance<HttpServerUtility>();
|
||||
Isolate.WhenCalled(() => HttpContext.Current).WillReturn(fakeHttpContext);
|
||||
Isolate.WhenCalled(() => fakeHttpContext.Server).WillReturn(fakeServer);
|
||||
Isolate.WhenCalled(() => fakeServer.MapPath(string.Empty)).WillReturn(Path.Combine(Environment.CurrentDirectory, "umbraco.config"));
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,81 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using umbraco.Test;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for OrderingTest
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class OrderingTest
|
||||
{
|
||||
public OrderingTest()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void OrderingTest_Date()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var orderedContext = new MyUmbracoDataContext())
|
||||
{
|
||||
var asc = orderedContext.CWSTextpages.OrderBy(p => p.CreateDate);
|
||||
|
||||
var desc = orderedContext.CWSTextpages.OrderByDescending(p => p.CreateDate);
|
||||
|
||||
Assert.AreEqual(asc.Count(), desc.Count());
|
||||
Assert.AreNotEqual(asc.First().Id, desc.First().Id);
|
||||
Assert.AreEqual(asc.First().Id, desc.Last().Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using umbraco.Test;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for ParentTest
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class ParentTest
|
||||
{
|
||||
public ParentTest()
|
||||
{
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void ParentTest_ParentIdExists()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var p = ctx.CWSTextpages.First();
|
||||
Assert.AreNotEqual(0, p.ParentNodeId);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void ParentTest_ParentCreated()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var page = ctx.CWSTextpages.Single(p => p.Id == 1099);
|
||||
|
||||
Assert.AreEqual(1098, page.ParentNodeId);
|
||||
|
||||
var parent = page.Parent<CWSHome>();
|
||||
|
||||
Assert.AreEqual(page.ParentNodeId, parent.Id);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void ParentTest_TopParentNull()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var hp = ctx.CWSHomes.First();
|
||||
Assert.IsNull(hp.Parent<CWSHome>());
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated, ExpectedException(typeof(DocTypeMissMatchException))]
|
||||
public void ParentTest_InvalidParentType()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var p = ctx.CWSPhotos.First().Parent<CWSHome>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using System.Reflection;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Core")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Core")]
|
||||
@@ -1,179 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using umbraco.Test;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for SelectTest
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class SelectTest
|
||||
{
|
||||
public SelectTest()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void SelectTest_LoopTree_Query()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var homePages = from hp in ctx.CWSHomes
|
||||
select hp;
|
||||
|
||||
Assert.IsNotNull(homePages);
|
||||
foreach (var item in homePages)
|
||||
{
|
||||
Assert.IsTrue(item.BodyText.Length > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void SelectTest_LoopTree_Lambda()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var homePages = ctx.CWSHomes;
|
||||
|
||||
Assert.IsNotNull(homePages);
|
||||
foreach (CWSHome item in homePages)
|
||||
{
|
||||
Assert.IsTrue(item.BodyText.Length > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void SelectTest_SingleProperty_Query()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var homePageText = from hp in ctx.CWSHomes
|
||||
select hp.BodyText;
|
||||
|
||||
Assert.IsNotNull(homePageText);
|
||||
foreach (var item in homePageText)
|
||||
{
|
||||
Assert.IsNotNull(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void SelectTest_SingleProperty_Lambda()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var homePageText = ctx.CWSHomes.Select(hp => hp.BodyText);
|
||||
|
||||
Assert.IsNotNull(homePageText);
|
||||
foreach (var item in homePageText)
|
||||
{
|
||||
Assert.IsNotNull(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void SelectTest_Anonymous_Query()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var anon = from hp in ctx.CWSHomes
|
||||
select new
|
||||
{
|
||||
hp.BodyText,
|
||||
CreatedDate = hp.CreateDate
|
||||
};
|
||||
|
||||
Assert.IsNotNull(anon);
|
||||
foreach (var item in anon)
|
||||
{
|
||||
Assert.IsNotNull(item.BodyText);
|
||||
Assert.AreNotEqual(DateTime.MinValue, item.CreatedDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void SelectTest_Anonymous_Lambda()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var anon = ctx.CWSHomes.Select(hp => new
|
||||
{
|
||||
hp.BodyText,
|
||||
CreatedDate = hp.CreateDate
|
||||
});
|
||||
|
||||
Assert.IsNotNull(anon);
|
||||
foreach (var item in anon)
|
||||
{
|
||||
Assert.IsNotNull(item.BodyText);
|
||||
Assert.AreNotEqual(DateTime.MinValue, item.CreatedDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using TypeMock.ArrangeActAssert;
|
||||
using umbraco.Test;
|
||||
|
||||
namespace umbraco.Linq.Core.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for WhereTest
|
||||
/// </summary>
|
||||
[TestClass, DeploymentItem("umbraco.config")]
|
||||
public class WhereTest
|
||||
{
|
||||
public WhereTest()
|
||||
{
|
||||
//
|
||||
// TODO: Add constructor logic here
|
||||
//
|
||||
}
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
// You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
// Use ClassInitialize to run code before running the first test in the class
|
||||
// [ClassInitialize()]
|
||||
// public static void MyClassInitialize(TestContext testContext) { }
|
||||
//
|
||||
// Use ClassCleanup to run code after all tests in a class have run
|
||||
// [ClassCleanup()]
|
||||
// public static void MyClassCleanup() { }
|
||||
//
|
||||
// Use TestInitialize to run code before running each test
|
||||
// [TestInitialize()]
|
||||
// public void MyTestInitialize() { }
|
||||
//
|
||||
// Use TestCleanup to run code after each test has run
|
||||
// [TestCleanup()]
|
||||
// public void MyTestCleanup() { }
|
||||
//
|
||||
#endregion
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void WhereTest_SingleParameter_Query()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var pages = from page in ctx.CWSTextpages
|
||||
where page.BodyText.Length > 0
|
||||
select page;
|
||||
|
||||
Assert.IsNotNull(pages);
|
||||
Assert.IsTrue(pages.Count() > 0);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void WhereTest_DateTimeGreaterThan_Query()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var pages = from page in ctx.CWSTextpages
|
||||
where page.CreateDate > DateTime.MinValue
|
||||
select page;
|
||||
|
||||
Assert.IsNotNull(pages);
|
||||
Assert.IsTrue(pages.Count() > 0);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void WhereTest_TwoParameter_Query()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var pages = from page in ctx.CWSTextpages
|
||||
where page.BodyText.Length > 0
|
||||
&& page.CreateDate > DateTime.MinValue
|
||||
select page;
|
||||
|
||||
Assert.IsNotNull(pages);
|
||||
Assert.IsTrue(pages.Count() > 0);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod, Isolated]
|
||||
public void WhereTest_ToAnonymous()
|
||||
{
|
||||
MockHelpers.SetupFakeHttpContext();
|
||||
using (var ctx = new MyUmbracoDataContext())
|
||||
{
|
||||
var pages = from page in ctx.CWSTextpages
|
||||
where page.BodyText.Length > 0
|
||||
select new
|
||||
{
|
||||
page.Id,
|
||||
page.BodyText
|
||||
};
|
||||
|
||||
Assert.AreNotEqual(0, pages.Count());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the child items of TDocTypeBase
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is used for creating a DataProvider specific child item collection of a DocType instance.
|
||||
///
|
||||
/// It allows a DocType to have strongly typed child associations, and accessors such as:
|
||||
/// <example>
|
||||
/// myDocType.SomeChildTypes
|
||||
/// </example>
|
||||
/// </remarks>
|
||||
/// <typeparam name="TDocTypeBase">The type of the DocTypeBase which this association represents.</typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
|
||||
public abstract class AssociationTree<TDocTypeBase> : Tree<TDocTypeBase> where TDocTypeBase : DocTypeBase, new()
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the parent node id which this AssociationTree is for
|
||||
/// </summary>
|
||||
/// <value>The parent node id.</value>
|
||||
public int ParentNodeId { get; protected set; }
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Standard umbraco info
|
||||
/// </summary>
|
||||
[global::System.AttributeUsage(AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)]
|
||||
public sealed class UmbracoInfoAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UmbracoInfoAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="alias">The alias for this piece of umbraco info.</param>
|
||||
public UmbracoInfoAttribute(string alias)
|
||||
{
|
||||
this.Alias = alias;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display name of the item.
|
||||
/// </summary>
|
||||
/// <value>The display name.</value>
|
||||
public string DisplayName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the alias.
|
||||
/// </summary>
|
||||
/// <value>The alias.</value>
|
||||
public string Alias { get; private set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this property is mandatory.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if mandatory; otherwise, <c>false</c>.</value>
|
||||
public bool Mandatory { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Marks a class as an umbraco DocType
|
||||
/// </summary>
|
||||
[global::System.AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)]
|
||||
public sealed class DocTypeAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DocTypeAttribute"/> class.
|
||||
/// </summary>
|
||||
public DocTypeAttribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Marks a property as a standard umbraco field
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Example usage:
|
||||
/// - ID
|
||||
/// - ParentID
|
||||
/// - CreateDate
|
||||
/// </remarks>
|
||||
[global::System.AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
|
||||
public sealed class FieldAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FieldAttribute"/> class.
|
||||
/// </summary>
|
||||
public FieldAttribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Marks a property as a custom umbraco DocType property
|
||||
/// </summary>
|
||||
[global::System.AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
|
||||
public sealed class PropertyAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PropertyAttribute"/> class.
|
||||
/// </summary>
|
||||
public PropertyAttribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1" GroupingSetting="Access" MembersFormat="NameAndType">
|
||||
<Class Name="umbraco.Linq.Core.AssociationTree<TDocTypeBase>">
|
||||
<Position X="1" Y="4.75" Width="2.25" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAA=</HashCode>
|
||||
<FileName>AssociationTree.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="umbraco.Linq.Core.DocTypeBase" BaseTypeListCollapsed="true">
|
||||
<Position X="8.25" Y="0.75" Width="4.5" />
|
||||
<Compartments>
|
||||
<Compartment Name="Internal" Collapsed="true" />
|
||||
<Compartment Name="Private" Collapsed="true" />
|
||||
</Compartments>
|
||||
<TypeIdentifier>
|
||||
<HashCode>MAASJAACAQCEAAAgAACUYAQBgACAAAAhEAIBAAEEAYI=</HashCode>
|
||||
<FileName>DocTypeBase.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" />
|
||||
</Class>
|
||||
<Class Name="umbraco.Linq.Core.Tree<TDocType>">
|
||||
<Position X="2.5" Y="0.75" Width="3" />
|
||||
<Compartments>
|
||||
<Compartment Name="Private" Collapsed="true" />
|
||||
</Compartments>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAQAAAAAAAEABAQAAAAAAAAAAAAAAAEAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Tree.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" />
|
||||
</Class>
|
||||
<Class Name="umbraco.Linq.Core.UmbracoDataContext" BaseTypeListCollapsed="true">
|
||||
<Position X="13" Y="0.75" Width="3.5" />
|
||||
<Compartments>
|
||||
<Compartment Name="Private" Collapsed="true" />
|
||||
</Compartments>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAACAEAAAAAAAAAABAAAAAAAAAAAAACACAAAA=</HashCode>
|
||||
<FileName>UmbracoDataContext.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" />
|
||||
</Class>
|
||||
<Class Name="umbraco.Linq.Core.Node.NodeAssociationTree<TDocTypeBase>">
|
||||
<Position X="0.5" Y="6.75" Width="3.25" />
|
||||
<Compartments>
|
||||
<Compartment Name="Private" Collapsed="true" />
|
||||
<Compartment Name="Internal" Collapsed="true" />
|
||||
</Compartments>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAUABAAAAAEABAQAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Node\NodeAssociationTree.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="umbraco.Linq.Core.Node.NodeDataProvider" BaseTypeListCollapsed="true">
|
||||
<Position X="5.25" Y="12" Width="4.5" />
|
||||
<Compartments>
|
||||
<Compartment Name="Private" Collapsed="true" />
|
||||
<Compartment Name="Internal" Collapsed="true" />
|
||||
</Compartments>
|
||||
<TypeIdentifier>
|
||||
<HashCode>IAAAiAAAACAUAAQAAAABCKQAAAAAAAAAAAACKAiAAAA=</HashCode>
|
||||
<FileName>Node\NodeDataProvider.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="umbraco.Linq.Core.Node.NodeTree<TDocTypeBase>">
|
||||
<Position X="4.5" Y="4.75" Width="3.25" />
|
||||
<Compartments>
|
||||
<Compartment Name="Private" Collapsed="true" />
|
||||
<Compartment Name="Internal" Collapsed="true" />
|
||||
</Compartments>
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAASABAAAAAEABAQAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Node\NodeTree.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="umbraco.Linq.Core.UmbracoDataProvider">
|
||||
<Position X="5.25" Y="8.75" Width="4.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAgAAAACAAAAQAAAABAAQAAAAAAAAAAAAAAACAAAA=</HashCode>
|
||||
<FileName>UmbracoDataProvider.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" />
|
||||
</Class>
|
||||
<Interface Name="umbraco.Linq.Core.ITree">
|
||||
<Position X="5.75" Y="0.75" Width="2.25" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAQAAAAAAAEAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>ITree.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
||||
@@ -1,442 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using umbraco.BusinessLogic;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the base framework for an umbraco item
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class DocTypeBase : IDocTypeBase //This class should be abstract but it can't be done AND achieve the Children property like this
|
||||
{
|
||||
#region Internal Storage
|
||||
private int _Id;
|
||||
private string _nodeName;
|
||||
private string _versionId;
|
||||
private int _templateId;
|
||||
private int _parentId;
|
||||
private int writerID;
|
||||
private User _writer;
|
||||
private int creatorID;
|
||||
private User _creator;
|
||||
private string _path;
|
||||
private IEnumerable<DocTypeBase> _ancestors;
|
||||
private AssociationTree<DocTypeBase> _children;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DocTypeBase"/> class.
|
||||
/// </summary>
|
||||
public DocTypeBase()
|
||||
{
|
||||
this.IsDirty = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the provider.
|
||||
/// </summary>
|
||||
/// <value>The provider.</value>
|
||||
protected internal UmbracoDataProvider Provider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance has been modified since it was first loaded
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance has been modified; otherwise, <c>false</c>.</value>
|
||||
public bool IsDirty { get; protected internal set; }
|
||||
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Gets or sets the id of the umbraco item
|
||||
/// </summary>
|
||||
/// <value>The id.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("id", DisplayName = "Id", Mandatory = true), DataMember(Name = "Id")]
|
||||
public virtual int Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Id;
|
||||
}
|
||||
protected internal set
|
||||
{
|
||||
if (this._Id != value)
|
||||
{
|
||||
this.RaisePropertyChanging();
|
||||
this._Id = value;
|
||||
this.RaisePropertyChanged("Id");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name (title) of the umbraco item
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("nodeName", DisplayName = "NodeName", Mandatory = true), DataMember(Name = "NodeName")]
|
||||
public virtual string NodeName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._nodeName;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this._nodeName != value)
|
||||
{
|
||||
this.RaisePropertyChanging();
|
||||
this._nodeName = value;
|
||||
this.IsDirty = true;
|
||||
this.RaisePropertyChanged("NodeName");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Field]
|
||||
[Obsolete("Name property is obsolete, use NodeName instead")] //this is because most people expect NodeName not Name as the property
|
||||
public virtual string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.NodeName;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.NodeName = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the template ID of the umbraco item
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("template", DisplayName = "Template", Mandatory = true), DataMember(Name = "TemplateId")]
|
||||
public virtual int TemplateId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._templateId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this._templateId != value)
|
||||
{
|
||||
this.RaisePropertyChanging();
|
||||
this._templateId = value;
|
||||
this.IsDirty = true;
|
||||
this.RaisePropertyChanged("Template");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the version of the umbraco item
|
||||
/// </summary>
|
||||
/// <value>The version.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("version", DisplayName = "Version", Mandatory = true), DataMember(Name = "Version")]
|
||||
public virtual string Version
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._versionId;
|
||||
}
|
||||
protected internal set
|
||||
{
|
||||
if (this._versionId != value)
|
||||
{
|
||||
this.RaisePropertyChanging();
|
||||
this._versionId = value;
|
||||
this.RaisePropertyChanged("Version");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ID of the parent node.
|
||||
/// </summary>
|
||||
/// <value>The parent node id.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("parentID", DisplayName = "ParentId", Mandatory = true), DataMember(Name = "ParentId")]
|
||||
public virtual int ParentNodeId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._parentId;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this._parentId != value)
|
||||
{
|
||||
this.RaisePropertyChanging();
|
||||
this._parentId = value;
|
||||
this.RaisePropertyChanged("ParentId");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the created date.
|
||||
/// </summary>
|
||||
/// <value>The create date.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("createDate", DisplayName = "CreateDate"), DataMember(Name = "CreateDate")]
|
||||
public virtual DateTime CreateDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the sort order.
|
||||
/// </summary>
|
||||
/// <value>The sort order.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("sortOrder", DisplayName = "SortOrder"), DataMember(Name = "SortOrder")]
|
||||
public virtual int SortOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the last updated date of the current version
|
||||
/// </summary>
|
||||
/// <value>The update date.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("updateDate", DisplayName = "UpdateDate"), DataMember(Name = "UpdateDate")]
|
||||
public virtual DateTime UpdateDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the level of this item in the content tree
|
||||
/// </summary>
|
||||
/// <value>The level.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("level", DisplayName = "Level"), DataMember(Name = "Level")]
|
||||
public virtual int Level { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path.
|
||||
/// </summary>
|
||||
/// <value>The path.</value>
|
||||
[Field]
|
||||
[UmbracoInfo("path", DisplayName = "Path")]
|
||||
[DataMember(Name = "Path")]
|
||||
public virtual string Path
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._path;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this._path != value)
|
||||
{
|
||||
this.RaisePropertyChanging();
|
||||
this._path = value;
|
||||
this.RaisePropertyChanged("Path");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Parents and Children
|
||||
/// <summary>
|
||||
/// Gets the children of this DocType instance.
|
||||
/// </summary>
|
||||
/// <value>The children of this DocType instance.</value>
|
||||
public AssociationTree<DocTypeBase> Children
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._children == null)
|
||||
{
|
||||
this._children = this.Provider.LoadAssociation(this.Id); //tell the provider to create it
|
||||
}
|
||||
|
||||
return this._children;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the children which are of the type TDocTypeBase.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocTypeBase">The DocType of the children desired.</typeparam>
|
||||
/// <returns>An <see cref="umbraco.Linq.Core.AssociationTree<TDocTypeBase>"/> of the children</returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
|
||||
protected AssociationTree<TDocTypeBase> ChildrenOfType<TDocTypeBase>() where TDocTypeBase : DocTypeBase, new()
|
||||
{
|
||||
return this.Provider.LoadAssociation<TDocTypeBase>(this.Children.Where(d => d is TDocTypeBase).Cast<TDocTypeBase>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parent this instance.
|
||||
/// </summary>
|
||||
/// <typeparam name="TParent">The type of the parent.</typeparam>
|
||||
/// <returns>Null when at the root level, else the parent instance</returns>
|
||||
/// <exception cref="umbraco.Linq.Core.DocTypeMissMatchException">If the type of the parent does not match the provided type</exception>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
|
||||
public virtual TParent Parent<TParent>() where TParent : DocTypeBase, new()
|
||||
{
|
||||
if (this._parentId == -1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.Provider.Load<TParent>(this._parentId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the first matching ancestor of the current type
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Provides similar functionality to the XPath method
|
||||
/// </remarks>
|
||||
/// <returns>First ancestor matching type. Null if no match found</returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
|
||||
public TDocType AncestorOrDefault<TDocType>() where TDocType : DocTypeBase
|
||||
{
|
||||
return this.AncestorOrDefault<TDocType>(t => true); //just a simple little true statement ;)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the first matching ancestor of the current type and additional boolean function
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocType">The type of the doc type.</typeparam>
|
||||
/// <param name="func">Additional boolean operation to filter on</param>
|
||||
/// <returns>First ancestor matching type and function. Null if no match found</returns>
|
||||
/// <exception cref="System.ArgumentNullException">Func parameter required</exception>
|
||||
public TDocType AncestorOrDefault<TDocType>(Func<TDocType, bool> func) where TDocType : DocTypeBase
|
||||
{
|
||||
if (func == null)
|
||||
{
|
||||
throw new ArgumentNullException("func");
|
||||
}
|
||||
|
||||
if (this._ancestors == null)
|
||||
{
|
||||
this._ancestors = this.Provider.LoadAncestors(this.Id);
|
||||
}
|
||||
|
||||
return this._ancestors.Where(a => a is TDocType).Cast<TDocType>().FirstOrDefault(func);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the creator ID.
|
||||
/// </summary>
|
||||
/// <value>The creator ID.</value>
|
||||
public int CreatorID
|
||||
{
|
||||
get
|
||||
{
|
||||
return creatorID;
|
||||
}
|
||||
internal set
|
||||
{
|
||||
this.creatorID = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the umbraco user who created the item
|
||||
/// </summary>
|
||||
/// <value>The creator.</value>
|
||||
public virtual User Creator
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._creator == null)
|
||||
{
|
||||
this._creator = new User(this.CreatorID);
|
||||
}
|
||||
|
||||
return this._creator;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string CreatorName { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// ID of the user who last edited the item
|
||||
/// </summary>
|
||||
public int WriterID
|
||||
{
|
||||
get
|
||||
{
|
||||
return writerID;
|
||||
}
|
||||
internal set
|
||||
{
|
||||
this.writerID = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the umbraco user who last edited the instance
|
||||
/// </summary>
|
||||
/// <value>The writer.</value>
|
||||
public virtual User Writer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._writer == null)
|
||||
{
|
||||
this._writer = new User(this.WriterID);
|
||||
}
|
||||
|
||||
return this._writer;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string WriterName { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Raises the property changing event.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")]
|
||||
protected virtual void RaisePropertyChanging()
|
||||
{
|
||||
if (this.PropertyChanging != null)
|
||||
{
|
||||
this.PropertyChanging(this, new PropertyChangingEventArgs(String.Empty));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises the property changed event.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the changed property.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")]
|
||||
protected virtual void RaisePropertyChanged(string name)
|
||||
{
|
||||
if (this.PropertyChanged != null)
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
|
||||
}
|
||||
}
|
||||
|
||||
#region INotifyPropertyChanging Members
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a property value is changing.
|
||||
/// </summary>
|
||||
public event PropertyChangingEventHandler PropertyChanging;
|
||||
|
||||
#endregion
|
||||
|
||||
#region INotifyPropertyChanged Members
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a property value changes.
|
||||
/// </summary>
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
protected void ValidateProperty(string regex, string value)
|
||||
{
|
||||
Regex r = new Regex(regex);
|
||||
if (!r.IsMatch(value))
|
||||
{
|
||||
throw new InvalidCastException("Value does not match validation expression from Umbraco");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Exception for when the provided class does not meet the expected class
|
||||
/// </summary>
|
||||
[global::System.Serializable]
|
||||
public class DocTypeMissMatchException : ArgumentException
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DocTypeMissMatchException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="actual">The actual doc type alias.</param>
|
||||
/// <param name="expected">The expcected doc type alias.</param>
|
||||
public DocTypeMissMatchException(string actual, string expected) : this(actual, expected, string.Empty) { }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DocTypeMissMatchException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="actual">The actual doc type alias.</param>
|
||||
/// <param name="expected">The expcected doc type alias.</param>
|
||||
/// <param name="message">Additional message information.</param>
|
||||
public DocTypeMissMatchException(string actual, string expected, string message)
|
||||
: base(string.Format("DocTypeAlias provided did not match what was expected (provided: {0}, expected: {1}){2}{3}", actual, expected, Environment.NewLine, message))
|
||||
{
|
||||
Expected = expected;
|
||||
Actual = actual;
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DocTypeMissMatchException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="actual">The actual doc type alias.</param>
|
||||
/// <param name="expected">The expcected doc type alias.</param>
|
||||
/// <param name="message">Additional message information.</param>
|
||||
/// <param name="innerException">The inner exception.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object[])")]
|
||||
public DocTypeMissMatchException(string actual, string expected, string message, Exception innerException)
|
||||
: base(string.Format("DocTypeAlias provided did not match what was expected (provided: {0}, expected: {1}){2}{3}", actual, expected, Environment.NewLine, message), innerException)
|
||||
{
|
||||
Expected = expected;
|
||||
Actual = actual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
|
||||
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// The <paramref name="info"/> parameter is null.
|
||||
/// </exception>
|
||||
/// <exception cref="T:System.Runtime.Serialization.SerializationException">
|
||||
/// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
|
||||
/// </exception>
|
||||
protected DocTypeMissMatchException(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context)
|
||||
: base(info, context) { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the expected DocTypeAlias
|
||||
/// </summary>
|
||||
/// <value>The expected DocTypeAlias.</value>
|
||||
public string Expected { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the actual DocTypeAlias
|
||||
/// </summary>
|
||||
/// <value>The actual DocTypeAlias.</value>
|
||||
public string Actual { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exception raised when a field isn't meeting its mandatory requirement
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors"), global::System.Serializable]
|
||||
public class MandatoryFailureException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">Name of the property that failed the mandatory check.</param>
|
||||
public MandatoryFailureException(string propertyName) : this(propertyName, string.Empty) { }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">Name of the property that failed the mandatory check.</param>
|
||||
/// <param name="message">Additional message information.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)")]
|
||||
public MandatoryFailureException(string propertyName, string message)
|
||||
: base(string.Format("The mandatory property \"{0}\" did not have a value.{1}{2}", propertyName, Environment.NewLine, message))
|
||||
{
|
||||
PropertyName = propertyName;
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">Name of the property that failed the mandatory check.</param>
|
||||
/// <param name="message">Additional message information.</param>
|
||||
/// <param name="innerException">The inner exception.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)")]
|
||||
public MandatoryFailureException(string propertyName, string message, Exception innerException)
|
||||
: base(string.Format("The mandatory property \"{0}\" did not have a value.{1}{2}", propertyName, Environment.NewLine, message), innerException)
|
||||
{
|
||||
PropertyName = propertyName;
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
|
||||
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// The <paramref name="info"/> parameter is null.
|
||||
/// </exception>
|
||||
/// <exception cref="T:System.Runtime.Serialization.SerializationException">
|
||||
/// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
|
||||
/// </exception>
|
||||
protected MandatoryFailureException(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context)
|
||||
: base(info, context) { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the property the exception was raised for.
|
||||
/// </summary>
|
||||
/// <value>The name of the property.</value>
|
||||
public string PropertyName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
//
|
||||
// To add a suppression to this file, right-click the message in the
|
||||
// Error List, point to "Suppress Message(s)", and click
|
||||
// "In Project Suppression File".
|
||||
// You do not need to add suppressions to this file manually.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "namespace", Target = "umbraco.Linq.Core")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "umbraco.Linq.Core.Node")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "namespace", Target = "umbraco.Linq.Core.Node")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "umbraco.Linq.Core.DocTypeMissMatchException")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object[])", Scope = "member", Target = "umbraco.Linq.Core.DocTypeMissMatchException.#.ctor(System.String,System.String,System.String)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "member", Target = "umbraco.Linq.Core.ReflectionAssistance.#GetumbracoInfoAttribute(System.Type)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "type", Target = "umbraco.Linq.Core.umbracoDataContext")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "type", Target = "umbraco.Linq.Core.umbracoDataProvider")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.umbracoDataProvider.#Load`1(System.Int32)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.umbracoDataProvider.#LoadTree`1()")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "type", Target = "umbraco.Linq.Core.umbracoInfoAttribute")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "umbraco.Linq.Core.Node.NodeAssociationTree`1")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.Node.NodeDataProvider.#LoadTree`1()")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "umbraco.Linq.Core.Node.NodeTree`1")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.Node.NodeDataProvider.#Load`1(System.Int32)")]
|
||||
@@ -1,27 +0,0 @@
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Base of an umbraco content tree
|
||||
/// </summary>
|
||||
public interface IContentTree
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the <see cref="UmbracoDataProvider"/> Provider associated with this instance
|
||||
/// </summary>
|
||||
/// <value>The provider.</value>
|
||||
UmbracoDataProvider Provider { get; }
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is read only.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if this instance is read only; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
bool IsReadOnly { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Reloads the cache for the particular tree
|
||||
/// </summary>
|
||||
void ReloadCache();
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IDocTypeBase : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Ancestor or Default based on type
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocType">The type of the Ancestor.</typeparam>
|
||||
/// <returns></returns>
|
||||
TDocType AncestorOrDefault<TDocType>() where TDocType : DocTypeBase;
|
||||
/// <summary>
|
||||
/// Gets the Ancestor or Default based on type
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocType">The type of the Ancestor.</typeparam>
|
||||
/// <param name="func">The func.</param>
|
||||
/// <returns></returns>
|
||||
TDocType AncestorOrDefault<TDocType>(Func<TDocType, bool> func) where TDocType : DocTypeBase;
|
||||
/// <summary>
|
||||
/// Gets the children.
|
||||
/// </summary>
|
||||
/// <value>The children.</value>
|
||||
AssociationTree<DocTypeBase> Children { get; }
|
||||
/// <summary>
|
||||
/// Gets or sets the create date.
|
||||
/// </summary>
|
||||
/// <value>The create date.</value>
|
||||
DateTime CreateDate { get; set; }
|
||||
/// <summary>
|
||||
/// Gets the creator user ID.
|
||||
/// </summary>
|
||||
/// <value>The creator ID.</value>
|
||||
int CreatorID { get; }
|
||||
/// <summary>
|
||||
/// Gets the name of the creator.
|
||||
/// </summary>
|
||||
/// <value>The name of the creator.</value>
|
||||
string CreatorName { get; }
|
||||
/// <summary>
|
||||
/// Gets the id of the item.
|
||||
/// </summary>
|
||||
/// <value>The id.</value>
|
||||
int Id { get; }
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is dirty.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is dirty; otherwise, <c>false</c>.</value>
|
||||
bool IsDirty { get; }
|
||||
/// <summary>
|
||||
/// Gets or sets the level of the item
|
||||
/// </summary>
|
||||
/// <value>The level.</value>
|
||||
int Level { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string NodeName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
[Obsolete("Name property is obsolete, use NodeName instead")] //this is because most people expect NodeName not Name as the property
|
||||
string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Parent if current instance
|
||||
/// </summary>
|
||||
/// <typeparam name="TParent">The type of the parent.</typeparam>
|
||||
/// <returns></returns>
|
||||
TParent Parent<TParent>() where TParent : DocTypeBase, new();
|
||||
/// <summary>
|
||||
/// Gets or sets the parent node id.
|
||||
/// </summary>
|
||||
/// <value>The parent node id.</value>
|
||||
int ParentNodeId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the sort order.
|
||||
/// </summary>
|
||||
/// <value>The sort order.</value>
|
||||
int SortOrder { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the template id.
|
||||
/// </summary>
|
||||
/// <value>The template id.</value>
|
||||
int TemplateId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the update date.
|
||||
/// </summary>
|
||||
/// <value>The update date.</value>
|
||||
DateTime UpdateDate { get; set; }
|
||||
/// <summary>
|
||||
/// Gets the version.
|
||||
/// </summary>
|
||||
/// <value>The version.</value>
|
||||
string Version { get; }
|
||||
/// <summary>
|
||||
/// Gets the writer user ID.
|
||||
/// </summary>
|
||||
/// <value>The writer ID.</value>
|
||||
int WriterID { get; }
|
||||
/// <summary>
|
||||
/// Gets the name of the writer.
|
||||
/// </summary>
|
||||
/// <value>The name of the writer.</value>
|
||||
string WriterName { get; }
|
||||
/// <summary>
|
||||
/// Gets or sets the path.
|
||||
/// </summary>
|
||||
/// <value>The path.</value>
|
||||
string Path { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstraction of the UmbracoDataContext
|
||||
/// </summary>
|
||||
public interface IUmbracoDataContext : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the data provider.
|
||||
/// </summary>
|
||||
/// <value>The data provider.</value>
|
||||
UmbracoDataProvider DataProvider { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Submits the changes tracked in this data context
|
||||
/// </summary>
|
||||
void SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace umbraco.Linq.Core.Node
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of TDocTypeBase retrieved from the umbraco XML cache which are direct children of a node
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocTypeBase">The type of the doc type base.</typeparam>
|
||||
public sealed class NodeAssociationTree<TDocTypeBase> : AssociationTree<TDocTypeBase> where TDocTypeBase : DocTypeBase, new()
|
||||
{
|
||||
private object lockObject = new object();
|
||||
private IEnumerable<TDocTypeBase> _nodes;
|
||||
|
||||
internal NodeAssociationTree(IEnumerable<TDocTypeBase> nodes)
|
||||
{
|
||||
this._nodes = new List<TDocTypeBase>();
|
||||
this._nodes = nodes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NodeAssociationTree<TDocTypeBase>"/> class for a particular tree section
|
||||
/// </summary>
|
||||
/// <param name="parentNodeId">The parent node id to start from.</param>
|
||||
/// <param name="provider">The NodeDataProvider to link the tree with.</param>
|
||||
public NodeAssociationTree(int parentNodeId, NodeDataProvider provider)
|
||||
{
|
||||
this.Provider = provider;
|
||||
this.ParentNodeId = parentNodeId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the enumerator for this Tree collection
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override IEnumerator<TDocTypeBase> GetEnumerator()
|
||||
{
|
||||
if (this._nodes == null) //first access, otherwise it'd be cached
|
||||
{
|
||||
LoadNodes();
|
||||
}
|
||||
return this._nodes.GetEnumerator();
|
||||
}
|
||||
|
||||
private void LoadNodes()
|
||||
{
|
||||
var provider = this.Provider as NodeDataProvider;
|
||||
|
||||
provider.CheckDisposed();
|
||||
|
||||
lock (lockObject)
|
||||
{
|
||||
var parents = provider
|
||||
.Xml
|
||||
.Descendants()
|
||||
.Where(x => x.Attribute("id") != null && (int)x.Attribute("id") == this.ParentNodeId);
|
||||
var rawNodes = parents
|
||||
.Single()
|
||||
.Elements()
|
||||
.Where(x => x.Attribute("isDoc") != null)
|
||||
;
|
||||
this._nodes = provider.DynamicNodeCreation(rawNodes).Cast<TDocTypeBase>(); //drop is back to the type which was asked for
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the NodeAssociationTree is ReadOnly
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c>
|
||||
/// </value>
|
||||
public override bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DataProvider associated with this Tree
|
||||
/// </summary>
|
||||
/// <value>The provider.</value>
|
||||
public override UmbracoDataProvider Provider { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reloads the cache.
|
||||
/// </summary>
|
||||
public override void ReloadCache()
|
||||
{
|
||||
this.LoadNodes();
|
||||
}
|
||||
|
||||
public override void InsertOnSubmit(TDocTypeBase item)
|
||||
{
|
||||
throw new NotImplementedException("The NodeAssociationTree does not support Inserting items");
|
||||
}
|
||||
|
||||
public override void InsertAllOnSubmit(IEnumerable<TDocTypeBase> items)
|
||||
{
|
||||
throw new NotImplementedException("The NodeAssociationTree does not support Inserting items");
|
||||
}
|
||||
|
||||
public override void DeleteOnSubmit(TDocTypeBase itemm)
|
||||
{
|
||||
throw new NotImplementedException("The NodeAssociationTree does not support Deleting items");
|
||||
}
|
||||
|
||||
public override void DeleteAllOnSubmit(IEnumerable<TDocTypeBase> items)
|
||||
{
|
||||
throw new NotImplementedException("The NodeAssociationTree does not support Deleting items");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,395 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Xml.Linq;
|
||||
using System.Reflection;
|
||||
using umbraco.presentation;
|
||||
using umbraco.cms.helpers;
|
||||
using umbraco.BusinessLogic.Utils;
|
||||
|
||||
namespace umbraco.Linq.Core.Node
|
||||
{
|
||||
/// <summary>
|
||||
/// Data Provider for LINQ to umbraco via umbraco ndoes
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This class provides a data access model for the umbraco XML cache.
|
||||
/// It is responsible for the access to the XML and construction of nodes from it.</para>
|
||||
/// <para>The <see cref="umbraco.Linq.Core.Node.NodeDataProvider"/> is capable of reading the XML cache from either the path provided in the umbraco settings or from a specified location on the file system.</para>
|
||||
/// </remarks>
|
||||
public sealed class NodeDataProvider : UmbracoDataProvider
|
||||
{
|
||||
private object lockObject = new object();
|
||||
private string _xmlPath;
|
||||
private Dictionary<UmbracoInfoAttribute, IContentTree> _trees;
|
||||
private XDocument _xml;
|
||||
private Dictionary<string, Type> _knownTypes;
|
||||
|
||||
private bool _tryMemoryCache = false;
|
||||
|
||||
internal XDocument Xml
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._xml == null)
|
||||
{
|
||||
if (this._tryMemoryCache)
|
||||
{
|
||||
var doc = UmbracoContext.Current.Server.ContentXml;
|
||||
if (doc != null)
|
||||
{
|
||||
this._xml = doc;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._xml = XDocument.Load(this._xmlPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._xml = XDocument.Load(this._xmlPath);
|
||||
}
|
||||
}
|
||||
|
||||
return this._xml; //cache the XML in memory to increase performance and force the disposable pattern
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the NodeDataProvider, performing validation
|
||||
/// </summary>
|
||||
/// <param name="xmlPath">The XML path.</param>
|
||||
/// <param name="newSchemaMode">if set to <c>true</c> [new schema mode].</param>
|
||||
protected void Init(string xmlPath, bool newSchemaMode)
|
||||
{
|
||||
if (!newSchemaMode)
|
||||
throw new NotSupportedException(this.Name + " only supports the new XML schema. Change the umbracoSettings.config to implement this and republish");
|
||||
|
||||
if (string.IsNullOrEmpty(xmlPath))
|
||||
throw new ArgumentNullException("xmlPath");
|
||||
|
||||
if (!File.Exists(xmlPath))
|
||||
throw new FileNotFoundException("The XML used by the provider must exist", xmlPath);
|
||||
|
||||
this._xmlPath = xmlPath;
|
||||
this._trees = new Dictionary<UmbracoInfoAttribute, IContentTree>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NodeDataProvider"/> class using umbraco settings as XML path
|
||||
/// </summary>
|
||||
public NodeDataProvider()
|
||||
: this(UmbracoContext.Current.Server.MapPath(UmbracoContext.Current.Server.ContentXmlPath), UmbracoContext.Current.NewSchemaMode)
|
||||
{
|
||||
this._tryMemoryCache = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NodeDataProvider"/> class
|
||||
/// </summary>
|
||||
/// <param name="xmlPath">The path of the umbraco XML</param>
|
||||
/// <param name="newSchemaMode">Indicates which Schema mode is used for the XML file</param>
|
||||
/// <remarks>
|
||||
/// This constructor is ideal for unit testing as it allows for the XML to be located anywhere
|
||||
/// </remarks>
|
||||
public NodeDataProvider(string xmlPath, bool newSchemaMode)
|
||||
{
|
||||
this.Init(xmlPath, newSchemaMode);
|
||||
}
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
/// <summary>
|
||||
/// Releases unmanaged and - optionally - managed resources
|
||||
/// </summary>
|
||||
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
protected internal override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
this._xmlPath = null;
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the provider
|
||||
/// </summary>
|
||||
/// <value>The name of the provider.</value>
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "NodeDataProvider";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the tree with the relivent DocTypes from the XML
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocType">The type of the DocType to load.</typeparam>
|
||||
/// <returns><see cref="umbraco.Linq.Core.Node.NodeTree<TDocType>"/> representation of the content tree</returns>
|
||||
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
|
||||
public override Tree<TDocType> LoadTree<TDocType>()
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
var attr = ReflectionAssistance.GetUmbracoInfoAttribute(typeof(TDocType));
|
||||
|
||||
if (!this._trees.ContainsKey(attr))
|
||||
SetupNodeTree<TDocType>(attr);
|
||||
|
||||
return (NodeTree<TDocType>)this._trees[attr];
|
||||
}
|
||||
|
||||
internal void SetupNodeTree<TDocType>(UmbracoInfoAttribute attr) where TDocType : DocTypeBase, new()
|
||||
{
|
||||
var tree = new NodeTree<TDocType>(this);
|
||||
if (!this._trees.ContainsKey(attr))
|
||||
{
|
||||
lock (lockObject)
|
||||
{
|
||||
this._trees.Add(attr, tree); //cache so it's faster to get next time
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._trees[attr] = tree;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the specified id.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocType">The type of the doc type.</typeparam>
|
||||
/// <param name="id">The id.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="umbraco.Linq.Core.DocTypeMissMatchException">If the type of the parent does not match the provided type</exception>
|
||||
/// <exception cref="System.ArgumentException">No node found matching the provided ID for the parent</exception>
|
||||
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
|
||||
public override TDocType Load<TDocType>(int id)
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
var parentXml = this.Xml.Descendants().SingleOrDefault(d => d.Attribute("isDoc") != null && (int)d.Attribute("id") == id);
|
||||
|
||||
if (!ReflectionAssistance.CompareByAlias(typeof(TDocType), parentXml))
|
||||
throw new DocTypeMissMatchException(parentXml.Name.LocalName, ReflectionAssistance.GetUmbracoInfoAttribute(typeof(TDocType)).Alias);
|
||||
|
||||
if (parentXml == null) //really shouldn't happen!
|
||||
throw new ArgumentException("Parent ID \"" + id + "\" cannot be found in the loaded XML. Ensure that the umbracoDataContext is being disposed of once it is no longer needed");
|
||||
|
||||
var parent = new TDocType();
|
||||
this.LoadFromXml(parentXml, parent);
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the associated (children) nodes with the relivent DocTypes
|
||||
/// </summary>
|
||||
/// <param name="parentNodeId">The parent node id.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
|
||||
public override AssociationTree<DocTypeBase> LoadAssociation(int parentNodeId)
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
NodeAssociationTree<DocTypeBase> associationTree = new NodeAssociationTree<DocTypeBase>(parentNodeId, this);
|
||||
|
||||
return associationTree;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Loads the associated nodes with the relivent DocTypes
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocType">The type of the DocType to load.</typeparam>
|
||||
/// <param name="nodes">The nodes.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
|
||||
public override AssociationTree<TDocType> LoadAssociation<TDocType>(IEnumerable<TDocType> nodes)
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
return new NodeAssociationTree<TDocType>(nodes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the ancestors for a node
|
||||
/// </summary>
|
||||
/// <param name="startNodeId">The start node id.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
|
||||
public override IEnumerable<DocTypeBase> LoadAncestors(int startNodeId)
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
var startElement = this.Xml.Descendants().Single(x => x.Attribute("isDoc") != null && (int)x.Attribute("id") == startNodeId);
|
||||
var ancestorElements = startElement.Ancestors();
|
||||
|
||||
IEnumerable<DocTypeBase> ancestors = DynamicNodeCreation(ancestorElements);
|
||||
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a collection of nodes with the type specified from the XML
|
||||
/// </summary>
|
||||
/// <param name="elements">The elements.</param>
|
||||
/// <returns>Collecton of .NET types from the XML</returns>
|
||||
internal IEnumerable<DocTypeBase> DynamicNodeCreation(IEnumerable<XElement> elements)
|
||||
{
|
||||
// TODO: investigate this method for performance bottlenecks
|
||||
// TODO: dataContext knows the types, maybe can load from there?
|
||||
List<DocTypeBase> ancestors = new List<DocTypeBase>();
|
||||
|
||||
foreach (var ancestor in elements)
|
||||
{
|
||||
var alias = Casing.SafeAlias(ancestor.Name.LocalName);
|
||||
var t = KnownTypes[alias];
|
||||
var instaceOfT = (DocTypeBase)Activator.CreateInstance(t); //create an instance of the type and down-cast so we can use it
|
||||
this.LoadFromXml(ancestor, instaceOfT);
|
||||
instaceOfT.Provider = this;
|
||||
ancestors.Add(instaceOfT);
|
||||
yield return instaceOfT;
|
||||
}
|
||||
}
|
||||
|
||||
internal Dictionary<string, Type> KnownTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._knownTypes == null)
|
||||
{
|
||||
this._knownTypes = new Dictionary<string, Type>();
|
||||
var types = TypeFinder
|
||||
.FindClassesOfType<DocTypeBase>()
|
||||
.Where(t => t != typeof(DocTypeBase))
|
||||
.ToDictionary(k =>
|
||||
{
|
||||
return ((UmbracoInfoAttribute)k.GetCustomAttributes(typeof(UmbracoInfoAttribute), true)[0]).Alias;
|
||||
});
|
||||
|
||||
foreach (var type in types)
|
||||
this._knownTypes.Add(Casing.SafeAlias(type.Key), type.Value);
|
||||
|
||||
}
|
||||
|
||||
return this._knownTypes;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Flushes the cache for this provider
|
||||
/// </summary>
|
||||
public void Flush()
|
||||
{
|
||||
this.CheckDisposed();
|
||||
|
||||
this._xml = null;
|
||||
this._trees.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads from XML.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="xml">The XML.</param>
|
||||
/// <param name="node">The node.</param>
|
||||
public void LoadFromXml<T>(XElement xml, T node) where T : DocTypeBase
|
||||
{
|
||||
if (!ReflectionAssistance.CompareByAlias(node.GetType(), xml))
|
||||
{
|
||||
throw new DocTypeMissMatchException(xml.Name.LocalName, ReflectionAssistance.GetUmbracoInfoAttribute(node.GetType()).Alias);
|
||||
}
|
||||
|
||||
node.Id = (int)xml.Attribute("id");
|
||||
node.ParentNodeId = (int)xml.Attribute("parentID");
|
||||
node.NodeName = (string)xml.Attribute("nodeName");
|
||||
node.Version = (string)xml.Attribute("version");
|
||||
node.CreateDate = (DateTime)xml.Attribute("createDate");
|
||||
node.SortOrder = (int)xml.Attribute("sortOrder");
|
||||
node.UpdateDate = (DateTime)xml.Attribute("updateDate");
|
||||
node.CreatorID = (int)xml.Attribute("creatorID");
|
||||
node.CreatorName = (string)xml.Attribute("creatorName");
|
||||
node.WriterID = (int)xml.Attribute("writerID");
|
||||
node.WriterName = (string)xml.Attribute("writerName");
|
||||
node.Level = (int)xml.Attribute("level");
|
||||
node.TemplateId = (int)xml.Attribute("template");
|
||||
|
||||
var properties = node.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => p.GetCustomAttributes(typeof(PropertyAttribute), true).Count() > 0);
|
||||
foreach (var p in properties)
|
||||
{
|
||||
var attr = ReflectionAssistance.GetUmbracoInfoAttribute(p);
|
||||
|
||||
XElement propertyXml = xml.Element(Casing.SafeAlias(attr.Alias));
|
||||
string data = null;
|
||||
//if the XML doesn't contain the property it means that the node hasn't been re-published with the property
|
||||
//so then we'll leave the data at null, otherwise let's grab it
|
||||
//Check if the propertyXml and propertyXml.FirstNode aren't null. If they are we don't need to set the value.
|
||||
if (propertyXml != null && propertyXml.FirstNode != null)
|
||||
{
|
||||
//If the FirstNode is an XElement it means the property contains inner xml and we should return it. Otherwise just return the normal value.
|
||||
if (propertyXml.FirstNode is XElement)
|
||||
{
|
||||
var reader = propertyXml.CreateReader();
|
||||
reader.MoveToContent();
|
||||
data = reader.ReadInnerXml();
|
||||
}
|
||||
else
|
||||
{
|
||||
data = propertyXml.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (p.PropertyType.IsValueType && p.PropertyType.GetGenericArguments().Length > 0 && typeof(Nullable<>).IsAssignableFrom(p.PropertyType.GetGenericTypeDefinition()))
|
||||
{
|
||||
if (string.IsNullOrEmpty(data))
|
||||
{
|
||||
//non-mandatory structs which have no value will be null
|
||||
try
|
||||
{
|
||||
p.SetValue(node, null, null);
|
||||
}
|
||||
catch (FormatException ex)
|
||||
{
|
||||
throw new FormatException(
|
||||
string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//non-mandatory structs which do have a value have to be cast based on the type of their Nullable<T>, found from the first (well, only) GenericArgument
|
||||
try
|
||||
{
|
||||
p.SetValue(node, Convert.ChangeType(data, p.PropertyType.GetGenericArguments()[0]), null);
|
||||
}
|
||||
catch (FormatException ex)
|
||||
{
|
||||
throw new FormatException(
|
||||
string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Address how Convert.ChangeType works in globalisation
|
||||
try
|
||||
{
|
||||
p.SetValue(node, Convert.ChangeType(data, p.PropertyType), null);
|
||||
}
|
||||
catch (FormatException ex)
|
||||
{
|
||||
throw new FormatException(
|
||||
string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace umbraco.Linq.Core.Node
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of TDocTypeBase retrieved from the umbraco XML cache
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocTypeBase">The type of the doc type base.</typeparam>
|
||||
public sealed class NodeTree<TDocTypeBase> : Tree<TDocTypeBase> where TDocTypeBase : DocTypeBase, new()
|
||||
{
|
||||
private object lockObject = new object();
|
||||
|
||||
private NodeDataProvider _provider;
|
||||
|
||||
private List<TDocTypeBase> _nodes;
|
||||
|
||||
internal NodeTree(NodeDataProvider provider)
|
||||
{
|
||||
this._provider = provider;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the provider.
|
||||
/// </summary>
|
||||
/// <value>The provider.</value>
|
||||
public override UmbracoDataProvider Provider
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._provider;
|
||||
}
|
||||
protected set
|
||||
{
|
||||
var nodeProvider = value as NodeDataProvider;
|
||||
if (nodeProvider == null)
|
||||
{
|
||||
throw new ArgumentException("Value must be of type NodeDataProvider");
|
||||
}
|
||||
this._provider = nodeProvider;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the NodeTree is ReadOnly
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c>
|
||||
/// </value>
|
||||
public override bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the enumerator.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override IEnumerator<TDocTypeBase> GetEnumerator()
|
||||
{
|
||||
if (this._nodes == null)
|
||||
{
|
||||
this._nodes = new List<TDocTypeBase>();
|
||||
var rawNodes = this._provider.Xml.Descendants().Where(x => ReflectionAssistance.CompareByAlias(typeof(TDocTypeBase), x));
|
||||
|
||||
lock (lockObject)
|
||||
{
|
||||
foreach (XElement n in rawNodes)
|
||||
{
|
||||
var dt = new TDocTypeBase();
|
||||
this._provider.LoadFromXml(n, dt);
|
||||
|
||||
dt.IsDirty = false;
|
||||
dt.Provider = this._provider;
|
||||
|
||||
this._nodes.Add(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this._nodes.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reloads the cache for the particular NodeTree
|
||||
/// </summary>
|
||||
public override void ReloadCache()
|
||||
{
|
||||
this._provider.CheckDisposed();
|
||||
|
||||
var attr = ReflectionAssistance.GetUmbracoInfoAttribute(typeof(TDocTypeBase));
|
||||
this._provider.SetupNodeTree<TDocTypeBase>(attr);
|
||||
}
|
||||
|
||||
public override void InsertOnSubmit(TDocTypeBase item)
|
||||
{
|
||||
throw new NotImplementedException("The NodeTree does not support Inserting items");
|
||||
}
|
||||
|
||||
public override void InsertAllOnSubmit(IEnumerable<TDocTypeBase> items)
|
||||
{
|
||||
throw new NotImplementedException("The NodeTree does not support Inserting items");
|
||||
}
|
||||
|
||||
public override void DeleteOnSubmit(TDocTypeBase itemm)
|
||||
{
|
||||
throw new NotImplementedException("The NodeTree does not support Deleting items");
|
||||
}
|
||||
|
||||
public override void DeleteAllOnSubmit(IEnumerable<TDocTypeBase> items)
|
||||
{
|
||||
throw new NotImplementedException("The NodeTree does not support Deleting items");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Core")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Core")]
|
||||
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("umbraco.Linq.Core.Tests")]
|
||||
[assembly: ComVisible(false)]
|
||||
@@ -1,55 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml.Linq;
|
||||
using umbraco.cms.helpers;
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Class containing helpers when doing reflection against nodes
|
||||
/// </summary>
|
||||
public sealed class ReflectionAssistance
|
||||
{
|
||||
private ReflectionAssistance() { }
|
||||
|
||||
/// <summary>
|
||||
/// Prebuilt function for getting the custom properites of the class
|
||||
/// </summary>
|
||||
/// <remarks>This is a Lambda function which will return all the properties of the current class which are custom DocType properties</remarks>
|
||||
internal static Func<PropertyInfo, bool> CustomDocTypeProperties = p => p.GetCustomAttributes(typeof(UmbracoInfoAttribute), false).Count() != 0 && p.GetCustomAttributes(typeof(PropertyAttribute), false).Count() != 0;
|
||||
|
||||
/// <summary>
|
||||
/// Prebuild function for getting the mandatory properites of the class
|
||||
/// </summary>
|
||||
/// <remarks>This is a Lambda function which will return all the properties of the current class which are custom DocType properties and mandatory</remarks>
|
||||
internal static Func<PropertyInfo, bool> MandatoryDocTypeProperties = p => p.GetCustomAttributes(typeof(UmbracoInfoAttribute), false).Count() != 0 && ((UmbracoInfoAttribute)p.GetCustomAttributes(typeof(UmbracoInfoAttribute), false)[0]).Mandatory;
|
||||
|
||||
/// <summary>
|
||||
/// Compares a .NET type to an Xml representation
|
||||
/// </summary>
|
||||
internal static Func<Type, XElement, bool> CompareByAlias = (t, x) => x.Name.LocalName == Casing.SafeAlias(ReflectionAssistance.GetUmbracoInfoAttribute(t).Alias);
|
||||
|
||||
/// <summary>
|
||||
/// Get the <see cref="umbraco.Linq.Core.umbracoInfoAttribute"/> for a <see cref="System.Reflection.MethodInfo"/> object
|
||||
/// </summary>
|
||||
/// <param name="member">The methodInfo to get the <see cref="umbraco.Linq.Core.umbracoInfoAttribute"/> for.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco")]
|
||||
public static UmbracoInfoAttribute GetUmbracoInfoAttribute(MemberInfo member)
|
||||
{
|
||||
return member.GetCustomAttributes(typeof(UmbracoInfoAttribute), true).Cast<UmbracoInfoAttribute>().SingleOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the <see cref="umbraco.Linq.Core.umbracoInfoAttribute"/> for a type
|
||||
/// </summary>
|
||||
/// <param name="type">The type to get the <see cref="umbraco.Linq.Core.umbracoInfoAttribute"/> for.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
|
||||
public static UmbracoInfoAttribute GetUmbracoInfoAttribute(Type type)
|
||||
{
|
||||
return type.GetCustomAttributes(typeof(UmbracoInfoAttribute), true).Cast<UmbracoInfoAttribute>().SingleOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Typed switch implementation from Bart De Smet: http://community.bartdesmet.net/blogs/bart/archive/2008/03/30/a-functional-c-type-switch.aspx
|
||||
/// </summary>
|
||||
public class Switch
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Switch"/> class.
|
||||
/// </summary>
|
||||
/// <param name="o">The o.</param>
|
||||
public Switch(object o)
|
||||
{
|
||||
Obj = o;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the object being operated against
|
||||
/// </summary>
|
||||
/// <value>The obj.</value>
|
||||
public object Obj { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Case statement
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of object</typeparam>
|
||||
/// <param name="a">Action method to execute for case evaluation</param>
|
||||
/// <returns></returns>
|
||||
public Switch Case<T>(Action<T> a)
|
||||
{
|
||||
return Case<T>(o => true, a, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Case statement
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of object</typeparam>
|
||||
/// <param name="a">Action method to execute for case evaluation</param>
|
||||
/// <param name="fallThrough">if set to <c>true</c> fall through to next case statement.</param>
|
||||
/// <returns></returns>
|
||||
public Switch Case<T>(Action<T> a, bool fallThrough)
|
||||
{
|
||||
return Case<T>(o => true, a, fallThrough);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Case statement
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of object</typeparam>
|
||||
/// <param name="c">The funcation to eveluate against to object.</param>
|
||||
/// <param name="a">Action method to execute for case evaluation</param>
|
||||
/// <returns></returns>
|
||||
public Switch Case<T>(Func<T, bool> c, Action<T> a)
|
||||
{
|
||||
return Case<T>(c, a, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Case statement
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of object</typeparam>
|
||||
/// <param name="c">The funcation to eveluate against to object.</param>
|
||||
/// <param name="a">Action method to execute for case evaluation</param>
|
||||
/// <param name="fallThrough">if set to <c>true</c> fall through to next case statement.</param>
|
||||
/// <returns></returns>
|
||||
public Switch Case<T>(Func<T, bool> c, Action<T> a, bool fallThrough)
|
||||
{
|
||||
if (this == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.Obj is T)
|
||||
{
|
||||
T t = (T)this.Obj;
|
||||
if (c(t))
|
||||
{
|
||||
a(t);
|
||||
return fallThrough ? this : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defaults case
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of object</typeparam>
|
||||
/// <param name="a">Action to perform</param>
|
||||
/// <returns></returns>
|
||||
public Switch Default<T>(Action<T> a)
|
||||
{
|
||||
if (this == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
a((T)this.Obj);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection within DataProvider of a DocType
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Similar to the implementation of <see cref="System.Data.Linq.Table<TEntity>"/>,
|
||||
/// providing a single collection which represents all instances of the given type within the DataProvider.
|
||||
///
|
||||
/// Implementers of this type will need to provide a manner of retrieving the TDocType from the DataProvider
|
||||
/// </remarks>
|
||||
/// <typeparam name="TDocType">The type of the DocType.</typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
|
||||
public abstract class Tree<TDocType> : IContentTree, IEnumerable<TDocType>, IEnumerable
|
||||
where TDocType : DocTypeBase, new()
|
||||
{
|
||||
#region IContentTree Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="umbracoDataProvider"/> Provider associated with this instance
|
||||
/// </summary>
|
||||
/// <value>The provider.</value>
|
||||
public abstract UmbracoDataProvider Provider { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is read only. The collection is not ReadOnly by default
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>false</c> to indicate that this collection isn't read-only
|
||||
/// </value>
|
||||
public virtual bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void ReloadCache();
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEnumerable<TDocType> Members
|
||||
|
||||
/// <summary>
|
||||
/// Returns an enumerator that iterates through the collection.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection.
|
||||
/// </returns>
|
||||
public abstract IEnumerator<TDocType> GetEnumerator();
|
||||
|
||||
#endregion
|
||||
|
||||
#region IEnumerable Members
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Insert an item on submit of the DataContext
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
public abstract void InsertOnSubmit(TDocType item);
|
||||
/// <summary>
|
||||
/// Insert a collection of items on submit of the DataContext
|
||||
/// </summary>
|
||||
/// <param name="items">The items.</param>
|
||||
public abstract void InsertAllOnSubmit(IEnumerable<TDocType> items);
|
||||
/// <summary>
|
||||
/// Deletes an item on submit of the DataContext
|
||||
/// </summary>
|
||||
/// <param name="itemm">The itemm.</param>
|
||||
public abstract void DeleteOnSubmit(TDocType itemm);
|
||||
/// <summary>
|
||||
/// Deletes a collection of items on submit of the DataContext
|
||||
/// </summary>
|
||||
/// <param name="items">The items.</param>
|
||||
public abstract void DeleteAllOnSubmit(IEnumerable<TDocType> items);
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using umbraco.Linq.Core.Node;
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// The umbracoDataContext which handles the interaction with an <see cref="umbraco.Linq.Core.UmbracoDataProvider"/>
|
||||
/// </summary>
|
||||
public abstract class UmbracoDataContext : IUmbracoDataContext
|
||||
{
|
||||
#region Privates
|
||||
private UmbracoDataProvider _dataProvider;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Loads the tree of umbraco items.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocTypeBase">The type of the DocTypeBase.</typeparam>
|
||||
/// <returns>Collection of umbraco items</returns>
|
||||
/// <exception cref="System.ObjectDisposedException">If the DataContext has been disposed of</exception>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
|
||||
protected Tree<TDocTypeBase> LoadTree<TDocTypeBase>() where TDocTypeBase : DocTypeBase, new()
|
||||
{
|
||||
CheckDisposed();
|
||||
return this._dataProvider.LoadTree<TDocTypeBase>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data provider.
|
||||
/// </summary>
|
||||
/// <value>The data provider.</value>
|
||||
public UmbracoDataProvider DataProvider
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._dataProvider;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Submits the changes within the UmbracoDataContext through the <see cref="umbraco.Linq.Core.UmbracoDataProvider"/>
|
||||
/// </summary>
|
||||
public void SubmitChanges()
|
||||
{
|
||||
this.CheckDisposed();
|
||||
|
||||
this._dataProvider.SubmitChanges();
|
||||
}
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="umbraco.Linq.Core.UmbracoDataProvider"/> class, using a <see cref="umbraco.Linq.Core.Node.NodeDataProvider"/> data provider with the connection string from the umbraco config
|
||||
/// </summary>
|
||||
protected UmbracoDataContext() : this(new NodeDataProvider())
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="umbraco.Linq.Core.UmbracoDataProvider"/> class.
|
||||
/// </summary>
|
||||
/// <param name="dataProvider">The data provider to use within the DataContext.</param>
|
||||
protected UmbracoDataContext(UmbracoDataProvider dataProvider)
|
||||
{
|
||||
this._dataProvider = dataProvider;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
private bool _disposed;
|
||||
|
||||
/// <summary>
|
||||
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases unmanaged and - optionally - managed resources
|
||||
/// </summary>
|
||||
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!this._disposed && disposing)
|
||||
{
|
||||
if (this._dataProvider != null)
|
||||
{
|
||||
this._dataProvider.Dispose(true);
|
||||
}
|
||||
|
||||
this._disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckDisposed()
|
||||
{
|
||||
if (this._disposed)
|
||||
{
|
||||
throw new ObjectDisposedException(null);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace umbraco.Linq.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the methods required for a data access model within the LINQ to Umbraco project
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This base class is used when defining how a DataProvider operates against a data source (such as the umbraco.config).
|
||||
///
|
||||
/// It provides abstractions for all the useful operations of the DataProvider
|
||||
/// </remarks>
|
||||
public abstract class UmbracoDataProvider : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates the disposal status of the current provider
|
||||
/// </summary>
|
||||
protected bool _disposed;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the provider
|
||||
/// </summary>
|
||||
/// <value>The name of the provider.</value>
|
||||
public abstract string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Loads the tree with the relevant DocTypes
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocType">The type of the DocType to load.</typeparam>
|
||||
/// <returns></returns>
|
||||
public abstract Tree<TDocType> LoadTree<TDocType>() where TDocType : DocTypeBase, new();
|
||||
|
||||
/// <summary>
|
||||
/// Loads the associated nodes with the relevant DocTypes
|
||||
/// </summary>
|
||||
/// <param name="parentNodeId">The parent node id.</param>
|
||||
/// <returns></returns>
|
||||
public abstract AssociationTree<DocTypeBase> LoadAssociation(int parentNodeId);
|
||||
|
||||
/// <summary>
|
||||
/// Loads the associated nodes with the relevant DocTypes
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocType">The type of the DocType to load.</typeparam>
|
||||
/// <param name="nodes">The nodes.</param>
|
||||
/// <returns></returns>
|
||||
public abstract AssociationTree<TDocType> LoadAssociation<TDocType>(IEnumerable<TDocType> nodes) where TDocType : DocTypeBase, new();
|
||||
|
||||
/// <summary>
|
||||
/// Loads the specified id.
|
||||
/// </summary>
|
||||
/// <typeparam name="TDocType">The type of the doc type.</typeparam>
|
||||
/// <param name="id">The id.</param>
|
||||
/// <returns></returns>
|
||||
public abstract TDocType Load<TDocType>(int id) where TDocType : DocTypeBase, new();
|
||||
|
||||
/// <summary>
|
||||
/// Loads the ancestors.
|
||||
/// </summary>
|
||||
/// <param name="startNodeId">The start node id.</param>
|
||||
/// <returns></returns>
|
||||
public abstract IEnumerable<DocTypeBase> LoadAncestors(int startNodeId);
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the provider has been disposed
|
||||
/// </summary>
|
||||
protected internal void CheckDisposed()
|
||||
{
|
||||
if (this._disposed)
|
||||
throw new ObjectDisposedException(null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases unmanaged and - optionally - managed resources
|
||||
/// </summary>
|
||||
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
|
||||
protected internal virtual void Dispose(bool disposing)
|
||||
{
|
||||
this._disposed = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Submits the changes tracked by the UmbracoDataProvider
|
||||
/// </summary>
|
||||
/// <remarks>It is up to the implementor of the UmbracoDataProvider to decide whether or not they are supporting change submission in their provider. This will thrown an exception unless it is explicitly implemented.</remarks>
|
||||
/// <exception cref="System.NotImplementedException">Thrown unless the method is implemented in a custom UmbracoDataProvider.</exception>
|
||||
protected internal virtual void SubmitChanges()
|
||||
{
|
||||
throw new NotImplementedException("Provider \"" + this.Name + "\" does not implement a submittable pattern");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{31CAEC36-0C3D-4D69-B092-84866811EA07}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>umbraco.Linq.Core</RootNamespace>
|
||||
<AssemblyName>umbraco.Linq.Core</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<umbracoPresentationPath>..\..\..\..\..\umbraco\presentation\bin</umbracoPresentationPath>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Debug\umbraco.Linq.Core.xml</DocumentationFile>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Release\umbraco.Linq.Core.XML</DocumentationFile>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\System.Web.Abstractions.dll</HintPath>
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\..\..\SolutionInfo.cs">
|
||||
<Link>Properties\SolutionInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="AssociationTree.cs" />
|
||||
<Compile Include="Attributes.cs" />
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="IContentTree.cs" />
|
||||
<Compile Include="IDocTypeBase.cs" />
|
||||
<Compile Include="IUmbracoDataContext.cs" />
|
||||
<Compile Include="UmbracoDataProvider.cs" />
|
||||
<Compile Include="Node\NodeAssociationTree.cs" />
|
||||
<Compile Include="Node\NodeTree.cs" />
|
||||
<Compile Include="Node\NodeDataProvider.cs" />
|
||||
<Compile Include="Tree.cs" />
|
||||
<Compile Include="UmbracoDataContext.cs" />
|
||||
<Compile Include="DocTypeBase.cs" />
|
||||
<Compile Include="Exceptions.cs" />
|
||||
<Compile Include="ReflectionAssistance.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Switch.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="CoreClasses.cd" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\umbraco.businesslogic\umbraco.businesslogic.csproj">
|
||||
<Project>{E469A9CE-1BEC-423F-AC44-713CD72457EA}</Project>
|
||||
<Name>umbraco.businesslogic</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\umbraco.cms\umbraco.cms.csproj">
|
||||
<Project>{CCD75EC3-63DB-4184-B49D-51C1DD337230}</Project>
|
||||
<Name>umbraco.cms</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\umbraco.presentation\umbraco.presentation.csproj">
|
||||
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
|
||||
<Name>umbraco.presentation</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>-->
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>XCOPY "$(TargetPath)" "$(SolutionDir)\umbraco\presentation\bin" /Y</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
File diff suppressed because it is too large
Load Diff
-93
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4872D945-97E8-4C30-8EDC-64E424645979}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Umbraco.Linq.DTMetal.CodeBuilder.Installer</RootNamespace>
|
||||
<AssemblyName>Umbraco.Linq.DTMetal.CodeBuilder.Installer</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\Solution Items\umbraco-key.snk</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration.Install" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Solution Items\SolutionInfo.cs">
|
||||
<Link>Properties\SolutionInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="InstallerHandler.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="InstallerProgress.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="InstallerProgress.Designer.cs">
|
||||
<DependentUpon>InstallerProgress.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="InstallerProgress.resx">
|
||||
<DependentUpon>InstallerProgress.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Item packages\LINQtoUmbracoCS.zip" />
|
||||
<Content Include="Item packages\LINQtoUmbracoVB.zip" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Solution Items\umbraco-key.snk">
|
||||
<Link>Properties\umbraco-key.snk</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DTMetal.CodeBuilder\DTMetal.CodeBuilder.csproj">
|
||||
<Project>{461089E7-008E-4737-BA17-E1FCD1CC3D0E}</Project>
|
||||
<Name>DTMetal.CodeBuilder</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,50 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
using Microsoft.Win32;
|
||||
using System.Windows.Forms;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Umbraco.Linq.DTMetal.CodeBuilder.Installer
|
||||
{
|
||||
[RunInstaller(true)]
|
||||
public class InstallerHandler : System.Configuration.Install.Installer
|
||||
{
|
||||
public override void Install(System.Collections.IDictionary stateSaver)
|
||||
{
|
||||
base.Install(stateSaver);
|
||||
|
||||
var vsPath = GetVsPath();
|
||||
var targetPath = Context.Parameters["TargetDir"];
|
||||
|
||||
if (vsPath != null && targetPath != null)
|
||||
{
|
||||
var progress = new InstallerProgress(InstallMode.Install, vsPath, targetPath);
|
||||
MessageBoxOptions options = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading : 0;
|
||||
if (progress.ShowDialog() != DialogResult.OK)
|
||||
{
|
||||
MessageBox.Show("VS 2008 Setup Failed", "LINQ to Umbraco Setup", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, options);
|
||||
MessageBox.Show(progress.Error.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetVsPath()
|
||||
{
|
||||
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0", false);
|
||||
if (key != null)
|
||||
return (string)key.GetValue("InstallDir");
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void Uninstall(System.Collections.IDictionary savedState)
|
||||
{
|
||||
base.Uninstall(savedState);
|
||||
|
||||
var vsPath = GetVsPath();
|
||||
if (vsPath != null)
|
||||
{
|
||||
var progress = new InstallerProgress(InstallMode.Uninstall, vsPath, null);
|
||||
progress.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-84
@@ -1,84 +0,0 @@
|
||||
namespace Umbraco.Linq.DTMetal.CodeBuilder.Installer
|
||||
{
|
||||
partial class InstallerProgress
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallerProgress));
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.installWorker = new System.ComponentModel.BackgroundWorker();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
resources.ApplyResources(this.label1, "label1");
|
||||
this.label1.Name = "label1";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
resources.ApplyResources(this.label2, "label2");
|
||||
this.label2.Name = "label2";
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
resources.ApplyResources(this.progressBar1, "progressBar1");
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
|
||||
//
|
||||
// installWorker
|
||||
//
|
||||
this.installWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.installWorker_DoWork);
|
||||
this.installWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.installWorker_RunWorkerCompleted);
|
||||
//
|
||||
// InstallerProgress
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "InstallerProgress";
|
||||
this.Load += new System.EventHandler(this.InstallerProgress_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.ComponentModel.BackgroundWorker installWorker;
|
||||
}
|
||||
}
|
||||
-287
@@ -1,287 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Globalization;
|
||||
using Microsoft.Win32;
|
||||
using System.Linq;
|
||||
|
||||
namespace Umbraco.Linq.DTMetal.CodeBuilder.Installer
|
||||
{
|
||||
public partial class InstallerProgress : Form
|
||||
{
|
||||
private const string generatorKey = "{52B316AA-1997-4c81-9969-95404C09EEB4}";
|
||||
private const string dtml = ".dtml";
|
||||
private const string clas = "LINQtoUmbraco.DTML.1.0";
|
||||
private const string desc = "LINQ to Umbraco Entity Mapping";
|
||||
|
||||
private InstallMode _mode;
|
||||
private string _vsPath;
|
||||
private string _targetPath;
|
||||
|
||||
public InstallerProgress(InstallMode mode, string vsPath, string targetPath)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_mode = mode;
|
||||
_vsPath = vsPath;
|
||||
_targetPath = targetPath;
|
||||
}
|
||||
|
||||
#region Events
|
||||
private void installWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
|
||||
switch (_mode)
|
||||
{
|
||||
case InstallMode.Install:
|
||||
InstallVsTemplates();
|
||||
SetupRegistry();
|
||||
InstallDtmlXsd();
|
||||
ConfigVs();
|
||||
break;
|
||||
case InstallMode.Uninstall:
|
||||
UninstallVsTemplates();
|
||||
TearDownRegistry();
|
||||
UninstallDtmlXsd();
|
||||
ConfigVs();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void installWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
if (e.Error != null)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Error = e.Error;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
public Exception Error { get; set; }
|
||||
|
||||
private void InstallerProgress_Load(object sender, EventArgs e)
|
||||
{
|
||||
installWorker.RunWorkerAsync();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Uninstall
|
||||
private void UninstallDtmlXsd()
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Delete(GetDtmlXsdPath());
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void TearDownRegistry()
|
||||
{
|
||||
if(Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey) != null)
|
||||
{
|
||||
Registry.LocalMachine.DeleteSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey);
|
||||
}
|
||||
|
||||
if (Registry.ClassesRoot.OpenSubKey(dtml) != null)
|
||||
{
|
||||
Registry.ClassesRoot.DeleteSubKeyTree(dtml);
|
||||
}
|
||||
|
||||
if (Registry.ClassesRoot.OpenSubKey(clas) != null)
|
||||
{
|
||||
Registry.ClassesRoot.DeleteSubKeyTree(clas);
|
||||
}
|
||||
}
|
||||
|
||||
private void UninstallVsTemplates()
|
||||
{
|
||||
string csTgt = Path.Combine(_vsPath, @"ItemTemplates\CSharp\1033\LINQtoUmbracoCS.zip");
|
||||
string vbTgt = Path.Combine(_vsPath, @"ItemTemplates\VisualBasic\1033\LINQtoUmbracoVB.zip");
|
||||
|
||||
try
|
||||
{
|
||||
File.Delete(csTgt);
|
||||
File.Delete(vbTgt);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Install
|
||||
private void InstallDtmlXsd()
|
||||
{
|
||||
//string assemblyName = GetCodeBuilderAssemblyName();
|
||||
//Assembly assembly = Assembly.Load(assemblyName);
|
||||
|
||||
//it seems that it runs this before the GAC is deployed, so the above code deosn't work
|
||||
//I have to embed the XSD in this assembly instead
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
|
||||
// Load the XSD for DocTypeML.
|
||||
string xsd;
|
||||
using (Stream s = ClassGenerator.GetXsd())
|
||||
{
|
||||
using (StreamReader sr = new StreamReader(s))
|
||||
{
|
||||
xsd = sr.ReadToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
// Write the XSD to the Visual Studio folder with XML schemas.
|
||||
using (StreamWriter sw = File.CreateText(GetDtmlXsdPath()))
|
||||
{
|
||||
sw.Write(xsd);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupRegistry()
|
||||
{
|
||||
#region LINQtoUmbracoGenerator Key
|
||||
RegistryKey genKey = Registry.LocalMachine.CreateSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey);
|
||||
genKey.SetValue("Assembly", GetCodeBuilderAssemblyName()); //full name of the assembly which the generator is in
|
||||
genKey.SetValue("Class", "Umbraco.Linq.DTMetal.CodeBuilder.LINQtoUmbracoGenerator"); //generator class
|
||||
genKey.SetValue("InprocServer32", Path.Combine(Environment.GetEnvironmentVariable("SystemRoot"), @"system32\mscoree.dll"));
|
||||
genKey.SetValue("ThreadingModel", "Both");
|
||||
genKey.Close();
|
||||
#endregion
|
||||
|
||||
#region HKEY_CLASSES_ROOT\.dtml
|
||||
{
|
||||
RegistryKey dtmlKey = Registry.ClassesRoot.CreateSubKey(dtml, RegistryKeyPermissionCheck.ReadWriteSubTree);
|
||||
dtmlKey.SetValue(null, clas);
|
||||
dtmlKey.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0
|
||||
{
|
||||
RegistryKey kClas = Registry.ClassesRoot.CreateSubKey(clas, RegistryKeyPermissionCheck.ReadWriteSubTree);
|
||||
kClas.SetValue(null, desc);
|
||||
kClas.SetValue("AlwaysShowExt", "1");
|
||||
|
||||
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\DefaultIcon
|
||||
{
|
||||
RegistryKey kIcon = kClas.CreateSubKey("DefaultIcon");
|
||||
kIcon.SetValue(null, Path.Combine(_targetPath, @"DTMetal.exe") + ",0");
|
||||
kIcon.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell
|
||||
{
|
||||
RegistryKey kShel = kClas.CreateSubKey("shell");
|
||||
|
||||
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open
|
||||
{
|
||||
RegistryKey kOpen = kShel.CreateSubKey("Open");
|
||||
|
||||
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\Command
|
||||
{
|
||||
RegistryKey kComm = kOpen.CreateSubKey("Command");
|
||||
kComm.SetValue(null, "\"" + Path.Combine(_vsPath, "devenv.exe") + "\" /dde \"%1\"");
|
||||
kComm.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\ddeexec
|
||||
{
|
||||
RegistryKey kDdex = kOpen.CreateSubKey("ddeexec");
|
||||
kDdex.SetValue(null, "Open(\"%1\")");
|
||||
|
||||
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\ddeexec\Application
|
||||
{
|
||||
RegistryKey kAppn = kDdex.CreateSubKey("Application");
|
||||
kAppn.SetValue(null, "VisualStudio.9.0");
|
||||
kAppn.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\ddeexec\Topic
|
||||
{
|
||||
RegistryKey kTopc = kDdex.CreateSubKey("Topic");
|
||||
kTopc.SetValue(null, "system");
|
||||
kTopc.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
kDdex.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
kOpen.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
kShel.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
kClas.Close();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
private void InstallVsTemplates()
|
||||
{
|
||||
string csSrc = Path.Combine(_targetPath, @"Item packages\LINQtoUmbracoCS.zip");
|
||||
string vbSrc = Path.Combine(_targetPath, @"Item packages\LINQtoUmbracoVB.zip");
|
||||
string csTgt = Path.Combine(_vsPath, @"ItemTemplates\CSharp\1033\LINQtoUmbracoCS.zip");
|
||||
string vbTgt = Path.Combine(_vsPath, @"ItemTemplates\VisualBasic\1033\LINQtoUmbracoVB.zip");
|
||||
|
||||
if (!File.Exists(csTgt))
|
||||
File.Copy(csSrc, csTgt);
|
||||
if (!File.Exists(vbTgt))
|
||||
File.Copy(vbSrc, vbTgt);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private static string GetCodeBuilderAssemblyName()
|
||||
{
|
||||
//get the assembly version info
|
||||
AssemblyName current = Assembly.GetExecutingAssembly().GetName();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (byte b in current.GetPublicKeyToken())
|
||||
sb.AppendFormat("{0:x2}", b);
|
||||
|
||||
string publicKeyToken = sb.ToString();
|
||||
string version = current.Version.ToString();
|
||||
|
||||
return String.Format(CultureInfo.InvariantCulture, "Umbraco.Linq.DTMetal.CodeBuilder, Version={0}, Culture=neutral, PublicKeyToken={1}", version, publicKeyToken);
|
||||
}
|
||||
|
||||
private string GetDtmlXsdPath()
|
||||
{
|
||||
string path = _vsPath; //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\
|
||||
path = path.TrimEnd('\\'); //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE
|
||||
path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7
|
||||
path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 9.0
|
||||
path = Path.Combine(path, "Xml"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml
|
||||
path = Path.Combine(path, "Schemas"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml\Schemas
|
||||
path = Path.Combine(path, "DocTypeML.xsd"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml\Schemas\DocTypeML.xsd
|
||||
return path;
|
||||
}
|
||||
|
||||
private void ConfigVs()
|
||||
{
|
||||
string devenv = Path.Combine(_vsPath, "devenv.exe");
|
||||
Process p = Process.Start(devenv, "/InstallVSTemplates");
|
||||
p.WaitForExit();
|
||||
}
|
||||
}
|
||||
|
||||
public enum InstallMode
|
||||
{
|
||||
Install,
|
||||
Uninstall
|
||||
}
|
||||
}
|
||||
-228
@@ -1,228 +0,0 @@
|
||||
<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>13, 13</value>
|
||||
</data>
|
||||
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>246, 13</value>
|
||||
</data>
|
||||
<data name="label1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="label1.Text" xml:space="preserve">
|
||||
<value>LINQ to Umbraco is configuring Visual Studio 2008</value>
|
||||
</data>
|
||||
<data name=">>label1.Name" xml:space="preserve">
|
||||
<value>label1</value>
|
||||
</data>
|
||||
<data name=">>label1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>label1.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label1.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>25, 30</value>
|
||||
</data>
|
||||
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>221, 13</value>
|
||||
</data>
|
||||
<data name="label2.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="label2.Text" xml:space="preserve">
|
||||
<value>This may take a few minutes, please stand by</value>
|
||||
</data>
|
||||
<data name=">>label2.Name" xml:space="preserve">
|
||||
<value>label2</value>
|
||||
</data>
|
||||
<data name=">>label2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>label2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="progressBar1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>16, 61</value>
|
||||
</data>
|
||||
<data name="progressBar1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>243, 27</value>
|
||||
</data>
|
||||
<data name="progressBar1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name=">>progressBar1.Name" xml:space="preserve">
|
||||
<value>progressBar1</value>
|
||||
</data>
|
||||
<data name=">>progressBar1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>progressBar1.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>progressBar1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="installWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>275, 100</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterParent</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>LINQ to Umbraco Installer Progress</value>
|
||||
</data>
|
||||
<data name=">>installWorker.Name" xml:space="preserve">
|
||||
<value>installWorker</value>
|
||||
</data>
|
||||
<data name=">>installWorker.Type" xml:space="preserve">
|
||||
<value>System.ComponentModel.BackgroundWorker, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>InstallerProgress</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
Binary file not shown.
-31
@@ -1,31 +0,0 @@
|
||||
<VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
|
||||
<TemplateData>
|
||||
<Name>LINQ to Umbraco File</Name>
|
||||
<Description>An empty LINQ to Umbraco file</Description>
|
||||
<Icon>umbraco.ico</Icon>
|
||||
<ProjectType>CSharp</ProjectType>
|
||||
<SortOrder>100</SortOrder>
|
||||
<DefaultName>DataClasses.dtml</DefaultName>
|
||||
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
|
||||
<TemplateID>Umbraco.Linq.Core.Designer</TemplateID>
|
||||
<RequiredFrameworkVersion>3.5</RequiredFrameworkVersion>
|
||||
</TemplateData>
|
||||
<TemplateContent>
|
||||
<References>
|
||||
<Reference>
|
||||
<Assembly>System</Assembly>
|
||||
</Reference>
|
||||
<Reference>
|
||||
<Assembly>System.Core</Assembly>
|
||||
</Reference>
|
||||
<Reference>
|
||||
<Assembly>Umbraco.Linq.Core</Assembly>
|
||||
</Reference>
|
||||
</References>
|
||||
<ProjectItem TargetFileName="$fileinputname$.dtml" ReplaceParameters="true">dtml.dtml</ProjectItem>
|
||||
<CustomParameters>
|
||||
<CustomParameter Name="$CustomTool$" Value="LINQtoUmbracoGenerator" />
|
||||
<CustomParameter Name="$Namespace$" Value="$rootnamespace$" />
|
||||
</CustomParameters>
|
||||
</TemplateContent>
|
||||
</VSTemplate>
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
<auto-generated>
|
||||
This code was generated by a tool.
|
||||
LINQ to Umbraco Version: $version$
|
||||
|
||||
Changes to this file may cause incorrect behavior and will be lost if
|
||||
the code is regenerated.
|
||||
</auto-generated>
|
||||
-->
|
||||
|
||||
<DocumentTypes Serialization="Unidirectional" DataContextName="$fileinputname$" PluralizeCollections="true">
|
||||
|
||||
</DocumentTypes>
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user