Compare commits

...

693 Commits

Author SHA1 Message Date
Stephan 6ba761df20 Fix null checks in HttpRequestCacheProvider 2016-07-19 15:37:55 +02:00
Shannon d687fadac3 Performs some null checks in the HttpRequestCacheProvider since if there is no place to cache, it just doesn't do any caching. 2016-07-19 15:07:38 +02:00
Warren Buckley 90b39070a7 Merge pull request #1367 from skttl/patch-1
U4-8579: Replace linebreaks
2016-07-19 12:20:56 +01:00
Sebastiaan Janssen 3c653fbd5f Don't use C#6 syntax in tests 2016-07-19 12:40:08 +02:00
Sebastiaan Janssen 05b0c16d18 Use the newest version of CDF 2016-07-19 12:15:36 +02:00
Stephan 57c561fae1 Merge pull request #1387 from umbraco/temp-u4-8729
u4 8729
2016-07-19 12:07:41 +02:00
Sebastiaan Janssen d7e6b0732e Add upgrade hints for some of our dependencies 2016-07-19 11:58:02 +02:00
Stephan 2481b77f03 U4-8729 - reviewing PR 2016-07-19 11:28:54 +02:00
Sebastiaan Janssen e2c2cdd632 Use the newest version of ModelsBuilder 2016-07-19 11:22:23 +02:00
Stephan 764f10327e Merge branch 'peta-poco-issues' of https://github.com/pynej/Umbraco-CMS into temp-u4-8729 2016-07-19 10:57:03 +02:00
Jeremy Pyne 2e24923cc4 Update PetaPoco.cs
Sql() class should reset build cache when new Append operations are called.  If not then stepping through with the debugger or doing internal logging can cause invalid SQL and unexpected results.
2016-07-18 09:00:23 -04:00
Sebastiaan Janssen c617599fef Use the newest version of ImageProcessor 2016-07-18 11:25:56 +02:00
Stephan 6836e48217 Fix assertion in tests 2016-07-18 10:17:34 +02:00
Shannon e3b9a45435 Updates public APIs to enable umbraco cookie auth so devs can specify their own cookie options if required. 2016-07-18 10:09:46 +02:00
Sebastiaan Janssen a758688c52 U4-8730 MigrationRunner should check for migrations params to already be null
#U4-8730 Fixed
2016-07-15 12:03:15 +02:00
Sebastiaan Janssen 6f2aac14fc Revert "Adds a pause after build succeeds and when not running on the build server"
This reverts commit de9c0d5cf1.
2016-07-15 12:00:11 +02:00
Sebastiaan Janssen 13ed60b77b In upgrades, the new install views weren't being copied over 2016-07-15 11:49:14 +02:00
Shannon 4469e6bf11 fixes migration to actually execute for mysql 2016-07-15 09:45:03 +02:00
Sebastiaan Janssen 3435a2d872 Updates version 2016-07-15 09:24:21 +02:00
Sebastiaan Janssen de9c0d5cf1 Adds a pause after build succeeds and when not running on the build server 2016-07-15 09:23:42 +02:00
Sebastiaan Janssen 91b8f4dcce Merge pull request #1380 from umbraco/temp-U4-8522
U4-8522 cmsPropertyData needs unique constraint indexes and index refactoring
2016-07-15 09:22:31 +02:00
Jeremy Pyne a40f87eb36 Fixed an issues with user generated PetaPoco's would not work if they included schema's.
Fixed an issue where strong typed helper methods would not generate valid SQL for column names if the poco didn't explicitly set a [Column(Name="")] attribute. The PetaPoco format allows for this though and will default to the property name.  Again this would cause issues for developers trying to use the DatabaseContext.Database class with their own Poco's.

Both the above causes would happen for example if using the PetaPoco T4 templates to automatically generate Poco's.
2016-07-14 17:01:51 -04:00
Shannon 52e2cbab90 updates delete query to work with MySql 2016-07-14 18:00:43 +02:00
Shannon e7b26ad949 updates migratoin to run a single delete statement during execution 2016-07-14 17:51:18 +02:00
Sebastiaan Janssen 1dc5515e80 Merge branch 'temp-appveyor-output' into dev-v7
Conflicts:
	appveyor.yml
2016-07-14 14:57:42 +02:00
Sebastiaan Janssen 4ee4066dc6 Whoops, too many newlines 2016-07-14 14:46:34 +02:00
Sebastiaan Janssen de0bb494a5 Improving Build.bat and appveyor build output
Moving all Console.Write* to Debug.Print
2016-07-14 14:11:05 +02:00
Sebastiaan Janssen db9f4325f5 Merge pull request #1378 from umbraco/temp-U4-8629
U4-8629 Displays link to version report on our.umb during Upgrade step
2016-07-14 13:27:02 +02:00
Sebastiaan Janssen 8a17494d1e Merge pull request #1377 from umbraco/temp-U4-8618
U4-8618 - Adds button to manually trigger health checks
2016-07-14 13:00:35 +02:00
Sebastiaan Janssen dfe1c52f6e Merge pull request #1379 from umbraco/temp-U4-8542
U4-8542 Require https attribute for back office web api controllers
2016-07-14 12:13:44 +02:00
Sebastiaan Janssen 89f759c088 U4-8670 Ensure the create package system in the back office allows for specifying correct metadata
Just a few more updates based on PR feedback
2016-07-14 12:09:55 +02:00
Shannon bd306295c2 Ensures the correct index is installed by default, fixes a test that didn't take this index into account 2016-07-12 19:39:22 +02:00
Shannon bd219cb8f2 U4-8542 Require https attribute for back office web api controllers
This adds the webapi filter and also creates a new MVC one with a better name and the correct namespace since it was previously in the wrong namespace . I've obsoleted the old one and proxied the logic to the new renamed one so there are no breaking changes.
2016-07-12 18:13:11 +02:00
Shannon 1eef30710d U4-8522 cmsPropertyData needs unique constraint indexes and index refactoring 2016-07-12 17:34:11 +02:00
Warren Buckley 9a5527864f Update the HTML Angular view for UpgradeStep to match the anonymous object we send down the wire as JSON from the InstallStep. Lists out the two versions & a simple button for a link to the our.umbraco version compare tool 2016-07-12 15:58:59 +01:00
Warren Buckley 13add0c355 Update the ViewModel we return as JSON to the Upgrade Installer Step - Has logic for checking latest logic (Needs bullet proof testing & discussion most likely) 2016-07-12 15:57:48 +01:00
Warren Buckley d90426eb64 Adds a button to manually trigger Health Checks. Adds disabled state & inactive CSS class to ensure it cannot be triggered again whilst checks taking place. 2016-07-12 13:32:16 +01:00
Shannon 0450cdd550 removes some old notes 2016-07-12 13:36:08 +02:00
Shannon 856de5b9f3 Ensures Stylesheet tables are not re-added on install, and re-removes them for upgrades. 2016-07-11 15:32:22 +02:00
Shannon Deminick f051ff2ec2 Merge pull request #1362 from umbraco/temp-U4-8602
U4-8602 Packages - Repository UI/UX Polish
2016-07-11 14:38:18 +02:00
Shannon a86a5d3db2 U4-8636 New Packager - Do not allow a package to be installed multiple times
adds better localization support for installing/uninstalling and validates the installation target
2016-07-11 14:34:02 +02:00
Shannon da92eef733 U4-8714 New packager - wrong number for package votes 2016-07-11 12:50:22 +02:00
Shannon d377ebfc47 Ensures you cannot install an already installed package in the local install area, localizes errors, ensures the installed packages list only shows the latest installed versions, ensures when uninstalling a package it removes all versions it installed. 2016-07-11 12:42:26 +02:00
Shannon d7c98c2686 Fixes the redirect when uninstalling, fixes the icon header width of installing a local package 2016-07-11 11:31:21 +02:00
Shannon 676bf3a6b2 Fixes where the packager redirects when there is not a custom control to display - it was going to the old old packager thing which we don't want 2016-07-11 11:02:18 +02:00
Shannon a83dec1351 Merge branch 'dev-v7' into temp-U4-8602
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.controller.js
#	src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html
#	src/Umbraco.Web.UI.Client/src/views/packager/views/installed.html
2016-07-11 10:38:33 +02:00
Shannon 50d6f876a4 updates some code notes 2016-07-11 10:25:42 +02:00
Shannon ff0711f786 bumps version txt file 2016-07-11 10:09:17 +02:00
Shannon Deminick 44eb491cd9 Merge pull request #1364 from umbraco/temp-U4-8624
U4-8624 umbracoCacheInstructions is slowing server response
2016-07-11 09:48:38 +02:00
Shannon 7858ad5634 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-07-11 09:40:04 +02:00
Shannon ca0ffe23ba U4-8718 Latest ClientDependency release 2016-07-11 09:39:54 +02:00
Sebastiaan Janssen 2a67e2eb46 YAML files need white lines to denote a new command, else they just get concatenated 2016-07-08 15:09:16 +02:00
Sebastiaan Janssen 444c431527 Improving Build.bat and appveyor build output 2016-07-08 14:51:02 +02:00
Sebastiaan Janssen 5ebcdce557 Merge pull request #1374 from umbraco/temp-u4-8682
U4-8682 - manage cache in tests
2016-07-07 17:54:39 +02:00
Sebastiaan Janssen f2d50866d9 Merge pull request #1370 from umbraco/temp-u4-8361
u4-8361 From ids to guids
2016-07-07 17:52:41 +02:00
Stephan 6f6c7ede0a U4-8361 - fixing migrations 2016-07-07 16:56:52 +02:00
Sebastiaan Janssen 85c7b102b9 Revert C#6 notation 2016-07-07 16:22:55 +02:00
Sebastiaan Janssen 05cb2050e7 Revert C#6 notation 2016-07-07 16:17:01 +02:00
Warren Buckley a494ea8dc8 Merge pull request #1350 from umbraco/temp-U4-8640
U4-8640 Deleting a content type with children only emits a deleted ev…
2016-07-07 14:40:56 +01:00
Sebastiaan Janssen d0e47fe1ff Merge pull request #1339 from dannydrogt/temp-u4-8613
U4-8613 Link to DocType from "Properties" tab is not localized
2016-07-07 15:38:00 +02:00
Sebastiaan Janssen 7c485dcd50 Forgot password email sent as raw text, but contains html
#U4-8703 Fixed
2016-07-07 15:24:53 +02:00
Warren Buckley a319aa9503 Merge pull request #1365 from umbraco/temp-packaging
U4-8670 Ensure the create package system in the back office allows for specifying correct metadata
2016-07-07 13:08:19 +01:00
Warren Buckley e02fbd0bbe Merge pull request #1355 from umbraco/temp-U4-8561
Properly URL Encodes stylesheet properties
2016-07-07 10:47:48 +01:00
Stephan 560c0fbb33 U4-8361 - fixing and perfs 2016-07-06 21:53:08 +02:00
Stephan c5a346d70f Merge branch 'dev-v7' into temp-u4-8361 2016-07-06 20:00:17 +02:00
Stephan c1f6708b21 Fix 2016-07-06 18:08:19 +02:00
Stephan 4531bf6c30 U4-8682 - manage cache in tests 2016-07-06 18:01:59 +02:00
Sebastiaan Janssen c7967dc4f2 Merge pull request #1363 from umbraco/temp-U4-8472
U4-8472 Add web.config file to media folder path to prevent all execu…
2016-07-06 16:49:00 +02:00
Sebastiaan Janssen 0f19937aec Making sure the media/web.config is correctly installed from nuget 2016-07-06 16:48:30 +02:00
Warren Buckley b3259e5d3c Merge pull request #1371 from umbraco/temp-u4-8675
u4-8675
2016-07-06 11:42:16 +01:00
Sebastiaan Janssen 620800b448 Merge branch 'dev-v7' into temp-U4-8561 2016-07-06 12:32:06 +02:00
Sebastiaan Janssen f057eca45a Scratch that.. the Alias is actually the Name. Consistency FTW! 2016-07-06 11:14:59 +02:00
Sebastiaan Janssen b395d1a049 Alias is already running through ToSafeAlias, doesn't need UrlEncoding 2016-07-06 11:04:27 +02:00
Sebastiaan Janssen 46cd7cae38 Make sure to encode/decode the property name everywhere 2016-07-06 11:02:51 +02:00
Sebastiaan Janssen b2e9fb1534 Need to UrlDecode the parts[1] part so that we can find and properly delete properties with ampersands 2016-07-06 11:00:34 +02:00
Shannon 1f041f17c1 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-07-06 09:38:00 +02:00
Shannon ee27264a72 Ensures all instances of SqlCeEngine are in a using claus so native objects are disposed properly 2016-07-06 09:37:52 +02:00
Stephan 1f40043740 Hopefull fixing tests 2016-07-05 15:11:10 +02:00
Stephan a7ae9e66cd U4-8624 - throttle pruning instr. and optimize query 2016-07-05 12:29:16 +02:00
Stephan a0f00efcef Merge branch 'dev-v7' into temp-U4-8624 2016-07-05 12:00:29 +02:00
Stephan ac44079044 Merge branch 'dev-v7' into temp-U4-8627 2016-07-05 11:45:42 +02:00
Stephan f799938989 Revert "Merge branch 'U4-8588' ..."
This reverts commit 1bfb32dcdc.
2016-07-05 11:44:41 +02:00
Stephan cec456d672 U4-8675 - minor fixes 2016-07-05 11:31:53 +02:00
Stephan b9e886c0bc Merge branch 'U4-8675' of https://github.com/benjaminketron/Umbraco-CMS into temp-u4-8675 2016-07-05 10:30:53 +02:00
Stephan 3d2a0b4a29 U4-8361 - from ids to guids 2016-07-04 18:22:06 +02:00
Stephan 6897ee1d14 U4-8469 - bugfix content cache 2016-07-04 18:21:36 +02:00
Shannon b1b5352e26 updates to latest Markdown version 2016-07-04 14:38:45 +02:00
Shannon Deminick 04ebb6ab4e Merge pull request #1368 from skttl/patch-2
U4-7386: Adds summaries to string functions
2016-07-04 12:42:05 +02:00
Søren Kottal 44565226fe U4-7386: Adds summaries to string functions 2016-07-01 22:14:44 +02:00
Søren Kottal b84f17ce5e U4-8579: Replace linebreaks
Uses Umbraco Helper to replace linebreaks for html in model.value
2016-07-01 21:32:09 +02:00
Simon Busborg 2bb89fa63b Cleanup 2016-06-29 16:12:22 +02:00
Shannon 76a962c2e0 published package now includes icon url 2016-06-29 15:44:34 +02:00
Shannon c05c14988e package saving now working with extra metadata 2016-06-29 15:36:45 +02:00
Shannon 092abfb56d Gets created packages deletion working, gets the min umb version field working on the created packages UI 2016-06-29 15:31:10 +02:00
Simon Busborg edd80ae55f Added better utilities 2016-06-29 14:34:59 +02:00
Mads Rasmussen 8d9da719b4 add progress bar to install and uninstall 2016-06-29 14:20:21 +02:00
Simon Busborg ca40fd3976 Changed name of utilities and their width value 2016-06-29 14:15:41 +02:00
Mads Rasmussen 9956dee829 move wrapper class so "Take me back" is in the top right corner 2016-06-29 13:34:50 +02:00
Mads Rasmussen 93945e30cc bring back the redirect to webforms view - use localStorageService to handle local storage 2016-06-29 13:18:26 +02:00
Mads Rasmussen a0ccbc3fac package details information: label as block element, wrap words, don't show empty information item 2016-06-29 11:55:19 +02:00
Simon Busborg 9aa25d5265 changed lorem ipsum with actual copy 2016-06-29 11:13:19 +02:00
Mads Rasmussen 61ef71d9fb Merge branch 'temp-U4-8602' of https://github.com/umbraco/Umbraco-CMS into temp-U4-8602 2016-06-29 11:04:16 +02:00
Mads Rasmussen 4be68eede7 only show external sources if there are any 2016-06-29 10:58:26 +02:00
Simon Busborg fbd5e58cca Fixed width issue for package details coursed by inline styling 2016-06-29 10:57:59 +02:00
Mads Rasmussen 5b4381cc2b change src to ng-src 2016-06-29 10:49:11 +02:00
Mads Rasmussen 0ede94e0f9 rename src and srcset attr on umb-avatar 2016-06-29 10:47:24 +02:00
Shannon a67020ec31 Ensures that the package Icon is displayed for installed packages. Cleans up lots of try/catch/swallows in the packaging logic, adds better xml error handling (we really need a lot more though), ensures that if any part of the package installation fails, that angular bails and doesn't keep trying to install - same logic for installing forms. 2016-06-28 20:14:12 +02:00
Benjamin Ketron 42ef6d3d76 An attempt to speed up sorting a large set of nodes when a large set of users exist. Our sorts were failing in azure because the user notifications were taking long enough that azure would kill the thread. 2016-06-28 12:03:36 -06:00
Shannon Deminick 7c8f0457f1 Merge pull request #1338 from Jeavon/U4-8612
Fix for U4-8612 so that Icon shows when installing a local package
2016-06-28 16:36:31 +02:00
Shannon 81a4130f46 U4-8624 umbracoCacheInstructions is slowing server response 2016-06-28 16:31:24 +02:00
Shannon 1a02841649 U4-8472 Add web.config file to media folder path to prevent all execution based files from being run by IIS 2016-06-28 16:01:23 +02:00
Simon Busborg e2826e36ef Fixed width on form and changed copy 2016-06-28 11:43:34 +02:00
Simon Busborg 2a7c50f114 Changed latest to “New Releases” 2016-06-28 11:43:34 +02:00
Mads Rasmussen f7cdee9ba9 delete unused views 2016-06-28 11:43:34 +02:00
Mads Rasmussen 39541cd335 swap title when searching 2016-06-28 11:43:34 +02:00
Mads Rasmussen a2973519e2 Add empty state for installed packages 2016-06-28 11:43:34 +02:00
Mads Rasmussen fd9db1fee7 use empty state component when there are no search result 2016-06-28 11:43:34 +02:00
Simon Busborg 6c95e9efd6 Added target blanks to all links 2016-06-28 11:43:34 +02:00
Mads Rasmussen 1bd391a392 increase page size to 24 2016-06-28 11:43:34 +02:00
Mads Rasmussen f41453b972 change search to use ng-change instead of $watch. Reset search results when search field is cleared. 2016-06-28 11:43:34 +02:00
Simon Busborg 340d0eb84e Added “Take me back link” to missing views 2016-06-28 11:43:34 +02:00
Simon Busborg 9602a52801 added better utility for flexbox and changed classes in views 2016-06-28 11:42:34 +02:00
Simon Busborg c280a0a5ab Added new utility in text-align and added empty message for search 2016-06-28 11:42:34 +02:00
Simon Busborg dbec2c207f Package category navigation fixed for all screen resolutions 2016-06-28 11:42:34 +02:00
Simon Busborg e12b9665ab Added better ui for multiple screen resolutions, added success screens for installer, added better ui for uninstall and accept term screens 2016-06-28 11:42:34 +02:00
Simon Busborg 831c7a951f Merge pull request #1358 from umbraco/temp-U4-8661
U4-8661 Add progress bar angular component
2016-06-28 11:29:01 +02:00
Mads Rasmussen 63b90ad0c9 use umb-progress-bar in package details 2016-06-28 11:27:26 +02:00
Mads Rasmussen 72a319572a add umb-progress-bar component 2016-06-28 11:27:04 +02:00
Claus 4423f965d1 Merge pull request #1359 from umbraco/temp-U4-8592b
U4-8592 - fix property conversions
2016-06-28 11:13:22 +02:00
Simon Busborg 3370c57ae6 Merge pull request #1357 from umbraco/temp-U4-8660
U4-8660 Add avatar angular component
2016-06-28 10:39:56 +02:00
Stephan db79690501 U4-8592 - fix decimal scaling factor issue 2016-06-28 10:09:11 +02:00
Mads Rasmussen 178dbcc7fc Merge pull request #1361 from umbraco/temp-U4-8416
U4-8416 Empty recycle bin does not refresh or gives feedback to user
2016-06-28 09:50:48 +02:00
Shannon 0e61eb79a8 U4-8416 Empty recycle bin does not refresh or gives feedback to user 2016-06-27 18:27:49 +02:00
Shannon Deminick 374fa5b574 Merge pull request #1351 from umbraco/temp-u4-8649
U4-8469 - xml cache TLC
2016-06-27 17:16:06 +02:00
Stephan 09526e6db4 U4-8592 - fix property conversions 2016-06-27 15:33:08 +02:00
Shannon eec0e4f946 Merge branch 'U4-8588' of https://github.com/JimBobSquarePants/Umbraco-CMS into dev-v7
# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	src/Umbraco.Core/Umbraco.Core.csproj
#	src/Umbraco.Web.UI/packages.config
2016-06-27 14:20:13 +02:00
Shannon Deminick 46690ed405 Merge pull request #1284 from umbraco/temp-U4-265
U4-265 Time zone adjustment in Umbraco backend for Date/Time picker
2016-06-27 14:15:13 +02:00
Shannon 37f67b505c Changes the greymed color to be a bit darker (after discussing with mads), makes the forms styles use greymed instead of a custom one, removes the first line from the help (too long) 2016-06-27 14:14:49 +02:00
Mads Rasmussen 3773c55633 use avatar component in sections 2016-06-27 09:53:40 +02:00
Mads Rasmussen f6c74eedf6 use avatar component in package details 2016-06-27 09:52:29 +02:00
Mads Rasmussen f420960eea add umb-avatar component + documentation 2016-06-27 09:50:35 +02:00
Shannon Deminick 5fc2d93709 Merge pull request #1354 from abjerner/patch-8
Implemented better translations for the create data type dialog
2016-06-27 09:45:27 +02:00
Sebastiaan Janssen b840ab250a Merge pull request #1238 from Dynacy/patch-1
Create tr.xml
2016-06-24 13:08:17 +02:00
Sebastiaan Janssen 2e2d0e506f Properly URL Encodes stylesheet properties 2016-06-24 10:49:07 +02:00
Anders Bjerner a70aa5cb25 Added translations for en-US 2016-06-23 18:14:58 +02:00
Anders Bjerner 6e1e7ff8ba Added translations for English 2016-06-23 18:13:37 +02:00
Anders Bjerner 74c22c8491 Added translations for Danish 2016-06-23 18:13:03 +02:00
Anders Bjerner 54b01caa38 Added localize elements for "New data type" and "New folder" 2016-06-23 18:11:19 +02:00
Stephan 1e12cb8ac5 U4-8649 - fix tests 2016-06-23 18:05:42 +02:00
Shannon 1c40d9d0d8 U4-8627 Umbraco.Core.Sync.DatabaseServerMessenger - No last synced Id found when '0' is stored and there are no instructions 2016-06-23 16:55:04 +02:00
Shannon 1bfb32dcdc Merge branch 'U4-8588' of https://github.com/JimBobSquarePants/Umbraco-CMS into JimBobSquarePants-U4-8588
# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	src/Umbraco.Web.UI/packages.config
2016-06-23 16:55:04 +02:00
Mads Rasmussen 8a3c5c226c fix angular docs build 2016-06-23 15:44:55 +02:00
Mads Rasmussen 7411be99a8 Merge pull request #1344 from bjarnef/dev-v7-U4-8607
Document localizationService and localize directive
2016-06-23 15:30:26 +02:00
Stephan 7d25723afd U4-8469 - media cache TLC 2016-06-23 13:52:43 +02:00
Sebastiaan Janssen 7dcd67f953 != to !== 2016-06-23 12:39:32 +02:00
Sebastiaan Janssen f995370792 Merge pull request #1328 from pynej/fix-markdwn-isDirty
Update markdowneditor.controller.js
2016-06-23 12:35:46 +02:00
Stephan f3f53896b7 U4-8469 - fixing 2016-06-23 11:31:32 +02:00
Stephan 5b28260f96 U4-8469 - xml cache TLC 2016-06-23 09:39:31 +02:00
Claus b75578c889 U4-8640 Deleting a content type with children only emits a deleted event on the parent content type
service now includes all deleted content types including children, in the DeletedContentType event arguments.
tests to ensure the correct number of deleted entities are sent in events.
2016-06-22 19:30:31 +02:00
Sebastiaan Janssen 402b2b082f Merge pull request #1347 from umbraco/temp-U4-8433
This ensures we are using the latest code from Log4Net.Async for thes…
2016-06-22 17:25:11 +02:00
Sebastiaan Janssen abd2e70b6a Make sure to hide the timezone offset message when no offsetting is needed (server and client are in the same timezone) 2016-06-22 17:19:24 +02:00
Warren Buckley 772754bde8 Merge pull request #1348 from umbraco/temp-U4-8630
fixes: U4-8630 Make lightbox component for package images
2016-06-22 15:35:46 +01:00
Stephan 980683d25a Merge pull request #1285 from umbraco/temp-U4-8410-2
Backports some changes from v8 so that we can perform a nice strongly… Reviewed, sounds good.
2016-06-22 14:55:06 +02:00
Stephan ab973fd4df U4-8410 - fix build 2016-06-22 13:33:52 +02:00
Stephan 3f285185d1 U4-8410 - minor fixes 2016-06-22 13:10:37 +02:00
Mads Rasmussen f1803b4f33 fixes: U4-8630 Make lightbox component for package images 2016-06-22 12:15:50 +02:00
Shannon 9463db7431 This ensures we are using the latest code from Log4Net.Async for these libs. there are very little changes and none breaking but it is now up-to-date and we will use the nuget package in v8 instead. 2016-06-22 11:48:52 +02:00
Mads Rasmussen 5021112934 fix the Angular Docs build: fixes small issues in healthCheck resource documentation 2016-06-22 11:40:11 +02:00
Stephan d4f2486b4f Merge remote-tracking branch 'origin/dev-v7' into temp-U4-8410-2 2016-06-22 10:58:46 +02:00
Shannon 740c3e770a remove test thing 2016-06-21 21:09:41 +02:00
Shannon b8c88139e1 fixing build 2016-06-21 21:08:38 +02:00
Shannon 33ca761441 Updated all to use the ref parameter, tests are passing - now to see if they run any faster :) 2016-06-21 20:43:02 +02:00
Shannon 866df9c0b8 Merge branch 'temp-U4-8410-2' of https://github.com/umbraco/Umbraco-CMS into temp-U4-8410-2
# Conflicts:
#	src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs
2016-06-21 18:22:26 +02:00
Shannon 06fd7c2780 starting ref refactor (need to merge first) 2016-06-21 18:20:55 +02:00
Shannon b5411a5402 Initial commit of refactor of better/more efficient in terms of mem and performance properpty selectors for our models, this also yields a much cleaner syntax. I have discovered one issue now which is that the PropertyChanged event now fires before the property value is actually set, this is why the lambda syntax existed before. Instead we can use a ref property for the SetPropertyValueAndDetectChanges methods which will work much nicer - and also potentially have less allocations. 2016-06-21 18:11:03 +02:00
Sebastiaan Janssen d2ad39f2d3 Merge pull request #1287 from bjarnef/dev-v7-U4-8526
Fix a few translations in da.xml
2016-06-21 17:47:06 +02:00
Sebastiaan Janssen 5842575d48 Correct path for the matchbrackets.js file 2016-06-21 16:55:02 +02:00
Sebastiaan Janssen 3a0ff337bd Merge pull request #1304 from pynej/fix-matchbrackets
Update CodeArea.cs
2016-06-21 16:54:09 +02:00
Simon Busborg 4c57cc2f39 Fixed white space in package overview 2016-06-21 12:19:02 +02:00
Sebastiaan Janssen afd62caa73 Ignore ClientDependency.config, building the solution will automatically create it 2016-06-21 10:55:18 +02:00
Sebastiaan Janssen df95b2a402 Same trick as for web.config, copy the ClientDependency.config from a template once and then ignore it so we don't always get prompted to commit it 2016-06-21 10:53:52 +02:00
Sebastiaan Janssen fc0334493a Update installer background 2016-06-21 10:43:56 +02:00
Mads Rasmussen 7b1563e0ca Merge pull request #1315 from JimBobSquarePants/U4-8583
U4 8583
2016-06-21 10:43:15 +02:00
Simon Busborg b7eb4e4e19 Merge pull request #1337 from bjarnef/dev-v7-U4-8598
Focus on input and toggle checkbox when clicking label
2016-06-21 10:34:04 +02:00
Warren Buckley 24a9ce51d5 Merge pull request #1330 from umbraco/temp-U4-6551
U4-6551 GetMediaByPath returning null
2016-06-21 09:21:55 +01:00
Simon Busborg 6c8771fae7 Merge pull request #1289 from pynej/fix-grid-macro
Macro's inserted in the grid should block link clicks so that users d…
2016-06-21 10:18:31 +02:00
bjarnef 5a53984b43 Document localizationService and localize directive 2016-06-21 01:25:14 +02:00
Stephan afcf2e195e Upgrade to ModelsBuilder 3.0.3 2016-06-20 16:10:06 +02:00
Shannon bc2b9ab298 U4-8614 JsonCamelCaseFormatter breaks the global configuration for the default JsonMediaTypeFormatter 2016-06-20 15:35:30 +02:00
Shannon Deminick 465a02d697 Merge pull request #1157 from simonech/patch-1
[U4-8128] Always rejecting promise even with server error
2016-06-20 15:33:21 +02:00
Danny Drogt 5b417f6241 U4-8613 Link to DocType from "Properties" tab is not localized - Added call to TextService 2016-06-20 15:32:27 +02:00
Jeavon 53fbf04a6c Add target=_blank on license url in local package installer so user doesn't loose their installer if they click the link 2016-06-20 13:20:24 +01:00
Jeavon fed718efb5 Fix Author link in Local package installer 2016-06-20 13:17:09 +01:00
Jeavon 05ed8e9530 Fix for U4-8612 so that Icon shows when installing a local package 2016-06-20 13:07:16 +01:00
bjarnef bca6e16e1b Focus on input, toggle checkbox when clicking label and only submit button dimmed 2016-06-19 23:11:26 +02:00
Sebastiaan Janssen 2a5dcef5f9 Merge pull request #1335 from bkclerke/U4-7879
escape semicolons
2016-06-16 14:11:32 +02:00
Blake Clerke-Smith f00a5271c3 escape other stuff 2016-06-16 06:09:59 -06:00
Blake Clerke-Smith deff98612f escape semicolons 2016-06-16 06:07:21 -06:00
Claus c612505362 updated unittest to be more precise. 2016-06-14 17:47:33 +02:00
Claus 12a2de7cf3 U4-6551 GetMediaByPath returning null
now doing fallbacks to other querys trying to get media from the json value format stored.
2016-06-14 17:43:46 +02:00
Sebastiaan Janssen 85b00f60ab Update broken unit test 2016-06-14 14:38:19 +02:00
Sebastiaan Janssen 2ae2047b7c Temporarily ignore two failing tests 2016-06-14 14:18:24 +02:00
Shannon c5aa97e23a Merge branch 'temp-packages' into dev-v7
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less
2016-06-14 14:15:47 +02:00
Shannon 017b925fe7 Merge branch 'temp-packages' of https://github.com/umbraco/Umbraco-CMS into temp-packages 2016-06-14 14:12:41 +02:00
Shannon 3fcb2a7840 Installer is now 'fully' working 2016-06-14 14:12:10 +02:00
Mads Rasmussen 5f506a8bbc fix dropzone width 2016-06-13 23:50:36 +02:00
Sebastiaan Janssen 8539de08d0 IRedirectUrlRepository needs to be public 2016-06-13 23:41:19 +02:00
Shannon a8c71e52ec Ensures the min umbraco version is checked when installing packages that have the strict flag set. 2016-06-13 23:35:09 +02:00
Sebastiaan Janssen 7cddeca730 New installer background 2016-06-13 23:24:58 +02:00
Sebastiaan Janssen 7f154e28de Add the beta label 2016-06-13 23:24:57 +02:00
Sebastiaan Janssen b2cd4820be Updates Examine 2016-06-13 23:24:19 +02:00
Sebastiaan Janssen 82954b6b6f Merge pull request #1325 from umbraco/temp-u4-8361
U4-8361 Basic 301 Support In Core
2016-06-13 23:22:34 +02:00
Stephan ef181b7230 U4-8361 - internal some things 2016-06-13 23:20:27 +02:00
Mads Rasmussen 67d71908bf add back button when uninstalling package 2016-06-13 22:45:42 +02:00
Jeremy Pyne 4cf202188f Update markdowneditor.controller.js
This is a important fix for the Markdown property type.  I added code previously to get it to properly record changes made via the button controls.  This was causing every document loaded with a markdown property on it to immedetly be flagged as checked with IsDirty() instead of only when a change was actually made.
2016-06-13 15:20:07 -04:00
Mads Rasmussen e38d4b7e88 increase icon font size 2016-06-13 20:57:00 +02:00
James Jackson-South c9c1aea8ab Update ImageProcessor, clean up log message 2016-06-14 04:54:26 +10:00
Sebastiaan Janssen 2407517fd5 Merge pull request #1326 from AndyButland/u4-3805f
u4-3805 - Set fixed value for click-jacking protection to sameorigin...
2016-06-13 20:54:26 +02:00
AndyButland 0a00be7cfe Set fixed value for click-jacking protection to sameorigin instead of deny 2016-06-13 20:48:37 +02:00
Mads Rasmussen 1a7993b9d7 set bigger font icon on uninstall dashboard 2016-06-13 20:46:40 +02:00
James Jackson-South b7ef324287 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into U4-8588 2016-06-14 04:24:46 +10:00
Shannon c0625a7853 adds small icon to packages without them 2016-06-13 20:15:11 +02:00
Shannon 3d2fe3c9da Install/uninstall working - just need a few ui updates and then get the repo install working 2016-06-13 20:10:31 +02:00
Stephan 839603342b U4-8361 - bugfix, get events to work 2016-06-13 19:45:25 +02:00
Andy Butland 203e9e3394 Ensured click-jacking meta-tag health check searches case insensitively (#1324) 2016-06-13 19:44:01 +02:00
Shannon 2d9010caf4 I can haz package uninstallation 2016-06-13 19:43:04 +02:00
Shannon c2b016d7d0 Gets local package installation 'working', now needs a little UI work. 2016-06-13 18:28:56 +02:00
Sebastiaan Janssen d83d7956bb Dev v7 health check (#1220)
Adds health check feature including some initial checks
2016-06-13 17:42:05 +02:00
James Jackson-South 33cbcbb7d4 Save projects. 2016-06-13 22:47:49 +10:00
James Jackson-South b0a4cc3333 Updates ImageProcessor 💥
- Update versions
- Add ImageProcessorLogger
2016-06-13 22:43:05 +10:00
Shannon f5d3f9087f updates to package filtering to unselect a category 2016-06-13 13:29:51 +02:00
Shannon 441ea0cfaf Got the package search/filter/etc.. all working 2016-06-13 13:10:26 +02:00
Shannon 5a32e1a294 package tree is basically done, got the editor updated to work with the server data to display the initial screen and details 2016-06-12 21:39:29 +02:00
Stephan 795e6945e3 Merge pull request #1313 from marcemarc/temp-u4-8361
Create 301 Redirects When Urls Change - merging for review
2016-06-12 19:54:00 +02:00
Stephan e231206555 U4-8361 - bugfix, get finder to work 2016-06-12 19:47:11 +02:00
James Jackson-South 7cfead45a6 Fix #U4-8583
Add styles to the hacks.less file that fixes all pre and code samples
within the back office.
2016-06-13 03:30:54 +10:00
Marc Goodson 7c49bb4aca Event Handler to wire up to publishing and moving events to track Url changes, and then create appropriate 301 redirects using the new RedirectUrlService to maintain google juice 2016-06-12 16:54:13 +01:00
Stephan 0ad25ff7b9 Merge pull request #1310 from JimBobSquarePants/temp-u4-8361
Add IContentFinder implementation.
2016-06-12 16:47:44 +02:00
Stephan 2570a9139c U4-8361 - service & repository 2016-06-12 16:22:06 +02:00
James Jackson-South c916c09dee Add IContentFinder implementation. 2016-06-12 23:51:22 +10:00
Stephan 79bbd6a70c U4-8361 - implement repository 2016-06-12 15:27:54 +02:00
Shannon ba9315079b Merge branch 'temp-packages' of https://github.com/umbraco/Umbraco-CMS into temp-packages 2016-06-12 15:20:50 +02:00
Shannon cba91145ee Updates new packages tree, obsoletes old one, have the package UI running for root node and sub nodes only for created packages. 2016-06-12 15:19:42 +02:00
Stephan a7759c6175 U4-8361 - renaming 2016-06-12 13:07:00 +02:00
Stephan 36fbb9df86 U4-8361 - initial work 2016-06-12 12:38:35 +02:00
Mads Rasmussen ae7c145fcd add scrollable header to details page 2016-06-12 11:45:57 +02:00
James Jackson-South ceddf6c883 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-06-10 20:31:59 +10:00
Jeremy Pyne fed8a170cd Update CodeArea.cs
Added a missing include so the matchbrackets tag works in CodeMirror.
2016-06-08 12:40:15 -04:00
Shannon 38e59373c6 U4-8569 Saving a member type changes the UniqueId of custom properties and tabs
This fixes the tab/group unique id mappings
2016-06-08 09:47:06 +02:00
Shannon 50f4bbdd1e U4-8569 Saving a member type changes the UniqueId of custom properties
This fixes the member property type UniqueID SQL and mapping.
This ensures that the main repositories fully assert/compare all fetched properties.
2016-06-07 12:20:10 +02:00
Simon Busborg 111ef37bfb Merge pull request #1286 from bjarnef/dev-v7-U4-8525
Fix tiny issues with dropzone border and sticky header
2016-06-06 12:04:48 +02:00
Shannon Deminick 6681e48c57 Merge pull request #1301 from dampee/dev-v7
update examine documentation links
2016-06-03 11:41:41 +02:00
Damiaan 7b101caf0b update examine documentation links 2016-06-03 11:36:07 +02:00
Mads Rasmussen 08ae541bd8 center icons in header 2016-06-01 13:47:03 +02:00
Mads Rasmussen e3b8ad5e23 fake loading state 2016-06-01 13:27:33 +02:00
Mads Rasmussen 6dab9d2966 clean up overview controller and view 2016-06-01 13:19:02 +02:00
Mads Rasmussen d435c8c4c8 hide footer 2016-06-01 13:16:49 +02:00
Simon Busborg 2ce2a03072 Local installer 2016-06-01 13:03:19 +02:00
Mads Rasmussen a39150a98c added auto focus to search field 2016-06-01 12:57:53 +02:00
Shannon aff03997d9 Moves static event binding for prop editors to startup handlers 2016-06-01 11:27:08 +02:00
Mads Rasmussen 0d99e1d9a2 added pagination 2016-06-01 11:12:34 +02:00
Mads Rasmussen 43f7a18eb6 move details view into repo sub view 2016-06-01 10:06:09 +02:00
Mads Rasmussen 41bef87365 add description to package 2016-05-31 21:56:33 +02:00
Mads Rasmussen 05cdc066ab do not redirect when changing category 2016-05-31 21:29:23 +02:00
Mads Rasmussen 5858823252 add even spacing to sections + a bit more padding to category nav 2016-05-31 21:29:00 +02:00
Mads Rasmussen 86eaacc5d2 tighten repo overview a bit 2016-05-31 21:10:52 +02:00
Simon Busborg c66de2298b Added local installer 2016-05-31 16:18:41 +02:00
Mads Rasmussen 4545e83534 added list for installed packages 2016-05-31 16:00:23 +02:00
Mads Rasmussen c36db267ce add val-form-manager to fix js errors 2016-05-31 15:57:34 +02:00
Mads Rasmussen 8b3160cd79 remove unused model 2016-05-31 15:56:56 +02:00
Sebastiaan Janssen cff7dbc81a Temp u4 8495 (#1293)
* U4-8495 Create YML file for AppVeyor

* Secret token needs to be in single quotes

* Secure token instead of a configuration variable should make the slack notification work

* Only post to Slack when build fails
2016-05-31 15:21:37 +02:00
Mads Rasmussen 5ba2967c15 added design for package details 2016-05-31 14:02:07 +02:00
Shannon 03d53737a0 Fixes issue with a zero offset time - which in JS also means false, so need to check for undefined explicitly 2016-05-31 13:39:14 +02:00
Simon Busborg c3e4b611a6 added subviews 2016-05-31 11:18:34 +02:00
Sebastiaan Janssen 1121362ca9 Merge pull request #1295 from umbraco/temp-U4-8511
U4-8511 Update moment.js to the version to 2.10.3 for release
2016-05-30 16:08:51 +02:00
Sebastiaan Janssen 6ad4390d20 Merge pull request #1294 from umbraco/temp-U4-8331
Fixes: U4-8331 Umbraco.MultipleMediaPicker 'pick only images' should not allow a folder to be picked
2016-05-30 14:57:14 +02:00
Mads Rasmussen 8d5742acb7 Merge pull request #1281 from umbraco/temp-U4-8445
U4-8445 Validation on the Email field for Members will not allow the …
2016-05-30 14:41:46 +02:00
Shannon 4aa4a03013 U4-8511 Update moment.js to the version to 2.10.3 for release 2016-05-30 14:25:47 +02:00
Mads Rasmussen 9190855bcf add configuration to disable folder select 2016-05-30 14:08:30 +02:00
Sebastiaan Janssen 720a46686b U4-8500 Get c# docs building (#1291)
fetches docfx, builds the metadata and builds the docs with the correct filters
builds the UI docs from the same powershell script
2016-05-30 12:02:13 +02:00
Mads Rasmussen 11c1b5a2c4 Merge pull request #1126 from KevinJump/dev-v7-StylesheetProperties-U4-7160
U4-7160: Stylesheet RegEx to capture multi class properties
2016-05-30 10:51:30 +02:00
Simon Busborg 885d14bcb6 Fixes: U4-8455 IE11 - Image Cropper stretches the image when zooming 2016-05-30 10:01:39 +02:00
Mads Rasmussen 654f130105 Merge pull request #1275 from bjarnef/dev-v7-U4-8489
Ensure correct font is used for icon-check
2016-05-30 09:56:05 +02:00
Mads Rasmussen 2f445543f4 Merge pull request #1263 from lars-erik/U4-8443
U4-8443 - Immediately create node from list view when only one available document type
2016-05-30 09:39:38 +02:00
Simon Busborg 216c70becc Merge pull request #1273 from gkonings/disable-submit-overlay
U4-8332
disable/enable submit button on overlay window
2016-05-30 09:35:42 +02:00
Simon Busborg 7046fca333 Merge pull request #1274 from bjarnef/dev-v7-U4-8486
Fixes some styling for login screen on narrow screen sizes
2016-05-30 09:27:42 +02:00
Simon Busborg 43ece1aba4 Merge pull request #1272 from gkonings/slider-default-round
Removed required attribute from slider-handle
2016-05-30 09:19:28 +02:00
Mads Rasmussen 521329feac send id to category and details view 2016-05-30 09:15:28 +02:00
Jeremy Pyne 24959f4495 Macro's inserted in the grid should block link clicks so that users done accidentally navigate away from backoffice when trying to edit macro settings. 2016-05-27 16:51:34 -04:00
Simon Busborg 5b9d063808 Changed categories 2016-05-27 14:52:35 +02:00
Mads Rasmussen a04cb1d970 added details view 2016-05-27 14:29:30 +02:00
Mads Rasmussen d77986fb18 open overview html instead of edit html.. add category html and link the two views 2016-05-27 13:11:03 +02:00
Simon Busborg db21aef150 added icons and versions 2016-05-27 11:59:19 +02:00
Mads Rasmussen 140218b0ed remove install button + make categories smaller 2016-05-27 10:32:55 +02:00
bjarnef 2f1b234d85 Fix template translation 2016-05-26 22:43:15 +02:00
bjarnef 00ae650ee2 Modify a few other keys 2016-05-26 22:37:49 +02:00
bjarnef e3dae6d77e Fix a few translations in da.xml 2016-05-26 22:24:33 +02:00
bjarnef cd3140af21 Fix tiny issues with dropzone border to the left for fixed header and header jump by 1px when it get sticky. 2016-05-26 21:13:25 +02:00
Stephan 6a0ca68d17 Fixing, stupid 2016-05-26 18:44:22 +02:00
Stephan 928e74f24c No C# 6 yet 2016-05-26 17:14:13 +02:00
Stephan d0c030a34c Reduce dictionary allocs in TracksChangesEntityBase 2016-05-26 16:49:55 +02:00
Shannon 41b68333d2 publicizes EnableChangeTracking and DisableChangeTracking methods for entities, ensures that change tracking is disabled whenever building an entity for a repository as this is totally unnecessary and probably large memory overhead. Updates examine content indexer to page by 10000 rows 2016-05-26 16:36:53 +02:00
Simon Busborg 3cc8a71a60 added button back 2016-05-26 16:31:56 +02:00
Shannon 628ce5ea1f Backports some changes from v8 so that we can perform a nice strongly typed query with paging - this is then used for the content indexer to index content via the db for published content instead of the xml cache system. This was already done in v8 but have no backported the logic and fixed up the unit tests. When merging with v8 we will most likely just keep all v8 stuff and discard these changes, but we'll need to compare just in case. All tests pass and re-indexing is working as expected. Also updated the paging count from 1000 to 5000 for reindexing. 2016-05-26 15:30:40 +02:00
Simon Busborg 8a744b52fe Removed install button, better spacing 2016-05-26 15:21:12 +02:00
Mads Rasmussen 098eb32ef6 added categories 2016-05-26 14:57:38 +02:00
Simon Busborg 7bb8430022 Packages 📦 2016-05-26 14:50:11 +02:00
Simon Busborg 259ccd653e Added dummy data to packages 2016-05-26 14:13:55 +02:00
Simon Busborg f876b6b728 added umb-packages.less, added repeater for packages + minimal styling 2016-05-26 13:39:01 +02:00
Mads Rasmussen 05746c7b7c added editor scaffold 2016-05-26 13:12:41 +02:00
Mads Rasmussen 30ac4e94be hacked new packages tree 2016-05-26 13:12:05 +02:00
Mads Rasmussen b3b4cd4654 Fixes: U4-8480 Allow deleting empty tab when creating a doctype 2016-05-25 15:30:35 +02:00
Shannon def8ee4962 fixes ysod when indexing grid content when the value is not a string (sub json value) 2016-05-25 14:38:24 +02:00
Shannon 8cea391a3f U4-8514 Fix installation issue when there are stale cookies on localhost 2016-05-25 14:36:00 +02:00
Shannon 1e38089bb4 U4-8514 Fix installation issue when there are stale cookies on localhost 2016-05-25 13:58:56 +02:00
Shannon 81d1ac74d2 U4-8513 Fix the RestartApplicationPool extension to null out the current identity 2016-05-25 13:56:42 +02:00
Claus 247a5f415d added a check to create macroScripts folder if it doesn't exist when creating a scripting file. 2016-05-25 12:12:52 +02:00
Shannon Deminick 8d5dabdfff Merge pull request #1282 from umbraco/temp-U4-7332
U4-7332 Default gravatar link broken
2016-05-25 12:00:38 +02:00
Shannon 85a54c6492 fixes the delete part of U4-8491 2016-05-25 11:20:35 +02:00
Shannon bab693f2ba fix build 2016-05-25 10:56:41 +02:00
Shannon f243133b95 Merge remote-tracking branch 'origin/dev-v7' into temp-U4-265
# Conflicts:
#	src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs
2016-05-25 09:51:46 +02:00
Shannon 2504586c26 removes initial idea of performing conversion on the server since this would be a breaking change, instead we can easily do this on the client side - and this works much better. Have added pre-values to the date/time picker to be able to enable offset times. This is enabled for the publish-at pickers since those must be offset. When the datetime is offset, it shows the server time in small text underneath the picker. Have added js unit tests for the date conversions. Have updated the datepicker controller to set the model date in a single place/method so it's consistent. 2016-05-25 09:43:31 +02:00
Sebastiaan Janssen 7f3f11ab58 Merge pull request #1279 from umbraco/temp-U4-8491
U4-8491 Moving/Deleting Media does not sync/refresh the tree
2016-05-24 17:22:51 +02:00
Sebastiaan Janssen f817eefd5c Merge pull request #1280 from umbraco/temp-U4-8358
U4-8358 Writers can't schedule publish/unpublish times
2016-05-24 16:25:55 +02:00
Sebastiaan Janssen 6cb817fc01 U4-7332 Default gravatar link broken 2016-05-24 16:20:20 +02:00
Shannon b69580967e Updates interceptor files with correct module usage - creates new request interceptor to append a custom Time-Offset header 2016-05-24 16:12:54 +02:00
Stephan 7fad91d86f Merge branch 'AndyButland-u4-8290' into dev-v7 2016-05-24 15:56:21 +02:00
Stephan 42021a56b2 U4-8290 - minor cleanup & refactoring 2016-05-24 15:55:26 +02:00
Shannon f29b5aade7 only removes the buggy formatters/parsers if the attribute is type="email" 2016-05-24 15:07:35 +02:00
Shannon 3ea01b7dab U4-8445 Validation on the Email field for Members will not allow the entry of root domains greater than four characters. 2016-05-24 15:04:46 +02:00
Stephan 0a4a230c07 Merge branch 'u4-8290' of https://github.com/AndyButland/Umbraco-CMS into AndyButland-u4-8290 2016-05-24 08:15:47 +02:00
Shannon 877b7d4af7 U4-8358 Writers can't schedule publish/unpublish times 2016-05-23 19:23:59 +02:00
Shannon 9cf5ac2f95 U4-8491 Moving/Deleting Media does not sync/refresh the tree 2016-05-23 17:44:45 +02:00
Sebastiaan Janssen c902649768 U4-8438 Umbraco 7.4.3 NuGet package missing file 2016-05-23 10:47:54 +02:00
Sebastiaan Janssen bbe37ea6b9 U4-8349 Cannot create Scripting Files in Umbraco 7.4.0 2016-05-23 08:55:51 +02:00
Sebastiaan Janssen 57b19e7017 Forgot semicolon, whoops! 2016-05-23 08:47:36 +02:00
Sebastiaan Janssen 43d791f9a5 U4-6504 SmtpClient Not Properly Disposed, Causing Emails to Fail Periodically 2016-05-23 08:27:30 +02:00
bjarnef b74bf661b8 Added quotes 2016-05-21 23:57:30 +02:00
bjarnef 3c9de3b20c Ensure correct font is used for icon-check 2016-05-21 23:43:37 +02:00
bjarnef ccd42ad1d4 Fix some issues in landscape mode 2016-05-21 22:42:58 +02:00
bjarnef a8712fb4cf Added a comment 2016-05-21 21:51:28 +02:00
bjarnef d7cb79513f Adjust login for narrow screen sizes. 2016-05-21 21:49:00 +02:00
Gerard Konings 3897d0f764 disable submitbutton
disable submitbutton on overlay, so you can enable it later on
2016-05-20 22:44:18 +02:00
Gerard Konings 2ffbdec14b Removed required attribute from slider-handle
Removed required attribute. Slider defaults to round, so doesn’t need
to be required
2016-05-20 22:40:26 +02:00
Sebastiaan Janssen 8c7390280e Updates this migration to only run when upgrading from 7.3.0 and higher 2016-05-20 16:36:22 +02:00
Sebastiaan Janssen e54d374eb2 Add cmsPreviewXml table if it doesn't yet exist 2016-05-20 15:54:39 +02:00
Stephan aea26e67b1 Merge pull request #1255 from umbraco/better-memory-xmlcache
This fixes the LoadContentFromDatabase method
2016-05-19 17:03:23 +02:00
Shannon 06ae15ee7c reverts the cloning change 2016-05-19 16:12:12 +02:00
Shannon 95871fde7c updates naming conventions 2016-05-19 15:22:49 +02:00
Shannon 6b954d962f Merge branch 'lars-erik-test-bases-refactoring' into dev-v7 2016-05-19 11:48:14 +02:00
Shannon 2bd81ccb90 Merge branch 'test-bases-refactoring' of https://github.com/lars-erik/Umbraco-CMS into lars-erik-test-bases-refactoring 2016-05-19 11:48:01 +02:00
Stephan 08ae03a2d4 Merge branch 'dev-v7' into better-memory-xmlcache 2016-05-17 19:10:38 +02:00
Shannon 512c19a132 U4-8461 ERROR umbraco.presentation.webservices.nodeSorter - Could not update content sort order 2016-05-17 13:27:45 +02:00
Shannon 1e468cda5d Removes unused method, ensures that Cloning only occurs once per request (sort of hacky). Before if you have a few nodes that are published but have pending changes, then perform a sort, then the xml will be cloned for as many times as there were content changes. 2016-05-17 13:26:47 +02:00
Mads Rasmussen adebd4acd6 Merge pull request #1169 from AndyButland/u4-7468
Fixes U4 7468 - mis-assigned translator when sending to translation
2016-05-17 13:18:15 +02:00
Shannon d826f04b54 Ensures sort order is accurate to what is in the database 2016-05-17 12:17:05 +02:00
Simon Busborg 4752a83135 Fixes: U4-8362 Inserting image in a grid with Firefox shows full-size rather than scaled image 2016-05-17 11:02:07 +02:00
Mads Rasmussen 6a593d8b5e Merge pull request #1245 from greystate/U4-8377
Fix for U4-8377
2016-05-17 10:42:12 +02:00
Mads Rasmussen 38bc38486a Merge pull request #1229 from bjarnef/dev-v7-U4-8300
Wrap text "Include all child nodes" in a label
2016-05-17 10:13:06 +02:00
Mads Rasmussen b3f50368e5 Merge pull request #1228 from bjarnef/dev-v7-U4-8330
Fix line-height when using custom icon font as section icon
2016-05-17 09:19:38 +02:00
Shannon f130e86c88 U4-8448 Background task runner missing a null check during shutdown 2016-05-12 12:27:02 +02:00
Shannon 8d5556d4bc Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-05-12 11:16:46 +02:00
Shannon 4d0dc90042 Revert "RteMacroRenderingValueConverter should return an IHtmlString"
This reverts commit 7e9a14be83.
2016-05-12 11:16:39 +02:00
Claus acb1aeabda Merge pull request #1261 from umbraco/temp-U4-8371
U4-8371 Dont ship with the {machinename} token for Examine
2016-05-12 10:55:52 +02:00
Claus f5e433fd3c Merge pull request #1260 from umbraco/temp-U4-7295
U4-7295 Examine search with the data in the grid should be easier OOTB
2016-05-12 10:52:18 +02:00
Lars-Erik Aabech 597b4c3dd2 Added button to create only available doctype
Hides dropdown when listViewAllowedTypes.length > 1
Shows button for single when listViewAllowedTypes.length === 1
2016-05-11 21:44:22 +02:00
Simon Busborg a3efb74ad3 Merge pull request #1240 from arknu/decimal-parsing
U4-8365: Fix decimal property value converter to work on non EN-US cultures
2016-05-11 13:33:48 +02:00
Simon Busborg 924eac1b95 Merge pull request #1235 from bjarnef/dev-v7-U4-8347
Fix localization of listview buttons/links actions.
2016-05-11 10:06:51 +02:00
Shannon fb55b0a60b U4-8371 Dont ship with the {machinename} token for Examine 2016-05-10 18:32:32 +02:00
Shannon 7ae1060f50 U4-7295 Examine search with the data in the grid should be easier OOTB 2016-05-10 18:25:18 +02:00
Shannon Deminick d11ae23fe3 Merge pull request #1259 from umbraco/temp-u4-8413
U4-8413 - fix missing ServersLock object
2016-05-10 13:51:10 +02:00
Stephan 271f4e7a4a U4-8413 - fix missing ServersLock object 2016-05-10 12:29:13 +02:00
AndyButland 4f3d82cf10 Change field to which data is saved for a data type if provided in prevalues and handle potential mis-matched types on display 2016-05-10 10:50:59 +02:00
Simon Busborg 50e92b80f9 Changed from int to Nvarchar for the multimediapicker 2016-05-09 14:35:55 +02:00
Simon Busborg 9cd33abd5b Merge pull request #1130 from jamescoxhead/U4-7315
U4-7315 Make new media picker default in new installs
2016-05-09 14:30:29 +02:00
AndyButland 7b6bcd24ae Added value type as a pre-value to the label property editor 2016-05-08 23:39:47 +02:00
AndyButland 7858521c8b Converted usage of property editor value type strings to constants 2016-05-08 22:05:23 +02:00
Shannon Deminick f79a1f1a71 Merge pull request #1253 from umbraco/temp-u4-8406
U4-8406 - restart app pool by unloading domain and support read-only …
2016-05-04 16:51:41 +02:00
Shannon 0d11b15b3f This fixes the LoadContentFromDatabase method - before this was storing every single xml node in memory in dictionaries (x2) and then performing the re-organization of all nodes afterwords to construct a document, now we just read each row and organize the document accordingly, 2016-05-04 16:36:43 +02:00
Stephan 5f8747b4d3 U4-1780 - detect colliding urls (#1243)
* U4-1780 - detect colliding urls

* U4-1780 - fix error message

* U4-1780 - fix XmlHelper issue with sortOrder

* U4-1780 - bugfix
2016-05-04 12:45:20 +02:00
Stephan 67996cdb64 U4-8406 - restart app pool by unloading domain and support read-only web.config 2016-05-04 08:45:50 +02:00
Claus 729b179473 Merge pull request #1242 from umbraco/temp-u4-8370
U4-8370 - fix broken upgrade
2016-05-03 12:54:47 +02:00
Claus 20b67e47be Fixed property name to match property of the dynamic. 2016-05-03 12:54:22 +02:00
Shannon Deminick 52b6e04ad4 Merge pull request #1248 from rustyswayne/dev-v7
Appends forum link to developer comment for reference when evaluating code removal.
2016-05-03 11:35:56 +02:00
Claus 1186b7cb47 Merge pull request #1246 from umbraco/temp-u4-2508
U4-2508 - improve culture detection in 404 situation
2016-05-03 11:02:31 +02:00
Shannon f03daf819e Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-05-02 23:06:45 +02:00
Shannon febaddaaef U4-8394 When persisting the xml cache file it double loads the full xml structure into memory before writing it to a file 2016-05-02 23:05:46 +02:00
rs@merchello.com 029e50dd3c Appends comment and forum reference to developer comment for reference when evaluating code removal. 2016-05-02 13:17:13 -07:00
Simon Busborg 2a87c926f3 Merge pull request #1234 from bjarnef/dev-v7-U4-8343
Localize "unsaved changes" dialog.
2016-05-02 10:44:47 +02:00
Simon Busborg f7ee47a37f Fixes U4-8029 Editor settings for "Grid Layouts" is too wide and text overflows 2016-05-02 10:18:37 +02:00
Stephan 6dea69c5a1 U4-2508 - improve culture detection in 404 situation 2016-04-27 19:09:49 +02:00
Chriztian Steinmeier 066ef6809b Change the language keys necessary for the fix 2016-04-26 23:36:42 +02:00
Mads Rasmussen 4b682e0669 Merge pull request #1201 from bjarnef/dev-v7-U4-8022
U4-8022 - Fix issues with tree icons + legacy icons
2016-04-25 21:13:14 +02:00
Mads Rasmussen 4886631d54 Merge pull request #1202 from bjarnef/dev-v7-U4-7967
U4-7967 - Fix errors when saving document type when no icon is selected
2016-04-25 20:14:11 +02:00
Stephan 2c3c0eae12 U4-8370 - fix broken upgrade 2016-04-25 17:10:10 +02:00
Claus a5c427bae7 Merge pull request #1241 from umbraco/temp-u4-5699
U4-5699 - update template alias in gui after saving
2016-04-25 14:29:03 +02:00
Stephan fb99e375d0 U4-5699 - update template alias in gui after saving 2016-04-25 14:14:55 +02:00
Stephan 7e9a14be83 RteMacroRenderingValueConverter should return an IHtmlString 2016-04-25 11:18:22 +02:00
Claus 9b39f712be U4-3411 Adding new language doesn't sync the tree 2016-04-25 10:11:54 +02:00
bjarnef fcdf212c4c Rename area alias 2016-04-24 18:42:46 +02:00
Asbjørn Riis-Knudsen deb74939af U4-8365: Fix decimal property value converter to work on non EN-US cultures 2016-04-23 17:54:37 +02:00
Shannon Deminick b28a4a410c Merge pull request #1239 from soreng/patch-1
Update ICacheProvider.cs
2016-04-23 16:18:38 +02:00
Søren Gregersen bad1372313 Update ICacheProvider.cs
Not really an abstract class... :)
2016-04-23 15:58:18 +02:00
Dynacy ff5714196c Update tr.xml 2016-04-22 12:34:03 +03:00
Dynacy b607ba52f4 Create tr.xml
Turkish Language
2016-04-22 12:26:26 +03:00
Shannon 7e13781d8b fixes merge issue 2016-04-20 16:04:35 +02:00
Shannon 72cef006d3 bumps version 2016-04-20 15:56:06 +02:00
Shannon 6124126835 Fixes the custom field sorting, no longer has a sub query for order by, now supports both mysql and sqlce, adds a unit test (should add more though) 2016-04-20 15:50:38 +02:00
Shannon 7e71dcd2ae Merge remote-tracking branch 'origin/dev-v7.5' into dev-v7 2016-04-20 12:56:03 +02:00
bjarnef 9174029126 Fix localization of listview buttons/links actions. 2016-04-18 22:33:38 +02:00
bjarnef 3564e70259 Localize "unsaved changes" dialog. 2016-04-18 20:42:19 +02:00
Lars-Erik Aabech 1d428045b6 Don't remove virtual on SetupApplicationContext. Might be many external inheritors. 2016-04-18 15:35:09 +02:00
bjarnef e9bf41e869 Wrap text "Include all child nodes" in a label 2016-04-14 23:22:26 +02:00
bjarnef 054fd9ecef Fix line-height when using custom icon font as section icon. 2016-04-14 22:18:14 +02:00
Per Ploug fcaa4ad8d6 JsDocs comments on listviewhelper (U4-7185) 2016-04-14 11:36:24 +02:00
Sebastiaan Janssen bf70e208ad U4-8325 XSLT macro rendering logs too much in Info mode (after upgrade 7.1.4 => 7.4.0) 2016-04-14 09:34:53 +02:00
Shannon Deminick 26f705b129 Merge pull request #1224 from 0xc0dec/dev-v7
Fixed logger context class
2016-04-13 20:18:21 +02:00
Aleksey Fedotov 9e3941e8e1 Fixed logger context class 2016-04-13 22:14:21 +05:00
Shannon Deminick a015032442 fixed typo 2016-04-13 16:45:47 +02:00
Shannon Deminick 38f6a7a8b6 fixed typo 2016-04-13 16:45:01 +02:00
Stephan 7886b7814d U4-8312 - models generation false error (#1222) 2016-04-13 15:57:27 +02:00
Shannon c3b4a9128a ensures all GetPagedDescendant methods are mocked - fixes tests. 2016-04-13 15:47:21 +02:00
Shannon dbff25bd6d Merge branch 'dev-v7' into dev-v7.5 2016-04-13 15:16:28 +02:00
Shannon c9c391e477 fixed type, decimal sorting now works 2016-04-13 15:05:23 +02:00
Shannon 10bb16316d Updates sorting code to support decimals - need to test on MySql 2016-04-13 14:49:37 +02:00
Shannon 82b4b4e668 Merge remote-tracking branch 'origin/7.5-ListViewCustomFieldSorting' into dev-v7.5
Conflicts:
	src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs
2016-04-13 14:44:22 +02:00
Shannon ce0ecd8114 Ensures that the emails sent our are in the culture of the user, fixes issue of logging in after resetting password and then logging out again 2016-04-13 14:35:40 +02:00
Shannon e610a5ef54 Changes the password reset link to be a real link (not an angular deep link), this means there is less logging of the reset code in a query string and less visibility of it, this also means that the validation of the code happens instantly. The premise for this is the same as how we deal with external authentication requests and uses ViewData/TempData with redirects. Fixes the models to have the correct attributes to be able to directly json serialize them. 2016-04-13 13:51:12 +02:00
Shannon f279000d00 removes unecessary methods from user.service.js, ensures correct error msg when resetting password on the server, fixes email copy and allows for non-html emails if the copy is plain text, removes the need for more than one email msg in the lang files and uses the correct way to replace tokens, 2016-04-12 19:54:04 +02:00
Shannon d424b13ac4 Fixes some styling, wording and validation 2016-04-12 18:59:39 +02:00
Shannon 1361e017a2 Merge branch 'u4-222' of https://github.com/AndyButland/Umbraco-CMS into AndyButland-u4-222
Conflicts:
	src/Umbraco.Core/Security/BackOfficeUserManager.cs
	src/Umbraco.Web.UI.Client/src/less/pages/login.less
	src/Umbraco.Web.UI.Client/src/routes.js
	src/Umbraco.Web.UI.Client/src/views/common/dialogs/login.controller.js
	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
	src/Umbraco.Web.UI/web.Template.config
	src/Umbraco.Web/Editors/AuthenticationController.cs
	src/Umbraco.Web/Editors/BackOfficeController.cs
	src/Umbraco.Web/Umbraco.Web.csproj
2016-04-12 18:07:25 +02:00
Claus 76054bb783 Enabling sorting by the Name column.
OrderDirection is only reversed if reclicking the same sort column.
2016-04-12 15:36:28 +02:00
Claus cf7756a96d Merge pull request #1217 from umbraco/temp-U4-8298
Fixes: U4-8298 CacheRefresher authorization logic reversed - traditio…
2016-04-12 13:19:59 +02:00
Claus 20347c1ccd Fixing typo. 2016-04-12 13:17:41 +02:00
Lars-Erik Aabech ae913ede6f Virtualized creating of application context
Closed setting up of application context
Opens up a whole bunch of doors. :)
2016-04-10 00:07:03 +02:00
Shannon 36255709e6 U4-8297 Custom MembershipProvider search doesn't work in the listview 2016-04-07 18:16:03 +02:00
Shannon 506ed9f866 U4-8286 Add OWIN startup events to the UmbracoDefaultOwinStartup class 2016-04-07 17:51:09 +02:00
Shannon f87bec398d U4-8239 DisableBrowserCacheAttribute causing YSOD when a previous exceptions is thrown before the filter kicks in 2016-04-07 16:44:45 +02:00
Shannon 1e5b6a6a0f Fixes: U4-8298 CacheRefresher authorization logic reversed - traditional load balancing will not work 2016-04-07 15:42:51 +02:00
Warren Buckley a2f8e92098 Merge pull request #1087 from bjarnef/dev-v7-U4-6425
U4-6425 - Maximum property for Related Links
2016-04-07 08:47:01 +01:00
bjarnef 9d5af4ad5e Merge branch 'dev-v7' of git://github.com/umbraco/Umbraco-CMS into dev-v7-U4-6425
Conflicts:
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html
2016-04-06 20:20:22 +02:00
bjarnef ae154885e4 Ensure icon has a value. 2016-04-06 19:52:21 +02:00
bjarnef 2c29e422bc Add icons for internal links. 2016-04-06 19:47:05 +02:00
bjarnef 2d6b8712d5 Limit this to listview, so it doesn't affect other property editors. 2016-04-06 19:44:09 +02:00
Warren Buckley 81aad6fc64 Merge pull request #1205 from bjarnef/dev-v7-U4-8248
U4-8248 - Add tooltip for listview layout + cursor style for listview table row
2016-04-06 15:45:31 +01:00
Shannon e2954fbf39 refactors interface methods so they are not breaking existing signatures and not overlapping based on optional parameters 2016-04-06 13:23:39 +02:00
Shannon 75be22a778 Fixes tests, adds null checks 2016-04-06 12:05:52 +02:00
Claus 58280e7d63 Merge pull request #1209 from greystate/fix-U4-8260
Fix for U4-8260
2016-04-06 11:12:43 +02:00
Shannon 6856540a7c fixes bool parameter for members 2016-04-06 09:49:53 +02:00
Shannon b9b3d62994 fixes boolean isSystem for media 2016-04-06 09:44:33 +02:00
Shannon dac7b93209 fixes GetChildren non bool argument to work as a bool again. 2016-04-06 09:17:05 +02:00
Shannon 90a66aeebd fixes merge / build 2016-04-05 16:32:46 +02:00
Shannon f485755082 Merge branch 'aadfPT-dev-v7' into 7.5-ListViewCustomFieldSorting 2016-04-05 16:21:10 +02:00
Shannon c20984dca7 Merge branch 'dev-v7' of https://github.com/aadfPT/Umbraco-CMS into aadfPT-dev-v7
Conflicts:
	src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
	src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs
	src/Umbraco.Core/Services/ContentService.cs
	src/Umbraco.Core/Services/IContentService.cs
	src/Umbraco.Core/Services/IMediaService.cs
	src/Umbraco.Core/Services/IMemberService.cs
	src/Umbraco.Core/Services/MediaService.cs
	src/Umbraco.Core/Services/MemberService.cs
	src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs
	src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs
	src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs
	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
	src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
	src/Umbraco.Web.UI.Client/src/common/resources/member.resource.js
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
	src/Umbraco.Web/Editors/ContentController.cs
	src/Umbraco.Web/Editors/MediaController.cs
	src/Umbraco.Web/Editors/MemberController.cs
	src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs
	src/UmbracoExamine/UmbracoMemberIndexer.cs
2016-04-05 16:20:39 +02:00
Shannon 80d7443bd3 fix build 2016-04-05 16:00:49 +02:00
Shannon ed7c682a68 Merge branch 'AndyButland-u4-6003b' into 7.5-ListViewCustomFieldSorting 2016-04-05 15:31:41 +02:00
Shannon ef3f15ec9b Merge branch 'u4-6003b' of https://github.com/AndyButland/Umbraco-CMS into AndyButland-u4-6003b
Conflicts:
	src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaRepository.cs
	src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs
	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
	src/Umbraco.Core/Services/ContentService.cs
	src/Umbraco.Core/Services/IContentService.cs
	src/Umbraco.Core/Services/IMediaService.cs
	src/Umbraco.Core/Services/IMemberService.cs
	src/Umbraco.Core/Services/MediaService.cs
	src/Umbraco.Core/Services/MemberService.cs
	src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs
	src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs
	src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.html
	src/Umbraco.Web/Editors/MemberController.cs
	src/UmbracoExamine/UmbracoMemberIndexer.cs
2016-04-05 15:31:33 +02:00
Sebastiaan Janssen c856795cb7 Fix hilariously wrong copy/pasted TODO comments.. 2016-04-05 08:03:47 +02:00
madden-tom 2d514ac09e Added check for publish permissions to remove option for Publish At a…
U4-287 "Publish at" circumvents "Send for approval/publishing"
2016-04-05 08:01:05 +02:00
Sebastiaan Janssen 8e8b8bdea1 Revert "Removes old obsoleted ping.aspx"
This reverts commit 453efc02a5.

Conflicts:
	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj

U4-8274 '/umbraco/ping.aspx' is missing
2016-04-04 09:20:59 +02:00
Sebastiaan Janssen d8c781f97f Make the file exclusion filter more readable 2016-04-03 13:39:05 +02:00
Sebastiaan Janssen 6502470708 U4-8265 Listview list and listview grid does not handle acceptedFileTypes in same way 2016-04-03 12:08:25 +02:00
Sebastiaan Janssen 680396daab Localize server-side error message for disallowed file uploads 2016-04-03 12:08:23 +02:00
Asbjørn Riis-Knudsen 4e4ea59433 * Only restrict to image files when onlyImages is active* Handle disallowed filetypes as per other upload controls
* Only restrict to image files when onlyImages is active
* Handle disallowed filetypes as per other upload controls
2016-04-02 19:07:35 +02:00
bjarnef 40f7e87e04 Fix issues when using custom font icons in backoffice. 2016-04-02 13:36:55 +02:00
Warren Buckley fbce20d0c3 Merge pull request #1158 from umbraco/temp-U4-8016
Fixes: U4-8016 Pick only images from media
2016-04-01 13:54:37 +01:00
André Ferreira c147db1334 Merge branch 'dev-v7' of https://github.com/aadfPT/Umbraco-CMS into dev-v7 2016-04-01 11:29:33 +01:00
André Ferreira bd2a40d214 U4-6003 List View - Order By Custom Property Fix
Original work done on https://github.com/umbraco/Umbraco-CMS/pull/711 but ported to the latest version

Content below for reference
With the current implementation of the list view you can only sort by system columns (Name, SortOrder etc.) and not custom columns you have added to your document types. This PR allows that.

The crux of it is a sub-query added to the ORDER BY clause when we are ordering by a custom field. This looks up the field's value from the most recent content version.

Provided here and not in the previous pull request is:

MySQL support
Have done some performance testing. On a local laptop with 1000 nodes in a list view, it's sorting in around 220-250ms. It's a little slower that sorting on native properties like node name, but still perfectly usable - there's no significant delay you see in use.
Please note also:

GetPagedResultsByQuery() in VersionableRepositoryBase was previously doing an ORDER BY in SQL and then repeating this via LINQ to Objects. I couldn't see that this second ordering was necessary so removed it, but wanted to flag here in case I've missed something around why this was necessary.
The PR also includes small amends to fix or hide sorting on a couple of the default columns for the member amd media list views.
2016-04-01 11:28:51 +01:00
André Ferreira 9376731533 Adhering to Umbraco's Coding Standards 2016-04-01 11:24:30 +01:00
Shannon Deminick 982fa26b7e Merge pull request #1210 from umbraco/temp-U4-8103
U4-8103
2016-03-31 18:26:09 +02:00
Stephan c3055ca43f U4-8103 - fix DisableBrowserCacheAttribute to handle exceptions 2016-03-31 16:37:16 +02:00
Stephan 4cca364511 U4-8103 - refactor YSOD overlay to display inner exceptions 2016-03-31 16:36:36 +02:00
Stephan 9e0ed94d77 Fix typo in lang xml files 2016-03-31 12:56:24 +02:00
Warren Buckley 374147a1a0 Merge pull request #1208 from umbraco/temp-U4-2954
U4-2954 - refresh domain cache when emptying recycle bin
2016-03-31 10:28:31 +01:00
Chriztian Steinmeier 5f0fe69c82 Update links to https 2016-03-30 21:11:29 +02:00
Chriztian Steinmeier e325e06efc Update link to Our on Backoffice sections 2016-03-30 21:10:41 +02:00
Chriztian Steinmeier 5e7db1047b Add the missing 't' 2016-03-30 21:09:14 +02:00
Stephan 61fe0a4a93 U4-2954 - refresh domain cache when emptying recycle bin 2016-03-30 17:56:34 +02:00
Warren Buckley aa1aabef3a Merge pull request #1204 from umbraco/temp-U4-7862
U4-7862 Brackets cause issues in the stylesheet editor
2016-03-30 16:11:15 +01:00
bjarnef d1c865480f Add tooltip for listview layout + cursor style for listview table row. 2016-03-29 23:22:42 +02:00
André Ferreira d560223eca Fixes to make it work 2016-03-29 20:13:53 +01:00
Claus c427c51053 U4-7862 Brackets cause issues in the stylesheet editor 2016-03-29 14:29:27 +02:00
paulsterling 08070e319a Update number of sites running 2016-03-28 16:46:31 -07:00
André Ferreira 54394f2ce9 fixes 2016-03-28 10:35:05 +01:00
André Ferreira 4f141e8b27 Fixing column sort on columns with custom headers 2016-03-28 10:35:04 +01:00
bjarnef 30e9a1ef82 Don't set dirty when just filtering icons. 2016-03-28 02:29:03 +02:00
bjarnef 0c9dcc1f5a Fix errors when saving document type when no icon is selected. 2016-03-28 01:47:01 +02:00
bjarnef 233e3d9387 Fix issues with tree icons + legacy icons 2016-03-27 19:07:09 +02:00
Warren Buckley ac2ebc4071 Merge pull request #1193 from umbraco/temp-U4-8220
U4-8220 ModelState and ViewData is not carried through when using the…
2016-03-23 12:10:05 +00:00
Shannon d4c79a0915 Fixes tests, adds more asserts 2016-03-23 11:02:27 +01:00
Shannon 61f9845db0 bumps version 2016-03-23 10:06:53 +01:00
Shannon 43e23829ae updates EnsurePartialViewMacroViewContextFilterAttribute to check for child actions 2016-03-23 10:06:13 +01:00
Stephan 5774ce68c7 GitIgnore Umbraco.Tests/media 2016-03-22 14:37:22 +01:00
Shannon b9af6f631a U4-8220 ModelState and ViewData is not carried through when using the obsolete Content.GetGridHtml method 2016-03-22 11:23:09 +01:00
Shannon cd401f5e37 U4-8216 Hijacked controller actions fail with custom RenderModel subclass due to ModelBinding error 2016-03-21 16:12:34 +01:00
Sebastiaan Janssen 75c2b07ad3 Update ModelsBuilder dependency for the NuGet package 2016-03-18 16:32:05 +01:00
Sebastiaan Janssen 969fe30f6e Merge pull request #1186 from umbraco/temp-U4-8043
U4-8043 - reboot app when PureLive models go wrong
2016-03-18 16:26:52 +01:00
Stephan 0f90d357cf U4-8043 - reboot application when PureLive models go wrong 2016-03-18 16:14:06 +01:00
Stephan d955daab0f Upgrade ModelsBuilder to 3.0.2 2016-03-18 16:13:19 +01:00
Shannon 617b17ca9e puts back in the current node permission check - since we use this for Create 2016-03-18 15:43:14 +01:00
Shannon 9e3d7a1cce updates default pipeline marker stage for the preview middleware, updates MembershipHelper to not throw an exception if the Role manager is disabled. 2016-03-18 11:05:39 +01:00
Warren Buckley f04071d7c7 Merge pull request #1180 from umbraco/temp-U4-8165
U4-8165 Ensure browsers are not caching service requests
2016-03-18 09:53:12 +00:00
Shannon Deminick 2cce9395da Merge pull request #1181 from mittonp/dev-v7
French translations for Grid.
2016-03-18 10:15:50 +01:00
Mitton 6ad56863d4 Grid translation - French 2016-03-18 06:15:37 +02:00
Mitton 2703fa7ea2 Grid translation - French 2016-03-18 06:12:44 +02:00
Shannon b3c6654d41 bumps version 2016-03-17 17:31:36 +01:00
Shannon 0071651621 fixes keyboard shortcut after refactor 2016-03-17 16:36:13 +01:00
Shannon Deminick 4dbc27f1fe Merge pull request #1178 from bjarnef/dev-U4-8163
U4-8163 - Don't set dirty on form for examine dashboard search
2016-03-17 11:31:36 +01:00
Shannon 3f8bbc2f02 Merge branch 'pynej-view-save-restore-cursor' into dev-v7 2016-03-17 11:29:29 +01:00
Shannon 999be9c578 Merge branch 'view-save-restore-cursor' of https://github.com/pynej/Umbraco-CMS into pynej-view-save-restore-cursor 2016-03-17 11:26:09 +01:00
Claus b36b1693dd Fixes broken regex. 2016-03-17 10:33:04 +01:00
Simon Busborg 99b2192ab7 Fixes U4-8181 It is not possible to scroll in an overlay in Chrome 49 on a Retina Mac
By removing animated -half-second fadeIn it resolves the issue where it's not possible to scroll in dialogs on a retina screen ¯\_(ツ)_/¯
2016-03-17 09:58:57 +01:00
Shannon 5230f55f44 moves attribute 2016-03-16 14:52:40 +01:00
Shannon f93fee28dd U4-8165 Ensure browsers are not caching service requests 2016-03-16 14:51:04 +01:00
Shannon Deminick fc7cfea4ad Merge pull request #1179 from umbraco/temp-U4-8175
U4-8175 - fix PropertyType.PropertyGroupId inconsistencies
2016-03-16 14:18:03 +01:00
Stephan bc5f651c64 U4-8154 - bugfix test 2016-03-16 13:46:51 +01:00
Stephan ecdca378c6 U4-8175 - fix PropertyType.PropertyGroupId inconsistencies 2016-03-16 13:41:58 +01:00
Stephan 4628c1f858 U4-8154 - bugfix test 2016-03-16 13:16:56 +01:00
Shannon Deminick 5af4d02f44 Merge pull request #1177 from umbraco/temp-U4-7109
U4-7109 - could not change language in Culture and Hostnames
2016-03-16 10:48:35 +01:00
Shannon 2f9b526465 Only apply preview auth if Umbraco is fully configured 2016-03-16 10:41:33 +01:00
Stephan 800e02bccf Bugfix model mapper for PropertyTypeDisplay 2016-03-16 10:19:06 +01:00
Shannon Deminick 693b0dba24 Merge pull request #1161 from umbraco/temp-U4-4219
U4-4219 Can't Preview protected pages
2016-03-16 10:18:06 +01:00
Stephan 2004f6a51e U4-8154 - bugfix 2016-03-16 10:10:31 +01:00
Claus f650b6238c Merge branch 'arknu-U4-8026' into dev-v7 2016-03-16 07:57:59 +01:00
Claus 7c179a7868 U4-8026 Fixes up unit tests 2016-03-16 07:56:41 +01:00
bjarnef 7a7e0edfa7 Don't set dirty on form for examine dashboard search 2016-03-15 23:59:11 +01:00
bjarnef 69adec1d68 Merge branch 'dev-v7' of https://github.com/bjarnef/Umbraco-CMS into dev-v7 2016-03-15 20:23:58 +01:00
Stephan 0cf6548f86 U4-7109 - could not change language in Culture and Hostnames 2016-03-15 17:26:05 +01:00
Sebastiaan Janssen 111ee66b60 Update ModelsBuilder dependency for the NuGet package 2016-03-15 17:15:39 +01:00
Stephan fedcd6f970 Merge pull request #1176 from umbraco/temp-U4-8168
U4-8168 Cannot re-order/move locked property types - such as the lock…
2016-03-15 16:29:57 +01:00
Stephan 8e82ff5450 Merge pull request #1173 from umbraco/temp-U4-8012
U4-8012 Generic properties tab disappears on the edit Member Type win…
2016-03-15 16:24:21 +01:00
Stephan 81459c3659 Merge pull request #1174 from umbraco/temp-U4-8065
U4-8065 Inherited from is empty - reverts 10617d1bd52bdac57534a7d7b8…
2016-03-15 16:08:26 +01:00
Rune Hem Strand 8907c9855b Merge pull request #1172 from umbraco/temp-U4-7185
Temp u4 7185
2016-03-15 16:02:47 +01:00
Stephan e1bf30ec26 Merge pull request #1175 from umbraco/temp-U4-8106
U4-8106 Content type inheritance can be broken by compositions
2016-03-15 15:53:37 +01:00
Shannon 6bb9c5b81c U4-8168 Cannot re-order/move locked property types - such as the locked/system member type properties 2016-03-15 15:43:21 +01:00
Shannon 6aafbfb245 U4-8106 Content type inheritance can be broken by compositions 2016-03-15 15:25:05 +01:00
Shannon d5fe8c11c8 U4-8065 Inherited from is empty - reverts 10617d1bd5, turns out this is why we needed that property value 2016-03-15 15:08:53 +01:00
Shannon 3fdb122e91 U4-8012 Generic properties tab disappears on the edit Member Type window after upgrade to 7.4 2016-03-15 14:44:03 +01:00
Shannon Deminick 710dda164f Merge pull request #1166 from umbraco/temp-U4-7708
U4-7708 Using a RTE Macro Partial Form (SurfaceController) & Doctype …
2016-03-15 13:57:27 +01:00
Claus 07d0d82bd1 Merge branch 'U4-8026' of git://github.com/arknu/Umbraco-CMS into arknu-U4-8026 2016-03-15 13:47:10 +01:00
Claus 91eb3ea59e Merge pull request #1152 from AndyButland/u4-7888
Fixed U4-7888 - Cannot change default template for document type
2016-03-15 13:43:07 +01:00
Rune Strand 096f1b6ff9 add selected state to umbFolderGrid 2016-03-15 13:18:48 +01:00
Rune Strand f24c0d3e7a Update umbBreadcrumb to use custom controller 2016-03-15 13:18:48 +01:00
Rune Hem Strand 104338c817 A little bit of foldergrid+ 2016-03-15 13:18:48 +01:00
Mads Rasmussen 568f098445 umbOverlay first draft 2016-03-15 13:18:48 +01:00
Mads Rasmussen f46d595f00 fix example on umbStickyBar 2016-03-15 13:18:48 +01:00
Mads Rasmussen 46826ad590 add docs for umbPagination 2016-03-15 13:18:48 +01:00
Mads Rasmussen a8bd34b77e add docs for umbMediaGrid 2016-03-15 13:18:48 +01:00
Mads Rasmussen 40774cfff2 rename umbContentGrid controller 2016-03-15 13:18:48 +01:00
Mads Rasmussen 5dde898205 change controller name on umbGenerateAlias 2016-03-15 13:18:48 +01:00
Mads Rasmussen 249287e101 fix umbKeyboardShortcutsOverview example 2016-03-15 13:18:48 +01:00
Mads Rasmussen 3e458e2ba6 add documentation for umbEmptyState 2016-03-15 13:18:48 +01:00
Mads Rasmussen 4f293a8be1 fix umbTooltip example 2016-03-15 13:18:48 +01:00
Mads Rasmussen 3b9d9ab8c4 change umbChildSelector controller name 2016-03-15 13:18:48 +01:00
Mads Rasmussen 83f875dadd fix umbConfirmAction example 2016-03-15 13:18:48 +01:00
Mads Rasmussen 89df81d3df update umbButtonGroup example to match newest code 2016-03-15 13:18:48 +01:00
Mads Rasmussen 2e4ee42c90 fix small issue with umbButton example 2016-03-15 13:18:48 +01:00
Mads Rasmussen a03858a726 fix examples in umbEditorHeader 2016-03-15 13:18:48 +01:00
Mads Rasmussen 253174d4b3 umbEditorSubHeader: move some example pieces to other directive examples to make it less overwhelming 2016-03-15 13:18:48 +01:00
Mads Rasmussen 947889fae6 update umbFooterContent directives example with a form element 2016-03-15 13:18:48 +01:00
Mads Rasmussen 7ee0b582dd update umbEditorFooter example with a form element 2016-03-15 13:18:48 +01:00
Mads Rasmussen 7bec4efc60 update umbEditorView with a better example 2016-03-15 13:18:48 +01:00
Mads Rasmussen 571d8086c8 update umbContentGrid docs to match latest directive changes 2016-03-15 13:18:48 +01:00
Rune Strand 8abeefe6bb Fix merge conflict 2016-03-15 13:18:48 +01:00
Mads Rasmussen 0aaf3eea02 added documentation for umbChildSelector 2016-03-15 13:18:48 +01:00
Mads Rasmussen 8fc84f9b09 added documentation to umbLockedField 2016-03-15 13:18:48 +01:00
Mads Rasmussen 493b98a771 added documentation to umbGenerateAlias 2016-03-15 13:18:48 +01:00
Mads Rasmussen 114a9b4d33 added documentation for umbFolderGrid 2016-03-15 13:18:48 +01:00
Mads Rasmussen 824b1e7c08 added documentation for umbContentGrid 2016-03-15 13:18:48 +01:00
Mads Rasmussen dfa9b297db added documentation for umbStickyBar 2016-03-15 13:18:48 +01:00
Mads Rasmussen adceb24651 added documentation for umbConfirmAction 2016-03-15 13:18:48 +01:00
Mads Rasmussen c7f1a1419a added documentation for umbTooltip 2016-03-15 13:18:48 +01:00
Mads Rasmussen 8878b5e21c added documentation for umbButtonGroup 2016-03-15 13:18:48 +01:00
Mads Rasmussen 6ebb1d1b4b added documentation for umbButton 2016-03-15 13:18:48 +01:00
Mads Rasmussen 583cd2d1e9 added documentation for sub header directives 2016-03-15 13:18:48 +01:00
Mads Rasmussen 86c6b01e73 added documentation for editor directives 2016-03-15 13:18:48 +01:00
Mads Rasmussen 1170e222e3 added umbBreadcrumbs documentation - first draft 2016-03-15 13:18:48 +01:00
Mads Rasmussen fe004db7d5 added umbLoadIndicator documentation - first draft 2016-03-15 13:18:48 +01:00
Mads Rasmussen 9e75ffb332 added umbKeyboardShortcutsOverview documentation - first draft 2016-03-15 13:18:48 +01:00
Mads Rasmussen d0bb6b7aa4 fix broken directives overview + set marker on deprecated directives 2016-03-15 13:18:48 +01:00
Claus c306f94a6a Merge pull request #1154 from pynej/fix-stylesheet-tree-sync
Fix for issue causing the entire stylesheets tree to reload when …
2016-03-15 12:46:59 +01:00
Claus 11b2ec89fd Merge pull request #1167 from umbraco/temp-U4-8154
U4-8154 - bugfix Sql query expressions parsing
2016-03-15 12:36:52 +01:00
Claus 89596f00f1 Merge pull request #1151 from arknu/icon-transparency
Fix transparency for image icons in the tray
2016-03-15 09:54:36 +01:00
Claus 4fa6e70e72 Merge pull request #1140 from jamescoxhead/U4-7746
U4-7746 - use flat icon in partial views tree
2016-03-15 09:22:18 +01:00
Warren Buckley a5a0a84d46 Merge pull request #1163 from umbraco/temp-U4-7767
U4-7767 List View Filter needs debounce - many requests to handler me…
2016-03-14 16:12:19 +00:00
Warren Buckley 839431e6fa Merge pull request #1170 from umbraco/temp-U4-8157
U4-8157 Right-click on root node returns console error when it doesn'…
2016-03-14 14:28:39 +00:00
Stephan 5369a6fc56 Upgrade ModelsBuilder to 3.0.1 2016-03-14 13:37:49 +01:00
Claus 8a078e258f U4-8157 Right-click on root node returns console error when it doesn't has any actions
Ensured we don't use throw to stop the program flow if no menuUrl is defined on the node. It is a likely scenario that some root node don't have right click actions so its better to handle this.
2016-03-14 12:15:15 +01:00
Sebastiaan Janssen fb42574c34 Revert "U4-5334 Richtext editor inserts extra p - tags to html output" - apparently it does just as much harm as it does good
This reverts commit 9ad3b6a337.
2016-03-12 21:02:05 +01:00
AndyButland e3411f7212 Provided a check that a language was selected when sending to translation such that a message is returned to the user rather than an unexpected error 2016-03-12 19:26:45 +01:00
AndyButland 64ad8f660f Fixed issue with misasigned task assignee on send to translation 2016-03-12 19:17:51 +01:00
Sebastiaan Janssen 9ad3b6a337 U4-5334 Richtext editor inserts extra p - tags to html output
#U4-5334 Fixed
2016-03-12 12:58:53 +01:00
Jeremy Pyne 91da14b0c6 Second fix for partial views. 2016-03-11 14:56:55 -05:00
Jeremy Pyne f361e286ed This minor fix will restore the editors cursor in CoreArea editor boxes when they save the item. There is a check included to prevent this behavior is the server level code changes the file for some reason as then the cursor location could act unpredictably, so instead we just let it reset to the beginning of the file. 2016-03-11 14:44:21 -05:00
Stephan 65b16fbfe5 U4-8154 - bugfix Sql query expressions parsing 2016-03-11 14:18:08 +01:00
Stephan 6ad2853bce Merge pull request #1165 from umbraco/temp-U4-7949
U4-7949 The task runner has completed YSOD when using the Umbraco Pac…
2016-03-10 18:29:08 +01:00
Shannon e60e4e52fc U4-7708 Using a RTE Macro Partial Form (SurfaceController) & Doctype Hijack Controller causes problem with submissions 2016-03-10 18:00:14 +01:00
Sebastiaan Janssen b2407eab98 Merge pull request #1107 from bjarnef/dev-v7-tinymce-font-icons
Change icons for richtext editor config
2016-03-10 17:47:46 +01:00
Shannon 778c7a836b Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-03-10 15:52:43 +01:00
Shannon 11f9cdead0 U4-6366 Issue assigning member roles on MemberService.Saved event 2016-03-10 15:52:34 +01:00
Sebastiaan Janssen a1076d5443 Merge pull request #1160 from umbraco/temp-U4-6438
U4-6438 - fix dynamic extension methods when type loading goes bad
2016-03-10 15:49:15 +01:00
Shannon 4a11bf68f3 U4-7949 The task runner has completed YSOD when using the Umbraco Package installer 2016-03-10 15:23:52 +01:00
Sebastiaan Janssen fa64e73a43 Merge pull request #1164 from umbraco/temp-U4-5797
U4-5797 - fix PublishedContentType cache refresh for compositions
2016-03-10 14:04:46 +01:00
Stephan adf3e2dfe0 U4-5797 - fix PublishedContentType cache refresh for compositions 2016-03-10 13:59:50 +01:00
Shannon c4c86cf5ce U4-7767 List View Filter needs debounce - many requests to handler method 2016-03-10 13:02:20 +01:00
Sebastiaan Janssen 479aba8e1d Fixes unit test.. in the correct branch this time 2016-03-10 11:47:51 +01:00
Sebastiaan Janssen effe7c1669 Fixes unit test 2016-03-10 11:20:44 +01:00
Shannon 0c474e2aba U4-7670 True/false fields on Macro Picker don't save their setting nor read existing setting. - another null check required. 2016-03-10 10:06:20 +01:00
Shannon Deminick 4f5b34cdfe Merge pull request #1162 from pynej/codemirror-js-error
Fix for missing doc.setLine() function breaking code mirror editor.
2016-03-10 09:58:16 +01:00
Warren Buckley 0cb7f220ea Merge pull request #1149 from umbraco/temp-U4-4700
U4-4700 List View Doesn't Respect User Permissions
2016-03-10 08:52:38 +00:00
Jeremy Pyne 0995b2cb5a Fix for missing doc.setLine() function breaking code mirror editor. 2016-03-09 14:55:15 -05:00
Shannon af1fe425a2 udpates ext method to specify an explicit marker stage, updates UmbracoDefaultOwinStartup to be more flexible with the methods to override. 2016-03-09 19:37:37 +01:00
Shannon 22385d40db U4-4219 Can't Preview protected pages 2016-03-09 17:35:50 +01:00
Stephan 1b37475144 U4-6438 - fix dynamic extension methods when type loading goes bad 2016-03-09 15:55:41 +01:00
Mads Rasmussen 87667ec2d1 Fixes: U4-8016 Pick only images from media 2016-03-08 20:56:24 +01:00
Shannon be0bacd895 Ensures all angular views are cache busted so browser cache is not an issue after upgrading. 2016-03-08 17:23:54 +01:00
Shannon a2564bd0c3 ensures that requests are only made for ids that haven't already been queried. 2016-03-08 16:18:33 +01:00
Shannon 402a5c9d56 fixes bool check 2016-03-08 15:57:59 +01:00
Shannon 2a2f22c7d9 fixes js null issue with boolean.controller 2016-03-08 15:53:45 +01:00
Shannon 372a768dca U4-4700 List view doesn't respect user permissions - makes the buttons show/hide based on the selected items instead of the current item. 2016-03-08 15:53:22 +01:00
Sebastiaan Janssen f6e48243a6 U4-8088 NuGet upgrade of UmbracoCms pacakage doesn't add ModelsBuilder keys to web.config 2016-03-08 13:39:35 +01:00
Simone Chiaretta 227e7a9c70 [U4-8128] Always rejecting promise even with server error
Updated postSaveContent and resourcePromise to always reject the promise (thus always calling callers error handler) even when the error is 500 server error
2016-03-08 11:21:21 +01:00
Warren Buckley 94ea677ec0 Merge pull request #1146 from umbraco/temp-U4-7641
U4-7641 - enable content type copy
2016-03-08 09:38:16 +00:00
Sebastiaan Janssen 55e7159f7d Forgot to remove them from the nuspec files 2016-03-08 10:35:57 +01:00
Sebastiaan Janssen 390a94e323 U4-8054 Issue with NuGet Uninstall.ps1 (running on updates)
#U4-8054 Fixed
2016-03-08 10:34:19 +01:00
Shannon Deminick 19fb920aa1 Merge pull request #1150 from umbraco/temp-U4-7823
U4-7823 - stop flooding the log with errors getting media 0
2016-03-07 17:58:49 +01:00
Shannon Deminick f35e1604ca Merge pull request #1141 from umbraco/temp-U4-8030
U4-8030 - Fix RenderModelBinder issue with surface
2016-03-07 17:53:31 +01:00
Shannon b9765c3bec fixes RenderModelBinder to use base implementation,adds unit tests 2016-03-07 17:52:28 +01:00
Shannon d5a57c505c adds RenderModelBinderTests 2016-03-07 16:53:57 +01:00
Shannon 5f365241a8 updates RenderModelBinder to simply check for IPublishedContent or IRenderModel 2016-03-07 16:29:40 +01:00
Shannon 9c121f0044 Fixes RenderModelBinder to inherit from DefaultModelBinder and use the default logic if the model in the route values is not IRenderModel 2016-03-07 16:26:30 +01:00
Shannon f13bc07ddc Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-03-07 15:13:41 +01:00
Shannon a707d23692 Allows for specifying explicit product names by overriding the property in MigrationStartupHander 2016-03-07 15:13:31 +01:00
Simon Busborg 0929b7d42c Fixes U4-8113 Styling for property labels affect package meta data labels 2016-03-07 14:55:18 +01:00
Simon Busborg 35a9272b68 Fixes U4-8036 Umbraco.MultiNodeTreePicker checkbox doesn't appear after selecting something from list view 2016-03-07 14:45:30 +01:00
Shannon Deminick 112453a032 Merge pull request #1144 from umbraco/temp-U4-8077
U4-8077 - ensure product name in migration event handlers
2016-03-07 14:09:29 +01:00
Simon Busborg bba7367ba6 Fixes U4-8058 Labels are changed to block-level elements 2016-03-07 12:12:35 +01:00
bjarnef 367073e02e Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-03-03 17:58:36 +01:00
Jeremy Pyne 83e679ba5e Fix for issue causing the entire stylesheets tree to reload when selecting a item. 2016-03-02 16:00:33 -05:00
AndyButland 1a4322eb48 Fix issue with database field check that led to default template for content type not being set 2016-02-29 09:04:50 +00:00
Asbjørn Riis-Knudsen 4d950fb4d4 Fix transparency for image icons in the tray 2016-02-28 17:40:58 +01:00
Stephan 0d191fb8bd U4-7823 - stop flooding the log with errors getting media 0 2016-02-26 11:35:24 +01:00
Warren Buckley c7a3efadb1 Remove debug JSON in the view 2016-02-25 21:09:12 +00:00
Warren Buckley 956425dfbf Now updated so the create button hides if we do not have the Create permission 'C' 2016-02-25 21:06:25 +00:00
Warren Buckley c616354522 After reading src code for contentEditorHelper.configureContentEditorButtons it makes the same assumption that if the publish action 'U' is present then the user can also unpublish aka 'Z' 2016-02-25 20:49:56 +00:00
Stephan 36246b96d4 Fix bug with permissions cache refresh 2016-02-25 17:39:34 +01:00
Stephan 7d8791ec86 Fix ActionButtonsResolver (need review) 2016-02-25 17:05:44 +01:00
Stephan f349a9ae3e U4-7641 - bugfix 2016-02-25 16:26:20 +01:00
Warren Buckley 2719e2c231 WIP - ListView that grabs the current nodes permission from the editorState & use a neater object to return to the view rather than the lovely Magic String CHARs. Need help understanding that I don't get all the permissions to be expected 2016-02-25 15:19:42 +00:00
Stephan dafde545b0 U4-7641 - bugfix + implement for media types 2016-02-25 16:02:04 +01:00
Stephan 610538261e U4-7641 - enable content type copy 2016-02-25 15:26:03 +01:00
Asbjørn Riis-Knudsen e8f84cfec0 Add parens around all BinaryExpressions to make sure that errors such U4-8026 do not happen 2016-02-25 12:20:58 +01:00
Stephan 9f7b82e20f U4-8077 - ensure product name in migration event handlers 2016-02-24 13:59:15 +01:00
Stephan 04b3532e9d U4-8030 - Fix RenderModelBinder issue with surface 2016-02-22 18:38:06 +01:00
James Coxhead 01bcd3b623 Changed partial views icon to icon-article 2016-02-22 16:15:31 +00:00
James Coxhead 64fd95bd22 Updated tree icons for partial views and partial view macros 2016-02-22 16:13:25 +00:00
Lesley b72d52bf90 Fix U4-8029
The div was too wide so description text was unreadable.
2016-02-18 17:16:01 +00:00
James Coxhead 3ce2b0e6a0 Updated database installer to use new media picker instead of legacy picker 2016-02-16 14:06:08 +00:00
Kevin Jump 95863ad618 Stylesheet RegEx to capture multi class properties
Change the RegEx in Stylesheet Helper to capture mutli element classes
as stylesheet properties (See U4-7160)

Previously single class names "H1", "P", ".test" all work but multi
".btn btn-default" fail - this change fixes that
2016-02-16 11:36:56 +00:00
bjarnef 6effcdfce9 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-02-15 18:52:30 +01:00
bjarnef 5176b68935 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-tinymce-font-icons 2016-02-08 15:07:36 +01:00
bjarnef 0bfc5f1272 Change icons in tinymce config 2016-02-08 15:07:16 +01:00
bjarnef 39c18d4201 Merge branch 'dev-v7' of https://github.com/bjarnef/Umbraco-CMS into dev-v7 2016-02-05 15:54:48 +01:00
bjarnef 66ea8ae604 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-02-05 14:55:53 +01:00
bjarnef 6fc794ca2e Merge branch 'dev-v7' of https://github.com/bjarnef/Umbraco-CMS into dev-v7 2016-02-03 14:42:14 +01:00
bjarnef 4bcee1df71 Change property to maximum 2016-02-03 02:42:47 +01:00
bjarnef 8e2716d300 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-U4-6425 2016-02-03 02:29:30 +01:00
bjarnef b8c7b09d25 Update styles + adjust sort of table row 2016-02-03 02:29:21 +01:00
bjarnef 741057b7d6 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-U4-6425 2016-02-02 15:21:34 +01:00
bjarnef 769b74afef Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-U4-6425 2016-02-02 15:15:49 +01:00
bjarnef 6d4364a8b9 Modify sortable table row 2016-02-02 03:47:10 +01:00
bjarnef efb7bc7689 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-U4-6425 2016-02-01 22:02:42 +01:00
bjarnef 6536286ffa Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-U4-6425 2016-02-01 13:34:22 +01:00
bjarnef 6f07898979 Max config adjustments 2016-02-01 02:13:05 +01:00
bjarnef 7cf4c33d15 Fix max number in config and other adjustments 2016-02-01 01:52:51 +01:00
bjarnef d75ebed53d Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-U4-6425 2016-01-31 14:57:08 +01:00
bjarnef 3136981043 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7-U4-6425 2016-01-28 20:05:33 +01:00
bjarnef 893ca14859 Config for max items 2016-01-28 01:01:06 +01:00
bjarnef df958223b0 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-01-26 18:17:00 +01:00
bjarnef 1217d9f0b3 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-01-24 23:25:29 +01:00
bjarnef 1301897f39 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-01-22 22:02:51 +01:00
bjarnef 6d34fe416d Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-01-21 20:38:52 +01:00
bjarnef a884ece8b1 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-01-21 18:15:50 +01:00
bjarnef 0ffcc9b889 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-01-20 19:21:58 +01:00
bjarnef ee3131b63d Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-01-19 21:03:42 +01:00
bjarnef 4fd7182388 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-01-19 20:56:36 +01:00
AndyButland af244917f6 Fixed issue with ordering by custom property from inherited or composed doc type 2015-06-14 11:24:03 +02:00
AndyButland 7008d6b2fb Fix to issue with ordering by custom date field 2015-06-13 00:15:51 +02:00
AndyButland a1ae0f70bb Moved custom column list view order by sql variations into syntax providers 2015-06-12 09:15:36 +02:00
AndyButland 58f2694a90 Removed option to sort by media last edited date as currently only base table fields can be sorted and this isn't one. Trying to do so currently triggers an error. 2015-06-12 09:15:26 +02:00
AndyButland b9ff327536 Removed ability to sort member list view system fields other than those on the base table (others aren't handled so error) 2015-06-12 09:15:12 +02:00
AndyButland 5954c370ed Fixed issue with sorting on default member list view column of username 2015-06-12 09:15:05 +02:00
AndyButland 968927d472 Enabled sorting for custom columns on list view 2015-06-12 09:14:47 +02:00
722 changed files with 26614 additions and 18939 deletions
+143 -134
View File
@@ -1,134 +1,143 @@
*.obj
*.pdb
*.user
*.aps
*.pch
*.vspscc
.DS_Store
._.DS_Store
[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/[Mm]acro[Ss]cripts/[Ww]eb.[Cc]onfig
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/*
*.ncrunchsolution
build/UmbracoCms.AllBinaries*zip
build/UmbracoCms.WebPI*zip
build/UmbracoCms*zip
build/UmbracoExamine.PDF*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/app.dev.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/loader.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/loader.dev.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/[Jj]s/tuning.panel.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.palettes.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.loader.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.front.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.config.js
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/
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/
src/Umbraco.Web.UI.Client/src/[Ll]ess/*.css
tools/NDepend/
src/Umbraco.Web.UI/App_Plugins/*
src/*.psess
src/*.vspx
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/routes.js.*
NDependOut/*
*.ndproj
QueryResult.htm
*.ndproj
src/Umbraco.Web.UI/[Uu]mbraco/[Aa]ssets/*
src/Umbraco.Web.UI/[Uu]mbraco/[Ll]ib/*
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.html
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.js
src/Umbraco.Web.UI/[Cc]onfig/appSettings.config
src/Umbraco.Web.UI/[Cc]onfig/connectionStrings.config
src/Umbraco.Web.UI/umbraco/plugins/*
src/Umbraco.Web.UI/umbraco/js/init.js
build/ApiDocs/*
build/ApiDocs/Output/*
src/Umbraco.Web.UI.Client/bower_components/*
/src/Umbraco.Web.UI/Umbraco/preview
#Ignore Rule for output of generated documentation files from Grunt docserve
src/Umbraco.Web.UI.Client/docs/api
src/*.boltdata/
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.loader.js
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.palettes.js
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.panel.js
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.config.js
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.front.js
src/umbraco.sln.ide/*
build/UmbracoCms.*/
src/.vs/
src/Umbraco.Web.UI/umbraco/js/install.loader.js
*.obj
*.pdb
*.user
*.aps
*.pch
*.vspscc
.DS_Store
._.DS_Store
[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/[Mm]acro[Ss]cripts/[Ww]eb.[Cc]onfig
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/*
*.ncrunchsolution
build/UmbracoCms.AllBinaries*zip
build/UmbracoCms.WebPI*zip
build/UmbracoCms*zip
build/UmbracoExamine.PDF*zip
build/*.nupkg
src/Umbraco.Tests/config/applications.config
src/Umbraco.Tests/config/trees.config
src/Umbraco.Web.UI/web.config
src/Umbraco.Web.UI/Config/ClientDependency.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/app.dev.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/loader.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/loader.dev.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/[Jj]s/tuning.panel.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.palettes.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.loader.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.front.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.config.js
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/
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/
src/Umbraco.Web.UI.Client/src/[Ll]ess/*.css
tools/NDepend/
src/Umbraco.Web.UI/App_Plugins/*
src/*.psess
src/*.vspx
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/routes.js.*
NDependOut/*
*.ndproj
QueryResult.htm
*.ndproj
src/Umbraco.Web.UI/[Uu]mbraco/[Aa]ssets/*
src/Umbraco.Web.UI/[Uu]mbraco/[Ll]ib/*
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.html
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.js
src/Umbraco.Web.UI/[Cc]onfig/appSettings.config
src/Umbraco.Web.UI/[Cc]onfig/connectionStrings.config
src/Umbraco.Web.UI/umbraco/plugins/*
src/Umbraco.Web.UI/umbraco/js/init.js
build/ApiDocs/*
build/ApiDocs/Output/*
src/Umbraco.Web.UI.Client/bower_components/*
/src/Umbraco.Web.UI/Umbraco/preview
#Ignore Rule for output of generated documentation files from Grunt docserve
src/Umbraco.Web.UI.Client/docs/api
src/*.boltdata/
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.loader.js
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.palettes.js
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.panel.js
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.config.js
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.front.js
src/umbraco.sln.ide/*
build/UmbracoCms.*/
src/.vs/
src/Umbraco.Web.UI/umbraco/js/install.loader.js
src/Umbraco.Tests/media
tools/docfx/*
apidocs/_site/*
apidocs/api/*
build/docs.zip
build/ui-docs.zip
build/csharp-docs.zip
build/msbuild.log
+2 -2
View File
@@ -13,11 +13,11 @@ If you're interested in making changes to Belle make sure to read the [Belle Rea
## Umbraco - the simple, flexible and friendly ASP.NET CMS ##
**More than 177,000 sites trust Umbraco**
**More than 350,000 sites trust Umbraco**
For the first time on the Microsoft platform, there is 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 has award-winning integration capabilities and supports ASP.NET MVC or Web Forms, including User and Custom Controls, out of the box. It's a developer's dream and your users will love it too.
Used by more than 177,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)), you can be sure that the technology is proven, stable and scales.
Used by more than 350,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)), you can be sure that the technology is proven, stable and scales.
To view more examples, please visit [http://umbraco.com/why-umbraco/#caseStudies](http://umbraco.com/why-umbraco/#caseStudies)
+18
View File
@@ -0,0 +1,18 @@
apiRules:
- include:
uidRegex: ^Umbraco\.Core
- exclude:
uidRegex: ^umbraco\.Web\.org
- include:
uidRegex: ^Umbraco\.Web
- exclude:
hasAttribute:
uid: System.ComponentModel.EditorBrowsableAttribute
ctorArguments:
- System.ComponentModel.EditorBrowsableState.Never
- exclude:
uidRegex: ^umbraco\.
- exclude:
uidRegex: ^CookComputing\.
- exclude:
uidRegex: ^.*$
+75
View File
@@ -0,0 +1,75 @@
{
"metadata": [
{
"src": [
{
"files": [
"Umbraco.Core/Umbraco.Core.csproj",
"Umbraco.Web/Umbraco.Web.csproj"
],
"exclude": [
"**/obj/**",
"**/bin/**",
"_site/**"
],
"cwd": "../src"
}
],
"dest": "../apidocs/api",
"filter": "../apidocs/docfx.filter.yml"
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"resource": [
{
"files": [
"images/**"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"overwrite": [
{
"files": [
"**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"globalMetadata": {
"_appTitle": "Umbraco c# Api docs",
"_enableSearch": true,
"_disableContribution": false
},
"dest": "_site",
"template": [
"default", "umbracotemplate"
]
}
}
+7
View File
@@ -0,0 +1,7 @@
# Umbraco c# API reference
## Quick Links:
### [Umbraco.Core](api/Umbraco.Core.html) docs
### [Umbraco.Web](api/Umbraco.Web.html) docs
+5
View File
@@ -0,0 +1,5 @@
- name: Umbraco.Core Documentation
href: https://our.umbraco.org/apidocs/csharp/api/Umbraco.Core.html
- name: Umbraco.Web Documentation
href: https://our.umbraco.org/apidocs/csharp/api/Umbraco.Web.html
@@ -0,0 +1,257 @@
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
{{^_disableContribution}}
{{#sourceurl}}<a href="{{sourceurl}}" class="btn btn-primary pull-right mobile-hide">{{__global.viewSource}}</a>{{/sourceurl}}
{{/_disableContribution}}
<h1 id="{{id}}" data-uid="{{uid}}">{{>partials/title}}</h1>
<div class="markdown level0 summary">{{{summary}}}</div>
<div class="markdown level0 conceptual">{{{conceptual}}}</div>
{{#inheritance.0}}
<div class="inheritance">
<h5>{{__global.inheritance}}</h5>
{{#inheritance}}
<div class="level{{index}}">{{{specName.0.value}}}</div>
{{/inheritance}}
<div class="level{{item.level}}"><span class="xref">{{item.name.0.value}}</span></div>
</div>
{{/inheritance.0}}
<h6><strong>{{__global.namespace}}</strong>:{{namespace}}</h6>
<h6><strong>{{__global.assembly}}</strong>:{{assemblies.0}}.dll</h6>
<h5 id="{{id}}_syntax">{{__global.syntax}}</h5>
<div class="codewrapper">
<pre><code class="lang-{{_lang}} hljs">{{syntax.content.0.value}}</code></pre>
</div>
{{#syntax.parameters.0}}
<h5 class="parameters">{{__global.parameters}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.name}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
{{/syntax.parameters.0}}
{{#syntax.parameters}}
<tr>
<td>{{{type.specName.0.value}}}</td>
<td><em>{{{id}}}</em></td>
<td>{{{description}}}</td>
</tr>
{{/syntax.parameters}}
{{#syntax.parameters.0}}
</tbody>
</table>
{{/syntax.parameters.0}}
{{#syntax.return}}
<h5 class="returns">{{__global.returns}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
</tbody>
</table>
{{/syntax.return}}
{{#syntax.typeParameters.0}}
<h5 class="typeParameters">{{__global.typeParameters}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.name}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
{{/syntax.typeParameters.0}}
{{#syntax.typeParameters}}
<tr>
<td><em>{{{id}}}</em></td>
<td>{{{description}}}</td>
</tr>
{{/syntax.typeParameters}}
{{#syntax.typeParameters.0}}
</tbody>
</table>
{{/syntax.typeParameters.0}}
{{#remarks}}
<h5 id="{{id}}_remarks"><strong>{{__global.remarks}}</strong></h5>
<div class="markdown level0 remarks">{{{remarks}}}</div>
{{/remarks}}
{{#example.0}}
<h5 id="{{id}}_examples"><strong>{{__global.examples}}</strong></h5>
{{/example.0}}
{{#example}}
{{{.}}}
{{/example}}
{{#children}}
<h3 id="{{id}}">{{>partials/classSubtitle}}</h3>
{{#children}}
{{^_disableContribution}}
{{#sourceurl}}
<span class="small pull-right mobile-hide">
<a href="{{sourceurl}}">{{__global.viewSource}}</a>
</span>{{/sourceurl}}
{{/_disableContribution}}
<h4 id="{{id}}" data-uid="{{uid}}">{{name.0.value}}</h4>
<div class="markdown level1 summary">{{{summary}}}</div>
<div class="markdown level1 conceptual">{{{conceptual}}}</div>
<h5 class="decalaration">{{__global.declaration}}</h5>
{{#syntax}}
<div class="codewrapper">
<pre><code class="lang-{{_lang}} hljs">{{syntax.content.0.value}}</code></pre>
</div>
{{#parameters.0}}
<h5 class="parameters">{{__global.parameters}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.name}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
{{/parameters.0}}
{{#parameters}}
<tr>
<td>{{{type.specName.0.value}}}</td>
<td><em>{{{id}}}</em></td>
<td>{{{description}}}</td>
</tr>
{{/parameters}}
{{#parameters.0}}
</tbody>
</table>
{{/parameters.0}}
{{#return}}
<h5 class="returns">{{__global.returns}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
</tbody>
</table>
{{/return}}
{{#typeParameters.0}}
<h5 class="typeParameters">{{__global.typeParameters}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.name}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
{{/typeParameters.0}}
{{#typeParameters}}
<tr>
<td><em>{{{id}}}</em></td>
<td>{{{description}}}</td>
</tr>
{{/typeParameters}}
{{#typeParameters.0}}
</tbody>
</table>
{{/typeParameters.0}}
{{#fieldValue}}
<h5 class="fieldValue">{{__global.fieldValue}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
</tbody>
</table>
{{/fieldValue}}
{{#propertyValue}}
<h5 class="propertyValue">{{__global.propertyValue}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
</tbody>
</table>
{{/propertyValue}}
{{#eventType}}
<h5 class="eventType">{{__global.eventType}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
</tbody>
</table>
{{/eventType}}
{{/syntax}}
{{#remarks}}
<h5 id="{{id}}_remarks">{{__global.remarks}}</h5>
<div class="markdown level1 remarks">{{{remarks}}}</div>
{{/remarks}}
{{#example.0}}
<h5 id="{{id}}_examples">{{__global.examples}}</h5>
{{/example.0}}
{{#example}}
{{{.}}}
{{/example}}
{{#exceptions.0}}
<h5 class="exceptions">{{__global.exceptions}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.condition}}</th>
</tr>
</thead>
<tbody>
{{/exceptions.0}}
{{#exceptions}}
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
{{/exceptions}}
{{#exceptions.0}}
</tbody>
</table>
{{/exceptions.0}}
{{/children}}
{{/children}}
@@ -0,0 +1,13 @@
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Copyright © 2016 Umbraco<br>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
@@ -0,0 +1,18 @@
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
<meta name="generator" content="docfx {{_docfxVersion}}">
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
<link rel="icon" type="image/png" href="https://our.umbraco.org/assets/images/app-icons/favicon.png">
<link rel="stylesheet" href="{{_rel}}styles/docfx.vendor.css">
<link rel="stylesheet" href="{{_rel}}styles/docfx.css">
<link rel="stylesheet" href="{{_rel}}styles/main.css">
<meta property="docfx:navrel" content="{{_navRel}}">
<meta property="docfx:tocrel" content="{{_tocRel}}">
{{#_enableSearch}}<meta property="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
</head>
@@ -0,0 +1,18 @@
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
{{^_disableContribution}}
{{#sourceurl}}
<a href="{{sourceurl}}" class="btn btn-primary pull-right mobile-hide">{{__global.viewSource}}</a>
{{/sourceurl}}
{{/_disableContribution}}
<h1 id="{{id}}" data-uid="{{uid}}">{{>partials/title}}</h1>
<div class="markdown level0 summary">{{{summary}}}</div>
<div class="markdown level0 conceptual">{{{conceptual}}}</div>
<div class="markdown level0 remarks">{{{remarks}}}</div>
{{#children}}
<h3 id="{{id}}">{{>partials/namespaceSubtitle}}</h3>
{{#children}}
<h4>{{{specName.0.value}}}</h4>
<section>{{{summary}}}</section>
{{/children}}
{{/children}}
@@ -0,0 +1,22 @@
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" alt="Our Umbraco"></a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
@@ -0,0 +1,101 @@
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
{{^_disableContribution}}
{{#sourceurl}}<a href="{{sourceurl}}" class="btn btn-primary pull-right mobile-hide">View Source</a>{{/sourceurl}}
{{/_disableContribution}}
<h1 id="{{htmlId}}" data-uid="{{uid}}" class="text-capitalize">{{name}}</h1>
{{#summary}}
<div class="markdown level0 summary">{{{summary}}}</div>
{{/summary}}
{{#description}}
<div class="markdown level0 description">{{{description}}}</div>
{{/description}}
{{#conceptual}}
<div class="markdown level0 conceptual">{{{conceptual}}}</div>
{{/conceptual}}
{{#children}}
{{^_disableContribution}}
{{#sourceurl}}
<span class="small pull-right mobile-hide">
<a href="{{sourceurl}}">View Source</a>
</span>{{/sourceurl}}
{{/_disableContribution}}
<h3 id="{{htmlId}}" data-uid="{{uid}}" class="text-capitalize">{{operationId}}</h3>
{{#summary}}
<div class="markdown level1 summary">{{{summary}}}</div>
{{/summary}}
{{#description}}
<div class="markdown level1 description">{{{description}}}</div>
{{/description}}
{{#conceptual}}
<div class="markdown level1 conceptual">{{{conceptual}}}</div>
{{/conceptual}}
<h5>Request</h5>
<div class="codewrapper">
<pre><code class="lang-restApi hljs">{{operation}} {{path}}</code></pre>
</div>
{{#parameters.0}}
<h5>Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Value</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
{{/parameters.0}}
{{#parameters}}
<tr>
<td><em>{{#required}}*{{/required}}{{name}}</em></td>
<td>{{type}}</td>
<td>{{default}}</td>
<td>{{{description}}}</td>
</tr>
{{/parameters}}
{{#parameters.0}}
</tbody>
</table>
{{/parameters.0}}
{{#responses.0}}
<div class="responses">
<h5>Responses</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Status Code</th>
<th>Description</th>
<th>Samples</th>
</tr>
</thead>
<tbody>
{{/responses.0}}
{{#responses}}
<tr>
<td><span class="status">{{statusCode}}</span></td>
<td>{{{description}}}</td>
<td class="sample-response">
{{#examples}}
<div class="mime-type">
<i>Mime type: </i><span class="mime">{{mimeType}}</span>
</div>
<pre class="response-content"><code class="lang-js json hljs">{{content}}</code></pre>
{{/examples}}
</td>
</tr>
{{/responses}}
{{#responses.0}}
</tbody>
</table>
</div>
{{/responses.0}}
{{#footer}}
<div class="markdown level1 api-footer">{{{footer}}}</div>
{{/footer}}
{{/children}}
{{#footer}}
<div class="markdown level0 api-footer">{{{footer}}}</div>
{{/footer}}
+73
View File
@@ -0,0 +1,73 @@
body {
color: rgba(0,0,0,.8);
}
.navbar-inverse {
background: #a3db78;
}
.navbar-inverse .navbar-nav>li>a, .navbar-inverse .navbar-text {
color: rgba(0,0,0,.8);
}
.navbar-inverse {
border-color: transparent;
}
.sidetoc {
background-color: #f5fbf1;
}
body .toc {
background-color: #f5fbf1;
}
.sidefilter {
background-color: #daf0c9;
}
.subnav {
background-color: #f5fbf1;
}
.navbar-inverse .navbar-nav>.active>a {
color: rgba(0,0,0,.8);
background-color: #daf0c9;
}
.navbar-inverse .navbar-nav>.active>a:focus, .navbar-inverse .navbar-nav>.active>a:hover {
color: rgba(0,0,0,.8);
background-color: #daf0c9;
}
.btn-primary {
color: rgba(0,0,0,.8);
background-color: #fff;
border-color: rgba(0,0,0,.8);
}
.btn-primary:hover {
background-color: #daf0c9;
color: rgba(0,0,0,.8);
border-color: rgba(0,0,0,.8);
}
.toc .nav > li > a {
color: rgba(0,0,0,.8);
}
button, a {
color: #f36f21;
}
button:hover,
button:focus,
a:hover,
a:focus {
color: #143653;
text-decoration: none;
}
.navbar-header .navbar-brand {
background: url(https://our.umbraco.org/assets/images/logo.svg) left center no-repeat;
background-size: 40px auto;
width:50px;
}
.toc .nav > li.active > a {
color: #f36f21;
}
+46
View File
@@ -0,0 +1,46 @@
version: '{build}'
shallow_clone: true
build_script:
- cmd: >-
cd build
SET "release="
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i"
SET nuGetFolder=C:\Users\appveyor\.nuget\packages
..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
IF EXIST ..\src\umbraco.businesslogic\packages.config ..\src\.nuget\NuGet.exe install ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
ECHO Building Release %release% build%APPVEYOR_BUILD_NUMBER%
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
SET MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe"
XCOPY "..\src\Umbraco.Tests\unit-test-log4net.CI.config" "..\src\Umbraco.Tests\unit-test-log4net.config" /Y
%MSBUILD% "..\src\Umbraco.Tests\Umbraco.Tests.csproj" /consoleloggerparameters:Summary;ErrorsOnly
build.bat nopause %release% build%APPVEYOR_BUILD_NUMBER%
ECHO %PATH%
test:
assemblies: src\Umbraco.Tests\bin\Debug\Umbraco.Tests.dll
artifacts:
- path: build\UmbracoCms.*
- path: build\msbuild.log
notifications:
- provider: Slack
auth_token:
secure: v2csJi2V5ghR0rPdODK8GJdOGNCA+XaK84iQ9MdPOClqB+VU+40ybdKp6gPirGSH
channel: '#build-umbraco-core'
on_build_success: false
on_build_failure: true
on_build_status_changed: false
-170
View File
@@ -1,170 +0,0 @@
/* File : TOC.css
// Author : Eric Woodruff (Eric@EWoodruff.us)
// Updated : 09/07/2007
//
// Stylesheet for the table of content
*/
*
{
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
body
{
font-family: Segoe UI, Arial, Verdana, Helvetica, sans-serif;
font-size: 0.9em;
background-color: white;
color: White;
overflow: hidden;
}
input
{
padding:5px;
margin: 3px 0px 3px 0px
}
img
{
border: 0;
margin-left: 5px;
margin-right: 2px;
}
img.TreeNodeImg
{
cursor: pointer;
}
img.TOCLink
{
cursor: pointer;
margin-left: 0;
margin-right: 0;
}
a.SelectedNode, a.UnselectedNode
{
color: #333;
text-decoration: none;
padding: 1px 3px 1px 3px;
white-space: nowrap;
}
a.SelectedNode
{
background-color: #ffffff;
border: solid 1px #999999;
padding: 0px 2px 0px 2px;
}
a.UnselectedNode:hover, a.SelectedNode:hover
{
background-color: #cccccc;
border: solid 1px #999999;
padding: 0px 2px 0px 2px;
}
.Visible
{
display: block;
margin-left: 2em;
}
.Hidden
{
display: none;
}
.Tree
{
background-color: #fff;
color: #333;
width: 300px;
overflow: auto;
}
.TreeNode, .TreeItem
{
white-space: nowrap;
margin: 2px 2px 2px 2px;
}
.TOCDiv
{
position: relative;
float: left;
width: 300px;
height: 100%;
}
.TOCSizer
{
clear: none;
float: left;
width: 10px;
height: 100%;
background-image: url("Splitter.gif");
background-position:center center;
background-repeat:no-repeat;
position: relative;
cursor: w-resize;
border-left: solid 1px #CCC;
}
.TopicContent
{
position: relative;
float: right;
background-color: white;
height: 100%;
}
.SearchOpts
{
padding: 5px 5px 10px 5px;
color: black;
width: 300px;
border-bottom: solid lightgrey 1px;
height: 110px !important;
}
.NavOpts
{
padding: 5px 5px 6px 5px;
color: black;
width: 300px;
border-bottom: solid lightgrey 1px;
}
.NavOpts img {
display:inline-block;
margin: 0px 5px 0px 5px;
}
.IndexOpts
{
padding: 5px 5px 6px 5px;
color: black;
width: 300px;
border-bottom: solid lightgrey 1px;
}
.IndexItem
{
white-space: nowrap;
margin: 2px 2px 2px 2px;
}
.IndexSubItem
{
white-space: nowrap;
margin: 2px 2px 2px 12px;
}
.PaddedText
{
margin: 10px 10px 10px 10px;
}
-172
View File
@@ -1,172 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<!-- The configuration and platform will be used to determine which
assemblies to include from solution and project documentation
sources -->
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{cb4d85f1-7390-40ee-b41f-a724bb8fddea}</ProjectGuid>
<SHFBSchemaVersion>1.9.5.0</SHFBSchemaVersion>
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual
Studio adds them anyway -->
<AssemblyName>Documentation</AssemblyName>
<RootNamespace>Documentation</RootNamespace>
<Name>Documentation</Name>
<!-- SHFB properties -->
<FrameworkVersion>.NET Framework 4.5</FrameworkVersion>
<OutputPath>.\Output\</OutputPath>
<HtmlHelpName>UmbracoClassLibrary</HtmlHelpName>
<Language>en-US</Language>
<BuildAssemblerVerbosity>OnlyErrors</BuildAssemblerVerbosity>
<BuildLogFile>csharp-api-docs.log</BuildLogFile>
<HelpFileFormat>Website</HelpFileFormat>
<IndentHtml>True</IndentHtml>
<KeepLogFile>False</KeepLogFile>
<DisableCodeBlockComponent>False</DisableCodeBlockComponent>
<CppCommentsFixup>False</CppCommentsFixup>
<CleanIntermediates>True</CleanIntermediates>
<SyntaxFilters>CSharp</SyntaxFilters>
<SdkLinkTarget>Blank</SdkLinkTarget>
<RootNamespaceContainer>False</RootNamespaceContainer>
<PresentationStyle>VS2010</PresentationStyle>
<Preliminary>False</Preliminary>
<NamingMethod>Guid</NamingMethod>
<HelpTitle>Umbraco .Net Class Library</HelpTitle>
<ContentPlacement>AboveNamespaces</ContentPlacement>
<VisibleItems>Attributes, InheritedMembers, InheritedFrameworkMembers, Protected, SealedProtected</VisibleItems>
<ComponentConfigurations />
<DocumentationSources>
<DocumentationSource sourceFile="..\..\src\Umbraco.Core\Umbraco.Core.csproj" />
<DocumentationSource sourceFile="..\..\src\Umbraco.Core\bin\Release\Umbraco.Core.xml" />
<DocumentationSource sourceFile="..\..\src\Umbraco.Web\Umbraco.Web.csproj" />
<DocumentationSource sourceFile="..\..\src\Umbraco.Web\bin\Release\umbraco.xml" /></DocumentationSources>
<WebsiteSdkLinkType>None</WebsiteSdkLinkType>
<HtmlSdkLinkType>None</HtmlSdkLinkType>
<IncludeFavorites>False</IncludeFavorites>
<BinaryTOC>True</BinaryTOC>
<MissingTags>Summary, AutoDocumentCtors, AutoDocumentDispose</MissingTags>
<TransformComponentArguments>
<Argument Key="logoFile" Value="" />
<Argument Key="logoHeight" Value="" />
<Argument Key="logoWidth" Value="" />
<Argument Key="logoAltText" Value="" />
<Argument Key="logoPlacement" Value="left" />
<Argument Key="logoAlignment" Value="left" />
</TransformComponentArguments>
<ApiFilter>
<Filter entryType="Namespace" fullName="CookComputing.Blogger" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="CookComputing.MetaWeblog" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="dashboardUtilities" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="presentation.umbraco.webservices" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco" isExposed="False" xmlns="">
<Filter entryType="Class" fullName="umbraco.content" filterName="content" isExposed="True" />
<Filter entryType="Delegate" fullName="umbraco.content.ContentCacheDatabaseLoadXmlStringEventHandler" filterName="content.ContentCacheDatabaseLoadXmlStringEventHandler" isExposed="False" />
<Filter entryType="Delegate" fullName="umbraco.content.ContentCacheLoadNodeEventHandler" filterName="content.ContentCacheLoadNodeEventHandler" isExposed="False" />
<Filter entryType="Delegate" fullName="umbraco.content.DocumentCacheEventHandler" filterName="content.DocumentCacheEventHandler" isExposed="False" />
<Filter entryType="Delegate" fullName="umbraco.content.RefreshContentEventHandler" filterName="content.RefreshContentEventHandler" isExposed="False" />
<Filter entryType="Class" fullName="umbraco.ContentExtensions" filterName="ContentExtensions" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.ContentTypeExtensions" filterName="ContentTypeExtensions" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.item" filterName="item" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.library" filterName="library" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.macro" filterName="macro" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.MacroCacheContent" filterName="MacroCacheContent" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.MacroRenderingEventArgs" filterName="MacroRenderingEventArgs" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.MediaExtensions" filterName="MediaExtensions" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.MemberExtensions" filterName="MemberExtensions" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.page" filterName="page" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.PreValueExtensions" filterName="PreValueExtensions" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.RelationTypeExtensions" filterName="RelationTypeExtensions" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.template" filterName="template" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.UmbracoObjectTypeExtensions" filterName="UmbracoObjectTypeExtensions" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.uQuery" filterName="uQuery" isExposed="True" />
<Filter entryType="Interface" fullName="umbraco.uQuery.IGetProperty" filterName="uQuery.IGetProperty" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.uQuery.Members" filterName="uQuery.Members" isExposed="True" />
<Filter entryType="Enumeration" fullName="umbraco.uQuery.UmbracoObjectType" filterName="uQuery.UmbracoObjectType" isExposed="True" />
</Filter>
<Filter entryType="Namespace" fullName="umbraco.cms.presentation" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.create.controls" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.developer" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.developer.RelationTypes" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.developer.RelationTypes.TreeMenu" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.members" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.settings" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.settings.modal" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.settings.scripts" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.settings.stylesheet" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.cms.presentation.user" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.controls" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.controls.GenericProperties" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.controls.Images" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.controls.Tree" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.developer" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.dialogs" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.js" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.layoutControls" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.NodeFactory" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.actions" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.channels" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.channels.businesslogic" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.create" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.developer.packages" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.dialogs" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.masterpages" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.members" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.nodeFactory" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.org.umbraco.update" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.plugins.tinymce3" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.preview" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.Search" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.settings" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.templateControls" isExposed="False" xmlns="">
<Filter entryType="Class" fullName="umbraco.presentation.templateControls.Item" filterName="Item" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.presentation.templateControls.ItemRenderer" filterName="ItemRenderer" isExposed="True" />
<Filter entryType="Class" fullName="umbraco.presentation.templateControls.Macro" filterName="Macro" isExposed="True" />
<Filter entryType="Enumeration" fullName="umbraco.presentation.templateControls.Macro.RenderEvents" filterName="Macro.RenderEvents" isExposed="False" />
</Filter>
<Filter entryType="Namespace" fullName="umbraco.presentation.tinymce3" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.translation" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.channels" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.controls" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.create" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.developer.Xslt" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.dialogs" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.masterpages" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.members" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.plugins.tinymce3" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.Search" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.translation" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco.webservices" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.umbraco_client.tinymce3.plugins.spellchecker" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.urlRewriter" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.Web.UI" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.presentation.webservices" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.scripting" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.settings" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="Umbraco.Web.org.umbraco.our" isExposed="False" xmlns="" />
<Filter entryType="Namespace" fullName="umbraco.webservices" isExposed="False" xmlns="" /></ApiFilter>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in
order for Visual Studio to perform the build. The others are optional
common platform types that may appear. -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
</PropertyGroup>
<!-- Import the SHFB build targets -->
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
</Project>
+48 -11
View File
@@ -11,20 +11,28 @@ FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SE
FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i"
REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version
IF [%1] NEQ [] (SET release=%1)
IF [%2] NEQ [] (SET comment=%2) ELSE (IF [%1] NEQ [] (SET "comment="))
IF [%2] NEQ [] (SET release=%2)
IF [%3] NEQ [] (SET comment=%3) ELSE (IF [%2] NEQ [] (SET "comment="))
REM Get the "is continuous integration" from the parameters
SET "isci=0"
IF [%1] NEQ [] (SET isci=1)
SET version=%release%
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
ECHO.
ECHO Building Umbraco %version%
ECHO.
ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%
ECHO.
ECHO Removing the belle build folder and bower_components folder to make sure everything is clean as a whistle
RD ..\src\Umbraco.Web.UI.Client\build /Q /S
RD ..\src\Umbraco.Web.UI.Client\bower_components /Q /S
ECHO.
ECHO Removing existing built files to make sure everything is clean as a whistle
RMDIR /Q /S _BuildOutput
DEL /F /Q UmbracoCms.*.zip
@@ -32,27 +40,56 @@ DEL /F /Q UmbracoExamine.*.zip
DEL /F /Q UmbracoCms.*.nupkg
DEL /F /Q webpihash.txt
ECHO.
ECHO Making sure Git is in the path so that the build can succeed
CALL InstallGit.cmd
ECHO Performing MSBuild and producing Umbraco binaries zip files
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% /verbosity:minimal
REM Adding the default Git path so that if it's installed it can actually be found
REM This is necessary because SETLOCAL is on in InstallGit.cmd so that one might find Git,
REM but the path setting is lost due to SETLOCAL
path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%
ECHO.
ECHO Making sure we have a web.config
IF NOT EXIST %CD%\..\src\Umbraco.Web.UI\web.config COPY %CD%\..\src\Umbraco.Web.UI\web.Template.config %CD%\..\src\Umbraco.Web.UI\web.config
ECHO.
ECHO.
ECHO Performing MSBuild and producing Umbraco binaries zip files
ECHO This takes a few minutes and logging is set to report warnings
ECHO and errors only so it might seems like nothing is happening for a while.
ECHO You can check the msbuild.log file for progress.
ECHO.
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% /p:NugetPackagesDirectory=%nuGetFolder% /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly /fileLogger
IF ERRORLEVEL 1 GOTO :error
ECHO.
ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project
attrib +h ..\src\Umbraco.Web.UI.Client\node_modules
ECHO.
ECHO Adding Web.config transform files to the NuGet package
REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform
ECHO.
ECHO Packing the NuGet release files
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version% -Symbols -Verbosity quiet
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version% -Verbosity quiet
IF ERRORLEVEL 1 GOTO :showerror
IF ERRORLEVEL 1 GOTO :error
ECHO No errors were detected but you still may see some in the output, then it's time to investigate.
ECHO You might see some warnings but that is completely normal.
:success
ECHO.
ECHO No errors were detected!
ECHO There may still be some in the output, which you would need to investigate.
ECHO Warnings are usually normal.
GOTO :EOF
:showerror
PAUSE
:error
ECHO.
ECHO Errors were detected!
REM don't pause if continuous integration else the build server waits forever
REM before cancelling the build (and, there is noone to read the output anyways)
IF isci NEQ 1 PAUSE
+1
View File
@@ -23,6 +23,7 @@ ECHO Change directory to %CD%\..\src\Umbraco.Web.UI.Client\
CD %CD%\..\src\Umbraco.Web.UI.Client\
ECHO Do npm install and the grunt build of Belle
call npm cache clean --quiet
call npm install --quiet
call npm install -g grunt-cli --quiet
call npm install -g bower --quiet
+20
View File
@@ -0,0 +1,20 @@
@ECHO OFF
SETLOCAL
SET release=%1
ECHO Installing Npm NuGet Package
SET nuGetFolder=%CD%\..\src\packages\
ECHO Configured packages folder: %nuGetFolder%
ECHO Current folder: %CD%
%CD%\..\src\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet
for /f "delims=" %%A in ('dir %nuGetFolder%node.js.* /b') do set "nodePath=%nuGetFolder%%%A\"
for /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') do set "npmPath=%nuGetFolder%%%A\tools\"
ECHO Adding Npm and Node to path
REM SETLOCAL is on, so changes to the path not persist to the actual user's path
PATH=%npmPath%;%nodePath%;%PATH%
Powershell.exe -ExecutionPolicy Unrestricted -File .\BuildDocs.ps1
+91 -18
View File
@@ -1,27 +1,100 @@
##We cannot continue if sandcastle is not installed determined by env variable: SHFBROOT
$PSScriptFilePath = (Get-Item $MyInvocation.MyCommand.Path);
$RepoRoot = (get-item $PSScriptFilePath).Directory.Parent.FullName;
$SolutionRoot = Join-Path -Path $RepoRoot "src";
$ToolsRoot = Join-Path -Path $RepoRoot "tools";
$DocFx = Join-Path -Path $ToolsRoot "docfx\docfx.exe"
$DocFxFolder = (Join-Path -Path $ToolsRoot "docfx")
$DocFxJson = Join-Path -Path $RepoRoot "apidocs\docfx.json"
$7Zip = Join-Path -Path $ToolsRoot "7zip\7za.exe"
$DocFxSiteOutput = Join-Path -Path $RepoRoot "apidocs\_site\*.*"
$NgDocsSiteOutput = Join-Path -Path $RepoRoot "src\Umbraco.Web.UI.Client\docs\api\*.*"
$ProgFiles86 = [Environment]::GetEnvironmentVariable("ProgramFiles(x86)");
$MSBuild = "$ProgFiles86\MSBuild\14.0\Bin\MSBuild.exe"
if (-not (Test-Path Env:\SHFBROOT))
{
throw "The docs cannot be build, install Sandcastle help file builder"
################ Do the UI docs
"Changing to Umbraco.Web.UI.Client folder"
cd ..
cd src\Umbraco.Web.UI.Client
Write-Host $(Get-Location)
"Creating build folder so MSBuild doesn't run the whole grunt build"
if (-Not (Test-Path "build")) {
md "build"
}
$PSScriptFilePath = (Get-Item $MyInvocation.MyCommand.Path).FullName
$BuildRoot = Split-Path -Path $PSScriptFilePath -Parent
$OutputPath = Join-Path -Path $BuildRoot -ChildPath "ApiDocs\Output"
$ProjFile = Join-Path -Path $BuildRoot -ChildPath "ApiDocs\csharp-api-docs.shfbproj"
"Installing node"
# Check if Install-Product exists, should only exist on the build server
if (Get-Command Install-Product -errorAction SilentlyContinue)
{
Install-Product node ''
}
"Building docs with project file: $ProjFile"
"Installing node modules"
& npm install
$MSBuild = "$Env:SYSTEMROOT\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
"Installing grunt"
& npm install -g grunt-cli
# build it!
& $MSBuild "$ProjFile"
"Moving back to build folder"
cd ..
cd ..
cd build
Write-Host $(Get-Location)
# remove files left over
Remove-Item $BuildRoot\* -include csharp-api-docs.shfbproj_*
& grunt --gruntfile ../src/umbraco.web.ui.client/gruntfile.js docs
# copy our custom styles in
Copy-Item $BuildRoot\ApiDocs\TOC.css $OutputPath\TOC.css
# change baseUrl
$BaseUrl = "https://our.umbraco.org/apidocs/ui/"
$IndexPath = "../src/umbraco.web.ui.client/docs/api/index.html"
(Get-Content $IndexPath).replace('location.href.replace(rUrl, indexFile)', "`'" + $BaseUrl + "`'") | Set-Content $IndexPath
# zip it
""
"Done!"
& $7Zip a -tzip ui-docs.zip $NgDocsSiteOutput -r
################ Do the c# docs
# Build the solution in debug mode
$SolutionPath = Join-Path -Path $SolutionRoot -ChildPath "umbraco.sln"
& $MSBuild "$SolutionPath" /p:Configuration=Debug /maxcpucount /t:Clean
if (-not $?)
{
throw "The MSBuild process returned an error code."
}
& $MSBuild "$SolutionPath" /p:Configuration=Debug /maxcpucount
if (-not $?)
{
throw "The MSBuild process returned an error code."
}
# Go get docfx if we don't hae it
$FileExists = Test-Path $DocFx
If ($FileExists -eq $False) {
If(!(Test-Path $DocFxFolder))
{
New-Item $DocFxFolder -type directory
}
$DocFxZip = Join-Path -Path $ToolsRoot "docfx\docfx.zip"
$DocFxSource = "https://github.com/dotnet/docfx/releases/download/v1.9.4/docfx.zip"
Invoke-WebRequest $DocFxSource -OutFile $DocFxZip
#unzip it
& $7Zip e $DocFxZip "-o$DocFxFolder"
}
#clear site
If(Test-Path(Join-Path -Path $RepoRoot "apidocs\_site"))
{
Remove-Item $DocFxSiteOutput -recurse
}
# run it!
& $DocFx metadata $DocFxJson
& $DocFx build $DocFxJson
# zip it
& $7Zip a -tzip csharp-docs.zip $DocFxSiteOutput -r
+2 -2
View File
@@ -2,13 +2,13 @@
SETLOCAL
REM SETLOCAL is on, so changes to the path not persist to the actual user's path
git.exe 2> NUL
git.exe --version
if %ERRORLEVEL%==9009 GOTO :trydefaultpath
GOTO :EOF
:trydefaultpath
path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%
git.exe 2> NUL
git.exe --version
if %ERRORLEVEL%==9009 GOTO :showerror
GOTO :EOF
+6 -5
View File
@@ -27,15 +27,17 @@
<dependency id="SharpZipLib" version="[0.86.0, 1.0.0)" />
<dependency id="MySql.Data" version="[6.9.8, 7.0.0)" />
<dependency id="xmlrpcnet" version="[2.5.0, 3.0.0)" />
<dependency id="ClientDependency" version="[1.8.4, 2.0.0)" />
<dependency id="ClientDependency" version="[1.9.0-beta4, 2.0.0)" />
<dependency id="ClientDependency-Mvc5" version="[1.8.0, 2.0.0)" />
<!-- AutoMapper can not be updated due to: https://github.com/AutoMapper/AutoMapper/issues/373#issuecomment-127644405 -->
<dependency id="AutoMapper" version="[3.0.0, 3.1.0)" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 9.0.0)" />
<dependency id="Examine" version="[0.1.68, 1.0.0)" />
<dependency id="ImageProcessor" version="[2.3.3, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[4.5.3, 5.0.0)" />
<dependency id="Examine" version="[0.1.69-beta, 1.0.0)" />
<dependency id="ImageProcessor" version="[2.4.3, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[4.6.3, 5.0.0)" />
<dependency id="semver" version="[1.1.2, 2.0.0)" />
<dependency id="UrlRewritingNet" version="[2.0.7, 3.0.0)" />
<!-- Markdown can not be updated due to: https://github.com/hey-red/markdownsharp/issues/71#issuecomment-233585487 -->
<dependency id="Markdown" version="[1.14.4, 2.0.0)" />
</dependencies>
</metadata>
@@ -72,7 +74,6 @@
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.dll" target="lib\UmbracoExamine.dll" />
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.xml" target="lib\UmbracoExamine.xml" />
<file src="tools\install.core.ps1" target="tools\install.ps1" />
<file src="tools\uninstall.core.ps1" target="tools\uninstall.ps1" />
<!-- Added to be able to produce a symbols package -->
<file src="..\_BuildOutput\bin\SQLCE4Umbraco.pdb" target="lib" />
+2 -2
View File
@@ -17,7 +17,7 @@
<dependencies>
<dependency id="UmbracoCms.Core" version="[$version$]" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 9.0.0)" />
<dependency id="Umbraco.ModelsBuilder" version="[3.0.0, 4.0.0)" />
<dependency id="Umbraco.ModelsBuilder" version="[3.0.3, 4.0.0)" />
</dependencies>
</metadata>
<files>
@@ -32,8 +32,8 @@
<file src="..\_BuildOutput\WebApp\config\splashes\**" target="UmbracoFiles\Config\splashes" />
<file src="..\_BuildOutput\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
<file src="..\_BuildOutput\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
<file src="..\_BuildOutput\WebApp\Media\Web.config" target="Content\Media\Web.config" />
<file src="tools\install.ps1" target="tools\install.ps1" />
<file src="tools\uninstall.ps1" target="tools\uninstall.ps1" />
<file src="tools\Readme.txt" target="tools\Readme.txt" />
<file src="tools\ReadmeUpgrade.txt" target="tools\ReadmeUpgrade.txt" />
<file src="tools\Web.config.install.xdt" target="Content\Web.config.install.xdt" />
@@ -21,6 +21,8 @@
<appSettings xdt:Transform="InsertIfMissing" />
<appSettings>
<add key="owin:appStartup" value="UmbracoDefaultOwinStartup" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
<add key="Umbraco.ModelsBuilder.Enable" value="false" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
<add key="Umbraco.ModelsBuilder.ModelsMode" value="Nothing" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
</appSettings>
<umbracoConfiguration xdt:Transform="InsertIfMissing">
+26 -1
View File
@@ -77,8 +77,33 @@ if ($project) {
{
$packageWebConfigSource = Join-Path $installPath "UmbracoFiles\Web.config"
Copy-Item $packageWebConfigSource $destinationWebConfig -Force
}
# Copy files that don't get automatically copied for Website projects
# We do this here, when copyWebconfig is true because we only want to do it for new installs
# If this is an upgrade then the files should already be there
$splashesSource = Join-Path $installPath "UmbracoFiles\Config\splashes\*.*"
$splashesDestination = Join-Path $projectPath "Config\splashes\"
New-Item $splashesDestination -Type directory
Copy-Item $splashesSource $splashesDestination -Force
$sqlCe64Source = Join-Path $installPath "UmbracoFiles\bin\amd64\*"
$sqlCe64Destination = Join-Path $projectPath "bin\amd64\"
Copy-Item $sqlCe64Source $sqlCe64Destination -Force
$sqlCex86Source = Join-Path $installPath "UmbracoFiles\bin\x86\*"
$sqlCex86Destination = Join-Path $projectPath "bin\x86\"
Copy-Item $sqlCex86source $sqlCex86Destination -Force
$umbracoUIXMLSource = Join-Path $installPath "UmbracoFiles\Umbraco\Config\Create\UI.xml"
$umbracoUIXMLDestination = Join-Path $projectPath "Umbraco\Config\Create\UI.xml"
Copy-Item $umbracoUIXMLSource $umbracoUIXMLDestination -Force
} else {
$upgradeViewSource = Join-Path $umbracoFolderSource "Views\install\*"
$upgradeView = Join-Path $umbracoFolder "Views\install\"
Write-Host "Copying2 ${upgradeViewSource} to ${upgradeView}"
Copy-Item $upgradeViewSource $upgradeView -Force
}
$installFolder = Join-Path $projectPath "Install"
if(Test-Path $installFolder) {
Remove-Item $installFolder -Force -Recurse -Confirm:$false
-48
View File
@@ -1,48 +0,0 @@
param($installPath, $toolsPath, $package, $project)
Write-Host "installPath:" "${installPath}"
Write-Host "toolsPath:" "${toolsPath}"
Write-Host " "
if ($project) {
# Create paths and list them
$projectPath = (Get-Item $project.Properties.Item("FullPath").Value).FullName
Write-Host "projectPath:" "${projectPath}"
$backupPath = Join-Path $projectPath "App_Data\NuGetBackup"
Write-Host "backupPath:" "${backupPath}"
$umbracoBinFolder = Join-Path $projectPath "bin"
Write-Host "umbracoBinFolder:" "${umbracoBinFolder}"
# Remove backups
Write-Host "removing backups:" "${backupPath}"
if(Test-Path $backupPath) { Remove-Item -Recurse -Force $backupPath -Confirm:$false }
# Delete files Umbraco ships with
Write-Host "removing dlls:" "${umbracoBinFolder}"
if(Test-Path $umbracoBinFolder\businesslogic.dll) { Remove-Item $umbracoBinFolder\businesslogic.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\cms.dll) { Remove-Item $umbracoBinFolder\cms.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\controls.dll) { Remove-Item $umbracoBinFolder\controls.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\interfaces.dll) { Remove-Item $umbracoBinFolder\interfaces.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\log4net.dll) { Remove-Item $umbracoBinFolder\log4net.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\Microsoft.ApplicationBlocks.Data.dll) { Remove-Item $umbracoBinFolder\Microsoft.ApplicationBlocks.Data.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\SQLCE4Umbraco.dll) { Remove-Item $umbracoBinFolder\SQLCE4Umbraco.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\System.Data.SqlServerCe.dll) { Remove-Item $umbracoBinFolder\System.Data.SqlServerCe.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\System.Data.SqlServerCe.Entity.dll) { Remove-Item $umbracoBinFolder\System.Data.SqlServerCe.Entity.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\TidyNet.dll) { Remove-Item $umbracoBinFolder\TidyNet.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\umbraco.dll) { Remove-Item $umbracoBinFolder\umbraco.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\Umbraco.Core.dll) { Remove-Item $umbracoBinFolder\Umbraco.Core.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\umbraco.DataLayer.dll) { Remove-Item $umbracoBinFolder\umbraco.DataLayer.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\umbraco.editorControls.dll) { Remove-Item $umbracoBinFolder\umbraco.editorControls.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\umbraco.MacroEngines.dll) { Remove-Item $umbracoBinFolder\umbraco.MacroEngines.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\umbraco.providers.dll) { Remove-Item $umbracoBinFolder\umbraco.providers.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\Umbraco.Web.UI.dll) { Remove-Item $umbracoBinFolder\Umbraco.Web.UI.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\UmbracoExamine.dll) { Remove-Item $umbracoBinFolder\UmbracoExamine.dll -Force -Confirm:$false }
$amd64Folder = Join-Path $umbracoBinFolder "amd64"
if(Test-Path $amd64Folder) { Remove-Item $amd64Folder -Force -Recurse -Confirm:$false }
$x86Folder = Join-Path $umbracoBinFolder "x86"
if(Test-Path $x86Folder) { Remove-Item $x86Folder -Force -Recurse -Confirm:$false }
}
-39
View File
@@ -1,39 +0,0 @@
param($installPath, $toolsPath, $package, $project)
Write-Host "installPath:" "${installPath}"
Write-Host "toolsPath:" "${toolsPath}"
Write-Host " "
if ($project) {
# Create paths and list them
$projectPath = (Get-Item $project.Properties.Item("FullPath").Value).FullName
Write-Host "projectPath:" "${projectPath}"
$backupPath = Join-Path $projectPath "App_Data\NuGetBackup"
Write-Host "backupPath:" "${backupPath}"
$appBrowsers = Join-Path $projectPath "App_Browsers"
Write-Host "appBrowsers:" "${appBrowsers}"
$appData = Join-Path $projectPath "App_Data"
Write-Host "appData:" "${appData}"
# Remove backups
Write-Host "removing backups:" "${backupPath}"
if(Test-Path $backupPath) { Remove-Item -Recurse -Force $backupPath -Confirm:$false }
# Remove app_data files
Write-Host "removing app_data files:" "${appData}"
if(Test-Path $appData\packages) { Remove-Item $appData\packages -Recurse -Force -Confirm:$false }
Write-Host "removing app_browsers:" "${appBrowsers}"
if(Test-Path $appBrowsers\Form.browser) { Remove-Item $appBrowsers\Form.browser -Force -Confirm:$false }
if(Test-Path $appBrowsers\w3cvalidator.browser) { Remove-Item $appBrowsers\w3cvalidator.browser -Force -Confirm:$false }
# Remove umbraco and umbraco_files
$umbracoFolder = Join-Path $projectPath "Umbraco"
Write-Host "removing umbraco folder:" "${umbracoFolder}"
if(Test-Path $umbracoFolder) { Remove-Item $umbracoFolder -Recurse -Force -Confirm:$false }
$umbracoClientFolder = Join-Path $projectPath "Umbraco_Client"
Write-Host "removing umbraco client folder:" "${umbracoClientFolder}"
if(Test-Path $umbracoClientFolder) { Remove-Item $umbracoClientFolder -Recurse -Force -Confirm:$false }
}
+2 -1
View File
@@ -1,2 +1,3 @@
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
7.4.1
7.5.0
beta2
+4 -9
View File
@@ -40,15 +40,10 @@ namespace SqlCE4Umbraco
var localConnection = new SqlCeConnection(ConnectionString);
if (!System.IO.File.Exists(ReplaceDataDirectory(localConnection.Database)))
{
var sqlCeEngine = new SqlCeEngine(ConnectionString);
sqlCeEngine.CreateDatabase();
// SD: Pretty sure this should be in a using clause but i don't want to cause unknown side-effects here
// since it's been like this for quite some time
//using (var sqlCeEngine = new SqlCeEngine(ConnectionString))
//{
// sqlCeEngine.CreateDatabase();
//}
using (var sqlCeEngine = new SqlCeEngine(ConnectionString))
{
sqlCeEngine.CreateDatabase();
}
}
}
+2 -2
View File
@@ -11,5 +11,5 @@ using System.Resources;
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.4.1")]
[assembly: AssemblyInformationalVersion("7.4.1")]
[assembly: AssemblyFileVersion("7.5.0")]
[assembly: AssemblyInformationalVersion("7.5.0-beta2")]
@@ -9,6 +9,9 @@ namespace Umbraco.Core.Cache
/// <summary>
/// A cache provider that caches items in the HttpContext.Items
/// </summary>
/// <remarks>
/// If the Items collection is null, then this provider has no effect
/// </remarks>
internal class HttpRequestCacheProvider : DictionaryCacheProviderBase
{
// context provider
@@ -34,6 +37,11 @@ namespace Umbraco.Core.Cache
get { return _context != null ? _context.Items : HttpContext.Current.Items; }
}
private bool HasContextItems
{
get { return (_context != null && _context.Items != null) || HttpContext.Current != null; }
}
// for unit tests
public HttpRequestCacheProvider(HttpContextBase context)
{
@@ -50,18 +58,23 @@ namespace Umbraco.Core.Cache
protected override IEnumerable<DictionaryEntry> GetDictionaryEntries()
{
const string prefix = CacheItemPrefix + "-";
if (HasContextItems == false) return Enumerable.Empty<DictionaryEntry>();
return ContextItems.Cast<DictionaryEntry>()
.Where(x => x.Key is string && ((string)x.Key).StartsWith(prefix));
}
protected override void RemoveEntry(string key)
{
if (HasContextItems == false) return;
ContextItems.Remove(key);
}
protected override object GetEntry(string key)
{
return ContextItems[key];
return HasContextItems ? ContextItems[key] : null;
}
#region Lock
@@ -81,7 +94,9 @@ namespace Umbraco.Core.Cache
get
{
return new MonitorLock(ContextItems.SyncRoot);
return HasContextItems
? (IDisposable) new MonitorLock(ContextItems.SyncRoot)
: new NoopLocker();
}
}
@@ -91,6 +106,9 @@ namespace Umbraco.Core.Cache
public override object GetCacheItem(string cacheKey, Func<object> getCacheItem)
{
//no place to cache so just return the callback result
if (HasContextItems == false) return getCacheItem();
cacheKey = GetCacheKey(cacheKey);
Lazy<object> result;
@@ -128,5 +146,10 @@ namespace Umbraco.Core.Cache
#region Insert
#endregion
private class NoopLocker : DisposableObject
{
protected override void DisposeResources()
{ }
}
}
}
+2 -2
View File
@@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace Umbraco.Core.Cache
{
/// <summary>
/// An abstract class for implementing a basic cache provider
/// An interface for implementing a basic cache provider
/// </summary>
public interface ICacheProvider
{
@@ -65,4 +65,4 @@ namespace Umbraco.Core.Cache
object GetCacheItem(string cacheKey, Func<object> getCacheItem);
}
}
}
+12 -21
View File
@@ -5,38 +5,31 @@ using System.Web.Caching;
namespace Umbraco.Core.Cache
{
internal class NullCacheProvider : IRuntimeCacheProvider
/// <summary>
/// Represents a cache provider that does not cache anything.
/// </summary>
public class NullCacheProvider : IRuntimeCacheProvider
{
public virtual void ClearAllCache()
{
}
{ }
public virtual void ClearCacheItem(string key)
{
}
{ }
public virtual void ClearCacheObjectTypes(string typeName)
{
}
{ }
public virtual void ClearCacheObjectTypes<T>()
{
}
{ }
public virtual void ClearCacheObjectTypes<T>(Func<string, T, bool> predicate)
{
}
{ }
public virtual void ClearCacheByKeySearch(string keyStartsWith)
{
}
{ }
public virtual void ClearCacheByKeyExpression(string regexString)
{
}
{ }
public virtual IEnumerable<object> GetCacheItemsByKeySearch(string keyStartsWith)
{
@@ -64,8 +57,6 @@ namespace Umbraco.Core.Cache
}
public void InsertCacheItem(string cacheKey, Func<object> getCacheItem, TimeSpan? timeout = null, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null)
{
}
{ }
}
}
@@ -1,23 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Runtime.Caching;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web.Caching;
using Umbraco.Core.Logging;
using CacheItemPriority = System.Web.Caching.CacheItemPriority;
namespace Umbraco.Core.Cache
{
/// <summary>
/// Represents a cache provider that caches item in a <see cref="MemoryCache"/>.
/// A cache provider that wraps the logic of a System.Runtime.Caching.ObjectCache
/// </summary>
internal class ObjectCacheRuntimeCacheProvider : IRuntimeCacheProvider
/// <remarks>The <see cref="MemoryCache"/> is created with name "in-memory". That name is
/// used to retrieve configuration options. It does not identify the memory cache, i.e.
/// each instance of this class has its own, independent, memory cache.</remarks>
public class ObjectCacheRuntimeCacheProvider : IRuntimeCacheProvider
{
private readonly ReaderWriterLockSlim _locker = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
internal ObjectCache MemoryCache;
@@ -3,14 +3,13 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web.Caching;
namespace Umbraco.Core.Cache
{
/// <summary>
/// A cache provider that statically caches everything in an in memory dictionary
/// Represents a cache provider that statically caches item in a concurrent dictionary.
/// </summary>
internal class StaticCacheProvider : ICacheProvider
public class StaticCacheProvider : ICacheProvider
{
internal readonly ConcurrentDictionary<string, object> StaticCache = new ConcurrentDictionary<string, object>();
@@ -75,7 +74,6 @@ namespace Umbraco.Core.Cache
public virtual object GetCacheItem(string cacheKey, Func<object> getCacheItem)
{
return StaticCache.GetOrAdd(cacheKey, key => getCacheItem());
}
}
}
}
@@ -6,6 +6,8 @@
bool HideDisabledUsersInBackoffice { get; }
bool AllowPasswordReset { get; }
string AuthCookieName { get; }
string AuthCookieDomain { get; }
@@ -28,6 +28,18 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
}
}
[ConfigurationProperty("allowPasswordReset")]
internal InnerTextConfigurationElement<bool> AllowPasswordReset
{
get
{
return new OptionalInnerTextConfigurationElement<bool>(
(InnerTextConfigurationElement<bool>)this["allowPasswordReset"],
//set the default
true);
}
}
[ConfigurationProperty("authCookieName")]
internal InnerTextConfigurationElement<string> AuthCookieName
{
@@ -62,6 +74,11 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return HideDisabledUsersInBackoffice; }
}
bool ISecuritySection.AllowPasswordReset
{
get { return AllowPasswordReset; }
}
string ISecuritySection.AuthCookieName
{
get { return AuthCookieName; }
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
{
public class UmbracoVersion
{
private static readonly Version Version = new Version("7.4.1");
private static readonly Version Version = new Version("7.5.0");
/// <summary>
/// Gets the current version of Umbraco.
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Configuration
/// Gets the version comment (like beta or RC).
/// </summary>
/// <value>The version comment.</value>
public static string CurrentComment { get { return ""; } }
public static string CurrentComment { get { return "beta2"; } }
// Get the version of the umbraco.dll by looking at a class in that dll
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
@@ -73,6 +73,11 @@
/// </summary>
public const string DataTypes = "dataTypes";
/// <summary>
/// alias for the packages tree
/// </summary>
public const string Packages = "packager";
/// <summary>
/// alias for the dictionary tree.
/// </summary>
+4 -1
View File
@@ -143,7 +143,10 @@ namespace Umbraco.Core
/// </summary>
public const string LockObject = "87A9F1FF-B1E4-4A25-BABB-465A4A47EC41";
/// <summary>
/// Guid for a Lock object.
/// </summary>
public static readonly Guid LockObjectGuid = new Guid(LockObject);
}
}
}
+13 -4
View File
@@ -11,7 +11,7 @@ namespace Umbraco.Core
{
/// <summary>
/// Used to prefix generic properties that are internal content properties
/// </summary>
/// </summary>
public const string InternalGenericPropertiesPrefix = "_umb_";
/// <summary>
@@ -74,7 +74,7 @@ namespace Umbraco.Core
/// </summary>
[Obsolete("GUIDs are no longer used to reference Property Editors, use the Alias constant instead. This will be removed in future versions")]
public const string DictionaryPicker = "17B70066-F764-407D-AB05-3717F1E1C513";
/// <summary>
/// Guid for the Dropdown list datatype.
/// </summary>
@@ -352,7 +352,7 @@ namespace Umbraco.Core
/// </summary>
[Obsolete("GUIDs are no longer used to reference Property Editors, use the Alias constant instead. This will be removed in future versions")]
public const string UltimatePicker = "CDBF0B5D-5CB2-445F-BC12-FCAAEC07CF2C";
/// <summary>
/// Guid for the UltraSimpleEditor datatype.
/// </summary>
@@ -369,7 +369,7 @@ namespace Umbraco.Core
/// </summary>
[Obsolete("GUIDs are no longer used to reference Property Editors, use the Alias constant instead. This will be removed in future versions")]
public const string UmbracoUserControlWrapper = "D15E1281-E456-4B24-AA86-1DDA3E4299D5";
/// <summary>
/// Guid for the Upload field datatype.
/// </summary>
@@ -419,6 +419,15 @@ namespace Umbraco.Core
/// Alias for the email address property editor
/// </summary>
public const string EmailAddressAlias = "Umbraco.EmailAddress";
public static class PreValueKeys
{
/// <summary>
/// Pre-value name used to indicate a field that can be used to override the database field to which data for the associated
/// property is saved
/// </summary>
public const string DataValueType = "umbracoDataValueType";
}
}
}
}
+23
View File
@@ -0,0 +1,23 @@
namespace Umbraco.Core
{
/// <summary>
/// Provides extension methods for System.Decimal.
/// </summary>
/// <remarks>See System.Decimal on MSDN and also
/// http://stackoverflow.com/questions/4298719/parse-decimal-and-filter-extra-0-on-the-right/4298787#4298787.
/// </remarks>
public static class DecimalExtensions
{
/// <summary>
/// Gets the normalized value.
/// </summary>
/// <param name="value">The value to normalize.</param>
/// <returns>The normalized value.</returns>
/// <remarks>Normalizing changes the scaling factor and removes trailing zeroes,
/// so 1.2500m comes out as 1.25m.</remarks>
public static decimal Normalize(this decimal value)
{
return value / 1.000000000000000000000000000000000m;
}
}
}
@@ -5,8 +5,10 @@ using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Linq.Expressions;
using System.Text;
using System.Web.Services.Description;
using Umbraco.Core.Cache;
using Umbraco.Core.Logging;
namespace Umbraco.Core.Dynamics
{
@@ -20,6 +22,20 @@ namespace Umbraco.Core.Dynamics
/// </summary>
private static readonly ConcurrentDictionary<Tuple<Type, string, int>, MethodInfo[]> MethodCache = new ConcurrentDictionary<Tuple<Type, string, int>, MethodInfo[]>();
private static IEnumerable<Type> GetTypes(Assembly a)
{
try
{
return TypeFinder.GetTypesWithFormattedException(a);
}
catch (ReflectionTypeLoadException ex)
{
// is this going to flood the log?
LogHelper.Error(typeof (ExtensionMethodFinder), "Failed to get types.", ex);
return Enumerable.Empty<Type>();
}
}
/// <summary>
/// Returns the enumerable of all extension method info's in the app domain = USE SPARINGLY!!!
/// </summary>
@@ -36,7 +52,7 @@ namespace Umbraco.Core.Dynamics
// assemblies that contain extension methods
.Where(a => a.IsDefined(typeof (ExtensionAttribute), false))
// types that contain extension methods
.SelectMany(a => a.GetTypes()
.SelectMany(a => GetTypes(a)
.Where(t => t.IsDefined(typeof (ExtensionAttribute), false) && t.IsSealed && t.IsGenericType == false && t.IsNested == false))
// actual extension methods
.SelectMany(t => t.GetMethods(BindingFlags.Static | BindingFlags.Public)
@@ -45,9 +61,9 @@ namespace Umbraco.Core.Dynamics
.Concat(typeof (Enumerable).GetMethods(BindingFlags.Static | BindingFlags.Public))
//If we don't do this then we'll be scanning all assemblies each time!
.ToArray(),
//only cache for 5 minutes
timeout: TimeSpan.FromMinutes(5),
timeout: TimeSpan.FromMinutes(5),
//each time this is accessed it will be for 5 minutes longer
isSliding:true);
@@ -57,7 +73,7 @@ namespace Umbraco.Core.Dynamics
/// Returns all extension methods found matching the definition
/// </summary>
/// <param name="runtimeCache">
/// The runtime cache is used to temporarily cache all extension methods found in the app domain so that
/// The runtime cache is used to temporarily cache all extension methods found in the app domain so that
/// while we search for individual extension methods, the process will be reasonably 'quick'. We then statically
/// cache the MethodInfo's that we are looking for and then the runtime cache will expire and give back all that memory.
/// </param>
@@ -78,7 +94,7 @@ namespace Umbraco.Core.Dynamics
{
var candidates = GetAllExtensionMethodsInAppDomain(runtimeCache);
// filter by name
// filter by name
var filtr1 = candidates.Where(m => m.Name == name);
// filter by args count
@@ -102,7 +118,7 @@ namespace Umbraco.Core.Dynamics
return filtr3.ToArray();
});
}
private static MethodInfo DetermineMethodFromParams(IEnumerable<MethodInfo> methods, Type genericType, IEnumerable<object> args)
@@ -123,12 +139,12 @@ namespace Umbraco.Core.Dynamics
types = method.GetParameters().Select(pi => pi.ParameterType).Skip(1)
});
//This type comparer will check
//This type comparer will check
var typeComparer = new DelegateEqualityComparer<Type>(
//Checks if the argument type passed in can be assigned from the parameter type in the method. For
//Checks if the argument type passed in can be assigned from the parameter type in the method. For
// example, if the argument type is HtmlHelper<MyModel> but the method parameter type is HtmlHelper then
// it will match because the argument is assignable to that parameter type and will be able to execute
TypeHelper.IsTypeAssignableFrom,
TypeHelper.IsTypeAssignableFrom,
//This will not ever execute but if it does we need to get the hash code of the string because the hash
// code of a type is random
type => type.FullName.GetHashCode());
@@ -159,7 +175,7 @@ namespace Umbraco.Core.Dynamics
.ToArray();
var methods = GetAllExtensionMethods(runtimeCache, thisType, name, args.Length).ToArray();
return DetermineMethodFromParams(methods, genericType, args);
}
}
+63 -24
View File
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using Semver;
using Umbraco.Core.Configuration;
using Umbraco.Core.Persistence.Migrations;
namespace Umbraco.Core.Events
@@ -13,23 +14,49 @@ namespace Umbraco.Core.Events
/// </summary>
/// <param name="eventObject"></param>
/// <param name="targetVersion"></param>
/// <param name="productName"></param>
/// <param name="canCancel"></param>
/// <param name="configuredVersion"></param>
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion, bool canCancel)
: base(eventObject, canCancel)
{
ConfiguredSemVersion = configuredVersion;
TargetSemVersion = targetVersion;
}
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion, string productName, bool canCancel)
: this(eventObject, null, configuredVersion, targetVersion, productName, canCancel)
{ }
[Obsolete("Use constructor accepting UmbracoVersion instances instead")]
/// <summary>
/// Constructor accepting multiple migrations that are used in the migration runner
/// </summary>
/// <param name="eventObject"></param>
/// <param name="targetVersion"></param>
/// <param name="canCancel"></param>
/// <param name="configuredVersion"></param>
[Obsolete("Use constructor accepting a product name instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion, bool canCancel)
: this(eventObject, null, configuredVersion, targetVersion, GlobalSettings.UmbracoMigrationName, canCancel)
{ }
[Obsolete("Use constructor accepting SemVersion instances and a product name instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public MigrationEventArgs(IList<IMigration> eventObject, Version configuredVersion, Version targetVersion, bool canCancel)
: base(eventObject, canCancel)
{
ConfiguredSemVersion = new SemVersion(configuredVersion);
TargetSemVersion = new SemVersion(targetVersion);
}
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), GlobalSettings.UmbracoMigrationName, canCancel)
{ }
/// <summary>
/// Constructor accepting multiple migrations that are used in the migration runner
/// </summary>
/// <param name="eventObject"></param>
/// <param name="migrationContext"></param>
/// <param name="targetVersion"></param>
/// <param name="productName"></param>
/// <param name="canCancel"></param>
/// <param name="configuredVersion"></param>
internal MigrationEventArgs(IList<IMigration> eventObject, MigrationContext migrationContext, SemVersion configuredVersion, SemVersion targetVersion, string productName, bool canCancel)
: base(eventObject, canCancel)
{
MigrationContext = migrationContext;
ConfiguredSemVersion = configuredVersion;
TargetSemVersion = targetVersion;
ProductName = productName;
}
/// <summary>
/// Constructor accepting multiple migrations that are used in the migration runner
@@ -39,12 +66,15 @@ namespace Umbraco.Core.Events
/// <param name="targetVersion"></param>
/// <param name="canCancel"></param>
/// <param name="configuredVersion"></param>
[Obsolete("Use constructor accepting a product name instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
internal MigrationEventArgs(IList<IMigration> eventObject, MigrationContext migrationContext, SemVersion configuredVersion, SemVersion targetVersion, bool canCancel)
: base(eventObject, canCancel)
{
MigrationContext = migrationContext;
ConfiguredSemVersion = configuredVersion;
TargetSemVersion = targetVersion;
ProductName = GlobalSettings.UmbracoMigrationName;
}
/// <summary>
@@ -53,21 +83,28 @@ namespace Umbraco.Core.Events
/// <param name="eventObject"></param>
/// <param name="configuredVersion"></param>
/// <param name="targetVersion"></param>
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion)
: base(eventObject)
{
ConfiguredSemVersion = configuredVersion;
TargetSemVersion = targetVersion;
}
/// <param name="productName"></param>
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion, string productName)
: this(eventObject, null, configuredVersion, targetVersion, productName, false)
{ }
[Obsolete("Use constructor accepting UmbracoVersion instances instead")]
/// <summary>
/// Constructor accepting multiple migrations that are used in the migration runner
/// </summary>
/// <param name="eventObject"></param>
/// <param name="configuredVersion"></param>
/// <param name="targetVersion"></param>
[Obsolete("Use constructor accepting a product name instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion)
: this(eventObject, null, configuredVersion, targetVersion, GlobalSettings.UmbracoMigrationName, false)
{ }
[Obsolete("Use constructor accepting SemVersion instances and a product name instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public MigrationEventArgs(IList<IMigration> eventObject, Version configuredVersion, Version targetVersion)
: base(eventObject)
{
ConfiguredSemVersion = new SemVersion(configuredVersion);
TargetSemVersion = new SemVersion(targetVersion);
}
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), GlobalSettings.UmbracoMigrationName, false)
{ }
/// <summary>
/// Returns all migrations that were used in the migration runner
@@ -95,6 +132,8 @@ namespace Umbraco.Core.Events
public SemVersion TargetSemVersion { get; private set; }
public string ProductName { get; private set; }
internal MigrationContext MigrationContext { get; private set; }
}
}
+10 -1
View File
@@ -69,7 +69,16 @@ namespace Umbraco.Core.IO
}
}
public static string AppPlugins
public static string AppCode
{
get
{
//NOTE: this is not configurable and shouldn't need to be
return "~/App_Code";
}
}
public static string AppPlugins
{
get
{
@@ -1,20 +1,21 @@
using System;
using log4net.Appender;
using log4net.Core;
using log4net.Util;
using System;
using System.Runtime.Remoting.Messaging;
namespace Umbraco.Core.Logging
{
/// <remarks>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// </remarks>
/// <summary>
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </summary>
public abstract class AsyncForwardingAppenderBase : ForwardingAppender
{
#region Private Members
private const FixFlags DefaultFixFlags = FixFlags.Partial;
private FixFlags _fixFlags = DefaultFixFlags;
private LoggingEventHelper _loggingEventHelper;
private FixFlags fixFlags = DefaultFixFlags;
private LoggingEventHelper loggingEventHelper;
#endregion Private Members
@@ -22,10 +23,25 @@ namespace Umbraco.Core.Logging
public FixFlags Fix
{
get { return _fixFlags; }
get { return fixFlags; }
set { SetFixFlags(value); }
}
/// <summary>
/// Returns HttpContext.Current
/// </summary>
protected internal object HttpContext
{
get
{
return CallContext.HostContext;
}
set
{
CallContext.HostContext = value;
}
}
/// <summary>
/// The logger name that will be used for logging internal errors.
/// </summary>
@@ -38,7 +54,7 @@ namespace Umbraco.Core.Logging
public override void ActivateOptions()
{
base.ActivateOptions();
_loggingEventHelper = new LoggingEventHelper(InternalLoggerName, DefaultFixFlags);
loggingEventHelper = new LoggingEventHelper(InternalLoggerName, DefaultFixFlags);
InitializeAppenders();
}
@@ -52,10 +68,10 @@ namespace Umbraco.Core.Logging
private void SetFixFlags(FixFlags newFixFlags)
{
if (newFixFlags != _fixFlags)
if (newFixFlags != fixFlags)
{
_loggingEventHelper.Fix = newFixFlags;
_fixFlags = newFixFlags;
loggingEventHelper.Fix = newFixFlags;
fixFlags = newFixFlags;
InitializeAppenders();
}
}
@@ -84,7 +100,7 @@ namespace Umbraco.Core.Logging
protected void ForwardInternalError(string message, Exception exception, Type thisType)
{
LogLog.Error(thisType, message, exception);
var loggingEvent = _loggingEventHelper.CreateLoggingEvent(Level.Error, message, exception);
var loggingEvent = loggingEventHelper.CreateLoggingEvent(Level.Error, message, exception);
ForwardLoggingEvent(loggingEvent, thisType);
}
@@ -1,6 +1,7 @@
using log4net.Core;
using log4net.Util;
using System;
using System.ComponentModel;
using System.Runtime.Remoting.Messaging;
using System.Security.Principal;
using System.Threading;
@@ -12,7 +13,11 @@ namespace Umbraco.Core.Logging
/// <summary>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// which is based on code by Chris Haines http://cjbhaines.wordpress.com/2012/02/13/asynchronous-log4net-appenders/
/// This is an old/deprecated logger and has been superceded by ParallelForwardingAppender which is included in Umbraco and
/// also by AsyncForwardingAppender in the Log4Net.Async library.
/// </summary>
[Obsolete("This is superceded by the ParallelForwardingAppender, this will be removed in v8")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class AsynchronousRollingFileAppender : RollingFileAppender
{
private RingBuffer<LoggingEvent> pendingAppends;
@@ -198,79 +203,4 @@ namespace Umbraco.Core.Logging
}
}
internal interface IQueue<T>
{
void Enqueue(T item);
bool TryDequeue(out T ret);
}
internal class RingBuffer<T> : IQueue<T>
{
private readonly object lockObject = new object();
private readonly T[] buffer;
private readonly int size;
private int readIndex = 0;
private int writeIndex = 0;
private bool bufferFull = false;
public int Size { get { return size; } }
public event Action<object, EventArgs> BufferOverflow;
public RingBuffer(int size)
{
this.size = size;
buffer = new T[size];
}
public void Enqueue(T item)
{
var bufferWasFull = false;
lock (lockObject)
{
buffer[writeIndex] = item;
writeIndex = (++writeIndex) % size;
if (bufferFull)
{
bufferWasFull = true;
readIndex = writeIndex;
}
else if (writeIndex == readIndex)
{
bufferFull = true;
}
}
if (bufferWasFull)
{
if (BufferOverflow != null)
{
BufferOverflow(this, EventArgs.Empty);
}
}
}
public bool TryDequeue(out T ret)
{
if (readIndex == writeIndex && !bufferFull)
{
ret = default(T);
return false;
}
lock (lockObject)
{
if (readIndex == writeIndex && !bufferFull)
{
ret = default(T);
return false;
}
ret = buffer[readIndex];
buffer[readIndex] = default(T);
readIndex = (++readIndex) % size;
bufferFull = false;
return true;
}
}
}
}
+12
View File
@@ -0,0 +1,12 @@
namespace Umbraco.Core.Logging
{
/// <summary>
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </summary>
/// <typeparam name="T"></typeparam>
internal interface IQueue<T>
{
void Enqueue(T item);
bool TryDequeue(out T ret);
}
}
@@ -0,0 +1,46 @@
namespace Umbraco.Core.Logging
{
using System;
using System.Runtime.CompilerServices;
using ImageProcessor.Common.Exceptions;
/// <summary>
/// A logger for explicitly logging ImageProcessor exceptions.
/// <remarks>
/// Creating this logger is enough for ImageProcessor to find and replace its in-built debug logger
/// without any additional configuration required. This class currently has to be public in order
/// to do so.
/// </remarks>
/// </summary>
public sealed class ImageProcessorLogger : ImageProcessor.Common.Exceptions.ILogger
{
/// <summary>
/// Logs the specified message as an error.
/// </summary>
/// <typeparam name="T">The type calling the logger.</typeparam>
/// <param name="text">The message to log.</param>
/// <param name="callerName">The property or method name calling the log.</param>
/// <param name="lineNumber">The line number where the method is called.</param>
public void Log<T>(string text, [CallerMemberName] string callerName = null, [CallerLineNumber] int lineNumber = 0)
{
// Using LogHelper since the ImageProcessor logger expects a parameterless constructor.
var message = string.Format("{0} {1} : {2}", callerName, lineNumber, text);
LogHelper.Error<T>(string.Empty, new ImageProcessingException(message));
}
/// <summary>
/// Logs the specified message as an error.
/// </summary>
/// <param name="type">The type calling the logger.</param>
/// <param name="text">The message to log.</param>
/// <param name="callerName">The property or method name calling the log.</param>
/// <param name="lineNumber">The line number where the method is called.</param>
public void Log(Type type, string text, [CallerMemberName] string callerName = null, [CallerLineNumber] int lineNumber = 0)
{
// Using LogHelper since the ImageProcessor logger expects a parameterless constructor.
var message = string.Format("{0} {1} : {2}", callerName, lineNumber, text);
LogHelper.Error(type, string.Empty, new ImageProcessingException(message));
}
}
}
@@ -3,15 +3,18 @@ using log4net.Core;
namespace Umbraco.Core.Logging
{
/// <remarks>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </remarks>
internal class LoggingEventContext
internal sealed class LoggingEventContext
{
public LoggingEventContext(LoggingEvent loggingEvent)
public LoggingEventContext(LoggingEvent loggingEvent, object httpContext)
{
LoggingEvent = loggingEvent;
HttpContext = httpContext;
}
public LoggingEvent LoggingEvent { get; set; }
public object HttpContext { get; set; }
}
}
@@ -4,9 +4,9 @@ using log4net.Core;
namespace Umbraco.Core.Logging
{
/// <remarks>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </remarks>
internal class LoggingEventHelper
internal sealed class LoggingEventHelper
{
// needs to be a seperate class so that location is determined correctly by log4net when required
@@ -23,8 +23,10 @@ namespace Umbraco.Core.Logging
public LoggingEvent CreateLoggingEvent(Level level, string message, Exception exception)
{
var loggingEvent = new LoggingEvent(HelperType, null, loggerName, level, message, exception);
loggingEvent.Fix = Fix;
var loggingEvent = new LoggingEvent(HelperType, null, loggerName, level, message, exception)
{
Fix = Fix
};
return loggingEvent;
}
}
@@ -1,9 +1,9 @@
using log4net.Core;
using log4net.Util;
using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using log4net.Core;
using log4net.Util;
namespace Umbraco.Core.Logging
{
@@ -11,7 +11,7 @@ namespace Umbraco.Core.Logging
/// An asynchronous appender based on <see cref="BlockingCollection{T}"/>
/// </summary>
/// <remarks>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </remarks>
public class ParallelForwardingAppender : AsyncForwardingAppenderBase, IDisposable
{
@@ -22,11 +22,11 @@ namespace Umbraco.Core.Logging
private CancellationTokenSource _loggingCancelationTokenSource;
private CancellationToken _loggingCancelationToken;
private Task _loggingTask;
private Double _shutdownFlushTimeout = 1;
private TimeSpan _shutdownFlushTimespan = TimeSpan.FromSeconds(1);
private Double _shutdownFlushTimeout = 2;
private TimeSpan _shutdownFlushTimespan = TimeSpan.FromSeconds(2);
private static readonly Type ThisType = typeof(ParallelForwardingAppender);
private volatile bool _shutDownRequested;
private int? _bufferSize = DefaultBufferSize;
private volatile bool shutDownRequested;
private int? bufferSize = DefaultBufferSize;
#endregion Private Members
@@ -37,8 +37,8 @@ namespace Umbraco.Core.Logging
/// </summary>
public override int? BufferSize
{
get { return _bufferSize; }
set { _bufferSize = value; }
get { return bufferSize; }
set { bufferSize = value; }
}
public int BufferEntryCount
@@ -67,7 +67,12 @@ namespace Umbraco.Core.Logging
protected override string InternalLoggerName
{
get { return "ParallelForwardingAppender"; }
get
{
{
return "ParallelForwardingAppender";
}
}
}
#endregion Properties
@@ -83,7 +88,7 @@ namespace Umbraco.Core.Logging
private void StartForwarding()
{
if (_shutDownRequested)
if (shutDownRequested)
{
return;
}
@@ -111,7 +116,7 @@ namespace Umbraco.Core.Logging
private void CompleteSubscriberTask()
{
_shutDownRequested = true;
shutDownRequested = true;
if (_loggingEvents == null || _loggingEvents.IsAddingCompleted)
{
return;
@@ -154,7 +159,7 @@ namespace Umbraco.Core.Logging
loggingEvent.Fix = Fix;
//In the case where blocking on a full collection, and the task is subsequently completed, the cancellation token
//will prevent the entry from attempting to add to the completed collection which would result in an exception.
_loggingEvents.Add(new LoggingEventContext(loggingEvent), _loggingCancelationToken);
_loggingEvents.Add(new LoggingEventContext(loggingEvent, HttpContext), _loggingCancelationToken);
}
protected override void Append(LoggingEvent[] loggingEvents)
@@ -187,6 +192,7 @@ namespace Umbraco.Core.Logging
//This call blocks until an item is available or until adding is completed
foreach (var entry in _loggingEvents.GetConsumingEnumerable(_loggingCancelationToken))
{
HttpContext = entry.HttpContext;
ForwardLoggingEvent(entry.LoggingEvent, ThisType);
}
}
+78
View File
@@ -0,0 +1,78 @@
using System;
namespace Umbraco.Core.Logging
{
/// <summary>
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </summary>
/// <typeparam name="T"></typeparam>
internal sealed class RingBuffer<T> : IQueue<T>
{
private readonly object lockObject = new object();
private readonly T[] buffer;
private readonly int size;
private int readIndex = 0;
private int writeIndex = 0;
private bool bufferFull = false;
public int Size { get { return size; } }
public event Action<object, EventArgs> BufferOverflow;
public RingBuffer(int size)
{
this.size = size;
buffer = new T[size];
}
public void Enqueue(T item)
{
var bufferWasFull = false;
lock (lockObject)
{
buffer[writeIndex] = item;
writeIndex = (++writeIndex) % size;
if (bufferFull)
{
bufferWasFull = true;
readIndex = writeIndex;
}
else if (writeIndex == readIndex)
{
bufferFull = true;
}
}
if (bufferWasFull)
{
if (BufferOverflow != null)
{
BufferOverflow(this, EventArgs.Empty);
}
}
}
public bool TryDequeue(out T ret)
{
if (readIndex == writeIndex && !bufferFull)
{
ret = default(T);
return false;
}
lock (lockObject)
{
if (readIndex == writeIndex && !bufferFull)
{
ret = default(T);
return false;
}
ret = buffer[readIndex];
buffer[readIndex] = default(T);
readIndex = (++readIndex) % size;
bufferFull = false;
return true;
}
}
}
}
+23 -72
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
@@ -75,14 +76,19 @@ namespace Umbraco.Core.Models
_contentType = contentType;
}
private static readonly PropertyInfo TemplateSelector = ExpressionHelper.GetPropertyInfo<Content, ITemplate>(x => x.Template);
private static readonly PropertyInfo PublishedSelector = ExpressionHelper.GetPropertyInfo<Content, bool>(x => x.Published);
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<Content, string>(x => x.Language);
private static readonly PropertyInfo ReleaseDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ReleaseDate);
private static readonly PropertyInfo ExpireDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ExpireDate);
private static readonly PropertyInfo WriterSelector = ExpressionHelper.GetPropertyInfo<Content, int>(x => x.WriterId);
private static readonly PropertyInfo NodeNameSelector = ExpressionHelper.GetPropertyInfo<Content, string>(x => x.NodeName);
private static readonly PropertyInfo PermissionsChangedSelector = ExpressionHelper.GetPropertyInfo<Content, bool>(x => x.PermissionsChanged);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo TemplateSelector = ExpressionHelper.GetPropertyInfo<Content, ITemplate>(x => x.Template);
public readonly PropertyInfo PublishedSelector = ExpressionHelper.GetPropertyInfo<Content, bool>(x => x.Published);
public readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<Content, string>(x => x.Language);
public readonly PropertyInfo ReleaseDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ReleaseDate);
public readonly PropertyInfo ExpireDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ExpireDate);
public readonly PropertyInfo WriterSelector = ExpressionHelper.GetPropertyInfo<Content, int>(x => x.WriterId);
public readonly PropertyInfo NodeNameSelector = ExpressionHelper.GetPropertyInfo<Content, string>(x => x.NodeName);
public readonly PropertyInfo PermissionsChangedSelector = ExpressionHelper.GetPropertyInfo<Content, bool>(x => x.PermissionsChanged);
}
/// <summary>
/// Gets or sets the template used by the Content.
@@ -96,14 +102,7 @@ namespace Umbraco.Core.Models
public virtual ITemplate Template
{
get { return _template; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_template = value;
return _template;
}, _template, TemplateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _template, Ps.Value.TemplateSelector); }
}
/// <summary>
@@ -141,31 +140,18 @@ namespace Umbraco.Core.Models
public bool Published
{
get { return _published; }
internal set
{
SetPropertyValueAndDetectChanges(o =>
{
_published = value;
return _published;
}, _published, PublishedSelector);
}
internal set { SetPropertyValueAndDetectChanges(value, ref _published, Ps.Value.PublishedSelector); }
}
/// <summary>
/// Language of the data contained within this Content object.
/// </summary>
[Obsolete("This is not used and will be removed from the codebase in future versions")]
[EditorBrowsable(EditorBrowsableState.Never)]
public string Language
{
get { return _language; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_language = value;
return _language;
}, _language, LanguageSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _language, Ps.Value.LanguageSelector); }
}
/// <summary>
@@ -175,14 +161,7 @@ namespace Umbraco.Core.Models
public DateTime? ReleaseDate
{
get { return _releaseDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_releaseDate = value;
return _releaseDate;
}, _releaseDate, ReleaseDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _releaseDate, Ps.Value.ReleaseDateSelector); }
}
/// <summary>
@@ -192,14 +171,7 @@ namespace Umbraco.Core.Models
public DateTime? ExpireDate
{
get { return _expireDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_expireDate = value;
return _expireDate;
}, _expireDate, ExpireDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _expireDate, Ps.Value.ExpireDateSelector); }
}
/// <summary>
@@ -209,14 +181,7 @@ namespace Umbraco.Core.Models
public virtual int WriterId
{
get { return _writer; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_writer = value;
return _writer;
}, _writer, WriterSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _writer, Ps.Value.WriterSelector); }
}
/// <summary>
@@ -229,14 +194,7 @@ namespace Umbraco.Core.Models
internal string NodeName
{
get { return _nodeName; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_nodeName = value;
return _nodeName;
}, _nodeName, NodeNameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _nodeName, Ps.Value.NodeNameSelector); }
}
/// <summary>
@@ -246,14 +204,7 @@ namespace Umbraco.Core.Models
internal bool PermissionsChanged
{
get { return _permissionsChanged; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_permissionsChanged = value;
return _permissionsChanged;
}, _permissionsChanged, PermissionsChangedSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _permissionsChanged, Ps.Value.PermissionsChangedSelector); }
}
/// <summary>
+23 -67
View File
@@ -81,19 +81,24 @@ namespace Umbraco.Core.Models
_additionalData = new Dictionary<string, object>();
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<ContentBase, string>(x => x.Name);
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.ParentId);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.SortOrder);
private static readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.Level);
private static readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<ContentBase, string>(x => x.Path);
private static readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.CreatorId);
private static readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<ContentBase, bool>(x => x.Trashed);
private static readonly PropertyInfo DefaultContentTypeIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.ContentTypeId);
private readonly static PropertyInfo PropertyCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentBase, PropertyCollection>(x => x.Properties);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<ContentBase, string>(x => x.Name);
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.ParentId);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.SortOrder);
public readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.Level);
public readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<ContentBase, string>(x => x.Path);
public readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.CreatorId);
public readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<ContentBase, bool>(x => x.Trashed);
public readonly PropertyInfo DefaultContentTypeIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.ContentTypeId);
public readonly PropertyInfo PropertyCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentBase, PropertyCollection>(x => x.Properties);
}
protected void PropertiesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertyCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyCollectionSelector);
}
/// <summary>
@@ -114,7 +119,7 @@ namespace Umbraco.Core.Models
set
{
_parentId = new Lazy<int>(() => value);
OnPropertyChanged(ParentIdSelector);
OnPropertyChanged(Ps.Value.ParentIdSelector);
}
}
@@ -125,14 +130,7 @@ namespace Umbraco.Core.Models
public virtual string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -142,14 +140,7 @@ namespace Umbraco.Core.Models
public virtual int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -159,14 +150,7 @@ namespace Umbraco.Core.Models
public virtual int Level
{
get { return _level; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_level = value;
return _level;
}, _level, LevelSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _level, Ps.Value.LevelSelector); }
}
/// <summary>
@@ -176,14 +160,7 @@ namespace Umbraco.Core.Models
public virtual string Path //Setting this value should be handled by the class not the user
{
get { return _path; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_path = value;
return _path;
}, _path, PathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _path, Ps.Value.PathSelector); }
}
/// <summary>
@@ -193,14 +170,7 @@ namespace Umbraco.Core.Models
public virtual int CreatorId
{
get { return _creatorId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_creatorId = value;
return _creatorId;
}, _creatorId, CreatorIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _creatorId, Ps.Value.CreatorIdSelector); }
}
/// <summary>
@@ -212,14 +182,7 @@ namespace Umbraco.Core.Models
public virtual bool Trashed //Setting this value should be handled by the class not the user
{
get { return _trashed; }
internal set
{
SetPropertyValueAndDetectChanges(o =>
{
_trashed = value;
return _trashed;
}, _trashed, TrashedSelector);
}
internal set { SetPropertyValueAndDetectChanges(value, ref _trashed, Ps.Value.TrashedSelector); }
}
/// <summary>
@@ -244,14 +207,7 @@ namespace Umbraco.Core.Models
}
return _contentTypeId;
}
protected set
{
SetPropertyValueAndDetectChanges(o =>
{
_contentTypeId = value;
return _contentTypeId;
}, _contentTypeId, DefaultContentTypeIdSelector);
}
protected set { SetPropertyValueAndDetectChanges(value, ref _contentTypeId, Ps.Value.DefaultContentTypeIdSelector); }
}
/// <summary>
+9 -15
View File
@@ -48,8 +48,13 @@ namespace Umbraco.Core.Models
_allowedTemplates = new List<ITemplate>();
}
private static readonly PropertyInfo DefaultTemplateSelector = ExpressionHelper.GetPropertyInfo<ContentType, int>(x => x.DefaultTemplateId);
private static readonly PropertyInfo AllowedTemplatesSelector = ExpressionHelper.GetPropertyInfo<ContentType, IEnumerable<ITemplate>>(x => x.AllowedTemplates);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo DefaultTemplateSelector = ExpressionHelper.GetPropertyInfo<ContentType, int>(x => x.DefaultTemplateId);
public readonly PropertyInfo AllowedTemplatesSelector = ExpressionHelper.GetPropertyInfo<ContentType, IEnumerable<ITemplate>>(x => x.AllowedTemplates);
}
/// <summary>
/// Gets or sets the alias of the default Template.
@@ -70,14 +75,7 @@ namespace Umbraco.Core.Models
internal int DefaultTemplateId
{
get { return _defaultTemplate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_defaultTemplate = value;
return _defaultTemplate;
}, _defaultTemplate, DefaultTemplateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _defaultTemplate, Ps.Value.DefaultTemplateSelector); }
}
/// <summary>
@@ -92,11 +90,7 @@ namespace Umbraco.Core.Models
get { return _allowedTemplates; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_allowedTemplates = value;
return _allowedTemplates;
}, _allowedTemplates, AllowedTemplatesSelector,
SetPropertyValueAndDetectChanges(value, ref _allowedTemplates, Ps.Value.AllowedTemplatesSelector,
//Custom comparer for enumerable
new DelegateEqualityComparer<IEnumerable<ITemplate>>(
(templates, enumerable) => templates.UnsortedSequenceEqual(enumerable),
+47 -128
View File
@@ -67,33 +67,38 @@ namespace Umbraco.Core.Models
_additionalData = new Dictionary<string, object>();
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Name);
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.ParentId);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.SortOrder);
private static readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.Level);
private static readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Path);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Alias);
private static readonly PropertyInfo DescriptionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Description);
private static readonly PropertyInfo IconSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Icon);
private static readonly PropertyInfo ThumbnailSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Thumbnail);
private static readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.CreatorId);
private static readonly PropertyInfo AllowedAsRootSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.AllowedAsRoot);
private static readonly PropertyInfo IsContainerSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.IsContainer);
private static readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.Trashed);
private static readonly PropertyInfo AllowedContentTypesSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<ContentTypeSort>>(x => x.AllowedContentTypes);
private static readonly PropertyInfo PropertyGroupCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, PropertyGroupCollection>(x => x.PropertyGroups);
private static readonly PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<PropertyType>>(x => x.PropertyTypes);
private static readonly PropertyInfo HasPropertyTypeBeenRemovedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.HasPropertyTypeBeenRemoved);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Name);
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.ParentId);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.SortOrder);
public readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.Level);
public readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Path);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Alias);
public readonly PropertyInfo DescriptionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Description);
public readonly PropertyInfo IconSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Icon);
public readonly PropertyInfo ThumbnailSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Thumbnail);
public readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.CreatorId);
public readonly PropertyInfo AllowedAsRootSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.AllowedAsRoot);
public readonly PropertyInfo IsContainerSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.IsContainer);
public readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.Trashed);
public readonly PropertyInfo AllowedContentTypesSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<ContentTypeSort>>(x => x.AllowedContentTypes);
public readonly PropertyInfo PropertyGroupCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, PropertyGroupCollection>(x => x.PropertyGroups);
public readonly PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<PropertyType>>(x => x.PropertyTypes);
public readonly PropertyInfo HasPropertyTypeBeenRemovedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.HasPropertyTypeBeenRemoved);
}
protected void PropertyGroupsChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertyGroupCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyGroupCollectionSelector);
}
protected void PropertyTypesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertyTypeCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyTypeCollectionSelector);
}
/// <summary>
@@ -115,7 +120,7 @@ namespace Umbraco.Core.Models
set
{
_parentId = new Lazy<int>(() => value);
OnPropertyChanged(ParentIdSelector);
OnPropertyChanged(Ps.Value.ParentIdSelector);
}
}
@@ -126,14 +131,7 @@ namespace Umbraco.Core.Models
public virtual string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -143,14 +141,7 @@ namespace Umbraco.Core.Models
public virtual int Level //NOTE Is this relevant for a ContentType?
{
get { return _level; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_level = value;
return _level;
}, _level, LevelSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _level, Ps.Value.LevelSelector); }
}
/// <summary>
@@ -160,14 +151,7 @@ namespace Umbraco.Core.Models
public virtual string Path //NOTE Is this relevant for a ContentType?
{
get { return _path; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_path = value;
return _path;
}, _path, PathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _path, Ps.Value.PathSelector); }
}
/// <summary>
@@ -179,12 +163,10 @@ namespace Umbraco.Core.Models
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
//_alias = value.ToSafeAlias();
_alias = value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase);
return _alias;
}, _alias, AliasSelector);
SetPropertyValueAndDetectChanges(
value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase),
ref _alias,
Ps.Value.AliasSelector);
}
}
@@ -195,14 +177,7 @@ namespace Umbraco.Core.Models
public virtual string Description
{
get { return _description; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_description = value;
return _description;
}, _description, DescriptionSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _description, Ps.Value.DescriptionSelector); }
}
/// <summary>
@@ -212,14 +187,7 @@ namespace Umbraco.Core.Models
public virtual int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -229,14 +197,7 @@ namespace Umbraco.Core.Models
public virtual string Icon
{
get { return _icon; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_icon = value;
return _icon;
}, _icon, IconSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _icon, Ps.Value.IconSelector); }
}
/// <summary>
@@ -246,14 +207,7 @@ namespace Umbraco.Core.Models
public virtual string Thumbnail
{
get { return _thumbnail; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_thumbnail = value;
return _thumbnail;
}, _thumbnail, ThumbnailSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _thumbnail, Ps.Value.ThumbnailSelector); }
}
/// <summary>
@@ -263,14 +217,7 @@ namespace Umbraco.Core.Models
public virtual int CreatorId
{
get { return _creatorId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_creatorId = value;
return _creatorId;
}, _creatorId, CreatorIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _creatorId, Ps.Value.CreatorIdSelector); }
}
/// <summary>
@@ -280,14 +227,7 @@ namespace Umbraco.Core.Models
public virtual bool AllowedAsRoot
{
get { return _allowedAsRoot; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_allowedAsRoot = value;
return _allowedAsRoot;
}, _allowedAsRoot, AllowedAsRootSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _allowedAsRoot, Ps.Value.AllowedAsRootSelector); }
}
/// <summary>
@@ -300,14 +240,7 @@ namespace Umbraco.Core.Models
public virtual bool IsContainer
{
get { return _isContainer; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isContainer = value;
return _isContainer;
}, _isContainer, IsContainerSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isContainer, Ps.Value.IsContainerSelector); }
}
/// <summary>
@@ -318,14 +251,7 @@ namespace Umbraco.Core.Models
public virtual bool Trashed //NOTE Is this relevant for a ContentType?
{
get { return _trashed; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_trashed = value;
return _trashed;
}, _trashed, TrashedSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _trashed, Ps.Value.TrashedSelector); }
}
private IDictionary<string, object> _additionalData;
@@ -347,15 +273,11 @@ namespace Umbraco.Core.Models
get { return _allowedContentTypes; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_allowedContentTypes = value;
return _allowedContentTypes;
}, _allowedContentTypes, AllowedContentTypesSelector,
SetPropertyValueAndDetectChanges(value, ref _allowedContentTypes, Ps.Value.AllowedContentTypesSelector,
//Custom comparer for enumerable
new DelegateEqualityComparer<IEnumerable<ContentTypeSort>>(
(sorts, enumerable) => sorts.UnsortedSequenceEqual(enumerable),
sorts => sorts.GetHashCode()));
sorts => sorts.GetHashCode()));
}
}
@@ -418,7 +340,7 @@ namespace Umbraco.Core.Models
private set
{
_hasPropertyTypeBeenRemoved = value;
OnPropertyChanged(HasPropertyTypeBeenRemovedSelector);
OnPropertyChanged(Ps.Value.HasPropertyTypeBeenRemovedSelector);
}
}
@@ -487,11 +409,8 @@ namespace Umbraco.Core.Models
var oldPropertyGroup = PropertyGroups.FirstOrDefault(x =>
x.PropertyTypes.Any(y => y.Alias == propertyTypeAlias));
// reset PropertyGroupId, which will be re-evaluated when the content type
// is saved - what is important is group.PropertyTypes - see code in
// ContentTypeBaseRepository.PersistUpdatedBaseContentType
propertyType.PropertyGroupId = new Lazy<int>(() => default(int));
propertyType.ResetDirtyProperties(); // PropertyGroupId must not be dirty
// set new group
propertyType.PropertyGroupId = newPropertyGroup == null ? null : new Lazy<int>(() => newPropertyGroup.Id, false);
// remove from old group, if any - add to new group, if any
if (oldPropertyGroup != null)
@@ -540,13 +459,13 @@ namespace Umbraco.Core.Models
// re-assign the group's properties to no group
foreach (var property in group.PropertyTypes)
{
property.PropertyGroupId = new Lazy<int>(() => 0);
property.PropertyGroupId = null;
_propertyTypes.Add(property);
}
// actually remove the group
PropertyGroups.RemoveItem(propertyGroupName);
OnPropertyChanged(PropertyGroupCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyGroupCollectionSelector);
}
/// <summary>
@@ -32,9 +32,13 @@ namespace Umbraco.Core.Models
AddContentType(parent);
}
private static readonly PropertyInfo ContentTypeCompositionSelector =
ExpressionHelper.GetPropertyInfo<ContentTypeCompositionBase, IEnumerable<IContentTypeComposition>>(
x => x.ContentTypeComposition);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ContentTypeCompositionSelector =
ExpressionHelper.GetPropertyInfo<ContentTypeCompositionBase, IEnumerable<IContentTypeComposition>>(x => x.ContentTypeComposition);
}
/// <summary>
/// Gets or sets the content types that compose this content type.
@@ -46,7 +50,7 @@ namespace Umbraco.Core.Models
set
{
_contentTypeComposition = value.ToList();
OnPropertyChanged(ContentTypeCompositionSelector);
OnPropertyChanged(Ps.Value.ContentTypeCompositionSelector);
}
}
@@ -102,7 +106,7 @@ namespace Umbraco.Core.Models
throw new InvalidCompositionException(Alias, contentType.Alias, conflictingPropertyTypeAliases.ToArray());
_contentTypeComposition.Add(contentType);
OnPropertyChanged(ContentTypeCompositionSelector);
OnPropertyChanged(Ps.Value.ContentTypeCompositionSelector);
return true;
}
return false;
@@ -128,7 +132,7 @@ namespace Umbraco.Core.Models
if (compositionIdsToRemove.Any())
RemovedContentTypeKeyTracker.AddRange(compositionIdsToRemove);
OnPropertyChanged(ContentTypeCompositionSelector);
OnPropertyChanged(Ps.Value.ContentTypeCompositionSelector);
return _contentTypeComposition.Remove(contentTypeComposition);
}
return false;
@@ -6,10 +6,6 @@ namespace Umbraco.Core.Models
/// <summary>
/// Enum of the various DbTypes for which the Property values are stored
/// </summary>
/// <remarks>
/// Object is added to support complex values from PropertyEditors,
/// but will be saved under the Ntext column.
/// </remarks>
[Serializable]
[DataContract]
public enum DataTypeDatabaseType
+23 -73
View File
@@ -65,15 +65,20 @@ namespace Umbraco.Core.Models
_additionalData = new Dictionary<string, object>();
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.Name);
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.ParentId);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.SortOrder);
private static readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.Level);
private static readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.Path);
private static readonly PropertyInfo UserIdSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.CreatorId);
private static readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, bool>(x => x.Trashed);
private static readonly PropertyInfo PropertyEditorAliasSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.PropertyEditorAlias);
private static readonly PropertyInfo DatabaseTypeSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, DataTypeDatabaseType>(x => x.DatabaseType);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.Name);
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.ParentId);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.SortOrder);
public readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.Level);
public readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.Path);
public readonly PropertyInfo UserIdSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.CreatorId);
public readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, bool>(x => x.Trashed);
public readonly PropertyInfo PropertyEditorAliasSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.PropertyEditorAlias);
public readonly PropertyInfo DatabaseTypeSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, DataTypeDatabaseType>(x => x.DatabaseType);
}
/// <summary>
/// Gets or sets the Id of the Parent entity
@@ -83,14 +88,7 @@ namespace Umbraco.Core.Models
public int ParentId
{
get { return _parentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_parentId = value;
return _parentId;
}, _parentId, ParentIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _parentId, Ps.Value.ParentIdSelector); }
}
/// <summary>
@@ -100,14 +98,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -117,14 +108,7 @@ namespace Umbraco.Core.Models
public int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -134,14 +118,7 @@ namespace Umbraco.Core.Models
public int Level
{
get { return _level; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_level = value;
return _level;
}, _level, LevelSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _level, Ps.Value.LevelSelector); }
}
/// <summary>
@@ -151,14 +128,7 @@ namespace Umbraco.Core.Models
public string Path //Setting this value should be handled by the class not the user
{
get { return _path; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_path = value;
return _path;
}, _path, PathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _path, Ps.Value.PathSelector); }
}
/// <summary>
@@ -168,14 +138,7 @@ namespace Umbraco.Core.Models
public int CreatorId
{
get { return _creatorId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_creatorId = value;
return _creatorId;
}, _creatorId, UserIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _creatorId, Ps.Value.UserIdSelector); }
}
//NOTE: SD: Why do we have this ??
@@ -189,11 +152,7 @@ namespace Umbraco.Core.Models
get { return _trashed; }
internal set
{
SetPropertyValueAndDetectChanges(o =>
{
_trashed = value;
return _trashed;
}, _trashed, TrashedSelector);
SetPropertyValueAndDetectChanges(value, ref _trashed, Ps.Value.TrashedSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
_additionalData["Trashed"] = value;
}
@@ -205,11 +164,7 @@ namespace Umbraco.Core.Models
get { return _propertyEditorAlias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_propertyEditorAlias = value;
return _propertyEditorAlias;
}, _propertyEditorAlias, PropertyEditorAliasSelector);
SetPropertyValueAndDetectChanges(value, ref _propertyEditorAlias, Ps.Value.PropertyEditorAliasSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
_additionalData["DatabaseType"] = value;
}
@@ -245,12 +200,7 @@ namespace Umbraco.Core.Models
get { return _databaseType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_databaseType = value;
return _databaseType;
}, _databaseType, DatabaseTypeSelector);
SetPropertyValueAndDetectChanges(value, ref _databaseType, Ps.Value.DatabaseTypeSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
_additionalData["DatabaseType"] = value;
}
+18 -31
View File
@@ -30,9 +30,14 @@ namespace Umbraco.Core.Models
_translations = new List<IDictionaryTranslation>();
}
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, Guid?>(x => x.ParentId);
private static readonly PropertyInfo ItemKeySelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, string>(x => x.ItemKey);
private static readonly PropertyInfo TranslationsSelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, IEnumerable<IDictionaryTranslation>>(x => x.Translations);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, Guid?>(x => x.ParentId);
public readonly PropertyInfo ItemKeySelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, string>(x => x.ItemKey);
public readonly PropertyInfo TranslationsSelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, IEnumerable<IDictionaryTranslation>>(x => x.Translations);
}
/// <summary>
/// Gets or Sets the Parent Id of the Dictionary Item
@@ -41,14 +46,7 @@ namespace Umbraco.Core.Models
public Guid? ParentId
{
get { return _parentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_parentId = value;
return _parentId;
}, _parentId, ParentIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _parentId, Ps.Value.ParentIdSelector); }
}
/// <summary>
@@ -58,14 +56,7 @@ namespace Umbraco.Core.Models
public string ItemKey
{
get { return _itemKey; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_itemKey = value;
return _itemKey;
}, _itemKey, ItemKeySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _itemKey, Ps.Value.ItemKeySelector); }
}
/// <summary>
@@ -77,25 +68,21 @@ namespace Umbraco.Core.Models
get { return _translations; }
set
{
SetPropertyValueAndDetectChanges(o =>
var asArray = value.ToArray();
//ensure the language callback is set on each translation
if (GetLanguage != null)
{
var asArray = value.ToArray();
//ensure the language callback is set on each translation
if (GetLanguage != null)
foreach (var translation in asArray.OfType<DictionaryTranslation>())
{
foreach (var translation in asArray.OfType<DictionaryTranslation>())
{
translation.GetLanguage = GetLanguage;
}
translation.GetLanguage = GetLanguage;
}
}
_translations = asArray;
return _translations;
}, _translations, TranslationsSelector,
SetPropertyValueAndDetectChanges(asArray, ref _translations, Ps.Value.TranslationsSelector,
//Custom comparer for enumerable
new DelegateEqualityComparer<IEnumerable<IDictionaryTranslation>>(
(enumerable, translations) => enumerable.UnsortedSequenceEqual(translations),
enumerable => enumerable.GetHashCode()));
enumerable => enumerable.GetHashCode()));
}
}
}
@@ -19,7 +19,7 @@ namespace Umbraco.Core.Models
private string _value;
//note: this will be memberwise cloned
private int _languageId;
public DictionaryTranslation(ILanguage language, string value)
{
if (language == null) throw new ArgumentNullException("language");
@@ -50,8 +50,13 @@ namespace Umbraco.Core.Models
Key = uniqueId;
}
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, ILanguage>(x => x.Language);
private static readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, string>(x => x.Value);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, ILanguage>(x => x.Language);
public readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, string>(x => x.Value);
}
/// <summary>
/// Gets or sets the <see cref="Language"/> for the translation
@@ -79,12 +84,8 @@ namespace Umbraco.Core.Models
}
set
{
SetPropertyValueAndDetectChanges(o =>
{
_language = value;
_languageId = _language == null ? -1 : _language.Id;
return _language;
}, _language, LanguageSelector);
SetPropertyValueAndDetectChanges(value, ref _language, Ps.Value.LanguageSelector);
_languageId = _language == null ? -1 : _language.Id;
}
}
@@ -100,14 +101,7 @@ namespace Umbraco.Core.Models
public string Value
{
get { return _value; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_value = value;
return _value;
}, _value, ValueSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _value, Ps.Value.ValueSelector); }
}
public override object DeepClone()
+19 -57
View File
@@ -23,13 +23,17 @@ namespace Umbraco.Core.Models.EntityBase
private DateTime _updateDate;
private bool _wasCancelled;
private static readonly PropertyInfo IdSelector = ExpressionHelper.GetPropertyInfo<Entity, int>(x => x.Id);
private static readonly PropertyInfo KeySelector = ExpressionHelper.GetPropertyInfo<Entity, Guid>(x => x.Key);
private static readonly PropertyInfo CreateDateSelector = ExpressionHelper.GetPropertyInfo<Entity, DateTime>(x => x.CreateDate);
private static readonly PropertyInfo UpdateDateSelector = ExpressionHelper.GetPropertyInfo<Entity, DateTime>(x => x.UpdateDate);
private static readonly PropertyInfo HasIdentitySelector = ExpressionHelper.GetPropertyInfo<Entity, bool>(x => x.HasIdentity);
private static readonly PropertyInfo WasCancelledSelector = ExpressionHelper.GetPropertyInfo<Entity, bool>(x => x.WasCancelled);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo IdSelector = ExpressionHelper.GetPropertyInfo<Entity, int>(x => x.Id);
public readonly PropertyInfo KeySelector = ExpressionHelper.GetPropertyInfo<Entity, Guid>(x => x.Key);
public readonly PropertyInfo CreateDateSelector = ExpressionHelper.GetPropertyInfo<Entity, DateTime>(x => x.CreateDate);
public readonly PropertyInfo UpdateDateSelector = ExpressionHelper.GetPropertyInfo<Entity, DateTime>(x => x.UpdateDate);
public readonly PropertyInfo HasIdentitySelector = ExpressionHelper.GetPropertyInfo<Entity, bool>(x => x.HasIdentity);
public readonly PropertyInfo WasCancelledSelector = ExpressionHelper.GetPropertyInfo<Entity, bool>(x => x.WasCancelled);
}
/// <summary>
/// Integer Id
@@ -37,18 +41,11 @@ namespace Umbraco.Core.Models.EntityBase
[DataMember]
public int Id
{
get
{
return _id;
}
get { return _id; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_id = value;
HasIdentity = true; //set the has Identity
return _id;
}, _id, IdSelector);
SetPropertyValueAndDetectChanges(value, ref _id, Ps.Value.IdSelector);
HasIdentity = true; //set the has Identity
}
}
@@ -67,14 +64,7 @@ namespace Umbraco.Core.Models.EntityBase
_key = Guid.NewGuid();
return _key;
}
set
{
SetPropertyValueAndDetectChanges(o =>
{
_key = value;
return _key;
}, _key, KeySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _key, Ps.Value.KeySelector); }
}
/// <summary>
@@ -84,14 +74,7 @@ namespace Umbraco.Core.Models.EntityBase
public DateTime CreateDate
{
get { return _createDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_createDate = value;
return _createDate;
}, _createDate, CreateDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _createDate, Ps.Value.CreateDateSelector); }
}
/// <summary>
@@ -105,14 +88,7 @@ namespace Umbraco.Core.Models.EntityBase
internal bool WasCancelled
{
get { return _wasCancelled; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_wasCancelled = value;
return _wasCancelled;
}, _wasCancelled, WasCancelledSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _wasCancelled, Ps.Value.WasCancelledSelector); }
}
/// <summary>
@@ -122,14 +98,7 @@ namespace Umbraco.Core.Models.EntityBase
public DateTime UpdateDate
{
get { return _updateDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_updateDate = value;
return _updateDate;
}, _updateDate, UpdateDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _updateDate, Ps.Value.UpdateDateSelector); }
}
internal virtual void ResetIdentity()
@@ -166,14 +135,7 @@ namespace Umbraco.Core.Models.EntityBase
{
return _hasIdentity;
}
protected set
{
SetPropertyValueAndDetectChanges(o =>
{
_hasIdentity = value;
return _hasIdentity;
}, _hasIdentity, HasIdentitySelector);
}
protected set { SetPropertyValueAndDetectChanges(value, ref _hasIdentity, Ps.Value.HasIdentitySelector); }
}
//TODO: Make this NOT virtual or even exist really!
@@ -18,7 +18,9 @@ namespace Umbraco.Core.Models.EntityBase
//TODO: This needs to go on to ICanBeDirty http://issues.umbraco.org/issue/U4-5662
public virtual IEnumerable<string> GetDirtyProperties()
{
return _propertyChangedInfo.Where(x => x.Value).Select(x => x.Key);
return _propertyChangedInfo == null
? Enumerable.Empty<string>()
: _propertyChangedInfo.Where(x => x.Value).Select(x => x.Key);
}
private bool _changeTrackingEnabled = true;
@@ -26,12 +28,12 @@ namespace Umbraco.Core.Models.EntityBase
/// <summary>
/// Tracks the properties that have changed
/// </summary>
private IDictionary<string, bool> _propertyChangedInfo = new Dictionary<string, bool>();
private IDictionary<string, bool> _propertyChangedInfo;
/// <summary>
/// Tracks the properties that we're changed before the last commit (or last call to ResetDirtyProperties)
/// </summary>
private IDictionary<string, bool> _lastPropertyChangedInfo = null;
private IDictionary<string, bool> _lastPropertyChangedInfo;
/// <summary>
/// Property changed event
@@ -47,12 +49,13 @@ namespace Umbraco.Core.Models.EntityBase
//return if we're not tracking changes
if (_changeTrackingEnabled == false) return;
if (_propertyChangedInfo == null)
_propertyChangedInfo = new Dictionary<string, bool>();
_propertyChangedInfo[propertyInfo.Name] = true;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyInfo.Name));
}
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyInfo.Name));
}
/// <summary>
@@ -62,7 +65,7 @@ namespace Umbraco.Core.Models.EntityBase
/// <returns>True if Property is dirty, otherwise False</returns>
public virtual bool IsPropertyDirty(string propertyName)
{
return _propertyChangedInfo.Any(x => x.Key == propertyName);
return _propertyChangedInfo != null && _propertyChangedInfo.Any(x => x.Key == propertyName);
}
/// <summary>
@@ -71,7 +74,7 @@ namespace Umbraco.Core.Models.EntityBase
/// <returns>True if entity is dirty, otherwise False</returns>
public virtual bool IsDirty()
{
return _propertyChangedInfo.Any();
return _propertyChangedInfo != null && _propertyChangedInfo.Any();
}
/// <summary>
@@ -90,7 +93,7 @@ namespace Umbraco.Core.Models.EntityBase
/// <returns>True if Property was changed, otherwise False. Returns false if the entity had not been previously changed.</returns>
public virtual bool WasPropertyDirty(string propertyName)
{
return WasDirty() && _lastPropertyChangedInfo.Any(x => x.Key == propertyName);
return _lastPropertyChangedInfo != null && _lastPropertyChangedInfo.Any(x => x.Key == propertyName);
}
/// <summary>
@@ -100,7 +103,7 @@ namespace Umbraco.Core.Models.EntityBase
{
//NOTE: We cannot .Clear() because when we memberwise clone this will be the SAME
// instance as the one on the clone, so we need to create a new instance.
_lastPropertyChangedInfo = new Dictionary<string, bool>();
_lastPropertyChangedInfo = null;
}
/// <summary>
@@ -130,26 +133,29 @@ namespace Umbraco.Core.Models.EntityBase
if (rememberPreviouslyChangedProperties)
{
//copy the changed properties to the last changed properties
_lastPropertyChangedInfo = _propertyChangedInfo.ToDictionary(v => v.Key, v => v.Value);
if (_propertyChangedInfo != null)
{
_lastPropertyChangedInfo = _propertyChangedInfo.ToDictionary(v => v.Key, v => v.Value);
}
}
//NOTE: We cannot .Clear() because when we memberwise clone this will be the SAME
// instance as the one on the clone, so we need to create a new instance.
_propertyChangedInfo = new Dictionary<string, bool>();
_propertyChangedInfo = null;
}
protected void ResetChangeTrackingCollections()
public void ResetChangeTrackingCollections()
{
_propertyChangedInfo = new Dictionary<string, bool>();
_lastPropertyChangedInfo = new Dictionary<string, bool>();
_propertyChangedInfo = null;
_lastPropertyChangedInfo = null;
}
protected void DisableChangeTracking()
public void DisableChangeTracking()
{
_changeTrackingEnabled = false;
}
protected void EnableChangeTracking()
public void EnableChangeTracking()
{
_changeTrackingEnabled = true;
}
@@ -158,60 +164,61 @@ namespace Umbraco.Core.Models.EntityBase
/// Used by inheritors to set the value of properties, this will detect if the property value actually changed and if it did
/// it will ensure that the property has a dirty flag set.
/// </summary>
/// <param name="setValue"></param>
/// <param name="value"></param>
/// <param name="newVal"></param>
/// <param name="origVal"></param>
/// <param name="propertySelector"></param>
/// <returns>returns true if the value changed</returns>
/// <remarks>
/// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we
/// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set
/// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we
/// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set
/// to the same value, so it's really not dirty.
/// </remarks>
internal bool SetPropertyValueAndDetectChanges<T>(Func<T, T> setValue, T value, PropertyInfo propertySelector)
internal void SetPropertyValueAndDetectChanges<T>(T newVal, ref T origVal, PropertyInfo propertySelector)
{
if ((typeof(T) == typeof(string) == false) && TypeHelper.IsTypeAssignableFrom<IEnumerable>(typeof(T)))
{
throw new InvalidOperationException("This method does not support IEnumerable instances. For IEnumerable instances a manual custom equality check will be required");
}
return SetPropertyValueAndDetectChanges(setValue, value, propertySelector,
new DelegateEqualityComparer<T>(
//Standard Equals comparison
(arg1, arg2) => Equals(arg1, arg2),
arg => arg.GetHashCode()));
SetPropertyValueAndDetectChanges(newVal, ref origVal, propertySelector, EqualityComparer<T>.Default);
}
/// <summary>
/// Used by inheritors to set the value of properties, this will detect if the property value actually changed and if it did
/// it will ensure that the property has a dirty flag set.
/// </summary>
/// <param name="setValue"></param>
/// <param name="value"></param>
/// <param name="newVal"></param>
/// <param name="origVal"></param>
/// <param name="propertySelector"></param>
/// <param name="comparer">The equality comparer to use</param>
/// <returns>returns true if the value changed</returns>
/// <remarks>
/// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we
/// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set
/// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we
/// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set
/// to the same value, so it's really not dirty.
/// </remarks>
internal bool SetPropertyValueAndDetectChanges<T>(Func<T, T> setValue, T value, PropertyInfo propertySelector, IEqualityComparer<T> comparer)
internal void SetPropertyValueAndDetectChanges<T>(T newVal, ref T origVal, PropertyInfo propertySelector, IEqualityComparer<T> comparer)
{
var initVal = value;
var newVal = setValue(value);
//don't track changes, just set the value (above)
if (_changeTrackingEnabled == false) return false;
if (comparer.Equals(initVal, newVal) == false)
//don't track changes, just set the value
if (_changeTrackingEnabled == false)
{
OnPropertyChanged(propertySelector);
return true;
//set the original value
origVal = newVal;
}
else
{
//check changed
var changed = comparer.Equals(origVal, newVal) == false;
//set the original value
origVal = newVal;
//raise the event if it was changed
if (changed)
{
OnPropertyChanged(propertySelector);
}
}
return false;
}
}
}
+12 -12
View File
@@ -33,8 +33,14 @@ namespace Umbraco.Core.Models
_content = getFileContent != null ? null : string.Empty;
}
private static readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<File, string>(x => x.Content);
private static readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<File, string>(x => x.Path);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<File, string>(x => x.Content);
public readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<File, string>(x => x.Path);
}
private string _alias;
private string _name;
@@ -87,11 +93,7 @@ namespace Umbraco.Core.Models
_alias = null;
_name = null;
SetPropertyValueAndDetectChanges(o =>
{
_path = SanitizePath(value);
return _path;
}, _path, PathSelector);
SetPropertyValueAndDetectChanges(SanitizePath(value), ref _path, Ps.Value.PathSelector);
}
}
@@ -131,11 +133,9 @@ namespace Umbraco.Core.Models
}
set
{
SetPropertyValueAndDetectChanges(o =>
{
_content = value ?? string.Empty; // cannot set to null
return _content;
}, _content, ContentSelector);
SetPropertyValueAndDetectChanges(
value ?? string.Empty, // cannot set to null
ref _content, Ps.Value.ContentSelector);
}
}
+2
View File
@@ -1,4 +1,5 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using Umbraco.Core.Persistence.Mappers;
@@ -21,6 +22,7 @@ namespace Umbraco.Core.Models
bool Published { get; }
[Obsolete("This will be removed in future versions")]
[EditorBrowsable(EditorBrowsableState.Never)]
string Language { get; set; }
/// <summary>
+7 -1
View File
@@ -7,6 +7,12 @@ namespace Umbraco.Core.Models
/// </summary
public interface IMediaType : IContentTypeComposition
{
/// <summary>
/// Creates a deep clone of the current entity with its identity/alias and it's property identities reset
/// </summary>
/// <param name="newAlias"></param>
/// <returns></returns>
IMediaType DeepCloneWithResetIdentities(string newAlias);
}
}
+37
View File
@@ -0,0 +1,37 @@
using System;
using System.Runtime.Serialization;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents a redirect url.
/// </summary>
public interface IRedirectUrl : IAggregateRoot, IRememberBeingDirty
{
/// <summary>
/// Gets or sets the identifier of the content item.
/// </summary>
[DataMember]
int ContentId { get; set; }
/// <summary>
/// Gets or sets the unique key identifying the content item.
/// </summary>
[DataMember]
Guid ContentKey { get; set; }
/// <summary>
/// Gets or sets the redirect url creation date.
/// </summary>
[DataMember]
DateTime CreateDateUtc { get; set; }
/// <summary>
/// Gets or sets the redirect url route.
/// </summary>
/// <remarks>Is a proper Umbraco route eg /path/to/foo or 123/path/tofoo.</remarks>
[DataMember]
string Url { get; set; }
}
}
+9 -18
View File
@@ -21,8 +21,13 @@ namespace Umbraco.Core.Models
IsoCode = isoCode;
}
private static readonly PropertyInfo IsoCodeSelector = ExpressionHelper.GetPropertyInfo<Language, string>(x => x.IsoCode);
private static readonly PropertyInfo CultureNameSelector = ExpressionHelper.GetPropertyInfo<Language, string>(x => x.CultureName);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo IsoCodeSelector = ExpressionHelper.GetPropertyInfo<Language, string>(x => x.IsoCode);
public readonly PropertyInfo CultureNameSelector = ExpressionHelper.GetPropertyInfo<Language, string>(x => x.CultureName);
}
/// <summary>
/// Gets or sets the Iso Code for the Language
@@ -31,14 +36,7 @@ namespace Umbraco.Core.Models
public string IsoCode
{
get { return _isoCode; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isoCode = value;
return _isoCode;
}, _isoCode, IsoCodeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isoCode, Ps.Value.IsoCodeSelector); }
}
/// <summary>
@@ -48,14 +46,7 @@ namespace Umbraco.Core.Models
public string CultureName
{
get { return _cultureName; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_cultureName = value;
return _cultureName;
}, _cultureName, CultureNameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _cultureName, Ps.Value.CultureNameSelector); }
}
/// <summary>
+30 -102
View File
@@ -114,22 +114,27 @@ namespace Umbraco.Core.Models
private List<string> _addedProperties;
private List<string> _removedProperties;
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.Alias);
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.Name);
private static readonly PropertyInfo UseInEditorSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.UseInEditor);
private static readonly PropertyInfo CacheDurationSelector = ExpressionHelper.GetPropertyInfo<Macro, int>(x => x.CacheDuration);
private static readonly PropertyInfo CacheByPageSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.CacheByPage);
private static readonly PropertyInfo CacheByMemberSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.CacheByMember);
private static readonly PropertyInfo DontRenderSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.DontRender);
private static readonly PropertyInfo ControlPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ControlType);
private static readonly PropertyInfo ControlAssemblySelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ControlAssembly);
private static readonly PropertyInfo ScriptPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ScriptPath);
private static readonly PropertyInfo XsltPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.XsltPath);
private static readonly PropertyInfo PropertiesSelector = ExpressionHelper.GetPropertyInfo<Macro, MacroPropertyCollection>(x => x.Properties);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.Alias);
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.Name);
public readonly PropertyInfo UseInEditorSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.UseInEditor);
public readonly PropertyInfo CacheDurationSelector = ExpressionHelper.GetPropertyInfo<Macro, int>(x => x.CacheDuration);
public readonly PropertyInfo CacheByPageSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.CacheByPage);
public readonly PropertyInfo CacheByMemberSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.CacheByMember);
public readonly PropertyInfo DontRenderSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.DontRender);
public readonly PropertyInfo ControlPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ControlType);
public readonly PropertyInfo ControlAssemblySelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ControlAssembly);
public readonly PropertyInfo ScriptPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ScriptPath);
public readonly PropertyInfo XsltPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.XsltPath);
public readonly PropertyInfo PropertiesSelector = ExpressionHelper.GetPropertyInfo<Macro, MacroPropertyCollection>(x => x.Properties);
}
void PropertiesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertiesSelector);
OnPropertyChanged(Ps.Value.PropertiesSelector);
if (e.Action == NotifyCollectionChangedAction.Add)
{
@@ -167,7 +172,7 @@ namespace Umbraco.Core.Models
/// <param name="e"></param>
void PropertyDataChanged(object sender, PropertyChangedEventArgs e)
{
OnPropertyChanged(PropertiesSelector);
OnPropertyChanged(Ps.Value.PropertiesSelector);
}
public override void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
@@ -204,14 +209,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value.ToCleanString(CleanStringType.Alias);
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value.ToCleanString(CleanStringType.Alias), ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -221,14 +219,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -238,14 +229,7 @@ namespace Umbraco.Core.Models
public bool UseInEditor
{
get { return _useInEditor; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_useInEditor = value;
return _useInEditor;
}, _useInEditor, UseInEditorSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _useInEditor, Ps.Value.UseInEditorSelector); }
}
/// <summary>
@@ -255,14 +239,7 @@ namespace Umbraco.Core.Models
public int CacheDuration
{
get { return _cacheDuration; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_cacheDuration = value;
return _cacheDuration;
}, _cacheDuration, CacheDurationSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _cacheDuration, Ps.Value.CacheDurationSelector); }
}
/// <summary>
@@ -272,14 +249,7 @@ namespace Umbraco.Core.Models
public bool CacheByPage
{
get { return _cacheByPage; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_cacheByPage = value;
return _cacheByPage;
}, _cacheByPage, CacheByPageSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _cacheByPage, Ps.Value.CacheByPageSelector); }
}
/// <summary>
@@ -289,14 +259,7 @@ namespace Umbraco.Core.Models
public bool CacheByMember
{
get { return _cacheByMember; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_cacheByMember = value;
return _cacheByMember;
}, _cacheByMember, CacheByMemberSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _cacheByMember, Ps.Value.CacheByMemberSelector); }
}
/// <summary>
@@ -306,14 +269,7 @@ namespace Umbraco.Core.Models
public bool DontRender
{
get { return _dontRender; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_dontRender = value;
return _dontRender;
}, _dontRender, DontRenderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _dontRender, Ps.Value.DontRenderSelector); }
}
/// <summary>
@@ -323,14 +279,7 @@ namespace Umbraco.Core.Models
public string ControlType
{
get { return _scriptFile; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_scriptFile = value;
return _scriptFile;
}, _scriptFile, ControlPathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _scriptFile, Ps.Value.ControlPathSelector); }
}
/// <summary>
@@ -341,14 +290,7 @@ namespace Umbraco.Core.Models
public string ControlAssembly
{
get { return _scriptAssembly; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_scriptAssembly = value;
return _scriptAssembly;
}, _scriptAssembly, ControlAssemblySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _scriptAssembly, Ps.Value.ControlAssemblySelector); }
}
/// <summary>
@@ -359,14 +301,7 @@ namespace Umbraco.Core.Models
public string ScriptPath
{
get { return _scriptPath; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_scriptPath = value;
return _scriptPath;
}, _scriptPath, ScriptPathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _scriptPath, Ps.Value.ScriptPathSelector); }
}
/// <summary>
@@ -377,14 +312,7 @@ namespace Umbraco.Core.Models
public string XsltPath
{
get { return _xslt; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_xslt = value;
return _xslt;
}, _xslt, XsltPathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _xslt, Ps.Value.XsltPathSelector); }
}
/// <summary>
+18 -52
View File
@@ -72,11 +72,16 @@ namespace Umbraco.Core.Models
private int _id;
private string _editorAlias;
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Alias);
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Name);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, int>(x => x.SortOrder);
private static readonly PropertyInfo IdSelector = ExpressionHelper.GetPropertyInfo<Entity, int>(x => x.Id);
private static readonly PropertyInfo PropertyTypeSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.EditorAlias);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Alias);
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Name);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, int>(x => x.SortOrder);
public readonly PropertyInfo IdSelector = ExpressionHelper.GetPropertyInfo<Entity, int>(x => x.Id);
public readonly PropertyInfo PropertyTypeSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.EditorAlias);
}
/// <summary>
/// Gets or sets the Alias of the Property
@@ -85,14 +90,7 @@ namespace Umbraco.Core.Models
public int Id
{
get { return _id; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_id = value;
return _alias;
}, _alias, IdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _id, Ps.Value.IdSelector); }
}
/// <summary>
@@ -102,14 +100,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value;
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -119,14 +110,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -136,14 +120,7 @@ namespace Umbraco.Core.Models
public int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -159,21 +136,10 @@ namespace Umbraco.Core.Models
get { return _editorAlias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
//try to get the new mapped parameter editor
var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(value, false);
if (mapped.IsNullOrWhiteSpace() == false)
{
_editorAlias = mapped;
}
else
{
_editorAlias = value;
}
return _editorAlias;
}, _editorAlias, PropertyTypeSelector);
//try to get the new mapped parameter editor
var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(value, false);
var newVal = mapped.IsNullOrWhiteSpace() == false ? mapped : value;
SetPropertyValueAndDetectChanges(newVal, ref _editorAlias, Ps.Value.PropertyTypeSelector);
}
}
+25
View File
@@ -38,5 +38,30 @@ namespace Umbraco.Core.Models
: base(parent, alias)
{
}
/// <summary>
/// Creates a deep clone of the current entity with its identity/alias and it's property identities reset
/// </summary>
/// <returns></returns>
public IMediaType DeepCloneWithResetIdentities(string alias)
{
var clone = (MediaType)DeepClone();
clone.Alias = alias;
clone.Key = Guid.Empty;
foreach (var propertyGroup in clone.PropertyGroups)
{
propertyGroup.ResetIdentity();
propertyGroup.ResetDirtyProperties(false);
}
foreach (var propertyType in clone.PropertyTypes)
{
propertyType.ResetIdentity();
propertyType.ResetDirtyProperties(false);
}
clone.ResetIdentity();
clone.ResetDirtyProperties(false);
return clone;
}
}
}
+13 -36
View File
@@ -109,10 +109,15 @@ namespace Umbraco.Core.Models
IsApproved = true;
}
private static readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Username);
private static readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Email);
private static readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.RawPasswordValue);
private static readonly PropertyInfo ProviderUserKeySelector = ExpressionHelper.GetPropertyInfo<Member, object>(x => x.ProviderUserKey);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Username);
public readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Email);
public readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.RawPasswordValue);
public readonly PropertyInfo ProviderUserKeySelector = ExpressionHelper.GetPropertyInfo<Member, object>(x => x.ProviderUserKey);
}
/// <summary>
/// Gets or sets the Username
@@ -121,14 +126,7 @@ namespace Umbraco.Core.Models
public string Username
{
get { return _username; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_username = value;
return _username;
}, _username, UsernameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _username, Ps.Value.UsernameSelector); }
}
/// <summary>
@@ -138,14 +136,7 @@ namespace Umbraco.Core.Models
public string Email
{
get { return _email; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_email = value;
return _email;
}, _email, EmailSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _email, Ps.Value.EmailSelector); }
}
/// <summary>
@@ -155,14 +146,7 @@ namespace Umbraco.Core.Models
public string RawPasswordValue
{
get { return _rawPasswordValue; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_rawPasswordValue = value;
return _rawPasswordValue;
}, _rawPasswordValue, PasswordSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _rawPasswordValue, Ps.Value.PasswordSelector); }
}
/// <summary>
@@ -490,14 +474,7 @@ namespace Umbraco.Core.Models
{
return _providerUserKey;
}
set
{
SetPropertyValueAndDetectChanges(o =>
{
_providerUserKey = value;
return _providerUserKey;
}, _providerUserKey, ProviderUserKeySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _providerUserKey, Ps.Value.ProviderUserKeySelector); }
}
+15 -21
View File
@@ -21,8 +21,13 @@ namespace Umbraco.Core.Models
private string _name;
private int _creatorId;
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MemberGroup, string>(x => x.Name);
private static readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<MemberGroup, int>(x => x.CreatorId);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MemberGroup, string>(x => x.Name);
public readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<MemberGroup, int>(x => x.CreatorId);
}
[DataMember]
public string Name
@@ -30,33 +35,22 @@ namespace Umbraco.Core.Models
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
if (_name != value)
{
if (_name != value)
{
//if the name has changed, add the value to the additional data,
//this is required purely for event handlers to know the previous name of the group
//so we can keep the public access up to date.
AdditionalData["previousName"] = _name;
}
//if the name has changed, add the value to the additional data,
//this is required purely for event handlers to know the previous name of the group
//so we can keep the public access up to date.
AdditionalData["previousName"] = _name;
}
_name = value;
return _name;
}, _name, NameSelector);
SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector);
}
}
public int CreatorId
{
get { return _creatorId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_creatorId = value;
return _creatorId;
}, _creatorId, CreatorIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _creatorId, Ps.Value.CreatorIdSelector); }
}
public IDictionary<string, object> AdditionalData { get; private set; }
+11 -8
View File
@@ -30,7 +30,12 @@ namespace Umbraco.Core.Models
MemberTypePropertyTypes = new Dictionary<string, MemberTypePropertyProfileAccess>();
}
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MemberType, string>(x => x.Alias);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MemberType, string>(x => x.Alias);
}
/// <summary>
/// The Alias of the ContentType
@@ -50,13 +55,11 @@ namespace Umbraco.Core.Models
// .ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase)
// Need to ask Stephen
SetPropertyValueAndDetectChanges(o =>
{
_alias = value == "_umbracoSystemDefaultProtectType"
? value
: (value == null ? string.Empty : value.ToSafeAlias() );
return _alias;
}, _alias, AliasSelector);
var newVal = value == "_umbracoSystemDefaultProtectType"
? value
: (value == null ? string.Empty : value.ToSafeAlias());
SetPropertyValueAndDetectChanges(newVal, ref _alias, Ps.Value.AliasSelector);
}
}
+42 -153
View File
@@ -77,27 +77,32 @@ namespace Umbraco.Core.Models.Membership
private bool _defaultToLiveEditing;
private static readonly PropertyInfo FailedPasswordAttemptsSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.FailedPasswordAttempts);
private static readonly PropertyInfo LastLockoutDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastLockoutDate);
private static readonly PropertyInfo LastLoginDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastLoginDate);
private static readonly PropertyInfo LastPasswordChangeDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastPasswordChangeDate);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private static readonly PropertyInfo SecurityStampSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.SecurityStamp);
private static readonly PropertyInfo SessionTimeoutSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.SessionTimeout);
private static readonly PropertyInfo StartContentIdSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.StartContentId);
private static readonly PropertyInfo StartMediaIdSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.StartMediaId);
private static readonly PropertyInfo AllowedSectionsSelector = ExpressionHelper.GetPropertyInfo<User, IEnumerable<string>>(x => x.AllowedSections);
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Name);
private static readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Username);
private static readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Email);
private static readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.RawPasswordValue);
private static readonly PropertyInfo IsLockedOutSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsLockedOut);
private static readonly PropertyInfo IsApprovedSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsApproved);
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Language);
private class PropertySelectors
{
public readonly PropertyInfo FailedPasswordAttemptsSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.FailedPasswordAttempts);
public readonly PropertyInfo LastLockoutDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastLockoutDate);
public readonly PropertyInfo LastLoginDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastLoginDate);
public readonly PropertyInfo LastPasswordChangeDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastPasswordChangeDate);
private static readonly PropertyInfo DefaultToLiveEditingSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.DefaultToLiveEditing);
private static readonly PropertyInfo UserTypeSelector = ExpressionHelper.GetPropertyInfo<User, IUserType>(x => x.UserType);
public readonly PropertyInfo SecurityStampSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.SecurityStamp);
public readonly PropertyInfo SessionTimeoutSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.SessionTimeout);
public readonly PropertyInfo StartContentIdSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.StartContentId);
public readonly PropertyInfo StartMediaIdSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.StartMediaId);
public readonly PropertyInfo AllowedSectionsSelector = ExpressionHelper.GetPropertyInfo<User, IEnumerable<string>>(x => x.AllowedSections);
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Name);
public readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Username);
public readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Email);
public readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.RawPasswordValue);
public readonly PropertyInfo IsLockedOutSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsLockedOut);
public readonly PropertyInfo IsApprovedSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsApproved);
public readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Language);
public readonly PropertyInfo DefaultToLiveEditingSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.DefaultToLiveEditing);
public readonly PropertyInfo UserTypeSelector = ExpressionHelper.GetPropertyInfo<User, IUserType>(x => x.UserType);
}
#region Implementation of IMembershipUser
@@ -113,124 +118,61 @@ namespace Umbraco.Core.Models.Membership
public string Username
{
get { return _username; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_username = value;
return _username;
}, _username, UsernameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _username, Ps.Value.UsernameSelector); }
}
[DataMember]
public string Email
{
get { return _email; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_email = value;
return _email;
}, _email, EmailSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _email, Ps.Value.EmailSelector); }
}
[DataMember]
public string RawPasswordValue
{
get { return _rawPasswordValue; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_rawPasswordValue = value;
return _rawPasswordValue;
}, _rawPasswordValue, PasswordSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _rawPasswordValue, Ps.Value.PasswordSelector); }
}
[DataMember]
public bool IsApproved
{
get { return _isApproved; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isApproved = value;
return _isApproved;
}, _isApproved, IsApprovedSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isApproved, Ps.Value.IsApprovedSelector); }
}
[IgnoreDataMember]
public bool IsLockedOut
{
get { return _isLockedOut; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isLockedOut = value;
return _isLockedOut;
}, _isLockedOut, IsLockedOutSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isLockedOut, Ps.Value.IsLockedOutSelector); }
}
[IgnoreDataMember]
public DateTime LastLoginDate
{
get { return _lastLoginDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_lastLoginDate = value;
return _lastLoginDate;
}, _lastLoginDate, LastLoginDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _lastLoginDate, Ps.Value.LastLoginDateSelector); }
}
[IgnoreDataMember]
public DateTime LastPasswordChangeDate
{
get { return _lastPasswordChangedDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_lastPasswordChangedDate = value;
return _lastPasswordChangedDate;
}, _lastPasswordChangedDate, LastPasswordChangeDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _lastPasswordChangedDate, Ps.Value.LastPasswordChangeDateSelector); }
}
[IgnoreDataMember]
public DateTime LastLockoutDate
{
get { return _lastLockoutDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_lastLockoutDate = value;
return _lastLockoutDate;
}, _lastLockoutDate, LastLockoutDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _lastLockoutDate, Ps.Value.LastLockoutDateSelector); }
}
[IgnoreDataMember]
public int FailedPasswordAttempts
{
get { return _failedLoginAttempts; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_failedLoginAttempts = value;
return _failedLoginAttempts;
}, _failedLoginAttempts, FailedPasswordAttemptsSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _failedLoginAttempts, Ps.Value.FailedPasswordAttemptsSelector); }
}
//TODO: Figure out how to support all of this! - we cannot have NotImplementedExceptions because these get used by the IMembershipMemberService<IUser> service so
@@ -251,14 +193,7 @@ namespace Umbraco.Core.Models.Membership
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
public IEnumerable<string> AllowedSections
@@ -294,14 +229,7 @@ namespace Umbraco.Core.Models.Membership
public string SecurityStamp
{
get { return _securityStamp; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_securityStamp = value;
return _securityStamp;
}, _securityStamp, SecurityStampSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _securityStamp, Ps.Value.SecurityStampSelector); }
}
/// <summary>
@@ -330,14 +258,7 @@ namespace Umbraco.Core.Models.Membership
public int SessionTimeout
{
get { return _sessionTimeout; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sessionTimeout = value;
return _sessionTimeout;
}, _sessionTimeout, SessionTimeoutSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sessionTimeout, Ps.Value.SessionTimeoutSelector); }
}
/// <summary>
@@ -350,14 +271,7 @@ namespace Umbraco.Core.Models.Membership
public int StartContentId
{
get { return _startContentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_startContentId = value;
return _startContentId;
}, _startContentId, StartContentIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _startContentId, Ps.Value.StartContentIdSelector); }
}
/// <summary>
@@ -370,28 +284,14 @@ namespace Umbraco.Core.Models.Membership
public int StartMediaId
{
get { return _startMediaId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_startMediaId = value;
return _startMediaId;
}, _startMediaId, StartMediaIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _startMediaId, Ps.Value.StartMediaIdSelector); }
}
[DataMember]
public string Language
{
get { return _language; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_language = value;
return _language;
}, _language, LanguageSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _language, Ps.Value.LanguageSelector); }
}
//TODO: This should be a private set
@@ -406,14 +306,7 @@ namespace Umbraco.Core.Models.Membership
internal bool DefaultToLiveEditing
{
get { return _defaultToLiveEditing; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_defaultToLiveEditing = value;
return _defaultToLiveEditing;
}, _defaultToLiveEditing, DefaultToLiveEditingSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _defaultToLiveEditing, Ps.Value.DefaultToLiveEditingSelector); }
}
[IgnoreDataMember]
@@ -427,11 +320,7 @@ namespace Umbraco.Core.Models.Membership
throw new InvalidOperationException("Cannot assign a User Type that has not been persisted");
}
SetPropertyValueAndDetectChanges(o =>
{
_userType = value;
return _userType;
}, _userType, UserTypeSelector);
SetPropertyValueAndDetectChanges(value, ref _userType, Ps.Value.UserTypeSelector);
}
}
@@ -457,7 +346,7 @@ namespace Umbraco.Core.Models.Membership
/// <param name="e"></param>
void SectionCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(AllowedSectionsSelector);
OnPropertyChanged(Ps.Value.AllowedSectionsSelector);
if (e.Action == NotifyCollectionChangedAction.Add)
{
+14 -21
View File
@@ -20,9 +20,14 @@ namespace Umbraco.Core.Models.Membership
private string _name;
private IEnumerable<string> _permissions;
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Name);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Alias);
private static readonly PropertyInfo PermissionsSelector = ExpressionHelper.GetPropertyInfo<UserType, IEnumerable<string>>(x => x.Permissions);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Name);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Alias);
public readonly PropertyInfo PermissionsSelector = ExpressionHelper.GetPropertyInfo<UserType, IEnumerable<string>>(x => x.Permissions);
}
[DataMember]
public string Alias
@@ -30,11 +35,10 @@ namespace Umbraco.Core.Models.Membership
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase);
return _alias;
}, _alias, AliasSelector);
SetPropertyValueAndDetectChanges(
value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase),
ref _alias,
Ps.Value.AliasSelector);
}
}
@@ -42,14 +46,7 @@ namespace Umbraco.Core.Models.Membership
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -64,11 +61,7 @@ namespace Umbraco.Core.Models.Membership
get { return _permissions; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_permissions = value;
return _permissions;
}, _permissions, PermissionsSelector,
SetPropertyValueAndDetectChanges(value, ref _permissions, Ps.Value.PermissionsSelector,
//Custom comparer for enumerable
new DelegateEqualityComparer<IEnumerable<string>>(
(enum1, enum2) => enum1.UnsortedSequenceEqual(enum2),
+10 -18
View File
@@ -19,35 +19,27 @@ namespace Umbraco.Core.Models
_version = version;
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MigrationEntry, string>(x => x.MigrationName);
private static readonly PropertyInfo VersionSelector = ExpressionHelper.GetPropertyInfo<MigrationEntry, SemVersion>(x => x.Version);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MigrationEntry, string>(x => x.MigrationName);
public readonly PropertyInfo VersionSelector = ExpressionHelper.GetPropertyInfo<MigrationEntry, SemVersion>(x => x.Version);
}
private string _migrationName;
private SemVersion _version;
public string MigrationName
{
get { return _migrationName; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_migrationName = value;
return _migrationName;
}, _migrationName, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _migrationName, Ps.Value.NameSelector); }
}
public SemVersion Version
{
get { return _version; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_version = value;
return _version;
}, _version, VersionSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _version, Ps.Value.VersionSelector); }
}
}
}
+86 -47
View File
@@ -1,11 +1,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Persistence.Mappers;
namespace Umbraco.Core.Models
{
@@ -45,8 +43,42 @@ namespace Umbraco.Core.Models
Value = value;
}
private static readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<Property, object>(x => x.Value);
private static readonly PropertyInfo VersionSelector = ExpressionHelper.GetPropertyInfo<Property, Guid>(x => x.Version);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<Property, object>(x => x.Value);
public readonly PropertyInfo VersionSelector = ExpressionHelper.GetPropertyInfo<Property, Guid>(x => x.Version);
}
private static readonly DelegateEqualityComparer<object> ValueComparer = new DelegateEqualityComparer<object>(
(o, o1) =>
{
if (o == null && o1 == null) return true;
//custom comparer for strings.
if (o is string || o1 is string)
{
//if one is null and another is empty then they are the same
if ((o as string).IsNullOrWhiteSpace() && (o1 as string).IsNullOrWhiteSpace())
{
return true;
}
if (o == null || o1 == null) return false;
return o.Equals(o1);
}
if (o == null || o1 == null) return false;
//Custom comparer for enumerable if it is enumerable
var enum1 = o as IEnumerable;
var enum2 = o1 as IEnumerable;
if (enum1 != null && enum2 != null)
{
return enum1.Cast<object>().UnsortedSequenceEqual(enum2.Cast<object>());
}
return o.Equals(o1);
}, o => o.GetHashCode());
/// <summary>
/// Returns the instance of the tag support, by default tags are not enabled
@@ -98,14 +130,14 @@ namespace Umbraco.Core.Models
public Guid Version
{
get { return _version; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_version = value;
return _version;
}, _version, VersionSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _version, Ps.Value.VersionSelector); }
}
private static void ThrowTypeException(object value, Type expected, string alias)
{
throw new Exception(string.Format("Value \"{0}\" of type \"{1}\" could not be converted"
+ " to type \"{2}\" which is expected by property type \"{3}\".",
value, value.GetType(), expected, alias));
}
/// <summary>
@@ -121,47 +153,54 @@ namespace Umbraco.Core.Models
get { return _value; }
set
{
bool typeValidation = _propertyType.IsPropertyTypeValid(value);
var isOfExpectedType = _propertyType.IsPropertyTypeValid(value);
if (typeValidation == false)
throw new Exception(
string.Format(
"Type validation failed. The value type: '{0}' does not match the DataType in PropertyType with alias: '{1}'",
value == null ? "null" : value.GetType().Name, Alias));
SetPropertyValueAndDetectChanges(o =>
if (isOfExpectedType == false) // isOfExpectedType is true if value is null - so if false, value is *not* null
{
_value = value;
return _value;
}, _value, ValueSelector,
new DelegateEqualityComparer<object>(
(o, o1) =>
// "garbage-in", accept what we can & convert
// throw only if conversion is not possible
var s = value.ToString();
switch (_propertyType.DataTypeDatabaseType)
{
if (o == null && o1 == null) return true;
//custom comparer for strings.
if (o is string || o1 is string)
{
//if one is null and another is empty then they are the same
if ((o as string).IsNullOrWhiteSpace() && (o1 as string).IsNullOrWhiteSpace())
case DataTypeDatabaseType.Nvarchar:
case DataTypeDatabaseType.Ntext:
value = s;
break;
case DataTypeDatabaseType.Integer:
if (s.IsNullOrWhiteSpace()) value = null; // assume empty means null
else
{
return true;
var convInt = value.TryConvertTo<int>();
if (convInt == false) ThrowTypeException(value, typeof(int), _propertyType.Alias);
value = convInt.Result;
}
if (o == null || o1 == null) return false;
return o.Equals(o1);
}
if (o == null || o1 == null) return false;
break;
case DataTypeDatabaseType.Decimal:
if (s.IsNullOrWhiteSpace()) value = null; // assume empty means null
else
{
var convDecimal = value.TryConvertTo<decimal>();
if (convDecimal == false) ThrowTypeException(value, typeof (decimal), _propertyType.Alias);
// need to normalize the value (change the scaling factor and remove trailing zeroes)
// because the underlying database is going to mess with the scaling factor anyways.
value = convDecimal.Result.Normalize();
}
break;
case DataTypeDatabaseType.Date:
if (s.IsNullOrWhiteSpace()) value = null; // assume empty means null
else
{
var convDateTime = value.TryConvertTo<DateTime>();
if (convDateTime == false) ThrowTypeException(value, typeof (DateTime), _propertyType.Alias);
value = convDateTime.Result;
}
break;
}
}
//Custom comparer for enumerable if it is enumerable
var enum1 = o as IEnumerable;
var enum2 = o1 as IEnumerable;
if (enum1 != null && enum2 != null)
{
return enum1.Cast<object>().UnsortedSequenceEqual(enum2.Cast<object>());
}
return o.Equals(o1);
}, o => o.GetHashCode()));
SetPropertyValueAndDetectChanges(value, ref _value, Ps.Value.ValueSelector, ValueComparer);
}
}
+12 -20
View File
@@ -29,12 +29,18 @@ namespace Umbraco.Core.Models
PropertyTypes = propertyTypeCollection;
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, string>(x => x.Name);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, int>(x => x.SortOrder);
private readonly static PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, PropertyTypeCollection>(x => x.PropertyTypes);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, string>(x => x.Name);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, int>(x => x.SortOrder);
public readonly PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, PropertyTypeCollection>(x => x.PropertyTypes);
}
void PropertyTypesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertyTypeCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyTypeCollectionSelector);
}
/// <summary>
@@ -44,14 +50,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -61,14 +60,7 @@ namespace Umbraco.Core.Models
public int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
+74 -141
View File
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
@@ -45,9 +46,9 @@ namespace Umbraco.Core.Models
public PropertyType(IDataTypeDefinition dataTypeDefinition, string propertyTypeAlias)
: this(dataTypeDefinition)
{
SetAlias(propertyTypeAlias);
_alias = GetAlias(propertyTypeAlias);
}
public PropertyType(string propertyEditorAlias, DataTypeDatabaseType dataTypeDatabaseType)
: this(propertyEditorAlias, dataTypeDatabaseType, false)
{
@@ -55,7 +56,7 @@ namespace Umbraco.Core.Models
public PropertyType(string propertyEditorAlias, DataTypeDatabaseType dataTypeDatabaseType, string propertyTypeAlias)
: this(propertyEditorAlias, dataTypeDatabaseType, false, propertyTypeAlias)
{
{
}
/// <summary>
@@ -83,20 +84,25 @@ namespace Umbraco.Core.Models
_isExplicitDbType = isExplicitDbType;
_propertyEditorAlias = propertyEditorAlias;
_dataTypeDatabaseType = dataTypeDatabaseType;
SetAlias(propertyTypeAlias);
_alias = GetAlias(propertyTypeAlias);
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Name);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Alias);
private static readonly PropertyInfo DescriptionSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Description);
private static readonly PropertyInfo DataTypeDefinitionIdSelector = ExpressionHelper.GetPropertyInfo<PropertyType, int>(x => x.DataTypeDefinitionId);
private static readonly PropertyInfo PropertyEditorAliasSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.PropertyEditorAlias);
private static readonly PropertyInfo DataTypeDatabaseTypeSelector = ExpressionHelper.GetPropertyInfo<PropertyType, DataTypeDatabaseType>(x => x.DataTypeDatabaseType);
private static readonly PropertyInfo MandatorySelector = ExpressionHelper.GetPropertyInfo<PropertyType, bool>(x => x.Mandatory);
private static readonly PropertyInfo HelpTextSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.HelpText);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<PropertyType, int>(x => x.SortOrder);
private static readonly PropertyInfo ValidationRegExpSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.ValidationRegExp);
private static readonly PropertyInfo PropertyGroupIdSelector = ExpressionHelper.GetPropertyInfo<PropertyType, Lazy<int>>(x => x.PropertyGroupId);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Name);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Alias);
public readonly PropertyInfo DescriptionSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Description);
public readonly PropertyInfo DataTypeDefinitionIdSelector = ExpressionHelper.GetPropertyInfo<PropertyType, int>(x => x.DataTypeDefinitionId);
public readonly PropertyInfo PropertyEditorAliasSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.PropertyEditorAlias);
public readonly PropertyInfo DataTypeDatabaseTypeSelector = ExpressionHelper.GetPropertyInfo<PropertyType, DataTypeDatabaseType>(x => x.DataTypeDatabaseType);
public readonly PropertyInfo MandatorySelector = ExpressionHelper.GetPropertyInfo<PropertyType, bool>(x => x.Mandatory);
public readonly PropertyInfo HelpTextSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.HelpText);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<PropertyType, int>(x => x.SortOrder);
public readonly PropertyInfo ValidationRegExpSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.ValidationRegExp);
public readonly PropertyInfo PropertyGroupIdSelector = ExpressionHelper.GetPropertyInfo<PropertyType, Lazy<int>>(x => x.PropertyGroupId);
}
/// <summary>
/// Gets of Sets the Name of the PropertyType
@@ -105,14 +111,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -122,14 +121,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
SetAlias(value);
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(GetAlias(value), ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -139,14 +131,7 @@ namespace Umbraco.Core.Models
public string Description
{
get { return _description; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_description = value;
return _description;
}, _description, DescriptionSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _description, Ps.Value.DescriptionSelector); }
}
/// <summary>
@@ -157,28 +142,14 @@ namespace Umbraco.Core.Models
public int DataTypeDefinitionId
{
get { return _dataTypeDefinitionId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_dataTypeDefinitionId = value;
return _dataTypeDefinitionId;
}, _dataTypeDefinitionId, DataTypeDefinitionIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _dataTypeDefinitionId, Ps.Value.DataTypeDefinitionIdSelector); }
}
[DataMember]
public string PropertyEditorAlias
{
get { return _propertyEditorAlias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_propertyEditorAlias = value;
return _propertyEditorAlias;
}, _propertyEditorAlias, PropertyEditorAliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _propertyEditorAlias, Ps.Value.PropertyEditorAliasSelector); }
}
/// <summary>
@@ -212,29 +183,19 @@ namespace Umbraco.Core.Models
//don't allow setting this if an explicit declaration has been made in the ctor
if (_isExplicitDbType) return;
SetPropertyValueAndDetectChanges(o =>
{
_dataTypeDatabaseType = value;
return _dataTypeDatabaseType;
}, _dataTypeDatabaseType, DataTypeDatabaseTypeSelector);
SetPropertyValueAndDetectChanges(value, ref _dataTypeDatabaseType, Ps.Value.DataTypeDatabaseTypeSelector);
}
}
/// <summary>
/// Gets or Sets the PropertyGroup's Id for which this PropertyType belongs
/// Gets or sets the identifier of the PropertyGroup this PropertyType belongs to.
/// </summary>
/// <remarks>For generic properties, the value is <c>null</c>.</remarks>
[DataMember]
internal Lazy<int> PropertyGroupId
{
get { return _propertyGroupId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_propertyGroupId = value;
return _propertyGroupId;
}, _propertyGroupId, PropertyGroupIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _propertyGroupId, Ps.Value.PropertyGroupIdSelector); }
}
/// <summary>
@@ -244,14 +205,7 @@ namespace Umbraco.Core.Models
public bool Mandatory
{
get { return _mandatory; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_mandatory = value;
return _mandatory;
}, _mandatory, MandatorySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _mandatory, Ps.Value.MandatorySelector); }
}
/// <summary>
@@ -262,14 +216,7 @@ namespace Umbraco.Core.Models
public string HelpText
{
get { return _helpText; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_helpText = value;
return _helpText;
}, _helpText, HelpTextSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _helpText, Ps.Value.HelpTextSelector); }
}
/// <summary>
@@ -279,14 +226,7 @@ namespace Umbraco.Core.Models
public int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -296,23 +236,16 @@ namespace Umbraco.Core.Models
public string ValidationRegExp
{
get { return _validationRegExp; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_validationRegExp = value;
return _validationRegExp;
}, _validationRegExp, ValidationRegExpSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _validationRegExp, Ps.Value.ValidationRegExpSelector); }
}
private void SetAlias(string value)
private string GetAlias(string value)
{
//NOTE: WE are doing this because we don't want to do a ToSafeAlias when the alias is the special case of
// being prefixed with Constants.PropertyEditors.InternalGenericPropertiesPrefix
// which is used internally
_alias = value.StartsWith(Constants.PropertyEditors.InternalGenericPropertiesPrefix)
return value.StartsWith(Constants.PropertyEditors.InternalGenericPropertiesPrefix)
? value
: value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase);
}
@@ -365,18 +298,21 @@ namespace Umbraco.Core.Models
}
/// <summary>
/// Validates the Value from a Property according to its type
/// Gets a value indicating whether the value is of the expected type
/// for the property, and can be assigned to the property "as is".
/// </summary>
/// <param name="value"></param>
/// <returns>True if valid, otherwise false</returns>
/// <param name="value">The value.</param>
/// <returns>True if the value is of the expected type for the property,
/// and can be assigned to the property "as is". Otherwise, false, to indicate
/// that some conversion is required.</returns>
public bool IsPropertyTypeValid(object value)
{
//Can't validate null values, so just allow it to pass the current validation
// null values are assumed to be ok
if (value == null)
return true;
//Check type if the type of the value match the type from the DataType/PropertyEditor
Type type = value.GetType();
// check if the type of the value matches the type from the DataType/PropertyEditor
var valueType = value.GetType();
//TODO Add PropertyEditor Type validation when its relevant to introduce
/*bool isEditorModel = value is IEditorModel;
@@ -393,32 +329,29 @@ namespace Umbraco.Core.Models
return argument == type;
}*/
if (PropertyEditorAlias.IsNullOrWhiteSpace() == false)
if (PropertyEditorAlias.IsNullOrWhiteSpace() == false) // fixme - always true?
{
//Find DataType by Id
//IDataType dataType = DataTypesResolver.Current.GetById(DataTypeControlId);
//Check if dataType is null (meaning that the ControlId is valid) ?
//Possibly cast to BaseDataType and get the DbType from there (which might not be possible because it lives in umbraco.cms.businesslogic.datatype) ?
//Simple validation using the DatabaseType from the DataTypeDefinition and Type of the passed in value
if (DataTypeDatabaseType == DataTypeDatabaseType.Integer && type == typeof(int))
return true;
if (DataTypeDatabaseType == DataTypeDatabaseType.Decimal && type == typeof(decimal))
return true;
if (DataTypeDatabaseType == DataTypeDatabaseType.Date && type == typeof(DateTime))
return true;
if (DataTypeDatabaseType == DataTypeDatabaseType.Nvarchar && type == typeof(string))
return true;
if (DataTypeDatabaseType == DataTypeDatabaseType.Ntext && type == typeof(string))
return true;
// simple validation using the DatabaseType from the DataTypeDefinition
// and the Type of the passed in value
switch (DataTypeDatabaseType)
{
// fixme breaking!
case DataTypeDatabaseType.Integer:
return valueType == typeof(int);
case DataTypeDatabaseType.Decimal:
return valueType == typeof(decimal);
case DataTypeDatabaseType.Date:
return valueType == typeof(DateTime);
case DataTypeDatabaseType.Nvarchar:
return valueType == typeof(string);
case DataTypeDatabaseType.Ntext:
return valueType == typeof(string);
}
}
//Fallback for simple value types when no Control Id or Database Type is set
if (type.IsPrimitive || value is string)
// fixme - never reached + makes no sense?
// fallback for simple value types when no Control Id or Database Type is set
if (valueType.IsPrimitive || value is string)
return true;
return false;
@@ -443,15 +376,15 @@ namespace Umbraco.Core.Models
var regexPattern = new Regex(ValidationRegExp);
return regexPattern.IsMatch(value.ToString());
}
catch
catch
{
throw new Exception(string .Format("Invalid validation expression on property {0}",this.Alias));
}
}
//TODO: We must ensure that the property value can actually be saved based on the specified database type
//TODO Add PropertyEditor validation when its relevant to introduce
/*if (value is IEditorModel && DataTypeControlId != Guid.Empty)
{
@@ -469,19 +402,19 @@ namespace Umbraco.Core.Models
{
if (base.Equals(other)) return true;
//Check whether the PropertyType's properties are equal.
//Check whether the PropertyType's properties are equal.
return Alias.InvariantEquals(other.Alias);
}
public override int GetHashCode()
{
//Get hash code for the Name field if it is not null.
//Get hash code for the Name field if it is not null.
int baseHash = base.GetHashCode();
//Get hash code for the Alias field.
//Get hash code for the Alias field.
int hashAlias = Alias.ToLowerInvariant().GetHashCode();
//Calculate the hash code for the product.
//Calculate the hash code for the product.
return baseHash ^ hashAlias;
}
@@ -493,7 +426,7 @@ namespace Umbraco.Core.Models
//need to manually assign the Lazy value as it will not be automatically mapped
if (PropertyGroupId != null)
{
clone._propertyGroupId = new Lazy<int>(() => PropertyGroupId.Value);
clone._propertyGroupId = new Lazy<int>(() => PropertyGroupId.Value);
}
//this shouldn't really be needed since we're not tracking
clone.ResetDirtyProperties(false);
+13 -29
View File
@@ -44,7 +44,7 @@ namespace Umbraco.Core.Models
void _ruleCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(AllowedSectionsSelector);
OnPropertyChanged(Ps.Value.AllowedSectionsSelector);
//if (e.Action == NotifyCollectionChangedAction.Add)
//{
@@ -68,10 +68,15 @@ namespace Umbraco.Core.Models
}
}
private static readonly PropertyInfo ProtectedNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.ProtectedNodeId);
private static readonly PropertyInfo LoginNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.LoginNodeId);
private static readonly PropertyInfo NoAccessNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.NoAccessNodeId);
private static readonly PropertyInfo AllowedSectionsSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, IEnumerable<PublicAccessRule>>(x => x.Rules);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ProtectedNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.ProtectedNodeId);
public readonly PropertyInfo LoginNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.LoginNodeId);
public readonly PropertyInfo NoAccessNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.NoAccessNodeId);
public readonly PropertyInfo AllowedSectionsSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, IEnumerable<PublicAccessRule>>(x => x.Rules);
}
internal IEnumerable<Guid> RemovedRules
{
@@ -112,42 +117,21 @@ namespace Umbraco.Core.Models
public int LoginNodeId
{
get { return _loginNodeId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_loginNodeId = value;
return _loginNodeId;
}, _loginNodeId, LoginNodeIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _loginNodeId, Ps.Value.LoginNodeIdSelector); }
}
[DataMember]
public int NoAccessNodeId
{
get { return _noAccessNodeId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_noAccessNodeId = value;
return _noAccessNodeId;
}, _noAccessNodeId, NoAccessNodeIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _noAccessNodeId, Ps.Value.NoAccessNodeIdSelector); }
}
[DataMember]
public int ProtectedNodeId
{
get { return _protectedNodeId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_protectedNodeId = value;
return _protectedNodeId;
}, _protectedNodeId, ProtectedNodeIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _protectedNodeId, Ps.Value.ProtectedNodeIdSelector); }
}
public override void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
+9 -18
View File
@@ -23,35 +23,26 @@ namespace Umbraco.Core.Models
{
}
private static readonly PropertyInfo RuleValueSelector = ExpressionHelper.GetPropertyInfo<PublicAccessRule, string>(x => x.RuleValue);
private static readonly PropertyInfo RuleTypeSelector = ExpressionHelper.GetPropertyInfo<PublicAccessRule, string>(x => x.RuleType);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo RuleValueSelector = ExpressionHelper.GetPropertyInfo<PublicAccessRule, string>(x => x.RuleValue);
public readonly PropertyInfo RuleTypeSelector = ExpressionHelper.GetPropertyInfo<PublicAccessRule, string>(x => x.RuleType);
}
public Guid AccessEntryId { get; internal set; }
public string RuleValue
{
get { return _ruleValue; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_ruleValue = value;
return _ruleValue;
}, _ruleValue, RuleValueSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _ruleValue, Ps.Value.RuleValueSelector); }
}
public string RuleType
{
get { return _ruleType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_ruleType = value;
return _ruleType;
}, _ruleType, RuleTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _ruleType, Ps.Value.RuleTypeSelector); }
}
@@ -114,10 +114,25 @@ namespace Umbraco.Core.Models.PublishedContent
internal static void ClearContentType(int id)
{
Logging.LogHelper.Debug<PublishedContentType>("Clear content type w/id {0}.", () => id);
// requires a predicate because the key does not contain the ID
// faster than key strings comparisons anyway
// we don't support "get all" at the moment - so, cheating
var all = ApplicationContext.Current.ApplicationCache.StaticCache.GetCacheItemsByKeySearch<PublishedContentType>("PublishedContentType_").ToArray();
// the one we want to clear
var clr = all.FirstOrDefault(x => x.Id == id);
if (clr == null) return;
// those that have that one in their composition aliases
// note: CompositionAliases contains all recursive aliases
var oth = all.Where(x => x.CompositionAliases.InvariantContains(clr.Alias)).Select(x => x.Id);
// merge ids
var ids = oth.Concat(new[] { clr.Id }).ToArray();
// clear them all at once
// we don't support "clear many at once" at the moment - so, cheating
ApplicationContext.Current.ApplicationCache.StaticCache.ClearCacheObjectTypes<PublishedContentType>(
(key, value) => value.Id == id);
(key, value) => ids.Contains(value.Id));
}
internal static void ClearDataType(int id)
@@ -16,7 +16,7 @@ namespace Umbraco.Core.Models.Rdbms
[Column("contentNodeId")]
[ForeignKey(typeof(NodeDto))]
[Index(IndexTypes.NonClustered, Name = "IX_cmsPropertyData_1")]
[Index(IndexTypes.UniqueNonClustered, Name = "IX_cmsPropertyData_1", ForColumns = "contentNodeId,versionId,propertytypeid")]
public int NodeId { get; set; }
[Column("versionId")]
@@ -33,9 +33,23 @@ namespace Umbraco.Core.Models.Rdbms
[NullSetting(NullSetting = NullSettings.Null)]
public int? Integer { get; set; }
private decimal? _decimalValue;
[Column("dataDecimal")]
[NullSetting(NullSetting = NullSettings.Null)]
public decimal? Decimal { get; set; }
public decimal? Decimal
{
get
{
return _decimalValue;
}
set
{
// need to normalize the value (change the scaling factor and remove trailing zeroes)
// because the underlying database probably has messed with the scaling factor.
_decimalValue = value.HasValue ? (decimal?) value.Value.Normalize() : null;
}
}
[Column("dataDate")]
[NullSetting(NullSetting = NullSettings.Null)]
@@ -1,4 +1,5 @@
using Umbraco.Core.Persistence;
using System;
using Umbraco.Core.Persistence;
namespace Umbraco.Core.Models.Rdbms
{
@@ -18,5 +19,8 @@ namespace Umbraco.Core.Models.Rdbms
[Column("contenttypeNodeId")]
public int ContentTypeNodeId { get; set; }
[Column("PropertyGroupUniqueID")]
public Guid UniqueId { get; set; }
}
}
@@ -51,5 +51,8 @@ namespace Umbraco.Core.Models.Rdbms
[Column("dbType")]
public string DbType { get; set; }
[Column("UniqueID")]
public Guid UniqueId { get; set; }
}
}
@@ -0,0 +1,50 @@
using System;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace Umbraco.Core.Models.Rdbms
{
[TableName("umbracoRedirectUrl")]
[PrimaryKey("id")]
[ExplicitColumns]
class RedirectUrlDto
{
public RedirectUrlDto()
{
CreateDateUtc = DateTime.UtcNow;
}
// notes
//
// we want a unique, non-clustered index on (url ASC, contentId ASC, createDate DESC) but the
// problem is that the index key must be 900 bytes max. should we run without an index? done
// some perfs comparisons, and running with an index on a hash is only slightly slower on
// inserts, and much faster on reads, so... we have an index on a hash.
[Column("id")]
[PrimaryKeyColumn(IdentitySeed = 1, Name = "PK_umbracoRedirectUrl")]
public int Id { get; set; }
[ResultColumn]
public int ContentId { get; set; }
[Column("contentKey")]
[NullSetting(NullSetting = NullSettings.NotNull)]
[ForeignKey(typeof(NodeDto), Column = "uniqueID")]
public Guid ContentKey { get; set; }
[Column("createDateUtc")]
[NullSetting(NullSetting = NullSettings.NotNull)]
public DateTime CreateDateUtc { get; set; }
[Column("url")]
[NullSetting(NullSetting = NullSettings.NotNull)]
//[Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoRedirectUrl", ForColumns = "url, createDateUtc")]
public string Url { get; set; }
[Column("urlHash")]
[NullSetting(NullSetting = NullSettings.NotNull)]
[Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoRedirectUrl", ForColumns = "urlHash, contentKey, createDateUtc")]
public string UrlHash { get; set; }
}
}
@@ -1,11 +1,10 @@
using Umbraco.Core.Persistence;
using System;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace Umbraco.Core.Models.Rdbms
{
[TableName("cmsStylesheet")]
[PrimaryKey("nodeId", autoIncrement = false)]
[ExplicitColumns]
[Obsolete("This is no longer used and will be removed from Umbraco in future versions")]
internal class StylesheetDto
{
[Column("nodeId")]
@@ -1,11 +1,10 @@
using Umbraco.Core.Persistence;
using System;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace Umbraco.Core.Models.Rdbms
{
[TableName("cmsStylesheetProperty")]
[PrimaryKey("nodeId", autoIncrement = false)]
[ExplicitColumns]
[Obsolete("This is no longer used and will be removed from Umbraco in future versions")]
internal class StylesheetPropertyDto
{
[Column("nodeId")]
+67
View File
@@ -0,0 +1,67 @@
using System;
using System.Reflection;
using System.Runtime.Serialization;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
/// <summary>
/// Implements <see cref="IRedirectUrl"/>.
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
public class RedirectUrl : Entity, IRedirectUrl
{
/// <summary>
/// Initializes a new instance of the <see cref="RedirectUrl"/> class.
/// </summary>
public RedirectUrl()
{
CreateDateUtc = DateTime.UtcNow;
}
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
// ReSharper disable once ClassNeverInstantiated.Local
private class PropertySelectors
{
public readonly PropertyInfo ContentIdSelector = ExpressionHelper.GetPropertyInfo<RedirectUrl, int>(x => x.ContentId);
public readonly PropertyInfo ContentKeySelector = ExpressionHelper.GetPropertyInfo<RedirectUrl, Guid>(x => x.ContentKey);
public readonly PropertyInfo CreateDateUtcSelector = ExpressionHelper.GetPropertyInfo<RedirectUrl, DateTime>(x => x.CreateDateUtc);
public readonly PropertyInfo UrlSelector = ExpressionHelper.GetPropertyInfo<RedirectUrl, string>(x => x.Url);
}
private int _contentId;
private Guid _contentKey;
private DateTime _createDateUtc;
private string _url;
/// <inheritdoc />
public int ContentId
{
get { return _contentId; }
set { SetPropertyValueAndDetectChanges(value, ref _contentId, Ps.Value.ContentIdSelector); }
}
/// <inheritdoc />
public Guid ContentKey
{
get { return _contentKey; }
set { SetPropertyValueAndDetectChanges(value, ref _contentKey, Ps.Value.ContentKeySelector); }
}
/// <inheritdoc />
public DateTime CreateDateUtc
{
get { return _createDateUtc; }
set { SetPropertyValueAndDetectChanges(value, ref _createDateUtc, Ps.Value.CreateDateUtcSelector); }
}
/// <inheritdoc />
public string Url
{
get { return _url; }
set { SetPropertyValueAndDetectChanges(value, ref _url, Ps.Value.UrlSelector); }
}
}
}
+13 -36
View File
@@ -26,10 +26,15 @@ namespace Umbraco.Core.Models
_relationType = relationType;
}
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<Relation, int>(x => x.ParentId);
private static readonly PropertyInfo ChildIdSelector = ExpressionHelper.GetPropertyInfo<Relation, int>(x => x.ChildId);
private static readonly PropertyInfo RelationTypeSelector = ExpressionHelper.GetPropertyInfo<Relation, IRelationType>(x => x.RelationType);
private static readonly PropertyInfo CommentSelector = ExpressionHelper.GetPropertyInfo<Relation, string>(x => x.Comment);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<Relation, int>(x => x.ParentId);
public readonly PropertyInfo ChildIdSelector = ExpressionHelper.GetPropertyInfo<Relation, int>(x => x.ChildId);
public readonly PropertyInfo RelationTypeSelector = ExpressionHelper.GetPropertyInfo<Relation, IRelationType>(x => x.RelationType);
public readonly PropertyInfo CommentSelector = ExpressionHelper.GetPropertyInfo<Relation, string>(x => x.Comment);
}
/// <summary>
/// Gets or sets the Parent Id of the Relation (Source)
@@ -38,14 +43,7 @@ namespace Umbraco.Core.Models
public int ParentId
{
get { return _parentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_parentId = value;
return _parentId;
}, _parentId, ParentIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _parentId, Ps.Value.ParentIdSelector); }
}
/// <summary>
@@ -55,14 +53,7 @@ namespace Umbraco.Core.Models
public int ChildId
{
get { return _childId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_childId = value;
return _childId;
}, _childId, ChildIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _childId, Ps.Value.ChildIdSelector); }
}
/// <summary>
@@ -72,14 +63,7 @@ namespace Umbraco.Core.Models
public IRelationType RelationType
{
get { return _relationType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_relationType = value;
return _relationType;
}, _relationType, RelationTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _relationType, Ps.Value.RelationTypeSelector); }
}
/// <summary>
@@ -89,14 +73,7 @@ namespace Umbraco.Core.Models
public string Comment
{
get { return _comment; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_comment = value;
return _comment;
}, _comment, CommentSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _comment, Ps.Value.CommentSelector); }
}
/// <summary>
+15 -45
View File
@@ -35,11 +35,16 @@ namespace Umbraco.Core.Models
Name = name;
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Name);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Alias);
private static readonly PropertyInfo IsBidirectionalSelector = ExpressionHelper.GetPropertyInfo<RelationType, bool>(x => x.IsBidirectional);
private static readonly PropertyInfo ParentObjectTypeSelector = ExpressionHelper.GetPropertyInfo<RelationType, Guid>(x => x.ParentObjectType);
private static readonly PropertyInfo ChildObjectTypeSelector = ExpressionHelper.GetPropertyInfo<RelationType, Guid>(x => x.ChildObjectType);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Name);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Alias);
public readonly PropertyInfo IsBidirectionalSelector = ExpressionHelper.GetPropertyInfo<RelationType, bool>(x => x.IsBidirectional);
public readonly PropertyInfo ParentObjectTypeSelector = ExpressionHelper.GetPropertyInfo<RelationType, Guid>(x => x.ParentObjectType);
public readonly PropertyInfo ChildObjectTypeSelector = ExpressionHelper.GetPropertyInfo<RelationType, Guid>(x => x.ChildObjectType);
}
/// <summary>
/// Gets or sets the Name of the RelationType
@@ -48,14 +53,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -65,14 +63,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value;
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -82,14 +73,7 @@ namespace Umbraco.Core.Models
public bool IsBidirectional
{
get { return _isBidrectional; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isBidrectional = value;
return _isBidrectional;
}, _isBidrectional, IsBidirectionalSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isBidrectional, Ps.Value.IsBidirectionalSelector); }
}
/// <summary>
@@ -100,14 +84,7 @@ namespace Umbraco.Core.Models
public Guid ParentObjectType
{
get { return _parentObjectType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_parentObjectType = value;
return _parentObjectType;
}, _parentObjectType, ParentObjectTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _parentObjectType, Ps.Value.ParentObjectTypeSelector); }
}
/// <summary>
@@ -118,14 +95,7 @@ namespace Umbraco.Core.Models
public Guid ChildObjectType
{
get { return _childObjectType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_childObjectType = value;
return _childObjectType;
}, _childObjectType, ChildObjectTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _childObjectType, Ps.Value.ChildObjectTypeSelector); }
}
}
+13 -36
View File
@@ -15,10 +15,15 @@ namespace Umbraco.Core.Models
private bool _isActive;
private bool _isMaster;
private static readonly PropertyInfo ServerAddressSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, string>(x => x.ServerAddress);
private static readonly PropertyInfo ServerIdentitySelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, string>(x => x.ServerIdentity);
private static readonly PropertyInfo IsActiveSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, bool>(x => x.IsActive);
private static readonly PropertyInfo IsMasterSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, bool>(x => x.IsMaster);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ServerAddressSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, string>(x => x.ServerAddress);
public readonly PropertyInfo ServerIdentitySelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, string>(x => x.ServerIdentity);
public readonly PropertyInfo IsActiveSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, bool>(x => x.IsActive);
public readonly PropertyInfo IsMasterSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, bool>(x => x.IsMaster);
}
/// <summary>
/// Initialiazes a new instance of the <see cref="ServerRegistration"/> class.
@@ -69,14 +74,7 @@ namespace Umbraco.Core.Models
public string ServerAddress
{
get { return _serverAddress; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_serverAddress = value;
return _serverAddress;
}, _serverAddress, ServerAddressSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _serverAddress, Ps.Value.ServerAddressSelector); }
}
/// <summary>
@@ -85,14 +83,7 @@ namespace Umbraco.Core.Models
public string ServerIdentity
{
get { return _serverIdentity; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_serverIdentity = value;
return _serverIdentity;
}, _serverIdentity, ServerIdentitySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _serverIdentity, Ps.Value.ServerIdentitySelector); }
}
/// <summary>
@@ -101,14 +92,7 @@ namespace Umbraco.Core.Models
public bool IsActive
{
get { return _isActive; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isActive = value;
return _isActive;
}, _isActive, IsActiveSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isActive, Ps.Value.IsActiveSelector); }
}
/// <summary>
@@ -117,14 +101,7 @@ namespace Umbraco.Core.Models
public bool IsMaster
{
get { return _isMaster; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isMaster = value;
return _isMaster;
}, _isMaster, IsMasterSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isMaster, Ps.Value.IsMasterSelector); }
}
/// <summary>
+9 -18
View File
@@ -25,8 +25,13 @@ namespace Umbraco.Core.Models
_value = value;
}
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<StylesheetProperty, string>(x => x.Alias);
private static readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<StylesheetProperty, string>(x => x.Value);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<StylesheetProperty, string>(x => x.Alias);
public readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<StylesheetProperty, string>(x => x.Value);
}
/// <summary>
/// The CSS rule name that can be used by Umbraco in the back office
@@ -39,14 +44,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value;
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -55,14 +53,7 @@ namespace Umbraco.Core.Models
public string Value
{
get { return _value; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_value = value;
return _value;
}, _value, ValueSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _value, Ps.Value.ValueSelector); }
}
}
+10 -18
View File
@@ -27,35 +27,27 @@ namespace Umbraco.Core.Models
NodeCount = nodeCount;
}
private static readonly PropertyInfo TextSelector = ExpressionHelper.GetPropertyInfo<Tag, string>(x => x.Text);
private static readonly PropertyInfo GroupSelector = ExpressionHelper.GetPropertyInfo<Tag, string>(x => x.Group);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo TextSelector = ExpressionHelper.GetPropertyInfo<Tag, string>(x => x.Text);
public readonly PropertyInfo GroupSelector = ExpressionHelper.GetPropertyInfo<Tag, string>(x => x.Group);
}
private string _text;
private string _group;
public string Text
{
get { return _text; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_text = value;
return _text;
}, _text, TextSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _text, Ps.Value.TextSelector); }
}
public string Group
{
get { return _group; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_group = value;
return _group;
}, _group, GroupSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _group, Ps.Value.GroupSelector); }
}
public int NodeCount { get; internal set; }
+17 -54
View File
@@ -24,12 +24,17 @@ namespace Umbraco.Core.Models
_taskType = taskType;
}
private static readonly PropertyInfo ClosedSelector = ExpressionHelper.GetPropertyInfo<Task, bool>(x => x.Closed);
private static readonly PropertyInfo TaskTypeSelector = ExpressionHelper.GetPropertyInfo<Task, TaskType>(x => x.TaskType);
private static readonly PropertyInfo EntityIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.EntityId);
private static readonly PropertyInfo OwnerUserIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.OwnerUserId);
private static readonly PropertyInfo AssigneeUserIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.AssigneeUserId);
private static readonly PropertyInfo CommentSelector = ExpressionHelper.GetPropertyInfo<Task, string>(x => x.Comment);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ClosedSelector = ExpressionHelper.GetPropertyInfo<Task, bool>(x => x.Closed);
public readonly PropertyInfo TaskTypeSelector = ExpressionHelper.GetPropertyInfo<Task, TaskType>(x => x.TaskType);
public readonly PropertyInfo EntityIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.EntityId);
public readonly PropertyInfo OwnerUserIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.OwnerUserId);
public readonly PropertyInfo AssigneeUserIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.AssigneeUserId);
public readonly PropertyInfo CommentSelector = ExpressionHelper.GetPropertyInfo<Task, string>(x => x.Comment);
}
/// <summary>
/// Gets or sets a boolean indicating whether the task is closed
@@ -38,14 +43,7 @@ namespace Umbraco.Core.Models
public bool Closed
{
get { return _closed; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_closed = value;
return _closed;
}, _closed, ClosedSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _closed, Ps.Value.ClosedSelector); }
}
/// <summary>
@@ -55,14 +53,7 @@ namespace Umbraco.Core.Models
public TaskType TaskType
{
get { return _taskType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_taskType = value;
return _taskType;
}, _taskType, TaskTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _taskType, Ps.Value.TaskTypeSelector); }
}
/// <summary>
@@ -72,14 +63,7 @@ namespace Umbraco.Core.Models
public int EntityId
{
get { return _entityId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_entityId = value;
return _entityId;
}, _entityId, EntityIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _entityId, Ps.Value.EntityIdSelector); }
}
/// <summary>
@@ -89,14 +73,7 @@ namespace Umbraco.Core.Models
public int OwnerUserId
{
get { return _ownerUserId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_ownerUserId = value;
return _ownerUserId;
}, _ownerUserId, OwnerUserIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _ownerUserId, Ps.Value.OwnerUserIdSelector); }
}
/// <summary>
@@ -106,14 +83,7 @@ namespace Umbraco.Core.Models
public int AssigneeUserId
{
get { return _assigneeUserId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_assigneeUserId = value;
return _assigneeUserId;
}, _assigneeUserId, AssigneeUserIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _assigneeUserId, Ps.Value.AssigneeUserIdSelector); }
}
/// <summary>
@@ -123,14 +93,7 @@ namespace Umbraco.Core.Models
public string Comment
{
get { return _comment; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_comment = value;
return _comment;
}, _comment, CommentSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _comment, Ps.Value.CommentSelector); }
}
}
+7 -9
View File
@@ -19,7 +19,12 @@ namespace Umbraco.Core.Models
_alias = alias;
}
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<TaskType, string>(x => x.Alias);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<TaskType, string>(x => x.Alias);
}
/// <summary>
/// Gets or sets the Alias of the TaskType
@@ -28,14 +33,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value;
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _alias, Ps.Value.AliasSelector); }
}
}
}
+13 -38
View File
@@ -26,10 +26,15 @@ namespace Umbraco.Core.Models
private string _masterTemplateAlias;
private Lazy<int> _masterTemplateId;
private static readonly PropertyInfo MasterTemplateAliasSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.MasterTemplateAlias);
private static readonly PropertyInfo MasterTemplateIdSelector = ExpressionHelper.GetPropertyInfo<Template, Lazy<int>>(x => x.MasterTemplateId);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.Alias);
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.Name);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo MasterTemplateAliasSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.MasterTemplateAlias);
public readonly PropertyInfo MasterTemplateIdSelector = ExpressionHelper.GetPropertyInfo<Template, Lazy<int>>(x => x.MasterTemplateId);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.Alias);
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.Name);
}
public Template(string name, string alias)
: this(name, alias, (Func<File, string>) null)
@@ -53,57 +58,27 @@ namespace Umbraco.Core.Models
public Lazy<int> MasterTemplateId
{
get { return _masterTemplateId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_masterTemplateId = value;
return _masterTemplateId;
}, _masterTemplateId, MasterTemplateIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _masterTemplateId, Ps.Value.MasterTemplateIdSelector); }
}
public string MasterTemplateAlias
{
get { return _masterTemplateAlias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_masterTemplateAlias = value;
return _masterTemplateAlias;
}, _masterTemplateAlias, MasterTemplateAliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _masterTemplateAlias, Ps.Value.MasterTemplateAliasSelector); }
}
[DataMember]
public new string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
[DataMember]
public new string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value.ToCleanString(CleanStringType.UnderscoreAlias);
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value.ToCleanString(CleanStringType.UnderscoreAlias), ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
+11 -28
View File
@@ -24,51 +24,34 @@ namespace Umbraco.Core.Models
private int? _languageId;
private string _domainName;
private static readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.RootContentId);
private static readonly PropertyInfo DefaultLanguageSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.LanguageId);
private static readonly PropertyInfo DomainNameSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, string>(x => x.DomainName);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.RootContentId);
public readonly PropertyInfo DefaultLanguageSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.LanguageId);
public readonly PropertyInfo DomainNameSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, string>(x => x.DomainName);
}
[DataMember]
public int? LanguageId
{
get { return _languageId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_languageId = value;
return _languageId;
}, _languageId, DefaultLanguageSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _languageId, Ps.Value.DefaultLanguageSelector); }
}
[DataMember]
public string DomainName
{
get { return _domainName; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_domainName = value;
return _domainName;
}, _domainName, DomainNameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _domainName, Ps.Value.DomainNameSelector); }
}
[DataMember]
public int? RootContentId
{
get { return _contentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_contentId = value;
return _contentId;
}, _contentId, ContentSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _contentId, Ps.Value.ContentSelector); }
}
public bool IsWildcard

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