Compare commits
789 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f916a6bc18 | |||
| 8865f798a6 | |||
| 362bb593f1 | |||
| 4dc7b185aa | |||
| d0d1b2675d | |||
| b624d87a59 | |||
| aa75a6bf9f | |||
| 14a0efde01 | |||
| 1c20496974 | |||
| 309dd5d4a2 | |||
| 92c28de028 | |||
| 16ea928c75 | |||
| 31f67eac6c | |||
| a04aef9b98 | |||
| 9f046f9945 | |||
| 64cae76dca | |||
| b6e4a96e3b | |||
| 82154ee660 | |||
| 655075aabe | |||
| 3773cac232 | |||
| 05cd6500ba | |||
| 345340b957 | |||
| 22be517daf | |||
| 8860e77468 | |||
| ffeed58f5d | |||
| 6fd5eee4f6 | |||
| 4354840674 | |||
| 6d1ba5a823 | |||
| eee63e3a48 | |||
| abd1c89660 | |||
| 9acaa82d4b | |||
| d5dc5127ae | |||
| d8862c85bf | |||
| 874c7977c2 | |||
| fa34652cf1 | |||
| 22c615a641 | |||
| 2ffc64b965 | |||
| 4c932f013a | |||
| 52b40ac514 | |||
| 631710222f | |||
| 2824a2ca8b | |||
| c90af1df39 | |||
| c679e00b81 | |||
| c6caa6aae7 | |||
| 1b1642ce46 | |||
| 31d0450d6c | |||
| a71d18f352 | |||
| 12c982f170 | |||
| 35af370f70 | |||
| bbee0a81c9 | |||
| 2beb3c5b4c | |||
| f7d407e9fd | |||
| d67db8a90a | |||
| 98e7ee90f4 | |||
| 90c4358844 | |||
| 2cb4b207dc | |||
| b80b2475e0 | |||
| 94bbcb98a6 | |||
| 26f79e1010 | |||
| a626eeff7d | |||
| 84353d1e77 | |||
| 39aa100490 | |||
| d1a656b3cd | |||
| d87db5b338 | |||
| 0a11f31754 | |||
| 0c226d1a2c | |||
| 596cf2a9e1 | |||
| 2f089128d7 | |||
| b52b649548 | |||
| 7e4739956a | |||
| e040fc8819 | |||
| c2a858b903 | |||
| e1108ce65b | |||
| a6e93879c2 | |||
| 56e9d0a602 | |||
| 23d5d117e7 | |||
| daa4ff28e7 | |||
| 291fcb043c | |||
| dea1e9e541 | |||
| ca8b6cac7a | |||
| 6cf9312d1a | |||
| 45868d3fec | |||
| 3d90e66d36 | |||
| 836177a90f | |||
| 14bb0ce4d8 | |||
| c6720ff42c | |||
| 863c7d11b7 | |||
| 53c043d22e | |||
| 7e70253e1c | |||
| b6bca084c5 | |||
| 0a7e09b3dd | |||
| 313b831559 | |||
| 355137f982 | |||
| 6cd09e7b86 | |||
| e80023bcff | |||
| d1c7a3764f | |||
| 806596f04d | |||
| 77889f968b | |||
| 7cb496ee3c | |||
| fb1d6436b7 | |||
| f749886bf4 | |||
| 11c35977d3 | |||
| 66119ba3d8 | |||
| 31ab56a3c1 | |||
| 640967666f | |||
| e2890d4186 | |||
| 1e2688b14d | |||
| 5fc82fef18 | |||
| d3b8ac31c7 | |||
| a11b326c22 | |||
| 7f012de43e | |||
| 7752aaabfe | |||
| f7e86f6b09 | |||
| e502579319 | |||
| 2f42fc61bf | |||
| ac2009e4ae | |||
| 44404b70e1 | |||
| 5bb68f32bf | |||
| 89b20a2e77 | |||
| d2a00f5c18 | |||
| 91bcb656ec | |||
| 4fea694c6a | |||
| abce483d0e | |||
| 8d0603b11c | |||
| 6d516212eb | |||
| c3fd4bd685 | |||
| e922ca88f2 | |||
| 64d5533274 | |||
| 734895c90c | |||
| a009cad200 | |||
| b743ea4fb8 | |||
| ed54b55965 | |||
| 82e9ab1825 | |||
| da2f3aefe6 | |||
| 17db60c34a | |||
| 9ae9a4e52d | |||
| 4dbd1d3ca7 | |||
| f758634a90 | |||
| c302de6bdf | |||
| e3ec0c1019 | |||
| a9dd33908c | |||
| 21e3893528 | |||
| f8e17b711e | |||
| 4d31512ef0 | |||
| 1707e6b18f | |||
| 9212033858 | |||
| 6effcf82ac | |||
| 71a0c45889 | |||
| febe81105b | |||
| 830d6d914f | |||
| 259d8e03db | |||
| 2784e2a22d | |||
| 94cc49e67e | |||
| 2bd91d619d | |||
| d446d84cf5 | |||
| 5244f75d0d | |||
| 96440c9ee5 | |||
| 4545af0a21 | |||
| 0878de4a8b | |||
| 9774744991 | |||
| 4a6103ba94 | |||
| 8bbe6675db | |||
| b4c005c140 | |||
| 34cebe989f | |||
| eca823ea90 | |||
| 89481405b5 | |||
| f1d837dfd1 | |||
| c61fd1ec27 | |||
| 5314afb51a | |||
| 1c742db414 | |||
| f8b2fcaa2b | |||
| 684c99b532 | |||
| 28ec40e1ae | |||
| cadf1fe9bb | |||
| 393c365b6e | |||
| a657e10545 | |||
| d6f9d23626 | |||
| 7e0eefc18a | |||
| 9bcd276073 | |||
| d0fd7523c2 | |||
| 0a6826c62a | |||
| 132b1f305a | |||
| 7dfd684cd8 | |||
| 4ce5e67116 | |||
| 6d2caaa723 | |||
| e3cd85a6a2 | |||
| 69f805ecca | |||
| 10e65e8027 | |||
| d79110aee6 | |||
| 9eb9b8df92 | |||
| fc8496dd95 | |||
| 21334bd282 | |||
| 367bbd7eff | |||
| 2f62c58055 | |||
| 47f7d0d8df | |||
| f4861fb344 | |||
| 378fc2c655 | |||
| 202ae1eafe | |||
| 77cb86f74b | |||
| 4281610bc1 | |||
| f11aca53e4 | |||
| 87fc9c3ee7 | |||
| 4f27fd6d40 | |||
| 85155175cb | |||
| 6cddd55065 | |||
| bf93d773a8 | |||
| 20f1a308a8 | |||
| b6dcbc83e4 | |||
| 6967027e41 | |||
| 87309a1ef3 | |||
| 9027b41ded | |||
| 43f001280e | |||
| 8dab2148f1 | |||
| 6474b2b045 | |||
| 0b1eb4b42c | |||
| 86c996efb8 | |||
| c037e2e09f | |||
| d8debf6789 | |||
| b02b45c815 | |||
| 05cbccec5c | |||
| 238bc58234 | |||
| dd22377b9b | |||
| 01589f0a35 | |||
| b9d22b2577 | |||
| 36c21ca322 | |||
| 4fe6da9118 | |||
| b4f8e6c93d | |||
| 886d146595 | |||
| 2aaf3d06fa | |||
| 35315e0331 | |||
| ba72991929 | |||
| ad7edf0d52 | |||
| ac15e84324 | |||
| 5d49dfbe28 | |||
| 5889140386 | |||
| fd91340e75 | |||
| 8dbdd67c98 | |||
| d0c5dd208f | |||
| d46486d3db | |||
| c52e0cbb65 | |||
| 6224d02989 | |||
| 9e8286bda9 | |||
| e9ed1bf17a | |||
| cfcfb75dcc | |||
| 9ad869d367 | |||
| acbde943b0 | |||
| c4a0e1e923 | |||
| 8465b3465b | |||
| 8666ae0540 | |||
| 9c8e156768 | |||
| 9efe68724d | |||
| 2129ac8241 | |||
| 6bab9500c1 | |||
| bb4a7ef21f | |||
| abb6b6519f | |||
| e94ca7513b | |||
| ad9fa736f4 | |||
| cad0f8bb2a | |||
| 289caa791a | |||
| bfa325163d | |||
| f03e9ecebe | |||
| 0ab2b74004 | |||
| fe40288514 | |||
| df867af900 | |||
| 5f5f535f05 | |||
| a532b49485 | |||
| c28f800fe6 | |||
| e7201b6a69 | |||
| 1f538d1bd5 | |||
| a9ffa3f1b7 | |||
| c2fca795e6 | |||
| 72b08f4029 | |||
| c4bfeeb321 | |||
| acd52d42f4 | |||
| 635ccc444d | |||
| 6dcfbaee7f | |||
| 6fb6aa397f | |||
| 181593f5ea | |||
| c0037a40c6 | |||
| 57e98fda97 | |||
| 3111a2d22f | |||
| f123c58c79 | |||
| 9f613c04f3 | |||
| 0be60a5c88 | |||
| 8fc82476a6 | |||
| 6fe647146c | |||
| dd80b41735 | |||
| a311a54d3d | |||
| 330732323f | |||
| ad0b7e4259 | |||
| 0d42f721db | |||
| 7664cec0d3 | |||
| ef40c76363 | |||
| 367cdde35e | |||
| 590b7f2289 | |||
| 9911f03745 | |||
| 2d09785753 | |||
| 7a31ba0de7 | |||
| 1cfb79788a | |||
| 641d0c737f | |||
| 242b755b1a | |||
| d76336cd39 | |||
| 0dc3920309 | |||
| 98d1aafb75 | |||
| fa0b3ddab9 | |||
| 7440855c72 | |||
| 937bda9c16 | |||
| 2b3a9a0b8f | |||
| 6a0d7ec8d6 | |||
| 8b879183ba | |||
| 0f424d314f | |||
| f9a86385b5 | |||
| b8f7df1a96 | |||
| 425fd80e65 | |||
| 04bb778dc1 | |||
| 3f2be3342a | |||
| 3ba50e7bae | |||
| 7306ddef14 | |||
| 17bb29eb66 | |||
| 8bf3de738f | |||
| 2d37502a44 | |||
| d5c485205a | |||
| 9533198365 | |||
| 66f20e3800 | |||
| 9269a98806 | |||
| 7c97fddec5 | |||
| a567cf2a87 | |||
| 1e319d667b | |||
| cc039e365d | |||
| f91ff5dc31 | |||
| 9347a2edbb | |||
| 64a73ef528 | |||
| 4ea04f5ffe | |||
| 6b006e6fd7 | |||
| 30fe174601 | |||
| 31448eb987 | |||
| 29cf9ae46a | |||
| 01eb7157bd | |||
| bacdcb7abf | |||
| 164b630d5e | |||
| d9abbd4232 | |||
| 3d6eea9470 | |||
| 345b96e253 | |||
| 546788761f | |||
| fad84ac0bb | |||
| fc0654a80f | |||
| 4717faaf1b | |||
| e7d587f776 | |||
| ceab957db5 | |||
| ac21859587 | |||
| fc6fb4030b | |||
| 039ec7b958 | |||
| 5659ab5fc0 | |||
| f6b2888c26 | |||
| e41e017fa3 | |||
| 63eccb4909 | |||
| 4f9ddfeb7a | |||
| c19a8fa602 | |||
| 17529b90b6 | |||
| 2371a40a8a | |||
| d2ae358a3d | |||
| f30416d20f | |||
| ef16e6c72f | |||
| 51c459d654 | |||
| 01b21dc9eb | |||
| bcf20f9f3f | |||
| fed8f51de8 | |||
| d9e18859e9 | |||
| ea73ecd9cb | |||
| 1c4129fd64 | |||
| 5a690bcf33 | |||
| 4be6e21257 | |||
| 7e36a6b6e1 | |||
| aa4bcdd040 | |||
| c9f29a443d | |||
| 725ef52243 | |||
| 6bc41f53ee | |||
| 11366558c9 | |||
| 11c02eba49 | |||
| 2617124ee8 | |||
| 74df45a056 | |||
| cf342ece45 | |||
| fbeff81128 | |||
| 787f304de7 | |||
| 2a52c584f8 | |||
| e6cc5a5736 | |||
| 1c423245e2 | |||
| eb3bd9f89c | |||
| 7f964beebf | |||
| 8b0767b41f | |||
| 68e84c6c59 | |||
| 38d6244611 | |||
| d321721a5e | |||
| 23e85920ef | |||
| c36197a01c | |||
| 9ab423a280 | |||
| 4895b5a2a8 | |||
| 102bf79320 | |||
| 47733b2bbe | |||
| e9ae2c0836 | |||
| 82b59c8f8d | |||
| 2d53aca29c | |||
| f342b80e86 | |||
| be9f0c066e | |||
| b84c2007ef | |||
| 87ce3806f9 | |||
| dca0c85db5 | |||
| eb181b220f | |||
| 8d7456dfe7 | |||
| 9c25131958 | |||
| 8d72705265 | |||
| 2adf2838f6 | |||
| b19ed4c039 | |||
| d3fcdff418 | |||
| 8cd7f26431 | |||
| 89653183dd | |||
| 5bbb54d6d0 | |||
| 1d72800c80 | |||
| 1c6afe9cea | |||
| 637ca85ae0 | |||
| 6cf510a9be | |||
| 485b69743f | |||
| eb0936c3a7 | |||
| 2738cd41cd | |||
| c8cb724508 | |||
| 548bdb6f02 | |||
| 136ef8f844 | |||
| bc0da04470 | |||
| 365eb6497f | |||
| 065aebac5b | |||
| 94de454264 | |||
| 2cd5b63555 | |||
| e1381e4e70 | |||
| 8cda966388 | |||
| 45d339928a | |||
| 1d078965b9 | |||
| 2ef48a3355 | |||
| 5006115b2d | |||
| 37967973a0 | |||
| a348177126 | |||
| 1c7609d5e0 | |||
| b75a9cc34b | |||
| 5836c061fa | |||
| 058cec7551 | |||
| 998bc73a90 | |||
| b7ff856073 | |||
| 5363cafd7f | |||
| 1533acc219 | |||
| 04e6e43fee | |||
| 7e7d93c815 | |||
| 2671709991 | |||
| 68f2396ff5 | |||
| 34f0576a90 | |||
| 76e8b4871b | |||
| 520ee92b4f | |||
| e671300dc0 | |||
| 31c7af1737 | |||
| 20c624915f | |||
| ac2d8633af | |||
| 76bc312842 | |||
| b4176ca7df | |||
| 9342a7e897 | |||
| e4bd459da4 | |||
| 083ca23d93 | |||
| b2c5d7270e | |||
| 59a81f4d12 | |||
| 60c4d670da | |||
| c1ad4aa560 | |||
| 7dc4cb7962 | |||
| 7cbd2f1aad | |||
| 19a1ca64f6 | |||
| 35f49962ca | |||
| 65db15487e | |||
| c722e57914 | |||
| c1f35e6991 | |||
| 767719357e | |||
| 7b29bd67f3 | |||
| e97bb0b354 | |||
| 72c173dbee | |||
| 7e0e84ae21 | |||
| 453769b1e7 | |||
| 2b9211c56d | |||
| a79132e922 | |||
| adcf09c99b | |||
| 177eb3d360 | |||
| 336182d8b7 | |||
| acb2e58a5c | |||
| 523c48d4fd | |||
| 90c62bddd9 | |||
| 719b777188 | |||
| 1ead3f9b6a | |||
| ab6a26445e | |||
| 881dab1612 | |||
| dc4a0fec80 | |||
| 4c3d700c54 | |||
| bfbed0249e | |||
| ea38f7a998 | |||
| b704220133 | |||
| 67903d7590 | |||
| 06d3f15fa0 | |||
| 00f8472cfc | |||
| db1ae58f96 | |||
| d981058498 | |||
| 81d2aac0d2 | |||
| ce509638e1 | |||
| 00d0d5e046 | |||
| b0b785954f | |||
| ed80f75c1c | |||
| cf1cbb5f94 | |||
| 7f56c79a8d | |||
| 69e445239a | |||
| 21f0e60061 | |||
| 8b5eefafdb | |||
| 54e4866325 | |||
| 5ce6ec124a | |||
| 4f79b8bf45 | |||
| 451004d45e | |||
| e5879a4c70 | |||
| bb5dad8c1d | |||
| 51aefd2b6b | |||
| 5c7f551015 | |||
| 35f842f7ba | |||
| e4f8f6ebd5 | |||
| 46ba9718ff | |||
| 68b955e611 | |||
| 5be7ed7d58 | |||
| 201e28513a | |||
| ca8e840195 | |||
| b30a479f86 | |||
| 95d98b132a | |||
| ca0db38870 | |||
| 3272be6a35 | |||
| 2b4957d4f2 | |||
| abb28250f8 | |||
| d922846a7e | |||
| 70491bb6e6 | |||
| d8a8556598 | |||
| a7f5576fee | |||
| 1860f3f953 | |||
| 6451f6ad68 | |||
| 7cd6882f28 | |||
| 968a94f281 | |||
| 3d7f7db396 | |||
| ff7116ac57 | |||
| d62aae0205 | |||
| 37464e5f0f | |||
| d96de90cd9 | |||
| aca550a9b4 | |||
| e862ffcb1b | |||
| 0cac739b50 | |||
| 3d44c78585 | |||
| 8588cbb836 | |||
| f5a2f87038 | |||
| 2075311773 | |||
| 151e20240a | |||
| fc2e605fd8 | |||
| 6ee867c01b | |||
| 0a677a3b54 | |||
| 0aab5e435a | |||
| c75a7817cf | |||
| 7716413015 | |||
| e69559238d | |||
| 6b5326ccbd | |||
| eb622504f2 | |||
| 228230d46b | |||
| dc336728b5 | |||
| 6263b07087 | |||
| 75dfde3bc5 | |||
| 7c9f742b4d | |||
| 025e7eba1d | |||
| 2b7a9389b4 | |||
| 3110b199c6 | |||
| e707506303 | |||
| 49d5791825 | |||
| 660e89a46c | |||
| fea90482b6 | |||
| 6cfb864055 | |||
| d0ef627532 | |||
| 7fd823c9e9 | |||
| 89c5d5d613 | |||
| 73b7729b82 | |||
| c66d49dbfe | |||
| ecf73a6230 | |||
| a915dff4a8 | |||
| 9a3b70149c | |||
| 98cc1c63ce | |||
| 757086b7bd | |||
| ab36687c85 | |||
| d86654fa6b | |||
| 128a08f169 | |||
| 4487e686d7 | |||
| 7679b36f13 | |||
| 716def8d33 | |||
| 4ceb16e20d | |||
| 61318df0b4 | |||
| 822117e453 | |||
| d09b34dd03 | |||
| ab8d0c6504 | |||
| c5c1946d1b | |||
| 5b6fd83f21 | |||
| 2587b06361 | |||
| e507ad4ace | |||
| 7636f17ba9 | |||
| 36ffd41007 | |||
| b5e06a6552 | |||
| 165caa5aba | |||
| a5d6cfd812 | |||
| 638a614a24 | |||
| a3c3e220a0 | |||
| 8d724ff2f7 | |||
| f13fd59059 | |||
| c03b839bb1 | |||
| 055cf5da3a | |||
| d8de1c5b1b | |||
| 04ab76e5a9 | |||
| 22da0c85f7 | |||
| 440d26d982 | |||
| 2891f96006 | |||
| 7d885e8af0 | |||
| 7d35ad124a | |||
| 45cf5d88cf | |||
| ee5e0a9b7e | |||
| 865d8e633e | |||
| 69a0de20d7 | |||
| 13f1c80329 | |||
| 9a36d40623 | |||
| db4bcab192 | |||
| be3288af44 | |||
| 322ad6ca26 | |||
| 617d7dcea1 | |||
| 0510773dc5 | |||
| 2325052d69 | |||
| 00486eeaa7 | |||
| ae32968efd | |||
| dc3c517697 | |||
| 36a472b79a | |||
| 99766e3f22 | |||
| 937e7f9004 | |||
| d82fd3dd04 | |||
| b94f2aba70 | |||
| 01c601f87e | |||
| 3ba05aca8f | |||
| d4a069451f | |||
| 547361a185 | |||
| 736339ad1c | |||
| c1778918b5 | |||
| 3f5fdf840a | |||
| 90c76ae465 | |||
| 680a4b9570 | |||
| 2243452261 | |||
| 4427554752 | |||
| 16be7a2971 | |||
| 35a03a1e58 | |||
| d258fc5a9f | |||
| 17e1020724 | |||
| 24858dfdfc | |||
| 2a9a7ee9c5 | |||
| 00690d011a | |||
| 4b5284fd7b | |||
| a286f358be | |||
| 0b65b3b4a1 | |||
| 48ef1aab1c | |||
| 652f1e52ec | |||
| 5a682c44bc | |||
| 70a1704b35 | |||
| d8ff1e97b3 | |||
| 39eb0351c0 | |||
| 49df332734 | |||
| 3af8354a93 | |||
| a39d41b1b7 | |||
| d9a1d3438b | |||
| 9000ece7d1 | |||
| 2b8c566e65 | |||
| aedb17781b | |||
| ba6ba15732 | |||
| 291f526368 | |||
| 6fd05ab6be | |||
| fca605287b | |||
| 5e63077a32 | |||
| ff61812e65 | |||
| d20ea58467 | |||
| c6431bde3f | |||
| c737c43fa2 | |||
| c4f3dae317 | |||
| a663cad110 | |||
| e0c1b5cd8d | |||
| b95575572d | |||
| 92c7b4446b | |||
| 844f4490fe | |||
| 4d5b330567 | |||
| e18b00ef25 | |||
| 3cef9d9186 | |||
| 8188f66892 | |||
| a87e699f8d | |||
| 40287fd427 | |||
| 5d5f7a4516 | |||
| ac6aaedf3e | |||
| 61ef83c748 | |||
| f82329b371 | |||
| 0fee434ac2 | |||
| 3aab41b1e4 | |||
| e0e5aef43e | |||
| fd6046ebb6 | |||
| 2a7844d031 | |||
| dc0f4757a2 | |||
| d6bd3354cf | |||
| e94f8da3e8 | |||
| d28cdf3bdc | |||
| 1ac2ccb8c2 | |||
| 3be2af15ee | |||
| aef7525354 | |||
| eef44e97c5 | |||
| 1f65f02f49 | |||
| 87cacaf92c | |||
| b3830067ca | |||
| ff40de7c29 | |||
| 3f76a130f1 | |||
| 205d5f7d71 | |||
| 100ab5643a | |||
| f9ad06be29 | |||
| 699c651daa | |||
| 79299175c1 | |||
| 14e3976e88 | |||
| 76c86daf24 | |||
| a1ef40e4be | |||
| e4a0904de6 | |||
| 6cca01718d | |||
| 6b259c8147 | |||
| cb727bf6e6 | |||
| 6400e7988f | |||
| 93d44df72b | |||
| 2267ac4534 | |||
| 7a3e9facd0 | |||
| 7c881a29ae | |||
| 607a52883a | |||
| 4651dfc763 | |||
| da74c0a163 | |||
| 8d9f741a6a | |||
| c42170cf6b | |||
| 35545019a5 | |||
| 0312b947e1 | |||
| e7162d46ce | |||
| dfec3965ab | |||
| fbb7f18f23 | |||
| e2e40a3356 | |||
| 754ed06d86 | |||
| 171de064f6 | |||
| e7176c40df | |||
| 51cb4ca371 | |||
| d9c42e2aca | |||
| df25edfaf6 | |||
| af43b35d17 | |||
| 72ea43758d | |||
| d41188598a | |||
| 2ed7fc06ea | |||
| ee5af4998f | |||
| 565a020acf | |||
| c459a893a5 | |||
| 4935525591 | |||
| 693778fe74 | |||
| 8eee7cae2f | |||
| b6777e4635 | |||
| a353f6fb74 | |||
| a64efb93b3 | |||
| cf9f11ff45 | |||
| d7481b5ca4 | |||
| 2fb55cb831 | |||
| 0e6a926a3f | |||
| 1e76cf67d3 | |||
| 61149f8112 | |||
| b5494546c7 | |||
| 7bac1ef1cd | |||
| da15d40b04 | |||
| 67bd303173 | |||
| 20e6843bf0 | |||
| 85c80b07f9 | |||
| 557dccd88b | |||
| 334f0bfd2b | |||
| 986d37afd6 | |||
| 63ea79a4d6 | |||
| e4df176a37 | |||
| d926180e3a | |||
| 72bb1b3583 | |||
| 240e58e061 | |||
| e980296d6d | |||
| d23482b7a6 | |||
| 212800f706 | |||
| d47ff4005c | |||
| dfeb1c7a0b |
+2
-1
@@ -104,4 +104,5 @@ 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/[Cc]onfig/connectionStrings.config
|
||||
src/Umbraco.Web.UI/umbraco/plugins/*
|
||||
|
||||
+34
-32
@@ -1,32 +1,34 @@
|
||||
@ECHO OFF
|
||||
SET release=7.0.0
|
||||
SET comment=beta
|
||||
SET version=%release%
|
||||
|
||||
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
|
||||
|
||||
ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%
|
||||
|
||||
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%
|
||||
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Code\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Data\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Plugins\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\css\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\macroScripts\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\masterpages\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\media\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\scripts\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\usercontrols\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\Views\Partials\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\Views\MacroPartials\dummy.txt
|
||||
|
||||
..\src\.nuget\NuGet.exe pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%
|
||||
..\src\.nuget\NuGet.exe pack NuSpecs\UmbracoCms.nuspec -Version %version%
|
||||
|
||||
IF ERRORLEVEL 1 GOTO :showerror
|
||||
|
||||
GOTO :EOF
|
||||
|
||||
:showerror
|
||||
PAUSE
|
||||
@ECHO OFF
|
||||
SET release=7.0.0
|
||||
SET comment=
|
||||
SET version=%release%
|
||||
|
||||
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
|
||||
|
||||
ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%
|
||||
|
||||
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%
|
||||
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Code\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Data\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Plugins\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\css\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\masterpages\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\media\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\scripts\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\usercontrols\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\Views\Partials\dummy.txt
|
||||
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\Views\MacroPartials\dummy.txt
|
||||
|
||||
ren .\_BuildOutput\WebApp\MacroScripts\Web.config Web.config.transform
|
||||
ren .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
|
||||
|
||||
..\src\.nuget\NuGet.exe pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%
|
||||
..\src\.nuget\NuGet.exe pack NuSpecs\UmbracoCms.nuspec -Version %version%
|
||||
|
||||
IF ERRORLEVEL 1 GOTO :showerror
|
||||
|
||||
GOTO :EOF
|
||||
|
||||
:showerror
|
||||
PAUSE
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<dependencies>
|
||||
<dependency id="Microsoft.AspNet.Mvc" version="4.0" />
|
||||
<dependency id="Microsoft.AspNet.WebApi" version="4.0" />
|
||||
<dependency id="Microsoft.AspNet.Mvc" version="[4.0.0,5.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi" version="[4.0.0,5.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi.Client" version="[4.0.0, 5.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" />
|
||||
<dependency id="Microsoft.Net.Http" version="[2.0.0, 3.0.0)" />
|
||||
<dependency id="MiniProfiler" version="[2.1.0, 3.0.0)" />
|
||||
<dependency id="HtmlAgilityPack" version="[1.4.6, 2.0.0)" />
|
||||
<dependency id="Lucene.Net" version="[2.9.4.1, 3.0.0.0)" />
|
||||
@@ -27,7 +29,7 @@
|
||||
<dependency id="ClientDependency" version="[1.7.0, 2.0.0)" />
|
||||
<dependency id="ClientDependency-Mvc" version="[1.7.0, 2.0.0)" />
|
||||
<dependency id="AutoMapper" version="[3.0.0, 4.0.0)" />
|
||||
<dependency id="Newtonsoft.Json" version="[5.0.0, 6.0.0)" />
|
||||
<dependency id="Newtonsoft.Json" version="[4.5.11, 5.0.0)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<file src="..\_BuildOutput\WebApp\bin\x86\**" target="Content\bin\x86" />
|
||||
<file src="..\_BuildOutput\Configs\**" target="Content\config" exclude="..\_BuildOutput\Configs\Web.config.transform" />
|
||||
<file src="..\_BuildOutput\WebApp\css\**" target="Content\css" />
|
||||
<file src="..\_BuildOutput\WebApp\macroScripts\**" target="Content\macroScripts" />
|
||||
<file src="..\_BuildOutput\WebApp\macroScripts\**" target="Content\macroScripts" exclude="..\_BuildOutput\WebApp\macroScripts\Web.config" />
|
||||
<file src="..\_BuildOutput\WebApp\masterpages\**" target="Content\masterpages" />
|
||||
<file src="..\_BuildOutput\WebApp\media\**" target="Content\media" />
|
||||
<file src="..\_BuildOutput\WebApp\scripts\**" target="Content\scripts" />
|
||||
|
||||
@@ -21,13 +21,7 @@ if ($project) {
|
||||
$projectDestinationPath = Split-Path $project.FullName -Parent
|
||||
$umbracoFilesPath = Join-Path $rootPath "UmbracoFiles\*"
|
||||
Copy-Item $umbracoFilesPath $projectDestinationPath -recurse -force
|
||||
|
||||
# Remove Newtonsoft.Json if present in the bin folder
|
||||
# If we don't do this, the correct version never gets copied in
|
||||
$projectDestinationPath = Split-Path $project.FullName -Parent
|
||||
$jsonDllFile = Join-Path $projectDestinationPath "bin\Newtonsoft.Json.dll"
|
||||
Remove-Item $jsonDllFile -Confirm:$false
|
||||
|
||||
|
||||
# Open readme.txt file
|
||||
$DTE.ItemOperations.OpenFile($toolsPath + '\Readme.txt')
|
||||
}
|
||||
+163
-163
@@ -1,164 +1,164 @@
|
||||
using System;
|
||||
using Umbraco.Core.Dynamics;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result of an operation attempt.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the attempted operation result.</typeparam>
|
||||
[Serializable]
|
||||
public struct Attempt<T>
|
||||
{
|
||||
private readonly bool _success;
|
||||
private readonly T _result;
|
||||
private readonly Exception _exception;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this <see cref="Attempt{T}"/> was successful.
|
||||
/// </summary>
|
||||
public bool Success
|
||||
{
|
||||
get { return _success; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the exception associated with an unsuccessful attempt.
|
||||
/// </summary>
|
||||
public Exception Exception { get { return _exception; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the exception associated with an unsuccessful attempt.
|
||||
/// </summary>
|
||||
/// <remarks>Keep it for backward compatibility sake.</remarks>
|
||||
[Obsolete(".Error is obsolete, you should use .Exception instead.", false)]
|
||||
public Exception Error { get { return _exception; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the attempt result.
|
||||
/// </summary>
|
||||
public T Result
|
||||
{
|
||||
get { return _result; }
|
||||
}
|
||||
|
||||
// optimize, use a singleton failed attempt
|
||||
private static readonly Attempt<T> Failed = new Attempt<T>(false, default(T), null);
|
||||
|
||||
/// <summary>
|
||||
/// Represents an unsuccessful attempt.
|
||||
/// </summary>
|
||||
/// <remarks>Keep it for backward compatibility sake.</remarks>
|
||||
[Obsolete(".Failed is obsolete, you should use Attempt<T>.Fail() instead.", false)]
|
||||
public static readonly Attempt<T> False = Failed;
|
||||
|
||||
// private - use Succeed() or Fail() methods to create attempts
|
||||
private Attempt(bool success, T result, Exception exception)
|
||||
{
|
||||
_success = success;
|
||||
_result = result;
|
||||
_exception = exception;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize a new instance of the <see cref="Attempt{T}"/> struct with a result.
|
||||
/// </summary>
|
||||
/// <param name="success">A value indicating whether the attempt is successful.</param>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <remarks>Keep it for backward compatibility sake.</remarks>
|
||||
[Obsolete("Attempt ctors are obsolete, you should use Attempt<T>.Succeed(), Attempt<T>.Fail() or Attempt<T>.If() instead.", false)]
|
||||
public Attempt(bool success, T result)
|
||||
: this(success, result, null)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Initialize a new instance of the <see cref="Attempt{T}"/> struct representing a failed attempt, with an exception.
|
||||
/// </summary>
|
||||
/// <param name="exception">The exception causing the failure of the attempt.</param>
|
||||
/// <remarks>Keep it for backward compatibility sake.</remarks>
|
||||
[Obsolete("Attempt ctors are obsolete, you should use Attempt<T>.Succeed(), Attempt<T>.Fail() or Attempt<T>.If() instead.", false)]
|
||||
public Attempt(Exception exception)
|
||||
: this(false, default(T), exception)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a successful attempt.
|
||||
/// </summary>
|
||||
/// <returns>The successful attempt.</returns>
|
||||
public static Attempt<T> Succeed()
|
||||
{
|
||||
return new Attempt<T>(true, default(T), null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a successful attempt with a result.
|
||||
/// </summary>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <returns>The successful attempt.</returns>
|
||||
public static Attempt<T> Succeed(T result)
|
||||
{
|
||||
return new Attempt<T>(true, result, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a failed attempt.
|
||||
/// </summary>
|
||||
/// <returns>The failed attempt.</returns>
|
||||
public static Attempt<T> Fail()
|
||||
{
|
||||
return Failed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a failed attempt with an exception.
|
||||
/// </summary>
|
||||
/// <param name="exception">The exception causing the failure of the attempt.</param>
|
||||
/// <returns>The failed attempt.</returns>
|
||||
public static Attempt<T> Fail(Exception exception)
|
||||
{
|
||||
return new Attempt<T>(false, default(T), exception);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a failed attempt with a result.
|
||||
/// </summary>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <returns>The failed attempt.</returns>
|
||||
public static Attempt<T> Fail(T result)
|
||||
{
|
||||
return new Attempt<T>(false, result, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a failed attempt with a result and an exception.
|
||||
/// </summary>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <param name="exception">The exception causing the failure of the attempt.</param>
|
||||
/// <returns>The failed attempt.</returns>
|
||||
public static Attempt<T> Fail(T result, Exception exception)
|
||||
{
|
||||
return new Attempt<T>(false, result, exception);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a successful or a failed attempt.
|
||||
/// </summary>
|
||||
/// <param name="condition">A value indicating whether the attempt is successful.</param>
|
||||
/// <returns>The attempt.</returns>
|
||||
public static Attempt<T> SucceedIf(bool condition)
|
||||
{
|
||||
return condition ? new Attempt<T>(true, default(T), null) : Failed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a successful or a failed attempt, with a result.
|
||||
/// </summary>
|
||||
/// <param name="condition">A value indicating whether the attempt is successful.</param>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <returns>The attempt.</returns>
|
||||
public static Attempt<T> SucceedIf(bool condition, T result)
|
||||
{
|
||||
return new Attempt<T>(condition, result, null);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using Umbraco.Core.Dynamics;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result of an operation attempt.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the attempted operation result.</typeparam>
|
||||
[Serializable]
|
||||
public struct Attempt<T>
|
||||
{
|
||||
private readonly bool _success;
|
||||
private readonly T _result;
|
||||
private readonly Exception _exception;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this <see cref="Attempt{T}"/> was successful.
|
||||
/// </summary>
|
||||
public bool Success
|
||||
{
|
||||
get { return _success; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the exception associated with an unsuccessful attempt.
|
||||
/// </summary>
|
||||
public Exception Exception { get { return _exception; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the exception associated with an unsuccessful attempt.
|
||||
/// </summary>
|
||||
/// <remarks>Keep it for backward compatibility sake.</remarks>
|
||||
[Obsolete(".Error is obsolete, you should use .Exception instead.", false)]
|
||||
public Exception Error { get { return _exception; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the attempt result.
|
||||
/// </summary>
|
||||
public T Result
|
||||
{
|
||||
get { return _result; }
|
||||
}
|
||||
|
||||
// optimize, use a singleton failed attempt
|
||||
private static readonly Attempt<T> Failed = new Attempt<T>(false, default(T), null);
|
||||
|
||||
/// <summary>
|
||||
/// Represents an unsuccessful attempt.
|
||||
/// </summary>
|
||||
/// <remarks>Keep it for backward compatibility sake.</remarks>
|
||||
[Obsolete(".Failed is obsolete, you should use Attempt<T>.Fail() instead.", false)]
|
||||
public static readonly Attempt<T> False = Failed;
|
||||
|
||||
// private - use Succeed() or Fail() methods to create attempts
|
||||
private Attempt(bool success, T result, Exception exception)
|
||||
{
|
||||
_success = success;
|
||||
_result = result;
|
||||
_exception = exception;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize a new instance of the <see cref="Attempt{T}"/> struct with a result.
|
||||
/// </summary>
|
||||
/// <param name="success">A value indicating whether the attempt is successful.</param>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <remarks>Keep it for backward compatibility sake.</remarks>
|
||||
[Obsolete("Attempt ctors are obsolete, you should use Attempt<T>.Succeed(), Attempt<T>.Fail() or Attempt<T>.If() instead.", false)]
|
||||
public Attempt(bool success, T result)
|
||||
: this(success, result, null)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Initialize a new instance of the <see cref="Attempt{T}"/> struct representing a failed attempt, with an exception.
|
||||
/// </summary>
|
||||
/// <param name="exception">The exception causing the failure of the attempt.</param>
|
||||
/// <remarks>Keep it for backward compatibility sake.</remarks>
|
||||
[Obsolete("Attempt ctors are obsolete, you should use Attempt<T>.Succeed(), Attempt<T>.Fail() or Attempt<T>.If() instead.", false)]
|
||||
public Attempt(Exception exception)
|
||||
: this(false, default(T), exception)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a successful attempt.
|
||||
/// </summary>
|
||||
/// <returns>The successful attempt.</returns>
|
||||
public static Attempt<T> Succeed()
|
||||
{
|
||||
return new Attempt<T>(true, default(T), null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a successful attempt with a result.
|
||||
/// </summary>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <returns>The successful attempt.</returns>
|
||||
public static Attempt<T> Succeed(T result)
|
||||
{
|
||||
return new Attempt<T>(true, result, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a failed attempt.
|
||||
/// </summary>
|
||||
/// <returns>The failed attempt.</returns>
|
||||
public static Attempt<T> Fail()
|
||||
{
|
||||
return Failed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a failed attempt with an exception.
|
||||
/// </summary>
|
||||
/// <param name="exception">The exception causing the failure of the attempt.</param>
|
||||
/// <returns>The failed attempt.</returns>
|
||||
public static Attempt<T> Fail(Exception exception)
|
||||
{
|
||||
return new Attempt<T>(false, default(T), exception);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a failed attempt with a result.
|
||||
/// </summary>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <returns>The failed attempt.</returns>
|
||||
public static Attempt<T> Fail(T result)
|
||||
{
|
||||
return new Attempt<T>(false, result, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a failed attempt with a result and an exception.
|
||||
/// </summary>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <param name="exception">The exception causing the failure of the attempt.</param>
|
||||
/// <returns>The failed attempt.</returns>
|
||||
public static Attempt<T> Fail(T result, Exception exception)
|
||||
{
|
||||
return new Attempt<T>(false, result, exception);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a successful or a failed attempt.
|
||||
/// </summary>
|
||||
/// <param name="condition">A value indicating whether the attempt is successful.</param>
|
||||
/// <returns>The attempt.</returns>
|
||||
public static Attempt<T> SucceedIf(bool condition)
|
||||
{
|
||||
return condition ? new Attempt<T>(true, default(T), null) : Failed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a successful or a failed attempt, with a result.
|
||||
/// </summary>
|
||||
/// <param name="condition">A value indicating whether the attempt is successful.</param>
|
||||
/// <param name="result">The result of the attempt.</param>
|
||||
/// <returns>The attempt.</returns>
|
||||
public static Attempt<T> SucceedIf(bool condition, T result)
|
||||
{
|
||||
return new Attempt<T>(condition, result, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
|
||||
internal class BaseRestSection : UmbracoConfigurationSection, IBaseRestSection
|
||||
{
|
||||
private const string KeyEnabled = "enabled";
|
||||
|
||||
private bool? _enabled;
|
||||
|
||||
[ConfigurationProperty("", IsKey = false, IsRequired = false, IsDefaultCollection = true)]
|
||||
public ExtensionElementCollection Items
|
||||
{
|
||||
get { return (ExtensionElementCollection)base[""]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether base rest extensions are enabled.
|
||||
/// </summary>
|
||||
[ConfigurationProperty(KeyEnabled, DefaultValue = true, IsRequired = false)]
|
||||
public bool Enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return _enabled ?? (IsPresent == false || (bool)this[KeyEnabled]);
|
||||
}
|
||||
internal set { _enabled = value; }
|
||||
}
|
||||
|
||||
IExtensionsCollection IBaseRestSection.Items
|
||||
{
|
||||
get { return Items; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
|
||||
internal class BaseRestSection : UmbracoConfigurationSection, IBaseRestSection
|
||||
{
|
||||
private const string KeyEnabled = "enabled";
|
||||
|
||||
private bool? _enabled;
|
||||
|
||||
[ConfigurationProperty("", IsKey = false, IsRequired = false, IsDefaultCollection = true)]
|
||||
public ExtensionElementCollection Items
|
||||
{
|
||||
get { return (ExtensionElementCollection)base[""]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether base rest extensions are enabled.
|
||||
/// </summary>
|
||||
[ConfigurationProperty(KeyEnabled, DefaultValue = true, IsRequired = false)]
|
||||
public bool Enabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return _enabled ?? (IsPresent == false || (bool)this[KeyEnabled]);
|
||||
}
|
||||
internal set { _enabled = value; }
|
||||
}
|
||||
|
||||
IExtensionsCollection IBaseRestSection.Items
|
||||
{
|
||||
get { return Items; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,81 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
|
||||
[ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
|
||||
internal class ExtensionElement : ConfigurationElementCollection, IEnumerable<IMethodSection>, IExtension
|
||||
{
|
||||
const string KeyAlias = "alias";
|
||||
const string KeyType = "type";
|
||||
const string KeyMethod = "method";
|
||||
|
||||
[ConfigurationProperty(KeyAlias, IsKey = true, IsRequired = true)]
|
||||
public string Alias
|
||||
{
|
||||
get { return (string)base[KeyAlias]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyType, IsKey = false, IsRequired = true)]
|
||||
public string Type
|
||||
{
|
||||
get { return (string)base[KeyType]; }
|
||||
}
|
||||
|
||||
public override ConfigurationElementCollectionType CollectionType
|
||||
{
|
||||
get { return ConfigurationElementCollectionType.BasicMapAlternate; }
|
||||
}
|
||||
|
||||
protected override string ElementName
|
||||
{
|
||||
get { return KeyMethod; }
|
||||
}
|
||||
|
||||
protected override bool IsElementName(string elementName)
|
||||
{
|
||||
return elementName.Equals(KeyMethod, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new MethodElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((MethodElement)element).Name;
|
||||
}
|
||||
|
||||
public override bool IsReadOnly()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
new public MethodElement this[string index]
|
||||
{
|
||||
get { return (MethodElement)BaseGet(index); }
|
||||
}
|
||||
|
||||
IEnumerator<IMethodSection> IEnumerable<IMethodSection>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IMethodSection;
|
||||
}
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
IMethodSection IExtension.this[string index]
|
||||
{
|
||||
get { return this[index]; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
|
||||
[ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
|
||||
internal class ExtensionElement : ConfigurationElementCollection, IEnumerable<IMethodSection>, IExtension
|
||||
{
|
||||
const string KeyAlias = "alias";
|
||||
const string KeyType = "type";
|
||||
const string KeyMethod = "method";
|
||||
|
||||
[ConfigurationProperty(KeyAlias, IsKey = true, IsRequired = true)]
|
||||
public string Alias
|
||||
{
|
||||
get { return (string)base[KeyAlias]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyType, IsKey = false, IsRequired = true)]
|
||||
public string Type
|
||||
{
|
||||
get { return (string)base[KeyType]; }
|
||||
}
|
||||
|
||||
public override ConfigurationElementCollectionType CollectionType
|
||||
{
|
||||
get { return ConfigurationElementCollectionType.BasicMapAlternate; }
|
||||
}
|
||||
|
||||
protected override string ElementName
|
||||
{
|
||||
get { return KeyMethod; }
|
||||
}
|
||||
|
||||
protected override bool IsElementName(string elementName)
|
||||
{
|
||||
return elementName.Equals(KeyMethod, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new MethodElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((MethodElement)element).Name;
|
||||
}
|
||||
|
||||
public override bool IsReadOnly()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
new public MethodElement this[string index]
|
||||
{
|
||||
get { return (MethodElement)BaseGet(index); }
|
||||
}
|
||||
|
||||
IEnumerator<IMethodSection> IEnumerable<IMethodSection>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IMethodSection;
|
||||
}
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
IMethodSection IExtension.this[string index]
|
||||
{
|
||||
get { return this[index]; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
public interface IExtensionsCollection : IEnumerable<IExtension>
|
||||
{
|
||||
IExtension this[string index] { get; }
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
|
||||
internal class ExtensionElementCollection : ConfigurationElementCollection, IExtensionsCollection
|
||||
{
|
||||
const string KeyExtension = "extension";
|
||||
|
||||
public override ConfigurationElementCollectionType CollectionType
|
||||
{
|
||||
get { return ConfigurationElementCollectionType.BasicMapAlternate; }
|
||||
}
|
||||
|
||||
protected override string ElementName
|
||||
{
|
||||
get { return KeyExtension; }
|
||||
}
|
||||
|
||||
protected override bool IsElementName(string elementName)
|
||||
{
|
||||
return elementName.Equals(KeyExtension, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new ExtensionElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((ExtensionElement)element).Alias;
|
||||
}
|
||||
|
||||
public override bool IsReadOnly()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
new public ExtensionElement this[string index]
|
||||
{
|
||||
get { return (ExtensionElement)BaseGet(index); }
|
||||
}
|
||||
|
||||
IEnumerator<IExtension> IEnumerable<IExtension>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IExtension;
|
||||
}
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
IExtension IExtensionsCollection.this[string index]
|
||||
{
|
||||
get { return this[index]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
public interface IExtensionsCollection : IEnumerable<IExtension>
|
||||
{
|
||||
IExtension this[string index] { get; }
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
|
||||
internal class ExtensionElementCollection : ConfigurationElementCollection, IExtensionsCollection
|
||||
{
|
||||
const string KeyExtension = "extension";
|
||||
|
||||
public override ConfigurationElementCollectionType CollectionType
|
||||
{
|
||||
get { return ConfigurationElementCollectionType.BasicMapAlternate; }
|
||||
}
|
||||
|
||||
protected override string ElementName
|
||||
{
|
||||
get { return KeyExtension; }
|
||||
}
|
||||
|
||||
protected override bool IsElementName(string elementName)
|
||||
{
|
||||
return elementName.Equals(KeyExtension, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new ExtensionElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((ExtensionElement)element).Alias;
|
||||
}
|
||||
|
||||
public override bool IsReadOnly()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
new public ExtensionElement this[string index]
|
||||
{
|
||||
get { return (ExtensionElement)BaseGet(index); }
|
||||
}
|
||||
|
||||
IEnumerator<IExtension> IEnumerable<IExtension>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IExtension;
|
||||
}
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
IExtension IExtensionsCollection.this[string index]
|
||||
{
|
||||
get { return this[index]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
public interface IBaseRestSection
|
||||
{
|
||||
IExtensionsCollection Items { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether base rest extensions are enabled.
|
||||
/// </summary>
|
||||
bool Enabled { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
public interface IBaseRestSection
|
||||
{
|
||||
IExtensionsCollection Items { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether base rest extensions are enabled.
|
||||
/// </summary>
|
||||
bool Enabled { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
public interface IExtension
|
||||
{
|
||||
string Alias { get; }
|
||||
|
||||
string Type { get; }
|
||||
|
||||
IMethodSection this[string index] { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
public interface IExtension
|
||||
{
|
||||
string Alias { get; }
|
||||
|
||||
string Type { get; }
|
||||
|
||||
IMethodSection this[string index] { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
public interface IMethodSection
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
bool AllowAll { get; }
|
||||
|
||||
string AllowGroup { get; }
|
||||
|
||||
string AllowType { get; }
|
||||
|
||||
string AllowMember { get; }
|
||||
|
||||
bool ReturnXml { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
public interface IMethodSection
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
bool AllowAll { get; }
|
||||
|
||||
string AllowGroup { get; }
|
||||
|
||||
string AllowType { get; }
|
||||
|
||||
string AllowMember { get; }
|
||||
|
||||
bool ReturnXml { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,50 +1,50 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
internal class MethodElement : ConfigurationElement, IMethodSection
|
||||
{
|
||||
const string KeyName = "name";
|
||||
const string KeyAllowAll = "allowAll";
|
||||
const string KeyAllowGroup = "allowGroup";
|
||||
const string KeyAllowType = "allowType";
|
||||
const string KeyAllowMember = "allowMember";
|
||||
const string KeyReturnXml = "returnXml";
|
||||
|
||||
[ConfigurationProperty(KeyName, IsKey = true, IsRequired = true)]
|
||||
public string Name
|
||||
{
|
||||
get { return (string)base[KeyName]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyAllowAll, IsKey = false, IsRequired = false, DefaultValue = false)]
|
||||
public bool AllowAll
|
||||
{
|
||||
get { return (bool)base[KeyAllowAll]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyAllowGroup, IsKey = false, IsRequired = false, DefaultValue = null)]
|
||||
public string AllowGroup
|
||||
{
|
||||
get { return (string)base[KeyAllowGroup]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyAllowType, IsKey = false, IsRequired = false, DefaultValue = null)]
|
||||
public string AllowType
|
||||
{
|
||||
get { return (string)base[KeyAllowType]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyAllowMember, IsKey = false, IsRequired = false, DefaultValue = null)]
|
||||
public string AllowMember
|
||||
{
|
||||
get { return (string)base[KeyAllowMember]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyReturnXml, IsKey = false, IsRequired = false, DefaultValue = true)]
|
||||
public bool ReturnXml
|
||||
{
|
||||
get { return (bool)base[KeyReturnXml]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.BaseRest
|
||||
{
|
||||
internal class MethodElement : ConfigurationElement, IMethodSection
|
||||
{
|
||||
const string KeyName = "name";
|
||||
const string KeyAllowAll = "allowAll";
|
||||
const string KeyAllowGroup = "allowGroup";
|
||||
const string KeyAllowType = "allowType";
|
||||
const string KeyAllowMember = "allowMember";
|
||||
const string KeyReturnXml = "returnXml";
|
||||
|
||||
[ConfigurationProperty(KeyName, IsKey = true, IsRequired = true)]
|
||||
public string Name
|
||||
{
|
||||
get { return (string)base[KeyName]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyAllowAll, IsKey = false, IsRequired = false, DefaultValue = false)]
|
||||
public bool AllowAll
|
||||
{
|
||||
get { return (bool)base[KeyAllowAll]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyAllowGroup, IsKey = false, IsRequired = false, DefaultValue = null)]
|
||||
public string AllowGroup
|
||||
{
|
||||
get { return (string)base[KeyAllowGroup]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyAllowType, IsKey = false, IsRequired = false, DefaultValue = null)]
|
||||
public string AllowType
|
||||
{
|
||||
get { return (string)base[KeyAllowType]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyAllowMember, IsKey = false, IsRequired = false, DefaultValue = null)]
|
||||
public string AllowMember
|
||||
{
|
||||
get { return (string)base[KeyAllowMember]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(KeyReturnXml, IsKey = false, IsRequired = false, DefaultValue = true)]
|
||||
public bool ReturnXml
|
||||
{
|
||||
get { return (bool)base[KeyReturnXml]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a configuration section that contains inner text that is comma delimited
|
||||
/// </summary>
|
||||
internal class CommaDelimitedConfigurationElement : InnerTextConfigurationElement<CommaDelimitedStringCollection>, IEnumerable<string>
|
||||
{
|
||||
public override CommaDelimitedStringCollection Value
|
||||
{
|
||||
get
|
||||
{
|
||||
var converter = new CommaDelimitedStringCollectionConverter();
|
||||
return (CommaDelimitedStringCollection) converter.ConvertFrom(RawValue);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator<string> IEnumerable<string>.GetEnumerator()
|
||||
{
|
||||
return new InnerEnumerator(Value.GetEnumerator());
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return new InnerEnumerator(Value.GetEnumerator());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A wrapper for StringEnumerator since it doesn't explicitly implement IEnumerable
|
||||
/// </summary>
|
||||
private class InnerEnumerator : IEnumerator<string>
|
||||
{
|
||||
private readonly StringEnumerator _stringEnumerator;
|
||||
|
||||
public InnerEnumerator(StringEnumerator stringEnumerator)
|
||||
{
|
||||
_stringEnumerator = stringEnumerator;
|
||||
}
|
||||
|
||||
public bool MoveNext()
|
||||
{
|
||||
return _stringEnumerator.MoveNext();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_stringEnumerator.Reset();
|
||||
}
|
||||
|
||||
string IEnumerator<string>.Current
|
||||
{
|
||||
get { return _stringEnumerator.Current; }
|
||||
}
|
||||
|
||||
public object Current
|
||||
{
|
||||
get { return _stringEnumerator.Current; }
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
UmbracoSettings.ObjectExtensions.DisposeIfDisposable(_stringEnumerator);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a configuration section that contains inner text that is comma delimited
|
||||
/// </summary>
|
||||
internal class CommaDelimitedConfigurationElement : InnerTextConfigurationElement<CommaDelimitedStringCollection>, IEnumerable<string>
|
||||
{
|
||||
public override CommaDelimitedStringCollection Value
|
||||
{
|
||||
get
|
||||
{
|
||||
var converter = new CommaDelimitedStringCollectionConverter();
|
||||
return (CommaDelimitedStringCollection) converter.ConvertFrom(RawValue);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator<string> IEnumerable<string>.GetEnumerator()
|
||||
{
|
||||
return new InnerEnumerator(Value.GetEnumerator());
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return new InnerEnumerator(Value.GetEnumerator());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A wrapper for StringEnumerator since it doesn't explicitly implement IEnumerable
|
||||
/// </summary>
|
||||
private class InnerEnumerator : IEnumerator<string>
|
||||
{
|
||||
private readonly StringEnumerator _stringEnumerator;
|
||||
|
||||
public InnerEnumerator(StringEnumerator stringEnumerator)
|
||||
{
|
||||
_stringEnumerator = stringEnumerator;
|
||||
}
|
||||
|
||||
public bool MoveNext()
|
||||
{
|
||||
return _stringEnumerator.MoveNext();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_stringEnumerator.Reset();
|
||||
}
|
||||
|
||||
string IEnumerator<string>.Current
|
||||
{
|
||||
get { return _stringEnumerator.Current; }
|
||||
}
|
||||
|
||||
public object Current
|
||||
{
|
||||
get { return _stringEnumerator.Current; }
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
ObjectExtensions.DisposeIfDisposable(_stringEnumerator);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class AccessElement : RawXmlConfigurationElement, IAccess
|
||||
{
|
||||
public AccessElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public AccessElement(XElement rawXml)
|
||||
:base(rawXml)
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerable<IAccessItem> Rules
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = new List<AccessItem>();
|
||||
if (RawXml != null)
|
||||
{
|
||||
result.AddRange(RawXml.Elements("deny").Select(x => new AccessItem {Action = AccessType.Deny, Value = x.Value }));
|
||||
result.AddRange(RawXml.Elements("grant").Select(x => new AccessItem { Action = AccessType.Grant, Value = x.Value }));
|
||||
result.AddRange(RawXml.Elements("grantBySection").Select(x => new AccessItem { Action = AccessType.GrantBySection, Value = x.Value }));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class AccessElement : RawXmlConfigurationElement, IAccess
|
||||
{
|
||||
public AccessElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public AccessElement(XElement rawXml)
|
||||
:base(rawXml)
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerable<IAccessItem> Rules
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = new List<AccessItem>();
|
||||
if (RawXml != null)
|
||||
{
|
||||
result.AddRange(RawXml.Elements("deny").Select(x => new AccessItem {Action = AccessType.Deny, Value = x.Value }));
|
||||
result.AddRange(RawXml.Elements("grant").Select(x => new AccessItem { Action = AccessType.Grant, Value = x.Value }));
|
||||
result.AddRange(RawXml.Elements("grantBySection").Select(x => new AccessItem { Action = AccessType.GrantBySection, Value = x.Value }));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class AccessItem : IAccessItem
|
||||
{
|
||||
/// <summary>
|
||||
/// This can be grant, deny or grantBySection
|
||||
/// </summary>
|
||||
public AccessType Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the action
|
||||
/// </summary>
|
||||
public string Value { get; set; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class AccessItem : IAccessItem
|
||||
{
|
||||
/// <summary>
|
||||
/// This can be grant, deny or grantBySection
|
||||
/// </summary>
|
||||
public AccessType Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the action
|
||||
/// </summary>
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public enum AccessType
|
||||
{
|
||||
Grant,
|
||||
Deny,
|
||||
GrantBySection
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public enum AccessType
|
||||
{
|
||||
Grant,
|
||||
Deny,
|
||||
GrantBySection
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class AreaCollection : ConfigurationElementCollection, IEnumerable<IArea>
|
||||
{
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new AreaElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((AreaElement) element).Value;
|
||||
}
|
||||
|
||||
IEnumerator<IArea> IEnumerable<IArea>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IArea;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class AreaElement : InnerTextConfigurationElement<string>, IArea
|
||||
{
|
||||
string IArea.AreaName
|
||||
{
|
||||
get { return Value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,15 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class AreasElement : ConfigurationElement, IArea
|
||||
{
|
||||
[ConfigurationProperty("area", IsRequired = true)]
|
||||
public InnerTextConfigurationElement<string> AreaName
|
||||
{
|
||||
get { return (InnerTextConfigurationElement<string>)this["area"]; }
|
||||
}
|
||||
|
||||
string IArea.AreaName
|
||||
{
|
||||
get { return AreaName; }
|
||||
}
|
||||
}
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class AreasElement : ConfigurationElement
|
||||
{
|
||||
[ConfigurationCollection(typeof(SectionCollection), AddItemName = "area")]
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
public AreaCollection AreaCollection
|
||||
{
|
||||
get { return (AreaCollection)base[""]; }
|
||||
set { base[""] = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class ControlCollection : ConfigurationElementCollection, IEnumerable<IDashboardControl>
|
||||
{
|
||||
internal void Add(ControlElement c)
|
||||
{
|
||||
BaseAdd(c);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new ControlElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((ControlElement)element).ControlPath;
|
||||
}
|
||||
|
||||
IEnumerator<IDashboardControl> IEnumerable<IDashboardControl>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IDashboardControl;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class ControlCollection : ConfigurationElementCollection, IEnumerable<IDashboardControl>
|
||||
{
|
||||
internal void Add(ControlElement c)
|
||||
{
|
||||
BaseAdd(c);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new ControlElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((ControlElement)element).ControlPath;
|
||||
}
|
||||
|
||||
IEnumerator<IDashboardControl> IEnumerable<IDashboardControl>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IDashboardControl;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,74 +1,74 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
|
||||
internal class ControlElement : RawXmlConfigurationElement, IDashboardControl
|
||||
{
|
||||
public bool ShowOnce
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("showOnce") == null
|
||||
? false
|
||||
: bool.Parse(RawXml.Attribute("showOnce").Value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool AddPanel
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("addPanel") == null
|
||||
? true
|
||||
: bool.Parse(RawXml.Attribute("addPanel").Value);
|
||||
}
|
||||
}
|
||||
|
||||
public string PanelCaption
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("panelCaption") == null
|
||||
? ""
|
||||
: RawXml.Attribute("panelCaption").Value;
|
||||
}
|
||||
}
|
||||
|
||||
public AccessElement Access
|
||||
{
|
||||
get
|
||||
{
|
||||
var access = RawXml.Element("access");
|
||||
if (access == null)
|
||||
{
|
||||
return new AccessElement();
|
||||
}
|
||||
return new AccessElement(access);
|
||||
}
|
||||
}
|
||||
|
||||
public string ControlPath
|
||||
{
|
||||
get
|
||||
{
|
||||
//we need to return the first (and only) text element of the children (wtf... who designed this configuration ! :P )
|
||||
var txt = RawXml.Nodes().OfType<XText>().FirstOrDefault();
|
||||
if (txt == null)
|
||||
{
|
||||
throw new ConfigurationErrorsException("The control element must contain a text node indicating the control path");
|
||||
}
|
||||
return txt.Value.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IAccess IDashboardControl.AccessRights
|
||||
{
|
||||
get { return Access; }
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
|
||||
internal class ControlElement : RawXmlConfigurationElement, IDashboardControl
|
||||
{
|
||||
public bool ShowOnce
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("showOnce") == null
|
||||
? false
|
||||
: bool.Parse(RawXml.Attribute("showOnce").Value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool AddPanel
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("addPanel") == null
|
||||
? true
|
||||
: bool.Parse(RawXml.Attribute("addPanel").Value);
|
||||
}
|
||||
}
|
||||
|
||||
public string PanelCaption
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("panelCaption") == null
|
||||
? ""
|
||||
: RawXml.Attribute("panelCaption").Value;
|
||||
}
|
||||
}
|
||||
|
||||
public AccessElement Access
|
||||
{
|
||||
get
|
||||
{
|
||||
var access = RawXml.Element("access");
|
||||
if (access == null)
|
||||
{
|
||||
return new AccessElement();
|
||||
}
|
||||
return new AccessElement(access);
|
||||
}
|
||||
}
|
||||
|
||||
public string ControlPath
|
||||
{
|
||||
get
|
||||
{
|
||||
//we need to return the first (and only) text element of the children (wtf... who designed this configuration ! :P )
|
||||
var txt = RawXml.Nodes().OfType<XText>().FirstOrDefault();
|
||||
if (txt == null)
|
||||
{
|
||||
throw new ConfigurationErrorsException("The control element must contain a text node indicating the control path");
|
||||
}
|
||||
return txt.Value.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IAccess IDashboardControl.AccessRights
|
||||
{
|
||||
get { return Access; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class DashboardSection : ConfigurationSection, IDashboardSection
|
||||
{
|
||||
[ConfigurationCollection(typeof(SectionCollection), AddItemName = "section")]
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
public SectionCollection SectionCollection
|
||||
{
|
||||
get { return (SectionCollection)base[""]; }
|
||||
set { base[""] = value; }
|
||||
}
|
||||
|
||||
IEnumerable<ISection> IDashboardSection.Sections
|
||||
{
|
||||
get { return SectionCollection; }
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class DashboardSection : ConfigurationSection, IDashboardSection
|
||||
{
|
||||
[ConfigurationCollection(typeof(SectionCollection), AddItemName = "section")]
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
public SectionCollection SectionCollection
|
||||
{
|
||||
get { return (SectionCollection)base[""]; }
|
||||
set { base[""] = value; }
|
||||
}
|
||||
|
||||
IEnumerable<ISection> IDashboardSection.Sections
|
||||
{
|
||||
get { return SectionCollection; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IAccess
|
||||
{
|
||||
IEnumerable<IAccessItem> Rules { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IAccess
|
||||
{
|
||||
IEnumerable<IAccessItem> Rules { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IAccessItem
|
||||
{
|
||||
/// <summary>
|
||||
/// This can be grant, deny or grantBySection
|
||||
/// </summary>
|
||||
AccessType Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the action
|
||||
/// </summary>
|
||||
string Value { get; set; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IAccessItem
|
||||
{
|
||||
/// <summary>
|
||||
/// This can be grant, deny or grantBySection
|
||||
/// </summary>
|
||||
AccessType Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the action
|
||||
/// </summary>
|
||||
string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IArea
|
||||
{
|
||||
string AreaName { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IArea
|
||||
{
|
||||
string AreaName { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IDashboardControl
|
||||
{
|
||||
bool ShowOnce { get; }
|
||||
|
||||
bool AddPanel { get; }
|
||||
|
||||
string PanelCaption { get; }
|
||||
|
||||
string ControlPath { get; }
|
||||
|
||||
IAccess AccessRights { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IDashboardControl
|
||||
{
|
||||
bool ShowOnce { get; }
|
||||
|
||||
bool AddPanel { get; }
|
||||
|
||||
string PanelCaption { get; }
|
||||
|
||||
string ControlPath { get; }
|
||||
|
||||
IAccess AccessRights { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IDashboardSection
|
||||
{
|
||||
IEnumerable<ISection> Sections { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IDashboardSection
|
||||
{
|
||||
IEnumerable<ISection> Sections { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IDashboardTab
|
||||
{
|
||||
string Caption { get; }
|
||||
|
||||
IEnumerable<IDashboardControl> Controls { get; }
|
||||
|
||||
IAccess AccessRights { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface IDashboardTab
|
||||
{
|
||||
string Caption { get; }
|
||||
|
||||
IEnumerable<IDashboardControl> Controls { get; }
|
||||
|
||||
IAccess AccessRights { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface ISection
|
||||
{
|
||||
string Alias { get; }
|
||||
|
||||
string Area { get; }
|
||||
|
||||
IEnumerable<IDashboardTab> Tabs { get; }
|
||||
|
||||
IAccess AccessRights { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
public interface ISection
|
||||
{
|
||||
string Alias { get; }
|
||||
|
||||
IEnumerable<string> Areas { get; }
|
||||
|
||||
IEnumerable<IDashboardTab> Tabs { get; }
|
||||
|
||||
IAccess AccessRights { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class SectionCollection : ConfigurationElementCollection, IEnumerable<ISection>
|
||||
{
|
||||
internal void Add(SectionElement c)
|
||||
{
|
||||
BaseAdd(c);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new SectionElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((SectionElement)element).Alias;
|
||||
}
|
||||
|
||||
IEnumerator<ISection> IEnumerable<ISection>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as ISection;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class SectionCollection : ConfigurationElementCollection, IEnumerable<ISection>
|
||||
{
|
||||
internal void Add(SectionElement c)
|
||||
{
|
||||
BaseAdd(c);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new SectionElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((SectionElement)element).Alias;
|
||||
}
|
||||
|
||||
IEnumerator<ISection> IEnumerable<ISection>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as ISection;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class SectionElement : ConfigurationElement, ISection
|
||||
{
|
||||
[ConfigurationProperty("alias", IsRequired = true)]
|
||||
public string Alias
|
||||
{
|
||||
get { return (string) this["alias"]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("areas", IsRequired = true)]
|
||||
public AreasElement Area
|
||||
{
|
||||
get { return (AreasElement)this["areas"]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("access")]
|
||||
public AccessElement Access
|
||||
{
|
||||
get { return (AccessElement)this["access"]; }
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof(SectionCollection), AddItemName = "tab")]
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
public TabCollection TabCollection
|
||||
{
|
||||
get { return (TabCollection)base[""]; }
|
||||
set { base[""] = value; }
|
||||
}
|
||||
|
||||
IEnumerable<IDashboardTab> ISection.Tabs
|
||||
{
|
||||
get { return TabCollection; }
|
||||
}
|
||||
|
||||
string ISection.Area
|
||||
{
|
||||
get { return Area.AreaName; }
|
||||
}
|
||||
|
||||
IAccess ISection.AccessRights
|
||||
{
|
||||
get { return Access; }
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class SectionElement : ConfigurationElement, ISection
|
||||
{
|
||||
[ConfigurationProperty("alias", IsRequired = true)]
|
||||
public string Alias
|
||||
{
|
||||
get { return (string) this["alias"]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("areas", IsRequired = true)]
|
||||
public AreasElement Areas
|
||||
{
|
||||
get { return (AreasElement)this["areas"]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("access")]
|
||||
public AccessElement Access
|
||||
{
|
||||
get { return (AccessElement)this["access"]; }
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof(SectionCollection), AddItemName = "tab")]
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
public TabCollection TabCollection
|
||||
{
|
||||
get { return (TabCollection)base[""]; }
|
||||
set { base[""] = value; }
|
||||
}
|
||||
|
||||
IEnumerable<IDashboardTab> ISection.Tabs
|
||||
{
|
||||
get { return TabCollection; }
|
||||
}
|
||||
|
||||
IEnumerable<string> ISection.Areas
|
||||
{
|
||||
get { return Areas.AreaCollection.Cast<AreaElement>().Select(x => x.Value); }
|
||||
}
|
||||
|
||||
IAccess ISection.AccessRights
|
||||
{
|
||||
get { return Access; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class TabCollection : ConfigurationElementCollection, IEnumerable<IDashboardTab>
|
||||
{
|
||||
internal void Add(TabElement c)
|
||||
{
|
||||
BaseAdd(c);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new TabElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((TabElement)element).Caption;
|
||||
}
|
||||
|
||||
IEnumerator<IDashboardTab> IEnumerable<IDashboardTab>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IDashboardTab;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class TabCollection : ConfigurationElementCollection, IEnumerable<IDashboardTab>
|
||||
{
|
||||
internal void Add(TabElement c)
|
||||
{
|
||||
BaseAdd(c);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new TabElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((TabElement)element).Caption;
|
||||
}
|
||||
|
||||
IEnumerator<IDashboardTab> IEnumerable<IDashboardTab>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IDashboardTab;
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class TabElement : ConfigurationElement, IDashboardTab
|
||||
{
|
||||
[ConfigurationProperty("caption", IsRequired = true)]
|
||||
public string Caption
|
||||
{
|
||||
get { return (string)this["caption"]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("access")]
|
||||
public AccessElement Access
|
||||
{
|
||||
get { return (AccessElement)this["access"]; }
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof(ControlCollection), AddItemName = "control")]
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
public ControlCollection ControlCollection
|
||||
{
|
||||
get { return (ControlCollection)base[""]; }
|
||||
set { base[""] = value; }
|
||||
}
|
||||
|
||||
IEnumerable<IDashboardControl> IDashboardTab.Controls
|
||||
{
|
||||
get { return ControlCollection; }
|
||||
}
|
||||
|
||||
IAccess IDashboardTab.AccessRights
|
||||
{
|
||||
get { return Access; }
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Dashboard
|
||||
{
|
||||
internal class TabElement : ConfigurationElement, IDashboardTab
|
||||
{
|
||||
[ConfigurationProperty("caption", IsRequired = true)]
|
||||
public string Caption
|
||||
{
|
||||
get { return (string)this["caption"]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("access")]
|
||||
public AccessElement Access
|
||||
{
|
||||
get { return (AccessElement)this["access"]; }
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof(ControlCollection), AddItemName = "control")]
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
public ControlCollection ControlCollection
|
||||
{
|
||||
get { return (ControlCollection)base[""]; }
|
||||
set { base[""] = value; }
|
||||
}
|
||||
|
||||
IEnumerable<IDashboardControl> IDashboardTab.Controls
|
||||
{
|
||||
get { return ControlCollection; }
|
||||
}
|
||||
|
||||
IAccess IDashboardTab.AccessRights
|
||||
{
|
||||
get { return Access; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,10 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
throw new InvalidOperationException("Cannot create an MVC Area path without the umbracoPath specified");
|
||||
}
|
||||
return Path.TrimStart(SystemDirectories.Root).TrimStart('~').TrimStart('/').Replace('/', '-').Trim().ToLower();
|
||||
var path = Path;
|
||||
if (path.StartsWith(SystemDirectories.Root)) // beware of TrimStart, see U4-2518
|
||||
path = path.Substring(SystemDirectories.Root.Length);
|
||||
return path.TrimStart('~').TrimStart('/').Replace('/', '-').Trim().ToLower();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,69 +1,69 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// A full config section is required for any full element and we have some elements that are defined like this:
|
||||
/// {element}MyValue{/element} instead of as attribute values.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
internal class InnerTextConfigurationElement<T> : RawXmlConfigurationElement
|
||||
{
|
||||
public InnerTextConfigurationElement()
|
||||
{
|
||||
}
|
||||
|
||||
public InnerTextConfigurationElement(XElement rawXml) : base(rawXml)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
|
||||
{
|
||||
base.DeserializeElement(reader, serializeCollectionKey);
|
||||
//now validate and set the raw value
|
||||
if (RawXml.HasElements)
|
||||
throw new InvalidOperationException("An InnerTextConfigurationElement cannot contain any child elements, only attributes and a value");
|
||||
RawValue = RawXml.Value.Trim();
|
||||
|
||||
//RawValue = reader.ReadElementContentAsString();
|
||||
}
|
||||
|
||||
public virtual T Value
|
||||
{
|
||||
get
|
||||
{
|
||||
var converted = UmbracoSettings.ObjectExtensions.TryConvertTo<T>(RawValue);
|
||||
if (converted.Success == false)
|
||||
throw new InvalidCastException("Could not convert value " + RawValue + " to type " + typeof(T));
|
||||
return converted.Result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exposes the raw string value
|
||||
/// </summary>
|
||||
internal string RawValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Implicit operator so we don't need to use the 'Value' property explicitly
|
||||
/// </summary>
|
||||
/// <param name="m"></param>
|
||||
/// <returns></returns>
|
||||
public static implicit operator T(InnerTextConfigurationElement<T> m)
|
||||
{
|
||||
return m.Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the string value of Value
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}", Value);
|
||||
}
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// A full config section is required for any full element and we have some elements that are defined like this:
|
||||
/// {element}MyValue{/element} instead of as attribute values.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
internal class InnerTextConfigurationElement<T> : RawXmlConfigurationElement
|
||||
{
|
||||
public InnerTextConfigurationElement()
|
||||
{
|
||||
}
|
||||
|
||||
public InnerTextConfigurationElement(XElement rawXml) : base(rawXml)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
|
||||
{
|
||||
base.DeserializeElement(reader, serializeCollectionKey);
|
||||
//now validate and set the raw value
|
||||
if (RawXml.HasElements)
|
||||
throw new InvalidOperationException("An InnerTextConfigurationElement cannot contain any child elements, only attributes and a value");
|
||||
RawValue = RawXml.Value.Trim();
|
||||
|
||||
//RawValue = reader.ReadElementContentAsString();
|
||||
}
|
||||
|
||||
public virtual T Value
|
||||
{
|
||||
get
|
||||
{
|
||||
var converted = ObjectExtensions.TryConvertTo<T>(RawValue);
|
||||
if (converted.Success == false)
|
||||
throw new InvalidCastException("Could not convert value " + RawValue + " to type " + typeof(T));
|
||||
return converted.Result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exposes the raw string value
|
||||
/// </summary>
|
||||
internal string RawValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Implicit operator so we don't need to use the 'Value' property explicitly
|
||||
/// </summary>
|
||||
/// <param name="m"></param>
|
||||
/// <returns></returns>
|
||||
public static implicit operator T(InnerTextConfigurationElement<T> m)
|
||||
{
|
||||
return m.Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the string value of Value
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}", Value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,43 +1,43 @@
|
||||
using System.Configuration;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for specifying default values for comma delimited config
|
||||
/// </summary>
|
||||
internal class OptionalCommaDelimitedConfigurationElement : CommaDelimitedConfigurationElement
|
||||
{
|
||||
private readonly CommaDelimitedConfigurationElement _wrapped;
|
||||
private readonly string[] _defaultValue;
|
||||
|
||||
public OptionalCommaDelimitedConfigurationElement()
|
||||
{
|
||||
}
|
||||
|
||||
public OptionalCommaDelimitedConfigurationElement(CommaDelimitedConfigurationElement wrapped, string[] defaultValue)
|
||||
{
|
||||
_wrapped = wrapped;
|
||||
_defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public override CommaDelimitedStringCollection Value
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_wrapped == null)
|
||||
{
|
||||
return base.Value;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(_wrapped.RawValue))
|
||||
{
|
||||
var val = new CommaDelimitedStringCollection();
|
||||
val.AddRange(_defaultValue);
|
||||
return val;
|
||||
}
|
||||
return _wrapped.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Configuration;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for specifying default values for comma delimited config
|
||||
/// </summary>
|
||||
internal class OptionalCommaDelimitedConfigurationElement : CommaDelimitedConfigurationElement
|
||||
{
|
||||
private readonly CommaDelimitedConfigurationElement _wrapped;
|
||||
private readonly string[] _defaultValue;
|
||||
|
||||
public OptionalCommaDelimitedConfigurationElement()
|
||||
{
|
||||
}
|
||||
|
||||
public OptionalCommaDelimitedConfigurationElement(CommaDelimitedConfigurationElement wrapped, string[] defaultValue)
|
||||
{
|
||||
_wrapped = wrapped;
|
||||
_defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public override CommaDelimitedStringCollection Value
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_wrapped == null)
|
||||
{
|
||||
return base.Value;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(_wrapped.RawValue))
|
||||
{
|
||||
var val = new CommaDelimitedStringCollection();
|
||||
val.AddRange(_defaultValue);
|
||||
return val;
|
||||
}
|
||||
return _wrapped.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// This is used to supply optional/default values when using InnerTextConfigurationElement
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
internal class OptionalInnerTextConfigurationElement<T> : InnerTextConfigurationElement<T>
|
||||
{
|
||||
private readonly InnerTextConfigurationElement<T> _wrapped;
|
||||
private readonly T _defaultValue;
|
||||
|
||||
public OptionalInnerTextConfigurationElement(InnerTextConfigurationElement<T> wrapped, T defaultValue)
|
||||
{
|
||||
_wrapped = wrapped;
|
||||
_defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public override T Value
|
||||
{
|
||||
get { return string.IsNullOrEmpty(_wrapped.RawValue) ? _defaultValue : _wrapped.Value; }
|
||||
}
|
||||
}
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// This is used to supply optional/default values when using InnerTextConfigurationElement
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
internal class OptionalInnerTextConfigurationElement<T> : InnerTextConfigurationElement<T>
|
||||
{
|
||||
private readonly InnerTextConfigurationElement<T> _wrapped;
|
||||
private readonly T _defaultValue;
|
||||
|
||||
public OptionalInnerTextConfigurationElement(InnerTextConfigurationElement<T> wrapped, T defaultValue)
|
||||
{
|
||||
_wrapped = wrapped;
|
||||
_defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public override T Value
|
||||
{
|
||||
get { return string.IsNullOrEmpty(_wrapped.RawValue) ? _defaultValue : _wrapped.Value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,30 @@
|
||||
using System.Configuration;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// A configuration section that simply exposes the entire raw xml of the section itself which inheritors can use
|
||||
/// to do with as they please.
|
||||
/// </summary>
|
||||
internal abstract class RawXmlConfigurationElement : ConfigurationElement
|
||||
{
|
||||
protected RawXmlConfigurationElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected RawXmlConfigurationElement(XElement rawXml)
|
||||
{
|
||||
RawXml = rawXml;
|
||||
}
|
||||
|
||||
protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
|
||||
{
|
||||
RawXml = (XElement)XNode.ReadFrom(reader);
|
||||
}
|
||||
|
||||
protected XElement RawXml { get; private set; }
|
||||
}
|
||||
using System.Configuration;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// A configuration section that simply exposes the entire raw xml of the section itself which inheritors can use
|
||||
/// to do with as they please.
|
||||
/// </summary>
|
||||
internal abstract class RawXmlConfigurationElement : ConfigurationElement
|
||||
{
|
||||
protected RawXmlConfigurationElement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected RawXmlConfigurationElement(XElement rawXml)
|
||||
{
|
||||
RawXml = rawXml;
|
||||
}
|
||||
|
||||
protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
|
||||
{
|
||||
RawXml = (XElement)XNode.ReadFrom(reader);
|
||||
}
|
||||
|
||||
protected XElement RawXml { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -1,127 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Umbraco.Core.Configuration.BaseRest;
|
||||
using Umbraco.Core.Configuration.Dashboard;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// The gateway to all umbraco configuration
|
||||
/// </summary>
|
||||
public class UmbracoConfig
|
||||
{
|
||||
#region Singleton
|
||||
|
||||
private static readonly Lazy<UmbracoConfig> Lazy = new Lazy<UmbracoConfig>(() => new UmbracoConfig());
|
||||
|
||||
public static UmbracoConfig For
|
||||
{
|
||||
get { return Lazy.Value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
private UmbracoConfig()
|
||||
{
|
||||
if (_umbracoSettings == null)
|
||||
{
|
||||
var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettingsSection;
|
||||
if (umbracoSettings == null)
|
||||
{
|
||||
LogHelper.Warn<UmbracoConfig>("Could not load the " + typeof(IUmbracoSettingsSection) + " from config file!");
|
||||
}
|
||||
SetUmbracoSettings(umbracoSettings);
|
||||
}
|
||||
|
||||
if (_baseRestExtensions == null)
|
||||
{
|
||||
var baseRestExtensions = ConfigurationManager.GetSection("umbracoConfiguration/BaseRestExtensions") as IBaseRestSection;
|
||||
if (baseRestExtensions == null)
|
||||
{
|
||||
LogHelper.Warn<UmbracoConfig>("Could not load the " + typeof(IBaseRestSection) + " from config file!");
|
||||
}
|
||||
SetBaseRestExtensions(baseRestExtensions);
|
||||
}
|
||||
|
||||
if (_dashboardSection == null)
|
||||
{
|
||||
var dashboardConfig = ConfigurationManager.GetSection("umbracoConfiguration/dashBoard") as IDashboardSection;
|
||||
if (dashboardConfig == null)
|
||||
{
|
||||
LogHelper.Warn<UmbracoConfig>("Could not load the " + typeof(IDashboardSection) + " from config file!");
|
||||
}
|
||||
SetDashboardSettings(dashboardConfig);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor - can be used for testing
|
||||
/// </summary>
|
||||
/// <param name="umbracoSettings"></param>
|
||||
/// <param name="baseRestSettings"></param>
|
||||
/// <param name="dashboardSettings"></param>
|
||||
public UmbracoConfig(IUmbracoSettingsSection umbracoSettings, IBaseRestSection baseRestSettings, IDashboardSection dashboardSettings)
|
||||
{
|
||||
SetUmbracoSettings(umbracoSettings);
|
||||
SetBaseRestExtensions(baseRestSettings);
|
||||
SetDashboardSettings(dashboardSettings);
|
||||
}
|
||||
|
||||
private IDashboardSection _dashboardSection;
|
||||
private IUmbracoSettingsSection _umbracoSettings;
|
||||
private IBaseRestSection _baseRestExtensions;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IDashboardSection
|
||||
/// </summary>
|
||||
public IDashboardSection DashboardSettings()
|
||||
{
|
||||
return _dashboardSection;
|
||||
}
|
||||
|
||||
//ONLY for unit testing
|
||||
internal void SetDashboardSettings(IDashboardSection value)
|
||||
{
|
||||
_dashboardSection = value;
|
||||
}
|
||||
|
||||
//ONLY for unit testing
|
||||
internal void SetUmbracoSettings(IUmbracoSettingsSection value)
|
||||
{
|
||||
_umbracoSettings = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IUmbracoSettings
|
||||
/// </summary>
|
||||
public IUmbracoSettingsSection UmbracoSettings()
|
||||
{
|
||||
return _umbracoSettings;
|
||||
}
|
||||
|
||||
//ONLY for unit testing
|
||||
public void SetBaseRestExtensions(IBaseRestSection value)
|
||||
{
|
||||
_baseRestExtensions = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IBaseRestSection
|
||||
/// </summary>
|
||||
public IBaseRestSection BaseRestExtensions()
|
||||
{
|
||||
return _baseRestExtensions;
|
||||
}
|
||||
|
||||
//TODO: Add other configurations here !
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Umbraco.Core.Configuration.BaseRest;
|
||||
using Umbraco.Core.Configuration.Dashboard;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// The gateway to all umbraco configuration
|
||||
/// </summary>
|
||||
public class UmbracoConfig
|
||||
{
|
||||
#region Singleton
|
||||
|
||||
private static readonly Lazy<UmbracoConfig> Lazy = new Lazy<UmbracoConfig>(() => new UmbracoConfig());
|
||||
|
||||
public static UmbracoConfig For
|
||||
{
|
||||
get { return Lazy.Value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
private UmbracoConfig()
|
||||
{
|
||||
if (_umbracoSettings == null)
|
||||
{
|
||||
var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettingsSection;
|
||||
if (umbracoSettings == null)
|
||||
{
|
||||
LogHelper.Warn<UmbracoConfig>("Could not load the " + typeof(IUmbracoSettingsSection) + " from config file!");
|
||||
}
|
||||
SetUmbracoSettings(umbracoSettings);
|
||||
}
|
||||
|
||||
if (_baseRestExtensions == null)
|
||||
{
|
||||
var baseRestExtensions = ConfigurationManager.GetSection("umbracoConfiguration/BaseRestExtensions") as IBaseRestSection;
|
||||
if (baseRestExtensions == null)
|
||||
{
|
||||
LogHelper.Warn<UmbracoConfig>("Could not load the " + typeof(IBaseRestSection) + " from config file!");
|
||||
}
|
||||
SetBaseRestExtensions(baseRestExtensions);
|
||||
}
|
||||
|
||||
if (_dashboardSection == null)
|
||||
{
|
||||
var dashboardConfig = ConfigurationManager.GetSection("umbracoConfiguration/dashBoard") as IDashboardSection;
|
||||
if (dashboardConfig == null)
|
||||
{
|
||||
LogHelper.Warn<UmbracoConfig>("Could not load the " + typeof(IDashboardSection) + " from config file!");
|
||||
}
|
||||
SetDashboardSettings(dashboardConfig);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor - can be used for testing
|
||||
/// </summary>
|
||||
/// <param name="umbracoSettings"></param>
|
||||
/// <param name="baseRestSettings"></param>
|
||||
/// <param name="dashboardSettings"></param>
|
||||
public UmbracoConfig(IUmbracoSettingsSection umbracoSettings, IBaseRestSection baseRestSettings, IDashboardSection dashboardSettings)
|
||||
{
|
||||
SetUmbracoSettings(umbracoSettings);
|
||||
SetBaseRestExtensions(baseRestSettings);
|
||||
SetDashboardSettings(dashboardSettings);
|
||||
}
|
||||
|
||||
private IDashboardSection _dashboardSection;
|
||||
private IUmbracoSettingsSection _umbracoSettings;
|
||||
private IBaseRestSection _baseRestExtensions;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IDashboardSection
|
||||
/// </summary>
|
||||
public IDashboardSection DashboardSettings()
|
||||
{
|
||||
return _dashboardSection;
|
||||
}
|
||||
|
||||
//ONLY for unit testing
|
||||
internal void SetDashboardSettings(IDashboardSection value)
|
||||
{
|
||||
_dashboardSection = value;
|
||||
}
|
||||
|
||||
//ONLY for unit testing
|
||||
internal void SetUmbracoSettings(IUmbracoSettingsSection value)
|
||||
{
|
||||
_umbracoSettings = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IUmbracoSettings
|
||||
/// </summary>
|
||||
public IUmbracoSettingsSection UmbracoSettings()
|
||||
{
|
||||
return _umbracoSettings;
|
||||
}
|
||||
|
||||
//ONLY for unit testing
|
||||
public void SetBaseRestExtensions(IBaseRestSection value)
|
||||
{
|
||||
_baseRestExtensions = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the IBaseRestSection
|
||||
/// </summary>
|
||||
public IBaseRestSection BaseRestExtensions()
|
||||
{
|
||||
return _baseRestExtensions;
|
||||
}
|
||||
|
||||
//TODO: Add other configurations here !
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
@@ -217,6 +218,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("This is here so that if this config element exists we won't get a YSOD, it is not used whatsoever and will be removed in future versions")]
|
||||
[ConfigurationProperty("DocumentTypeIconList")]
|
||||
internal InnerTextConfigurationElement<IconPickerBehaviour> DocumentTypeIconList
|
||||
{
|
||||
@@ -393,11 +395,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
get { return MacroErrors; }
|
||||
}
|
||||
|
||||
IconPickerBehaviour IContentSection.IconPickerBehaviour
|
||||
{
|
||||
get { return DocumentTypeIconList; }
|
||||
}
|
||||
|
||||
IEnumerable<string> IContentSection.DisallowedUploadFiles
|
||||
{
|
||||
get { return DisallowedUploadFiles; }
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IChar
|
||||
{
|
||||
string Char { get; }
|
||||
string Replacement { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IChar
|
||||
{
|
||||
string Char { get; }
|
||||
string Replacement { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IContentErrorPage
|
||||
{
|
||||
int ContentId { get; }
|
||||
string Culture { get; set; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IContentErrorPage
|
||||
{
|
||||
int ContentId { get; }
|
||||
string Culture { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,65 +1,63 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IContentSection : IUmbracoConfigurationSection
|
||||
{
|
||||
string NotificationEmailAddress { get; }
|
||||
|
||||
bool DisableHtmlEmail { get; }
|
||||
|
||||
IEnumerable<string> ImageFileTypes { get; }
|
||||
|
||||
IEnumerable<string> ImageTagAllowedAttributes { get; }
|
||||
|
||||
IEnumerable<IImagingAutoFillUploadField> ImageAutoFillProperties { get; }
|
||||
|
||||
string ScriptFolderPath { get; }
|
||||
|
||||
IEnumerable<string> ScriptFileTypes { get; }
|
||||
|
||||
bool ScriptEditorDisable { get; }
|
||||
|
||||
bool ResolveUrlsFromTextString { get; }
|
||||
|
||||
bool UploadAllowDirectories { get; }
|
||||
|
||||
IEnumerable<IContentErrorPage> Error404Collection { get; }
|
||||
|
||||
bool EnsureUniqueNaming { get; }
|
||||
|
||||
bool TidyEditorContent { get; }
|
||||
|
||||
string TidyCharEncoding { get; }
|
||||
|
||||
bool XmlCacheEnabled { get; }
|
||||
|
||||
bool ContinouslyUpdateXmlDiskCache { get; }
|
||||
|
||||
bool XmlContentCheckForDiskChanges { get; }
|
||||
|
||||
bool EnableSplashWhileLoading { get; }
|
||||
|
||||
string PropertyContextHelpOption { get; }
|
||||
|
||||
bool UseLegacyXmlSchema { get; }
|
||||
|
||||
bool ForceSafeAliases { get; }
|
||||
|
||||
string PreviewBadge { get; }
|
||||
|
||||
int UmbracoLibraryCacheDuration { get; }
|
||||
|
||||
MacroErrorBehaviour MacroErrorBehaviour { get; }
|
||||
|
||||
IconPickerBehaviour IconPickerBehaviour { get; }
|
||||
|
||||
IEnumerable<string> DisallowedUploadFiles { get; }
|
||||
|
||||
bool CloneXmlContent { get; }
|
||||
|
||||
bool GlobalPreviewStorageEnabled { get; }
|
||||
|
||||
string DefaultDocumentTypeProperty { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IContentSection : IUmbracoConfigurationSection
|
||||
{
|
||||
string NotificationEmailAddress { get; }
|
||||
|
||||
bool DisableHtmlEmail { get; }
|
||||
|
||||
IEnumerable<string> ImageFileTypes { get; }
|
||||
|
||||
IEnumerable<string> ImageTagAllowedAttributes { get; }
|
||||
|
||||
IEnumerable<IImagingAutoFillUploadField> ImageAutoFillProperties { get; }
|
||||
|
||||
string ScriptFolderPath { get; }
|
||||
|
||||
IEnumerable<string> ScriptFileTypes { get; }
|
||||
|
||||
bool ScriptEditorDisable { get; }
|
||||
|
||||
bool ResolveUrlsFromTextString { get; }
|
||||
|
||||
bool UploadAllowDirectories { get; }
|
||||
|
||||
IEnumerable<IContentErrorPage> Error404Collection { get; }
|
||||
|
||||
bool EnsureUniqueNaming { get; }
|
||||
|
||||
bool TidyEditorContent { get; }
|
||||
|
||||
string TidyCharEncoding { get; }
|
||||
|
||||
bool XmlCacheEnabled { get; }
|
||||
|
||||
bool ContinouslyUpdateXmlDiskCache { get; }
|
||||
|
||||
bool XmlContentCheckForDiskChanges { get; }
|
||||
|
||||
bool EnableSplashWhileLoading { get; }
|
||||
|
||||
string PropertyContextHelpOption { get; }
|
||||
|
||||
bool UseLegacyXmlSchema { get; }
|
||||
|
||||
bool ForceSafeAliases { get; }
|
||||
|
||||
string PreviewBadge { get; }
|
||||
|
||||
int UmbracoLibraryCacheDuration { get; }
|
||||
|
||||
MacroErrorBehaviour MacroErrorBehaviour { get; }
|
||||
|
||||
IEnumerable<string> DisallowedUploadFiles { get; }
|
||||
|
||||
bool CloneXmlContent { get; }
|
||||
|
||||
bool GlobalPreviewStorageEnabled { get; }
|
||||
|
||||
string DefaultDocumentTypeProperty { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IDeveloperSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<IFileExtension> AppCodeFileExtensions { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IDeveloperSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<IFileExtension> AppCodeFileExtensions { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IDistributedCallSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool Enabled { get; }
|
||||
|
||||
int UserId { get; }
|
||||
|
||||
IEnumerable<IServer> Servers { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IDistributedCallSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool Enabled { get; }
|
||||
|
||||
int UserId { get; }
|
||||
|
||||
IEnumerable<IServer> Servers { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IFileExtension
|
||||
{
|
||||
string Extension { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IFileExtension
|
||||
{
|
||||
string Extension { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IHelpSection : IUmbracoConfigurationSection
|
||||
{
|
||||
string DefaultUrl { get; }
|
||||
|
||||
IEnumerable<ILink> Links { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IHelpSection : IUmbracoConfigurationSection
|
||||
{
|
||||
string DefaultUrl { get; }
|
||||
|
||||
IEnumerable<ILink> Links { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IImagingAutoFillUploadField
|
||||
{
|
||||
/// <summary>
|
||||
/// Allow setting internally so we can create a default
|
||||
/// </summary>
|
||||
string Alias { get; }
|
||||
|
||||
string WidthFieldAlias { get; }
|
||||
|
||||
string HeightFieldAlias { get; }
|
||||
|
||||
string LengthFieldAlias { get; }
|
||||
|
||||
string ExtensionFieldAlias { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IImagingAutoFillUploadField
|
||||
{
|
||||
/// <summary>
|
||||
/// Allow setting internally so we can create a default
|
||||
/// </summary>
|
||||
string Alias { get; }
|
||||
|
||||
string WidthFieldAlias { get; }
|
||||
|
||||
string HeightFieldAlias { get; }
|
||||
|
||||
string LengthFieldAlias { get; }
|
||||
|
||||
string ExtensionFieldAlias { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ILink
|
||||
{
|
||||
string Application { get; }
|
||||
|
||||
string ApplicationUrl { get; }
|
||||
|
||||
string Language { get; }
|
||||
|
||||
string UserType { get; }
|
||||
|
||||
string HelpUrl { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ILink
|
||||
{
|
||||
string Application { get; }
|
||||
|
||||
string ApplicationUrl { get; }
|
||||
|
||||
string Language { get; }
|
||||
|
||||
string UserType { get; }
|
||||
|
||||
string HelpUrl { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ILogType
|
||||
{
|
||||
string LogTypeAlias { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ILogType
|
||||
{
|
||||
string LogTypeAlias { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ILoggingSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool AutoCleanLogs { get; }
|
||||
|
||||
bool EnableLogging { get; }
|
||||
|
||||
bool EnableAsyncLogging { get; }
|
||||
|
||||
int CleaningMiliseconds { get; }
|
||||
|
||||
int MaxLogAge { get; }
|
||||
|
||||
IEnumerable<ILogType> DisabledLogTypes { get; }
|
||||
|
||||
string ExternalLoggerAssembly { get; }
|
||||
|
||||
string ExternalLoggerType { get; }
|
||||
|
||||
bool ExternalLoggerEnableAuditTrail { get; }
|
||||
|
||||
bool ExternalLoggerIsConfigured { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ILoggingSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool AutoCleanLogs { get; }
|
||||
|
||||
bool EnableLogging { get; }
|
||||
|
||||
bool EnableAsyncLogging { get; }
|
||||
|
||||
int CleaningMiliseconds { get; }
|
||||
|
||||
int MaxLogAge { get; }
|
||||
|
||||
IEnumerable<ILogType> DisabledLogTypes { get; }
|
||||
|
||||
string ExternalLoggerAssembly { get; }
|
||||
|
||||
string ExternalLoggerType { get; }
|
||||
|
||||
bool ExternalLoggerEnableAuditTrail { get; }
|
||||
|
||||
bool ExternalLoggerIsConfigured { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface INotDynamicXmlDocument
|
||||
{
|
||||
string Element { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface INotDynamicXmlDocument
|
||||
{
|
||||
string Element { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IProvidersSection : IUmbracoConfigurationSection
|
||||
{
|
||||
string DefaultBackOfficeUserProvider { get; }
|
||||
}
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IProvidersSection : IUmbracoConfigurationSection
|
||||
{
|
||||
string DefaultBackOfficeUserProvider { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IRazorStaticMapping
|
||||
{
|
||||
Guid DataTypeGuid { get; }
|
||||
string NodeTypeAlias { get; }
|
||||
string PropertyTypeAlias { get; }
|
||||
string MappingName { get; }
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IRazorStaticMapping
|
||||
{
|
||||
Guid DataTypeGuid { get; }
|
||||
string NodeTypeAlias { get; }
|
||||
string PropertyTypeAlias { get; }
|
||||
string MappingName { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
|
||||
public interface IRepositoriesSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<IRepository> Repositories { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
|
||||
public interface IRepositoriesSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<IRepository> Repositories { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IRepository
|
||||
{
|
||||
string Name { get; }
|
||||
Guid Id { get; }
|
||||
string RepositoryUrl { get; }
|
||||
string WebServiceUrl { get; }
|
||||
bool HasCustomWebServiceUrl { get; }
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IRepository
|
||||
{
|
||||
string Name { get; }
|
||||
Guid Id { get; }
|
||||
string RepositoryUrl { get; }
|
||||
string WebServiceUrl { get; }
|
||||
bool HasCustomWebServiceUrl { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IRequestHandlerSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool UseDomainPrefixes { get; }
|
||||
|
||||
bool AddTrailingSlash { get; }
|
||||
|
||||
bool RemoveDoubleDashes { get; }
|
||||
|
||||
IEnumerable<IChar> CharCollection { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IRequestHandlerSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool UseDomainPrefixes { get; }
|
||||
|
||||
bool AddTrailingSlash { get; }
|
||||
|
||||
bool RemoveDoubleDashes { get; }
|
||||
|
||||
IEnumerable<IChar> CharCollection { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IScheduledTask
|
||||
{
|
||||
string Alias { get; }
|
||||
|
||||
bool Log { get; }
|
||||
|
||||
int Interval { get; }
|
||||
|
||||
string Url { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IScheduledTask
|
||||
{
|
||||
string Alias { get; }
|
||||
|
||||
bool Log { get; }
|
||||
|
||||
int Interval { get; }
|
||||
|
||||
string Url { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IScheduledTasksSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<IScheduledTask> Tasks { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IScheduledTasksSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<IScheduledTask> Tasks { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IScriptingSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<INotDynamicXmlDocument> NotDynamicXmlDocumentElements { get; }
|
||||
|
||||
IEnumerable<IRazorStaticMapping> DataTypeModelStaticMappings { get; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IScriptingSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<INotDynamicXmlDocument> NotDynamicXmlDocumentElements { get; }
|
||||
|
||||
IEnumerable<IRazorStaticMapping> DataTypeModelStaticMappings { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ISecuritySection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool KeepUserLoggedIn { get; }
|
||||
|
||||
bool HideDisabledUsersInBackoffice { get; }
|
||||
|
||||
string AuthCookieName { get; }
|
||||
|
||||
string AuthCookieDomain { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ISecuritySection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool KeepUserLoggedIn { get; }
|
||||
|
||||
bool HideDisabledUsersInBackoffice { get; }
|
||||
|
||||
string AuthCookieName { get; }
|
||||
|
||||
string AuthCookieDomain { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IServer
|
||||
{
|
||||
string ForcePortnumber { get; }
|
||||
string ForceProtocol { get; }
|
||||
string ServerAddress { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IServer
|
||||
{
|
||||
string ForcePortnumber { get; }
|
||||
string ForceProtocol { get; }
|
||||
string ServerAddress { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ITemplatesSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool UseAspNetMasterPages { get; }
|
||||
|
||||
bool EnableSkinSupport { get; }
|
||||
|
||||
RenderingEngine DefaultRenderingEngine { get; }
|
||||
|
||||
bool EnableTemplateFolders { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ITemplatesSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool UseAspNetMasterPages { get; }
|
||||
|
||||
bool EnableSkinSupport { get; }
|
||||
|
||||
RenderingEngine DefaultRenderingEngine { get; }
|
||||
|
||||
bool EnableTemplateFolders { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IUmbracoSettingsSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IContentSection Content { get; }
|
||||
|
||||
ISecuritySection Security { get; }
|
||||
|
||||
IRequestHandlerSection RequestHandler { get; }
|
||||
|
||||
ITemplatesSection Templates { get; }
|
||||
|
||||
IDeveloperSection Developer { get; }
|
||||
|
||||
IViewStateMoverModuleSection ViewStateMoverModule { get; }
|
||||
|
||||
ILoggingSection Logging { get; }
|
||||
|
||||
IScheduledTasksSection ScheduledTasks { get; }
|
||||
|
||||
IDistributedCallSection DistributedCall { get; }
|
||||
|
||||
IRepositoriesSection PackageRepositories { get; }
|
||||
|
||||
IProvidersSection Providers { get; }
|
||||
|
||||
IHelpSection Help { get; }
|
||||
|
||||
IWebRoutingSection WebRouting { get; }
|
||||
|
||||
IScriptingSection Scripting { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IUmbracoSettingsSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IContentSection Content { get; }
|
||||
|
||||
ISecuritySection Security { get; }
|
||||
|
||||
IRequestHandlerSection RequestHandler { get; }
|
||||
|
||||
ITemplatesSection Templates { get; }
|
||||
|
||||
IDeveloperSection Developer { get; }
|
||||
|
||||
IViewStateMoverModuleSection ViewStateMoverModule { get; }
|
||||
|
||||
ILoggingSection Logging { get; }
|
||||
|
||||
IScheduledTasksSection ScheduledTasks { get; }
|
||||
|
||||
IDistributedCallSection DistributedCall { get; }
|
||||
|
||||
IRepositoriesSection PackageRepositories { get; }
|
||||
|
||||
IProvidersSection Providers { get; }
|
||||
|
||||
IHelpSection Help { get; }
|
||||
|
||||
IWebRoutingSection WebRouting { get; }
|
||||
|
||||
IScriptingSection Scripting { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IViewStateMoverModuleSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool Enable { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IViewStateMoverModuleSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool Enable { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IWebRoutingSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool TrySkipIisCustomErrors { get; }
|
||||
|
||||
bool InternalRedirectPreservesTemplate { get; }
|
||||
|
||||
string UrlProviderMode { get; }
|
||||
}
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IWebRoutingSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool TrySkipIisCustomErrors { get; }
|
||||
|
||||
bool InternalRedirectPreservesTemplate { get; }
|
||||
|
||||
string UrlProviderMode { get; }
|
||||
}
|
||||
|
||||
}
|
||||
+36
-36
@@ -1,37 +1,37 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class ImagingAutoFillPropertiesCollection : ConfigurationElementCollection, IEnumerable<IImagingAutoFillUploadField>
|
||||
{
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new ImagingAutoFillUploadFieldElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((ImagingAutoFillUploadFieldElement)element).Alias;
|
||||
}
|
||||
|
||||
internal void Add(ImagingAutoFillUploadFieldElement item)
|
||||
{
|
||||
BaseAdd(item);
|
||||
}
|
||||
|
||||
IEnumerator<IImagingAutoFillUploadField> IEnumerable<IImagingAutoFillUploadField>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IImagingAutoFillUploadField;
|
||||
}
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class ImagingAutoFillPropertiesCollection : ConfigurationElementCollection, IEnumerable<IImagingAutoFillUploadField>
|
||||
{
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new ImagingAutoFillUploadFieldElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((ImagingAutoFillUploadFieldElement)element).Alias;
|
||||
}
|
||||
|
||||
internal void Add(ImagingAutoFillUploadFieldElement item)
|
||||
{
|
||||
BaseAdd(item);
|
||||
}
|
||||
|
||||
IEnumerator<IImagingAutoFillUploadField> IEnumerable<IImagingAutoFillUploadField>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IImagingAutoFillUploadField;
|
||||
}
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
+90
-90
@@ -1,91 +1,91 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class ImagingAutoFillUploadFieldElement : ConfigurationElement, IImagingAutoFillUploadField
|
||||
{
|
||||
/// <summary>
|
||||
/// Allow setting internally so we can create a default
|
||||
/// </summary>
|
||||
[ConfigurationProperty("alias", IsKey = true, IsRequired = true)]
|
||||
public string Alias
|
||||
{
|
||||
get { return (string)this["alias"]; }
|
||||
set { this["alias"] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("widthFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> WidthFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["widthFieldAlias"],
|
||||
//set the default
|
||||
"umbracoWidth");
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("heightFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> HeightFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["heightFieldAlias"],
|
||||
//set the default
|
||||
"umbracoHeight");
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("lengthFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> LengthFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["lengthFieldAlias"],
|
||||
//set the default
|
||||
"umbracoBytes");
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("extensionFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> ExtensionFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["extensionFieldAlias"],
|
||||
//set the default
|
||||
"umbracoExtension");
|
||||
}
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.Alias
|
||||
{
|
||||
get { return Alias; }
|
||||
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.WidthFieldAlias
|
||||
{
|
||||
get { return WidthFieldAlias; }
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.HeightFieldAlias
|
||||
{
|
||||
get { return HeightFieldAlias; }
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.LengthFieldAlias
|
||||
{
|
||||
get { return LengthFieldAlias; }
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.ExtensionFieldAlias
|
||||
{
|
||||
get { return ExtensionFieldAlias; }
|
||||
}
|
||||
}
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class ImagingAutoFillUploadFieldElement : ConfigurationElement, IImagingAutoFillUploadField
|
||||
{
|
||||
/// <summary>
|
||||
/// Allow setting internally so we can create a default
|
||||
/// </summary>
|
||||
[ConfigurationProperty("alias", IsKey = true, IsRequired = true)]
|
||||
public string Alias
|
||||
{
|
||||
get { return (string)this["alias"]; }
|
||||
set { this["alias"] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("widthFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> WidthFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["widthFieldAlias"],
|
||||
//set the default
|
||||
"umbracoWidth");
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("heightFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> HeightFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["heightFieldAlias"],
|
||||
//set the default
|
||||
"umbracoHeight");
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("lengthFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> LengthFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["lengthFieldAlias"],
|
||||
//set the default
|
||||
"umbracoBytes");
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("extensionFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> ExtensionFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["extensionFieldAlias"],
|
||||
//set the default
|
||||
"umbracoExtension");
|
||||
}
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.Alias
|
||||
{
|
||||
get { return Alias; }
|
||||
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.WidthFieldAlias
|
||||
{
|
||||
get { return WidthFieldAlias; }
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.HeightFieldAlias
|
||||
{
|
||||
get { return HeightFieldAlias; }
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.LengthFieldAlias
|
||||
{
|
||||
get { return LengthFieldAlias; }
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.ExtensionFieldAlias
|
||||
{
|
||||
get { return ExtensionFieldAlias; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,210 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
|
||||
internal static class ObjectExtensions
|
||||
{
|
||||
|
||||
//private static readonly ConcurrentDictionary<Type, Func<object>> ObjectFactoryCache = new ConcurrentDictionary<Type, Func<object>>();
|
||||
|
||||
public static IEnumerable<T> AsEnumerableOfOne<T>(this T input)
|
||||
{
|
||||
return Enumerable.Repeat(input, 1);
|
||||
}
|
||||
|
||||
public static void DisposeIfDisposable(this object input)
|
||||
{
|
||||
var disposable = input as IDisposable;
|
||||
if (disposable != null) disposable.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides a shortcut way of safely casting an input when you cannot guarantee the <typeparam name="T"></typeparam> is an instance type (i.e., when the C# AS keyword is not applicable)
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="input">The input.</param>
|
||||
/// <returns></returns>
|
||||
public static T SafeCast<T>(this object input)
|
||||
{
|
||||
if (ReferenceEquals(null, input) || ReferenceEquals(default(T), input)) return default(T);
|
||||
if (input is T) return (T)input;
|
||||
return default(T);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to convert the input object to the output type using TypeConverters
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public static Attempt<T> TryConvertTo<T>(this object input)
|
||||
{
|
||||
var result = TryConvertTo(input, typeof(T));
|
||||
if (!result.Success)
|
||||
{
|
||||
//just try a straight up conversion
|
||||
try
|
||||
{
|
||||
var converted = (T)input;
|
||||
return Attempt.Succeed(converted);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Attempt<T>.Fail(e);
|
||||
}
|
||||
}
|
||||
return !result.Success ? Attempt<T>.Fail() : Attempt.Succeed((T)result.Result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to convert the input object to the output type using TypeConverters. If the destination type is a superclass of the input type,
|
||||
/// if will use <see cref="Convert.ChangeType(object,System.Type)"/>.
|
||||
/// </summary>
|
||||
/// <param name="input">The input.</param>
|
||||
/// <param name="destinationType">Type of the destination.</param>
|
||||
/// <returns></returns>
|
||||
public static Attempt<object> TryConvertTo(this object input, Type destinationType)
|
||||
{
|
||||
if (input == null) return Attempt<object>.Fail();
|
||||
|
||||
if (destinationType == typeof(object)) return Attempt.Succeed(input);
|
||||
|
||||
if (input.GetType() == destinationType) return Attempt.Succeed(input);
|
||||
|
||||
if (input is string && destinationType.IsEnum)
|
||||
{
|
||||
try
|
||||
{
|
||||
var output = Enum.Parse(destinationType, (string)input, true);
|
||||
return Attempt.Succeed(output);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Attempt<object>.Succeed(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (!destinationType.IsGenericType || destinationType.GetGenericTypeDefinition() != typeof(Nullable<>))
|
||||
{
|
||||
//TODO: Do a check for destination type being IEnumerable<T> and source type implementing IEnumerable<T> with
|
||||
// the same 'T', then we'd have to find the extension method for the type AsEnumerable() and execute it.
|
||||
|
||||
if (TypeHelper.IsTypeAssignableFrom(destinationType, input.GetType())
|
||||
&& TypeHelper.IsTypeAssignableFrom<IConvertible>(input))
|
||||
{
|
||||
try
|
||||
{
|
||||
var casted = Convert.ChangeType(input, destinationType);
|
||||
return Attempt<object>.Succeed(casted);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Attempt<object>.Fail(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var inputConverter = TypeDescriptor.GetConverter(input);
|
||||
if (inputConverter.CanConvertTo(destinationType))
|
||||
{
|
||||
try
|
||||
{
|
||||
var converted = inputConverter.ConvertTo(input, destinationType);
|
||||
return Attempt<object>.Succeed(converted);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Attempt<object>.Fail(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (destinationType == typeof(bool))
|
||||
{
|
||||
var boolConverter = new CustomBooleanTypeConverter();
|
||||
if (boolConverter.CanConvertFrom(input.GetType()))
|
||||
{
|
||||
try
|
||||
{
|
||||
var converted = boolConverter.ConvertFrom(input);
|
||||
return Attempt<object>.Succeed(converted);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Attempt<object>.Fail(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var outputConverter = TypeDescriptor.GetConverter(destinationType);
|
||||
if (outputConverter.CanConvertFrom(input.GetType()))
|
||||
{
|
||||
try
|
||||
{
|
||||
var converted = outputConverter.ConvertFrom(input);
|
||||
return Attempt<object>.Succeed(converted);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Attempt<object>.Fail(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (TypeHelper.IsTypeAssignableFrom<IConvertible>(input))
|
||||
{
|
||||
try
|
||||
{
|
||||
var casted = Convert.ChangeType(input, destinationType);
|
||||
return Attempt<object>.Succeed(casted);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Attempt<object>.Fail(e);
|
||||
}
|
||||
}
|
||||
|
||||
return Attempt<object>.Fail();
|
||||
}
|
||||
|
||||
public static void CheckThrowObjectDisposed(this IDisposable disposable, bool isDisposed, string objectname)
|
||||
{
|
||||
//TODO: Localise this exception
|
||||
if (isDisposed)
|
||||
throw new ObjectDisposedException(objectname);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns object into dictionary
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
/// <param name="ignoreProperties">Properties to ignore</param>
|
||||
/// <returns></returns>
|
||||
public static IDictionary<string, TVal> ToDictionary<TVal>(this object o, params string[] ignoreProperties)
|
||||
{
|
||||
if (o != null)
|
||||
{
|
||||
var props = TypeDescriptor.GetProperties(o);
|
||||
var d = new Dictionary<string, TVal>();
|
||||
foreach (var prop in props.Cast<PropertyDescriptor>().Where(x => !ignoreProperties.Contains(x.Name)))
|
||||
{
|
||||
var val = prop.GetValue(o);
|
||||
if (val != null)
|
||||
{
|
||||
d.Add(prop.Name, (TVal)val);
|
||||
}
|
||||
}
|
||||
return d;
|
||||
}
|
||||
return new Dictionary<string, TVal>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Umbraco.Core.Configuration
|
||||
@@ -23,7 +23,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 "beta"; } }
|
||||
public static string CurrentComment { get { return ""; } }
|
||||
|
||||
// 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
|
||||
|
||||
@@ -99,6 +99,11 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
public static class Member
|
||||
{
|
||||
/// <summary>
|
||||
/// if a role starts with __umbracoRole we won't show it as it's an internal role used for public access
|
||||
/// </summary>
|
||||
public static readonly string InternalRolePrefix = "__umbracoRole";
|
||||
|
||||
public static readonly string UmbracoMemberProviderName = "UmbracoMembershipProvider";
|
||||
|
||||
public static readonly string UmbracoRoleProviderName = "UmbracoRoleProvider";
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class Examine
|
||||
{
|
||||
/// <summary>
|
||||
/// The alias of the internal member searcher
|
||||
/// </summary>
|
||||
public const string InternalMemberSearcher = "InternalMemberSearcher";
|
||||
|
||||
/// <summary>
|
||||
/// The alias of the internal content searcher
|
||||
/// </summary>
|
||||
public const string InternalSearcher = "InternalSearcher";
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class Examine
|
||||
{
|
||||
/// <summary>
|
||||
/// The alias of the internal member searcher
|
||||
/// </summary>
|
||||
public const string InternalMemberSearcher = "InternalMemberSearcher";
|
||||
|
||||
/// <summary>
|
||||
/// The alias of the internal content searcher
|
||||
/// </summary>
|
||||
public const string InternalSearcher = "InternalSearcher";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,12 +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>
|
||||
/// Alias for the Dictionary Picker datatype.
|
||||
/// </summary>
|
||||
public const string DictionaryPickerAlias = "Umbraco.DictionaryPicker";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the Dropdown list datatype.
|
||||
/// </summary>
|
||||
@@ -141,10 +136,10 @@ namespace Umbraco.Core
|
||||
[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 ImageCropper = "7A2D436C-34C2-410F-898F-4A23B3D79F54";
|
||||
|
||||
/// <summary>
|
||||
/// Alias for the Image Cropper datatype.
|
||||
/// </summary>
|
||||
public const string ImageCropperAlias = "Umbraco.ImageCropper";
|
||||
///// <summary>
|
||||
///// Alias for the Image Cropper datatype.
|
||||
///// </summary>
|
||||
//public const string ImageCropperAlias = "Umbraco.ImageCropper";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the Integer datatype.
|
||||
@@ -191,6 +186,8 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
public const string MediaPickerAlias = "Umbraco.MediaPicker";
|
||||
|
||||
public const string MultipleMediaPickerAlias = "Umbraco.MultipleMediaPicker";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the Member Picker datatype.
|
||||
/// </summary>
|
||||
@@ -202,6 +199,11 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
public const string MemberPickerAlias = "Umbraco.MemberPicker";
|
||||
|
||||
/// <summary>
|
||||
/// Alias for the Member Group Picker datatype.
|
||||
/// </summary>
|
||||
public const string MemberGroupPickerAlias = "Umbraco.MemberGroupPicker";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the Multi-Node Tree Picker datatype
|
||||
/// </summary>
|
||||
@@ -319,9 +321,9 @@ namespace Umbraco.Core
|
||||
public const string TinyMCEv3 = "5E9B75AE-FACE-41C8-B47E-5F4B0FD82F83";
|
||||
|
||||
/// <summary>
|
||||
/// Alias for the TinyMCE v3 wysiwyg datatype.
|
||||
/// Alias for the TinyMCE wysiwyg datatype.
|
||||
/// </summary>
|
||||
public const string TinyMCEv3Alias = "Umbraco.TinyMCEv3";
|
||||
public const string TinyMCEAlias = "Umbraco.TinyMCEv3";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the True/False (Ja/Nej) datatype.
|
||||
@@ -339,12 +341,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>
|
||||
/// Alias for the Ultimate Picker datatype.
|
||||
/// </summary>
|
||||
public const string UltimatePickerAlias = "Umbraco.UltimatePicker";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the UltraSimpleEditor datatype.
|
||||
/// </summary>
|
||||
@@ -352,21 +349,16 @@ namespace Umbraco.Core
|
||||
public const string UltraSimpleEditor = "60B7DABF-99CD-41EB-B8E9-4D2E669BBDE9";
|
||||
|
||||
/// <summary>
|
||||
/// Alias for the UltraSimpleEditor datatype.
|
||||
/// Alias for the MarkdownEditor datatype.
|
||||
/// </summary>
|
||||
public const string UltraSimpleEditorAlias = "Umbraco.UltraSimpleEditor";
|
||||
public const string MarkdownEditorAlias = "Umbraco.MarkdownEditor";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the Umbraco Usercontrol Wrapper datatype.
|
||||
/// </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>
|
||||
/// Alias for the Umbraco Usercontrol Wrapper datatype.
|
||||
/// </summary>
|
||||
public const string UmbracoUserControlWrapperAlias = "Umbraco.UmbracoUserControlWrapper";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the Upload field datatype.
|
||||
/// </summary>
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace Umbraco.Core
|
||||
|
||||
//Create the legacy prop-eds mapping
|
||||
LegacyPropertyEditorIdToAliasConverter.CreateMappingsForCoreEditors();
|
||||
LegacyParameterEditorAliasConverter.CreateMappingsForCoreEditors();
|
||||
|
||||
//create database and service contexts for the app context
|
||||
var dbFactory = new DefaultDatabaseFactory(GlobalSettings.UmbracoConnectionName);
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace Umbraco.Core
|
||||
if (value is string)
|
||||
{
|
||||
var str = (string)value;
|
||||
if (str == null || str.Length == 0 || str == "0") return false;
|
||||
if (str == "1") return true;
|
||||
if (str == "0" || str == "") return false;
|
||||
}
|
||||
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
|
||||
@@ -177,8 +177,21 @@ namespace Umbraco.Core
|
||||
public static MethodInfo GetMethodInfo<T1, T2>(Expression<Func<T1, T2>> fromExpression)
|
||||
{
|
||||
if (fromExpression == null) return null;
|
||||
var body = fromExpression.Body as MethodCallExpression;
|
||||
return body != null ? body.Method : null;
|
||||
|
||||
MethodCallExpression me;
|
||||
switch (fromExpression.Body.NodeType)
|
||||
{
|
||||
case ExpressionType.Convert:
|
||||
case ExpressionType.ConvertChecked:
|
||||
var ue = fromExpression.Body as UnaryExpression;
|
||||
me = ((ue != null) ? ue.Operand : null) as MethodCallExpression;
|
||||
break;
|
||||
default:
|
||||
me = fromExpression.Body as MethodCallExpression;
|
||||
break;
|
||||
}
|
||||
|
||||
return me != null ? me.Method : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Any class implementing this interface that is added to the httpcontext.items keys or values will be disposed of at the end of the request.
|
||||
/// </summary>
|
||||
public interface IDisposeOnRequestEnd : IDisposable
|
||||
{
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Any class implementing this interface that is added to the httpcontext.items keys or values will be disposed of at the end of the request.
|
||||
/// </summary>
|
||||
public interface IDisposeOnRequestEnd : IDisposable
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,11 +45,11 @@ namespace Umbraco.Core.IO
|
||||
|
||||
public IEnumerable<string> GetThumbnails(string path)
|
||||
{
|
||||
var parentDirectory = System.IO.Path.GetDirectoryName(path);
|
||||
var extension = System.IO.Path.GetExtension(path);
|
||||
var parentDirectory = Path.GetDirectoryName(path);
|
||||
var extension = Path.GetExtension(path);
|
||||
|
||||
return GetFiles(parentDirectory)
|
||||
.Where(x => x.StartsWith(path.TrimEnd(extension) + "_thumb"))
|
||||
.Where(x => x.StartsWith(path.TrimEnd(extension) + "_thumb") || x.StartsWith(path.TrimEnd(extension) + "_big-thumb"))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Umbraco.Core.IO
|
||||
{
|
||||
DeleteFile(path);
|
||||
|
||||
if (!deleteThumbnails)
|
||||
if (deleteThumbnails == false)
|
||||
return;
|
||||
|
||||
DeleteThumbnails(path);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
namespace Umbraco.Core
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
[Obsolete("This is no longer used and will be removed from the core in future versions")]
|
||||
public enum IconPickerBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Manifest
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to convert a parameter editor manifest to a property editor object
|
||||
/// </summary>
|
||||
internal class ParameterEditorConverter : JsonCreationConverter<ParameterEditor>
|
||||
{
|
||||
protected override ParameterEditor Create(Type objectType, JObject jObject)
|
||||
{
|
||||
return new ParameterEditor();
|
||||
}
|
||||
|
||||
protected override void Deserialize(JObject jObject, ParameterEditor target, JsonSerializer serializer)
|
||||
{
|
||||
//since it's a manifest editor, we need to create it's instance.
|
||||
//we need to specify the view value for the editor here otherwise we'll get an exception.
|
||||
target.ManifestDefinedParameterValueEditor = new ParameterValueEditor
|
||||
{
|
||||
View = jObject["view"].ToString()
|
||||
};
|
||||
|
||||
base.Deserialize(jObject, target, serializer);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Manifest
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to convert a parameter editor manifest to a property editor object
|
||||
/// </summary>
|
||||
internal class ParameterEditorConverter : JsonCreationConverter<ParameterEditor>
|
||||
{
|
||||
protected override ParameterEditor Create(Type objectType, JObject jObject)
|
||||
{
|
||||
return new ParameterEditor();
|
||||
}
|
||||
|
||||
protected override void Deserialize(JObject jObject, ParameterEditor target, JsonSerializer serializer)
|
||||
{
|
||||
//since it's a manifest editor, we need to create it's instance.
|
||||
//we need to specify the view value for the editor here otherwise we'll get an exception.
|
||||
target.ManifestDefinedParameterValueEditor = new ParameterValueEditor
|
||||
{
|
||||
View = jObject["view"].ToString()
|
||||
};
|
||||
|
||||
base.Deserialize(jObject, target, serializer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,144 +1,144 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
|
||||
namespace Umbraco.Core.Media
|
||||
{
|
||||
/// <summary>
|
||||
/// A helper class used for imaging
|
||||
/// </summary>
|
||||
internal static class ImageHelper
|
||||
{
|
||||
public static string GetMimeType(this Image image)
|
||||
{
|
||||
var format = image.RawFormat;
|
||||
var codec = ImageCodecInfo.GetImageDecoders().First(c => c.FormatID == format.Guid);
|
||||
return codec.MimeType;
|
||||
}
|
||||
|
||||
internal static IEnumerable<ResizedImage> GenerateMediaThumbnails(
|
||||
IFileSystem fs,
|
||||
string fileName,
|
||||
string extension,
|
||||
Image originalImage,
|
||||
IEnumerable<int> additionalThumbSizes)
|
||||
{
|
||||
// Make default thumbnails
|
||||
var thumbs = new List<ResizedImage>
|
||||
{
|
||||
Resize(fs, fileName, extension, 100, "thumb", originalImage),
|
||||
Resize(fs, fileName, extension, 500, "big-thumb", originalImage)
|
||||
};
|
||||
|
||||
//make custom ones
|
||||
foreach (var thumb in additionalThumbSizes.Where(x => x > 0).Distinct())
|
||||
{
|
||||
thumbs.Add(Resize(fs, fileName, extension, thumb, string.Format("thumb_{0}", thumb), originalImage));
|
||||
}
|
||||
|
||||
return thumbs;
|
||||
}
|
||||
|
||||
private static ResizedImage Resize(IFileSystem fileSystem, string path, string extension, int maxWidthHeight, string fileNameAddition, Image originalImage)
|
||||
{
|
||||
var fileNameThumb = String.IsNullOrEmpty(fileNameAddition)
|
||||
? string.Format("{0}_UMBRACOSYSTHUMBNAIL.jpg", path.Substring(0, path.LastIndexOf(".")))
|
||||
: string.Format("{0}_{1}.jpg", path.Substring(0, path.LastIndexOf(".")), fileNameAddition);
|
||||
|
||||
var thumb = GenerateThumbnail(
|
||||
originalImage,
|
||||
maxWidthHeight,
|
||||
fileNameThumb,
|
||||
extension,
|
||||
fileSystem);
|
||||
|
||||
return thumb;
|
||||
}
|
||||
|
||||
internal static ResizedImage GenerateThumbnail(Image image, int maxWidthHeight, string thumbnailFileName, string extension, IFileSystem fs)
|
||||
{
|
||||
return GenerateThumbnail(image, maxWidthHeight, -1, -1, thumbnailFileName, extension, fs);
|
||||
}
|
||||
|
||||
internal static ResizedImage GenerateThumbnail(Image image, int fixedWidth, int fixedHeight, string thumbnailFileName, string extension, IFileSystem fs)
|
||||
{
|
||||
return GenerateThumbnail(image, -1, fixedWidth, fixedHeight, thumbnailFileName, extension, fs);
|
||||
}
|
||||
|
||||
private static ResizedImage GenerateThumbnail(Image image, int maxWidthHeight, int fixedWidth, int fixedHeight, string thumbnailFileName, string extension, IFileSystem fs)
|
||||
{
|
||||
// Generate thumbnail
|
||||
float f = 1;
|
||||
if (maxWidthHeight >= 0)
|
||||
{
|
||||
var fx = (float)image.Size.Width / maxWidthHeight;
|
||||
var fy = (float)image.Size.Height / maxWidthHeight;
|
||||
|
||||
// must fit in thumbnail size
|
||||
f = Math.Max(fx, fy);
|
||||
}
|
||||
|
||||
//depending on if we are doing fixed width resizing or not.
|
||||
fixedWidth = (maxWidthHeight > 0) ? image.Width : fixedWidth;
|
||||
fixedHeight = (maxWidthHeight > 0) ? image.Height : fixedHeight;
|
||||
|
||||
var widthTh = (int)Math.Round(fixedWidth / f);
|
||||
var heightTh = (int)Math.Round(fixedHeight / f);
|
||||
|
||||
// fixes for empty width or height
|
||||
if (widthTh == 0)
|
||||
widthTh = 1;
|
||||
if (heightTh == 0)
|
||||
heightTh = 1;
|
||||
|
||||
// Create new image with best quality settings
|
||||
using (var bp = new Bitmap(widthTh, heightTh))
|
||||
{
|
||||
using (var g = Graphics.FromImage(bp))
|
||||
{
|
||||
g.SmoothingMode = SmoothingMode.HighQuality;
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
g.CompositingQuality = CompositingQuality.HighQuality;
|
||||
|
||||
// Copy the old image to the new and resized
|
||||
var rect = new Rectangle(0, 0, widthTh, heightTh);
|
||||
g.DrawImage(image, rect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel);
|
||||
|
||||
// Copy metadata
|
||||
var imageEncoders = ImageCodecInfo.GetImageEncoders();
|
||||
|
||||
var codec = extension.ToLower() == "png" || extension.ToLower() == "gif"
|
||||
? imageEncoders.Single(t => t.MimeType.Equals("image/png"))
|
||||
: imageEncoders.Single(t => t.MimeType.Equals("image/jpeg"));
|
||||
|
||||
// Set compresion ratio to 90%
|
||||
var ep = new EncoderParameters();
|
||||
ep.Param[0] = new EncoderParameter(Encoder.Quality, 90L);
|
||||
|
||||
// Save the new image using the dimensions of the image
|
||||
var newFileName = thumbnailFileName.Replace("UMBRACOSYSTHUMBNAIL", string.Format("{0}x{1}", widthTh, heightTh));
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
bp.Save(ms, codec, ep);
|
||||
ms.Seek(0, 0);
|
||||
|
||||
fs.AddFile(newFileName, ms);
|
||||
}
|
||||
|
||||
return new ResizedImage(widthTh, heightTh, newFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
|
||||
namespace Umbraco.Core.Media
|
||||
{
|
||||
/// <summary>
|
||||
/// A helper class used for imaging
|
||||
/// </summary>
|
||||
internal static class ImageHelper
|
||||
{
|
||||
public static string GetMimeType(this Image image)
|
||||
{
|
||||
var format = image.RawFormat;
|
||||
var codec = ImageCodecInfo.GetImageDecoders().First(c => c.FormatID == format.Guid);
|
||||
return codec.MimeType;
|
||||
}
|
||||
|
||||
internal static IEnumerable<ResizedImage> GenerateMediaThumbnails(
|
||||
IFileSystem fs,
|
||||
string fileName,
|
||||
string extension,
|
||||
Image originalImage,
|
||||
IEnumerable<int> additionalThumbSizes)
|
||||
{
|
||||
// Make default thumbnails
|
||||
var thumbs = new List<ResizedImage>
|
||||
{
|
||||
Resize(fs, fileName, extension, 100, "thumb", originalImage),
|
||||
Resize(fs, fileName, extension, 500, "big-thumb", originalImage)
|
||||
};
|
||||
|
||||
//make custom ones
|
||||
foreach (var thumb in additionalThumbSizes.Where(x => x > 0).Distinct())
|
||||
{
|
||||
thumbs.Add(Resize(fs, fileName, extension, thumb, string.Format("thumb_{0}", thumb), originalImage));
|
||||
}
|
||||
|
||||
return thumbs;
|
||||
}
|
||||
|
||||
private static ResizedImage Resize(IFileSystem fileSystem, string path, string extension, int maxWidthHeight, string fileNameAddition, Image originalImage)
|
||||
{
|
||||
var fileNameThumb = String.IsNullOrEmpty(fileNameAddition)
|
||||
? string.Format("{0}_UMBRACOSYSTHUMBNAIL.jpg", path.Substring(0, path.LastIndexOf(".")))
|
||||
: string.Format("{0}_{1}.jpg", path.Substring(0, path.LastIndexOf(".")), fileNameAddition);
|
||||
|
||||
var thumb = GenerateThumbnail(
|
||||
originalImage,
|
||||
maxWidthHeight,
|
||||
fileNameThumb,
|
||||
extension,
|
||||
fileSystem);
|
||||
|
||||
return thumb;
|
||||
}
|
||||
|
||||
internal static ResizedImage GenerateThumbnail(Image image, int maxWidthHeight, string thumbnailFileName, string extension, IFileSystem fs)
|
||||
{
|
||||
return GenerateThumbnail(image, maxWidthHeight, -1, -1, thumbnailFileName, extension, fs);
|
||||
}
|
||||
|
||||
internal static ResizedImage GenerateThumbnail(Image image, int fixedWidth, int fixedHeight, string thumbnailFileName, string extension, IFileSystem fs)
|
||||
{
|
||||
return GenerateThumbnail(image, -1, fixedWidth, fixedHeight, thumbnailFileName, extension, fs);
|
||||
}
|
||||
|
||||
private static ResizedImage GenerateThumbnail(Image image, int maxWidthHeight, int fixedWidth, int fixedHeight, string thumbnailFileName, string extension, IFileSystem fs)
|
||||
{
|
||||
// Generate thumbnail
|
||||
float f = 1;
|
||||
if (maxWidthHeight >= 0)
|
||||
{
|
||||
var fx = (float)image.Size.Width / maxWidthHeight;
|
||||
var fy = (float)image.Size.Height / maxWidthHeight;
|
||||
|
||||
// must fit in thumbnail size
|
||||
f = Math.Max(fx, fy);
|
||||
}
|
||||
|
||||
//depending on if we are doing fixed width resizing or not.
|
||||
fixedWidth = (maxWidthHeight > 0) ? image.Width : fixedWidth;
|
||||
fixedHeight = (maxWidthHeight > 0) ? image.Height : fixedHeight;
|
||||
|
||||
var widthTh = (int)Math.Round(fixedWidth / f);
|
||||
var heightTh = (int)Math.Round(fixedHeight / f);
|
||||
|
||||
// fixes for empty width or height
|
||||
if (widthTh == 0)
|
||||
widthTh = 1;
|
||||
if (heightTh == 0)
|
||||
heightTh = 1;
|
||||
|
||||
// Create new image with best quality settings
|
||||
using (var bp = new Bitmap(widthTh, heightTh))
|
||||
{
|
||||
using (var g = Graphics.FromImage(bp))
|
||||
{
|
||||
g.SmoothingMode = SmoothingMode.HighQuality;
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
g.CompositingQuality = CompositingQuality.HighQuality;
|
||||
|
||||
// Copy the old image to the new and resized
|
||||
var rect = new Rectangle(0, 0, widthTh, heightTh);
|
||||
g.DrawImage(image, rect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel);
|
||||
|
||||
// Copy metadata
|
||||
var imageEncoders = ImageCodecInfo.GetImageEncoders();
|
||||
|
||||
var codec = extension.ToLower() == "png" || extension.ToLower() == "gif"
|
||||
? imageEncoders.Single(t => t.MimeType.Equals("image/png"))
|
||||
: imageEncoders.Single(t => t.MimeType.Equals("image/jpeg"));
|
||||
|
||||
// Set compresion ratio to 90%
|
||||
var ep = new EncoderParameters();
|
||||
ep.Param[0] = new EncoderParameter(Encoder.Quality, 90L);
|
||||
|
||||
// Save the new image using the dimensions of the image
|
||||
var newFileName = thumbnailFileName.Replace("UMBRACOSYSTHUMBNAIL", string.Format("{0}x{1}", widthTh, heightTh));
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
bp.Save(ms, codec, ep);
|
||||
ms.Seek(0, 0);
|
||||
|
||||
fs.AddFile(newFileName, ms);
|
||||
}
|
||||
|
||||
return new ResizedImage(widthTh, heightTh, newFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,11 +266,6 @@ namespace Umbraco.Core.Models
|
||||
get { return _additionalData; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Some entities may expose additional data that other's might not, this custom data will be available in this collection
|
||||
/// </summary>
|
||||
public IDictionary<string, object> AdditionalData { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of PropertyGroups available on this Content object
|
||||
/// </summary>
|
||||
|
||||
@@ -528,6 +528,21 @@ namespace Umbraco.Core.Models
|
||||
|
||||
#region Tag methods
|
||||
|
||||
///// <summary>
|
||||
///// Returns the tags for the given property
|
||||
///// </summary>
|
||||
///// <param name="content"></param>
|
||||
///// <param name="propertyTypeAlias"></param>
|
||||
///// <param name="tagGroup"></param>
|
||||
///// <returns></returns>
|
||||
///// <remarks>
|
||||
///// The tags returned are only relavent for published content & saved media or members
|
||||
///// </remarks>
|
||||
//public static IEnumerable<ITag> GetTags(this IContentBase content, string propertyTypeAlias, string tagGroup = "default")
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Sets tags for the property - will add tags to the tags table and set the property value to be the comma delimited value of the tags.
|
||||
/// </summary>
|
||||
@@ -631,6 +646,16 @@ namespace Umbraco.Core.Models
|
||||
return ApplicationContext.Current.Services.PackagingService.Export(media, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the xml representation for the <see cref="IMedia"/> object
|
||||
/// </summary>
|
||||
/// <param name="member"><see cref="IContent"/> to generate xml for</param>
|
||||
/// <returns>Xml representation of the passed in <see cref="IContent"/></returns>
|
||||
public static XElement ToXml(this IMember member)
|
||||
{
|
||||
return ApplicationContext.Current.Services.PackagingService.Export(member);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the xml representation for the <see cref="IContent"/> object
|
||||
/// </summary>
|
||||
|
||||
@@ -3,9 +3,11 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
@@ -34,8 +36,15 @@ namespace Umbraco.Core.Models
|
||||
public DataTypeDefinition(int parentId, Guid controlId)
|
||||
{
|
||||
_parentId = parentId;
|
||||
_propertyEditorAlias = LegacyPropertyEditorIdToAliasConverter.GetAliasFromLegacyId(controlId, true);
|
||||
|
||||
|
||||
_propertyEditorAlias = LegacyPropertyEditorIdToAliasConverter.GetAliasFromLegacyId(controlId, false);
|
||||
if (_propertyEditorAlias == null)
|
||||
{
|
||||
//convert to Label!
|
||||
LogHelper.Warn<DataTypeDefinition>("Could not find a GUID -> Alias mapping for the legacy property editor with id " + controlId + ". The DataType has been converted to a Label.");
|
||||
_propertyEditorAlias = Constants.PropertyEditors.NoEditAlias;
|
||||
}
|
||||
|
||||
_additionalData = new Dictionary<string, object>();
|
||||
}
|
||||
public DataTypeDefinition(int parentId, string propertyEditorAlias)
|
||||
|
||||
@@ -1,93 +1,93 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a Macro
|
||||
/// </summary>
|
||||
public interface IMacro : IAggregateRoot
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the alias of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro can be used in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool UseInEditor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Cache Duration for the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int CacheDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached by Page
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool CacheByPage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached Personally
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool CacheByMember { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be rendered in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool DontRender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to user control or the Control Type to render
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string ControlType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the assembly, which should be used by the Macro
|
||||
/// </summary>
|
||||
/// <remarks>Will usually only be filled if the ScriptFile is a Usercontrol</remarks>
|
||||
[DataMember]
|
||||
string ControlAssembly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the path to the Python file in use
|
||||
/// </summary>
|
||||
/// <remarks>Optional: Can only be one of three Script, Python or Xslt</remarks>
|
||||
[DataMember]
|
||||
string ScriptPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to the Xslt file in use
|
||||
/// </summary>
|
||||
/// <remarks>Optional: Can only be one of three Script, Python or Xslt</remarks>
|
||||
[DataMember]
|
||||
string XsltPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of Macro Properties
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
MacroPropertyCollection Properties { get; }
|
||||
|
||||
///// <summary>
|
||||
///// Returns an enum <see cref="MacroTypes"/> based on the properties on the Macro
|
||||
///// </summary>
|
||||
///// <returns><see cref="MacroTypes"/></returns>
|
||||
//MacroTypes MacroType();
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a Macro
|
||||
/// </summary>
|
||||
public interface IMacro : IAggregateRoot
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the alias of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro can be used in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool UseInEditor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Cache Duration for the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int CacheDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached by Page
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool CacheByPage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached Personally
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool CacheByMember { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be rendered in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool DontRender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to user control or the Control Type to render
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string ControlType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the assembly, which should be used by the Macro
|
||||
/// </summary>
|
||||
/// <remarks>Will usually only be filled if the ScriptFile is a Usercontrol</remarks>
|
||||
[DataMember]
|
||||
string ControlAssembly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the path to the Python file in use
|
||||
/// </summary>
|
||||
/// <remarks>Optional: Can only be one of three Script, Python or Xslt</remarks>
|
||||
[DataMember]
|
||||
string ScriptPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to the Xslt file in use
|
||||
/// </summary>
|
||||
/// <remarks>Optional: Can only be one of three Script, Python or Xslt</remarks>
|
||||
[DataMember]
|
||||
string XsltPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of Macro Properties
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
MacroPropertyCollection Properties { get; }
|
||||
|
||||
///// <summary>
|
||||
///// Returns an enum <see cref="MacroTypes"/> based on the properties on the Macro
|
||||
///// </summary>
|
||||
///// <returns><see cref="MacroTypes"/></returns>
|
||||
//MacroTypes MacroType();
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,38 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a Property for a Macro
|
||||
/// </summary>
|
||||
public interface IMacroProperty : IValueObject
|
||||
{
|
||||
[DataMember]
|
||||
int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Sort Order of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int SortOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parameter editor alias
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string EditorAlias { get; set; }
|
||||
}
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a Property for a Macro
|
||||
/// </summary>
|
||||
public interface IMacroProperty : IValueObject
|
||||
{
|
||||
[DataMember]
|
||||
int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Sort Order of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int SortOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parameter editor alias
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string EditorAlias { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a PropertyType (plugin) for a Macro
|
||||
/// </summary>
|
||||
internal interface IMacroPropertyType
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the unique Alias of the Property Type
|
||||
/// </summary>
|
||||
string Alias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the Assembly used to render the Property Type
|
||||
/// </summary>
|
||||
string RenderingAssembly { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the Type used to render the Property Type
|
||||
/// </summary>
|
||||
string RenderingType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Base Type for storing the PropertyType (Int32, String, Boolean)
|
||||
/// </summary>
|
||||
MacroPropertyTypeBaseTypes BaseType { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a PropertyType (plugin) for a Macro
|
||||
/// </summary>
|
||||
internal interface IMacroPropertyType
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the unique Alias of the Property Type
|
||||
/// </summary>
|
||||
string Alias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the Assembly used to render the Property Type
|
||||
/// </summary>
|
||||
string RenderingAssembly { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the Type used to render the Property Type
|
||||
/// </summary>
|
||||
string RenderingType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Base Type for storing the PropertyType (Int32, String, Boolean)
|
||||
/// </summary>
|
||||
MacroPropertyTypeBaseTypes BaseType { get; }
|
||||
}
|
||||
}
|
||||
+113
-113
@@ -1,114 +1,114 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IMember : IContentBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Username
|
||||
/// </summary>
|
||||
string Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Email
|
||||
/// </summary>
|
||||
string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password
|
||||
/// </summary>
|
||||
string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password Question
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoPasswordRetrievalQuestionPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
string PasswordQuestion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password Answer
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoPasswordRetrievalAnswerPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
string PasswordAnswer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the comments for the member
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoCommentPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
string Comments { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Member is approved
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoApprovePropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
bool IsApproved { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Member is locked out
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoLockPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
bool IsLockedOut { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date for last login
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoLastLoginPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
DateTime LastLoginDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gest or sets the date for last password change
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoMemberLastPasswordChange
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
DateTime LastPasswordChangeDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date for when Member was locked out
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoMemberLastLockout
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
DateTime LastLockoutDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of failed password attempts.
|
||||
/// This is the number of times the password was entered incorrectly upon login.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoFailedPasswordAttemptsPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
int FailedPasswordAttempts { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// String alias of the default ContentType
|
||||
/// </summary>
|
||||
string ContentTypeAlias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ContentType used by this content object
|
||||
/// </summary>
|
||||
IMemberType ContentType { get; }
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IMember : IContentBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Username
|
||||
/// </summary>
|
||||
string Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Email
|
||||
/// </summary>
|
||||
string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password
|
||||
/// </summary>
|
||||
string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password Question
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoPasswordRetrievalQuestionPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
string PasswordQuestion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password Answer
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoPasswordRetrievalAnswerPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
string PasswordAnswer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the comments for the member
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoCommentPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
string Comments { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Member is approved
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoApprovePropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
bool IsApproved { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Member is locked out
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoLockPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
bool IsLockedOut { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date for last login
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoLastLoginPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
DateTime LastLoginDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gest or sets the date for last password change
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoMemberLastPasswordChange
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
DateTime LastPasswordChangeDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date for when Member was locked out
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoMemberLastLockout
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
DateTime LastLockoutDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of failed password attempts.
|
||||
/// This is the number of times the password was entered incorrectly upon login.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoFailedPasswordAttemptsPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
int FailedPasswordAttempts { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// String alias of the default ContentType
|
||||
/// </summary>
|
||||
string ContentTypeAlias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ContentType used by this content object
|
||||
/// </summary>
|
||||
IMemberType ContentType { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,36 @@
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a MemberType, which Member is based on
|
||||
/// </summary>
|
||||
public interface IMemberType : IContentTypeComposition
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a boolean indicating whether a Property is editable by the Member.
|
||||
/// </summary>
|
||||
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to check</param>
|
||||
/// <returns></returns>
|
||||
bool MemberCanEditProperty(string propertyTypeAlias);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a boolean indicating whether a Property is visible on the Members profile.
|
||||
/// </summary>
|
||||
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to check</param>
|
||||
/// <returns></returns>
|
||||
bool MemberCanViewProperty(string propertyTypeAlias);
|
||||
|
||||
/// <summary>
|
||||
/// Sets a boolean indicating whether a Property is editable by the Member.
|
||||
/// </summary>
|
||||
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to set</param>
|
||||
/// <param name="value">Boolean value, true or false</param>
|
||||
void SetMemberCanEditProperty(string propertyTypeAlias, bool value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets a boolean indicating whether a Property is visible on the Members profile.
|
||||
/// </summary>
|
||||
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to set</param>
|
||||
/// <param name="value">Boolean value, true or false</param>
|
||||
void SetMemberCanViewProperty(string propertyTypeAlias, bool value);
|
||||
}
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a MemberType, which Member is based on
|
||||
/// </summary>
|
||||
public interface IMemberType : IContentTypeComposition
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a boolean indicating whether a Property is editable by the Member.
|
||||
/// </summary>
|
||||
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to check</param>
|
||||
/// <returns></returns>
|
||||
bool MemberCanEditProperty(string propertyTypeAlias);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a boolean indicating whether a Property is visible on the Members profile.
|
||||
/// </summary>
|
||||
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to check</param>
|
||||
/// <returns></returns>
|
||||
bool MemberCanViewProperty(string propertyTypeAlias);
|
||||
|
||||
/// <summary>
|
||||
/// Sets a boolean indicating whether a Property is editable by the Member.
|
||||
/// </summary>
|
||||
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to set</param>
|
||||
/// <param name="value">Boolean value, true or false</param>
|
||||
void SetMemberCanEditProperty(string propertyTypeAlias, bool value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets a boolean indicating whether a Property is visible on the Members profile.
|
||||
/// </summary>
|
||||
/// <param name="propertyTypeAlias">PropertyType Alias of the Property to set</param>
|
||||
/// <param name="value">Boolean value, true or false</param>
|
||||
void SetMemberCanViewProperty(string propertyTypeAlias, bool value);
|
||||
}
|
||||
}
|
||||
@@ -1,60 +1,60 @@
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a property of an <c>IPublishedContent</c>.
|
||||
/// </summary>
|
||||
public interface IPublishedProperty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the alias of the property.
|
||||
/// </summary>
|
||||
string PropertyTypeAlias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the property has a value.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This is somewhat implementation-dependent -- depending on whatever IPublishedCache considers
|
||||
/// a missing value.</para>
|
||||
/// <para>The XmlPublishedCache raw values are strings, and it will consider missing, null or empty (and
|
||||
/// that includes whitespace-only) strings as "no value".</para>
|
||||
/// <para>Other caches that get their raw value from the database would consider that a property has "no
|
||||
/// value" if it is missing, null, or an empty string (including whitespace-only).</para>
|
||||
/// </remarks>
|
||||
bool HasValue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data value of the property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The data value is whatever was passed to the property when it was instanciated, and it is
|
||||
/// somewhat implementation-dependent -- depending on how the IPublishedCache is implemented.</para>
|
||||
/// <para>The XmlPublishedCache raw values are strings exclusively since they come from the Xml cache.</para>
|
||||
/// <para>For other caches that get their raw value from the database, it would be either a string,
|
||||
/// an integer (Int32), or a date and time (DateTime).</para>
|
||||
/// <para>If you're using that value, you're probably wrong, unless you're doing some internal
|
||||
/// Umbraco stuff.</para>
|
||||
/// </remarks>
|
||||
object DataValue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the object value of the property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The value is what you want to use when rendering content in an MVC view ie in C#.</para>
|
||||
/// <para>It can be null, or any type of CLR object.</para>
|
||||
/// <para>It has been fully prepared and processed by the appropriate converter.</para>
|
||||
/// </remarks>
|
||||
object Value { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the XPath value of the property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The XPath value is what you want to use when navigating content via XPath eg in the XSLT engine.</para>
|
||||
/// <para>It must be either null, or a string, or an XPathNavigator.</para>
|
||||
/// <para>It has been fully prepared and processed by the appropriate converter.</para>
|
||||
/// </remarks>
|
||||
object XPathValue { get; }
|
||||
}
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a property of an <c>IPublishedContent</c>.
|
||||
/// </summary>
|
||||
public interface IPublishedProperty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the alias of the property.
|
||||
/// </summary>
|
||||
string PropertyTypeAlias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the property has a value.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This is somewhat implementation-dependent -- depending on whatever IPublishedCache considers
|
||||
/// a missing value.</para>
|
||||
/// <para>The XmlPublishedCache raw values are strings, and it will consider missing, null or empty (and
|
||||
/// that includes whitespace-only) strings as "no value".</para>
|
||||
/// <para>Other caches that get their raw value from the database would consider that a property has "no
|
||||
/// value" if it is missing, null, or an empty string (including whitespace-only).</para>
|
||||
/// </remarks>
|
||||
bool HasValue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data value of the property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The data value is whatever was passed to the property when it was instanciated, and it is
|
||||
/// somewhat implementation-dependent -- depending on how the IPublishedCache is implemented.</para>
|
||||
/// <para>The XmlPublishedCache raw values are strings exclusively since they come from the Xml cache.</para>
|
||||
/// <para>For other caches that get their raw value from the database, it would be either a string,
|
||||
/// an integer (Int32), or a date and time (DateTime).</para>
|
||||
/// <para>If you're using that value, you're probably wrong, unless you're doing some internal
|
||||
/// Umbraco stuff.</para>
|
||||
/// </remarks>
|
||||
object DataValue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the object value of the property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The value is what you want to use when rendering content in an MVC view ie in C#.</para>
|
||||
/// <para>It can be null, or any type of CLR object.</para>
|
||||
/// <para>It has been fully prepared and processed by the appropriate converter.</para>
|
||||
/// </remarks>
|
||||
object Value { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the XPath value of the property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The XPath value is what you want to use when navigating content via XPath eg in the XSLT engine.</para>
|
||||
/// <para>It must be either null, or a string, or an XPathNavigator.</para>
|
||||
/// <para>It has been fully prepared and processed by the appropriate converter.</para>
|
||||
/// </remarks>
|
||||
object XPathValue { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IRelation : IAggregateRoot
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Parent Id of the Relation (Source)
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Child Id of the Relation (Destination)
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int ChildId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="RelationType"/> for the Relation
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
IRelationType RelationType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a comment for the Relation
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Comment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Id of the <see cref="RelationType"/> that this Relation is based on.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
int RelationTypeId { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IRelationType : IAggregateRoot
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Name of the RelationType
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the RelationType
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the RelationType is Bidirectional (true) or Parent to Child (false)
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool IsBidirectional { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Parents object type id
|
||||
/// </summary>
|
||||
/// <remarks>Corresponds to the NodeObjectType in the umbracoNode table</remarks>
|
||||
[DataMember]
|
||||
Guid ParentObjectType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Childs object type id
|
||||
/// </summary>
|
||||
/// <remarks>Corresponds to the NodeObjectType in the umbracoNode table</remarks>
|
||||
[DataMember]
|
||||
Guid ChildObjectType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface ITag : IAggregateRoot
|
||||
{
|
||||
[DataMember]
|
||||
string Text { get; set; }
|
||||
|
||||
[DataMember]
|
||||
string Group { get; set; }
|
||||
|
||||
//TODO: enable this at some stage
|
||||
//int ParentId { get; set; }
|
||||
}
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface ITag : IAggregateRoot
|
||||
{
|
||||
[DataMember]
|
||||
string Text { get; set; }
|
||||
|
||||
[DataMember]
|
||||
string Group { get; set; }
|
||||
|
||||
//TODO: enable this at some stage
|
||||
//int ParentId { get; set; }
|
||||
}
|
||||
}
|
||||
+402
-402
@@ -1,403 +1,403 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text.RegularExpressions;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Macro
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
internal class Macro : Entity, IMacro
|
||||
{
|
||||
public Macro()
|
||||
{
|
||||
_properties = new MacroPropertyCollection();
|
||||
_properties.CollectionChanged += PropertiesChanged;
|
||||
_addedProperties = new List<string>();
|
||||
_removedProperties = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an item with pre-filled properties
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="useInEditor"></param>
|
||||
/// <param name="cacheDuration"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="controlType"></param>
|
||||
/// <param name="controlAssembly"></param>
|
||||
/// <param name="xsltPath"></param>
|
||||
/// <param name="cacheByPage"></param>
|
||||
/// <param name="cacheByMember"></param>
|
||||
/// <param name="dontRender"></param>
|
||||
/// <param name="scriptPath"></param>
|
||||
public Macro(int id, bool useInEditor, int cacheDuration, string @alias, string name, string controlType, string controlAssembly, string xsltPath, bool cacheByPage, bool cacheByMember, bool dontRender, string scriptPath)
|
||||
: this()
|
||||
{
|
||||
Id = id;
|
||||
UseInEditor = useInEditor;
|
||||
CacheDuration = cacheDuration;
|
||||
Alias = alias;
|
||||
Name = name;
|
||||
ControlType = controlType;
|
||||
ControlAssembly = controlAssembly;
|
||||
XsltPath = xsltPath;
|
||||
CacheByPage = cacheByPage;
|
||||
CacheByMember = cacheByMember;
|
||||
DontRender = dontRender;
|
||||
ScriptPath = scriptPath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an instance for persisting a new item
|
||||
/// </summary>
|
||||
/// <param name="useInEditor"></param>
|
||||
/// <param name="cacheDuration"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="controlType"></param>
|
||||
/// <param name="controlAssembly"></param>
|
||||
/// <param name="xsltPath"></param>
|
||||
/// <param name="cacheByPage"></param>
|
||||
/// <param name="cacheByMember"></param>
|
||||
/// <param name="dontRender"></param>
|
||||
/// <param name="scriptPath"></param>
|
||||
public Macro(string @alias, string name,
|
||||
string controlType = "",
|
||||
string controlAssembly = "",
|
||||
string xsltPath = "",
|
||||
string scriptPath = "",
|
||||
bool cacheByPage = false,
|
||||
bool cacheByMember = false,
|
||||
bool dontRender = true,
|
||||
bool useInEditor = false,
|
||||
int cacheDuration = 0)
|
||||
: this()
|
||||
{
|
||||
UseInEditor = useInEditor;
|
||||
CacheDuration = cacheDuration;
|
||||
Alias = alias;
|
||||
Name = name;
|
||||
ControlType = controlType;
|
||||
ControlAssembly = controlAssembly;
|
||||
XsltPath = xsltPath;
|
||||
CacheByPage = cacheByPage;
|
||||
CacheByMember = cacheByMember;
|
||||
DontRender = dontRender;
|
||||
ScriptPath = scriptPath;
|
||||
}
|
||||
|
||||
private string _alias;
|
||||
private string _name;
|
||||
private bool _useInEditor;
|
||||
private int _cacheDuration;
|
||||
private bool _cacheByPage;
|
||||
private bool _cacheByMember;
|
||||
private bool _dontRender;
|
||||
private string _scriptFile;
|
||||
private string _scriptAssembly;
|
||||
private string _python;
|
||||
private string _xslt;
|
||||
private readonly MacroPropertyCollection _properties;
|
||||
private readonly List<string> _addedProperties;
|
||||
private readonly 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);
|
||||
|
||||
void PropertiesChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(PropertiesSelector);
|
||||
|
||||
if (e.Action == NotifyCollectionChangedAction.Add)
|
||||
{
|
||||
//listen for changes
|
||||
var prop = e.NewItems.Cast<MacroProperty>().First();
|
||||
prop.PropertyChanged += PropertyDataChanged;
|
||||
|
||||
var alias = prop.Alias;
|
||||
|
||||
//remove from the removed/added props (since people could add/remove all they want in one request)
|
||||
_removedProperties.RemoveAll(s => s == alias);
|
||||
_addedProperties.RemoveAll(s => s == alias);
|
||||
|
||||
//add to the added props
|
||||
_addedProperties.Add(alias);
|
||||
}
|
||||
else if (e.Action == NotifyCollectionChangedAction.Remove)
|
||||
{
|
||||
//remove listening for changes
|
||||
var prop = e.OldItems.Cast<MacroProperty>().First();
|
||||
prop.PropertyChanged -= PropertyDataChanged;
|
||||
|
||||
var alias = prop.Alias;
|
||||
|
||||
//remove from the removed/added props (since people could add/remove all they want in one request)
|
||||
_removedProperties.RemoveAll(s => s == alias);
|
||||
_addedProperties.RemoveAll(s => s == alias);
|
||||
|
||||
//add to the added props
|
||||
_removedProperties.Add(alias);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When some data of a property has changed ensure our Properties flag is dirty
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void PropertyDataChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(PropertiesSelector);
|
||||
}
|
||||
|
||||
public override void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
|
||||
{
|
||||
_addedProperties.Clear();
|
||||
_removedProperties.Clear();
|
||||
base.ResetDirtyProperties(rememberPreviouslyChangedProperties);
|
||||
foreach (var prop in Properties)
|
||||
{
|
||||
((TracksChangesEntityBase)prop).ResetDirtyProperties(rememberPreviouslyChangedProperties);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used internally to check if we need to add a section in the repository to the db
|
||||
/// </summary>
|
||||
internal IEnumerable<string> AddedProperties
|
||||
{
|
||||
get { return _addedProperties; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used internally to check if we need to remove a section in the repository to the db
|
||||
/// </summary>
|
||||
internal IEnumerable<string> RemovedProperties
|
||||
{
|
||||
get { return _removedProperties; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the alias of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Alias
|
||||
{
|
||||
get { return _alias; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_alias = value;
|
||||
return _alias;
|
||||
}, _alias, AliasSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_name = value;
|
||||
return _name;
|
||||
}, _name, NameSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro can be used in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public bool UseInEditor
|
||||
{
|
||||
get { return _useInEditor; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_useInEditor = value;
|
||||
return _useInEditor;
|
||||
}, _useInEditor, UseInEditorSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Cache Duration for the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public int CacheDuration
|
||||
{
|
||||
get { return _cacheDuration; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_cacheDuration = value;
|
||||
return _cacheDuration;
|
||||
}, _cacheDuration, CacheDurationSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached by Page
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public bool CacheByPage
|
||||
{
|
||||
get { return _cacheByPage; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_cacheByPage = value;
|
||||
return _cacheByPage;
|
||||
}, _cacheByPage, CacheByPageSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached Personally
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public bool CacheByMember
|
||||
{
|
||||
get { return _cacheByMember; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_cacheByMember = value;
|
||||
return _cacheByMember;
|
||||
}, _cacheByMember, CacheByMemberSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be rendered in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public bool DontRender
|
||||
{
|
||||
get { return _dontRender; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_dontRender = value;
|
||||
return _dontRender;
|
||||
}, _dontRender, DontRenderSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to user control or the Control Type to render
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string ControlType
|
||||
{
|
||||
get { return _scriptFile; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_scriptFile = value;
|
||||
return _scriptFile;
|
||||
}, _scriptFile, ControlPathSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the assembly, which should be used by the Macro
|
||||
/// </summary>
|
||||
/// <remarks>Will usually only be filled if the ControlType is a Usercontrol</remarks>
|
||||
[DataMember]
|
||||
public string ControlAssembly
|
||||
{
|
||||
get { return _scriptAssembly; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_scriptAssembly = value;
|
||||
return _scriptAssembly;
|
||||
}, _scriptAssembly, ControlAssemblySelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the path to the Python file in use
|
||||
/// </summary>
|
||||
/// <remarks>Optional: Can only be one of three Script, Python or Xslt</remarks>
|
||||
[DataMember]
|
||||
public string ScriptPath
|
||||
{
|
||||
get { return _python; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_python = value;
|
||||
return _python;
|
||||
}, _python, ScriptPathSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to the Xslt file in use
|
||||
/// </summary>
|
||||
/// <remarks>Optional: Can only be one of three Script, Python or Xslt</remarks>
|
||||
[DataMember]
|
||||
public string XsltPath
|
||||
{
|
||||
get { return _xslt; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_xslt = value;
|
||||
return _xslt;
|
||||
}, _xslt, XsltPathSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of Macro Properties
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public MacroPropertyCollection Properties
|
||||
{
|
||||
get { return _properties; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text.RegularExpressions;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Macro
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
internal class Macro : Entity, IMacro
|
||||
{
|
||||
public Macro()
|
||||
{
|
||||
_properties = new MacroPropertyCollection();
|
||||
_properties.CollectionChanged += PropertiesChanged;
|
||||
_addedProperties = new List<string>();
|
||||
_removedProperties = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an item with pre-filled properties
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="useInEditor"></param>
|
||||
/// <param name="cacheDuration"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="controlType"></param>
|
||||
/// <param name="controlAssembly"></param>
|
||||
/// <param name="xsltPath"></param>
|
||||
/// <param name="cacheByPage"></param>
|
||||
/// <param name="cacheByMember"></param>
|
||||
/// <param name="dontRender"></param>
|
||||
/// <param name="scriptPath"></param>
|
||||
public Macro(int id, bool useInEditor, int cacheDuration, string @alias, string name, string controlType, string controlAssembly, string xsltPath, bool cacheByPage, bool cacheByMember, bool dontRender, string scriptPath)
|
||||
: this()
|
||||
{
|
||||
Id = id;
|
||||
UseInEditor = useInEditor;
|
||||
CacheDuration = cacheDuration;
|
||||
Alias = alias;
|
||||
Name = name;
|
||||
ControlType = controlType;
|
||||
ControlAssembly = controlAssembly;
|
||||
XsltPath = xsltPath;
|
||||
CacheByPage = cacheByPage;
|
||||
CacheByMember = cacheByMember;
|
||||
DontRender = dontRender;
|
||||
ScriptPath = scriptPath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an instance for persisting a new item
|
||||
/// </summary>
|
||||
/// <param name="useInEditor"></param>
|
||||
/// <param name="cacheDuration"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="controlType"></param>
|
||||
/// <param name="controlAssembly"></param>
|
||||
/// <param name="xsltPath"></param>
|
||||
/// <param name="cacheByPage"></param>
|
||||
/// <param name="cacheByMember"></param>
|
||||
/// <param name="dontRender"></param>
|
||||
/// <param name="scriptPath"></param>
|
||||
public Macro(string @alias, string name,
|
||||
string controlType = "",
|
||||
string controlAssembly = "",
|
||||
string xsltPath = "",
|
||||
string scriptPath = "",
|
||||
bool cacheByPage = false,
|
||||
bool cacheByMember = false,
|
||||
bool dontRender = true,
|
||||
bool useInEditor = false,
|
||||
int cacheDuration = 0)
|
||||
: this()
|
||||
{
|
||||
UseInEditor = useInEditor;
|
||||
CacheDuration = cacheDuration;
|
||||
Alias = alias;
|
||||
Name = name;
|
||||
ControlType = controlType;
|
||||
ControlAssembly = controlAssembly;
|
||||
XsltPath = xsltPath;
|
||||
CacheByPage = cacheByPage;
|
||||
CacheByMember = cacheByMember;
|
||||
DontRender = dontRender;
|
||||
ScriptPath = scriptPath;
|
||||
}
|
||||
|
||||
private string _alias;
|
||||
private string _name;
|
||||
private bool _useInEditor;
|
||||
private int _cacheDuration;
|
||||
private bool _cacheByPage;
|
||||
private bool _cacheByMember;
|
||||
private bool _dontRender;
|
||||
private string _scriptFile;
|
||||
private string _scriptAssembly;
|
||||
private string _python;
|
||||
private string _xslt;
|
||||
private readonly MacroPropertyCollection _properties;
|
||||
private readonly List<string> _addedProperties;
|
||||
private readonly 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);
|
||||
|
||||
void PropertiesChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(PropertiesSelector);
|
||||
|
||||
if (e.Action == NotifyCollectionChangedAction.Add)
|
||||
{
|
||||
//listen for changes
|
||||
var prop = e.NewItems.Cast<MacroProperty>().First();
|
||||
prop.PropertyChanged += PropertyDataChanged;
|
||||
|
||||
var alias = prop.Alias;
|
||||
|
||||
//remove from the removed/added props (since people could add/remove all they want in one request)
|
||||
_removedProperties.RemoveAll(s => s == alias);
|
||||
_addedProperties.RemoveAll(s => s == alias);
|
||||
|
||||
//add to the added props
|
||||
_addedProperties.Add(alias);
|
||||
}
|
||||
else if (e.Action == NotifyCollectionChangedAction.Remove)
|
||||
{
|
||||
//remove listening for changes
|
||||
var prop = e.OldItems.Cast<MacroProperty>().First();
|
||||
prop.PropertyChanged -= PropertyDataChanged;
|
||||
|
||||
var alias = prop.Alias;
|
||||
|
||||
//remove from the removed/added props (since people could add/remove all they want in one request)
|
||||
_removedProperties.RemoveAll(s => s == alias);
|
||||
_addedProperties.RemoveAll(s => s == alias);
|
||||
|
||||
//add to the added props
|
||||
_removedProperties.Add(alias);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When some data of a property has changed ensure our Properties flag is dirty
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void PropertyDataChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(PropertiesSelector);
|
||||
}
|
||||
|
||||
public override void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
|
||||
{
|
||||
_addedProperties.Clear();
|
||||
_removedProperties.Clear();
|
||||
base.ResetDirtyProperties(rememberPreviouslyChangedProperties);
|
||||
foreach (var prop in Properties)
|
||||
{
|
||||
((TracksChangesEntityBase)prop).ResetDirtyProperties(rememberPreviouslyChangedProperties);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used internally to check if we need to add a section in the repository to the db
|
||||
/// </summary>
|
||||
internal IEnumerable<string> AddedProperties
|
||||
{
|
||||
get { return _addedProperties; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used internally to check if we need to remove a section in the repository to the db
|
||||
/// </summary>
|
||||
internal IEnumerable<string> RemovedProperties
|
||||
{
|
||||
get { return _removedProperties; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the alias of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Alias
|
||||
{
|
||||
get { return _alias; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_alias = value;
|
||||
return _alias;
|
||||
}, _alias, AliasSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_name = value;
|
||||
return _name;
|
||||
}, _name, NameSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro can be used in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public bool UseInEditor
|
||||
{
|
||||
get { return _useInEditor; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_useInEditor = value;
|
||||
return _useInEditor;
|
||||
}, _useInEditor, UseInEditorSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Cache Duration for the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public int CacheDuration
|
||||
{
|
||||
get { return _cacheDuration; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_cacheDuration = value;
|
||||
return _cacheDuration;
|
||||
}, _cacheDuration, CacheDurationSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached by Page
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public bool CacheByPage
|
||||
{
|
||||
get { return _cacheByPage; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_cacheByPage = value;
|
||||
return _cacheByPage;
|
||||
}, _cacheByPage, CacheByPageSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached Personally
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public bool CacheByMember
|
||||
{
|
||||
get { return _cacheByMember; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_cacheByMember = value;
|
||||
return _cacheByMember;
|
||||
}, _cacheByMember, CacheByMemberSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be rendered in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public bool DontRender
|
||||
{
|
||||
get { return _dontRender; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_dontRender = value;
|
||||
return _dontRender;
|
||||
}, _dontRender, DontRenderSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to user control or the Control Type to render
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string ControlType
|
||||
{
|
||||
get { return _scriptFile; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_scriptFile = value;
|
||||
return _scriptFile;
|
||||
}, _scriptFile, ControlPathSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the assembly, which should be used by the Macro
|
||||
/// </summary>
|
||||
/// <remarks>Will usually only be filled if the ControlType is a Usercontrol</remarks>
|
||||
[DataMember]
|
||||
public string ControlAssembly
|
||||
{
|
||||
get { return _scriptAssembly; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_scriptAssembly = value;
|
||||
return _scriptAssembly;
|
||||
}, _scriptAssembly, ControlAssemblySelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the path to the Python file in use
|
||||
/// </summary>
|
||||
/// <remarks>Optional: Can only be one of three Script, Python or Xslt</remarks>
|
||||
[DataMember]
|
||||
public string ScriptPath
|
||||
{
|
||||
get { return _python; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_python = value;
|
||||
return _python;
|
||||
}, _python, ScriptPathSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to the Xslt file in use
|
||||
/// </summary>
|
||||
/// <remarks>Optional: Can only be one of three Script, Python or Xslt</remarks>
|
||||
[DataMember]
|
||||
public string XsltPath
|
||||
{
|
||||
get { return _xslt; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_xslt = value;
|
||||
return _xslt;
|
||||
}, _xslt, XsltPathSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of Macro Properties
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public MacroPropertyCollection Properties
|
||||
{
|
||||
get { return _properties; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,154 +1,181 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Macro Property
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
internal class MacroProperty : TracksChangesEntityBase, IMacroProperty, IRememberBeingDirty
|
||||
{
|
||||
public MacroProperty()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ctor for creating a new property
|
||||
/// </summary>
|
||||
/// <param name="alias"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="sortOrder"></param>
|
||||
/// <param name="editorAlias"></param>
|
||||
public MacroProperty(string @alias, string name, int sortOrder, string editorAlias)
|
||||
{
|
||||
_alias = alias;
|
||||
_name = name;
|
||||
_sortOrder = sortOrder;
|
||||
_editorAlias = editorAlias;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ctor for creating an existing property
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="sortOrder"></param>
|
||||
/// <param name="editorAlias"></param>
|
||||
internal MacroProperty(int id, string @alias, string name, int sortOrder, string editorAlias)
|
||||
{
|
||||
_id = id;
|
||||
_alias = alias;
|
||||
_name = name;
|
||||
_sortOrder = sortOrder;
|
||||
_editorAlias = editorAlias;
|
||||
}
|
||||
|
||||
private string _alias;
|
||||
private string _name;
|
||||
private int _sortOrder;
|
||||
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);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public int Id
|
||||
{
|
||||
get { return _id; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_id = value;
|
||||
return _alias;
|
||||
}, _alias, IdSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Alias
|
||||
{
|
||||
get { return _alias; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_alias = value;
|
||||
return _alias;
|
||||
}, _alias, AliasSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_name = value;
|
||||
return _name;
|
||||
}, _name, NameSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Sort Order of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public int SortOrder
|
||||
{
|
||||
get { return _sortOrder; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_sortOrder = value;
|
||||
return _sortOrder;
|
||||
}, _sortOrder, SortOrderSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Type for this Property
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The MacroPropertyTypes acts as a plugin for Macros.
|
||||
/// All types was previously contained in the database, but has been ported to code.
|
||||
/// </remarks>
|
||||
[DataMember]
|
||||
public string EditorAlias
|
||||
|
||||
{
|
||||
get { return _editorAlias; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_editorAlias = value;
|
||||
return _editorAlias;
|
||||
}, _editorAlias, PropertyTypeSelector);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Macro Property
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
internal class MacroProperty : TracksChangesEntityBase, IMacroProperty, IRememberBeingDirty
|
||||
{
|
||||
public MacroProperty()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ctor for creating a new property
|
||||
/// </summary>
|
||||
/// <param name="alias"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="sortOrder"></param>
|
||||
/// <param name="editorAlias"></param>
|
||||
public MacroProperty(string @alias, string name, int sortOrder, string editorAlias)
|
||||
{
|
||||
_alias = alias;
|
||||
_name = name;
|
||||
_sortOrder = sortOrder;
|
||||
|
||||
//try to get the new mapped parameter editor
|
||||
var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(editorAlias, false);
|
||||
if (mapped.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
editorAlias = mapped;
|
||||
}
|
||||
|
||||
_editorAlias = editorAlias;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ctor for creating an existing property
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="sortOrder"></param>
|
||||
/// <param name="editorAlias"></param>
|
||||
internal MacroProperty(int id, string @alias, string name, int sortOrder, string editorAlias)
|
||||
{
|
||||
_id = id;
|
||||
_alias = alias;
|
||||
_name = name;
|
||||
_sortOrder = sortOrder;
|
||||
|
||||
//try to get the new mapped parameter editor
|
||||
var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(editorAlias, false);
|
||||
if (mapped.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
editorAlias = mapped;
|
||||
}
|
||||
|
||||
_editorAlias = editorAlias;
|
||||
}
|
||||
|
||||
private string _alias;
|
||||
private string _name;
|
||||
private int _sortOrder;
|
||||
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);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public int Id
|
||||
{
|
||||
get { return _id; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_id = value;
|
||||
return _alias;
|
||||
}, _alias, IdSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Alias
|
||||
{
|
||||
get { return _alias; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_alias = value;
|
||||
return _alias;
|
||||
}, _alias, AliasSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_name = value;
|
||||
return _name;
|
||||
}, _name, NameSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Sort Order of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public int SortOrder
|
||||
{
|
||||
get { return _sortOrder; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_sortOrder = value;
|
||||
return _sortOrder;
|
||||
}, _sortOrder, SortOrderSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Type for this Property
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The MacroPropertyTypes acts as a plugin for Macros.
|
||||
/// All types was previously contained in the database, but has been ported to code.
|
||||
/// </remarks>
|
||||
[DataMember]
|
||||
public string EditorAlias
|
||||
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A macro's property collection
|
||||
/// </summary>
|
||||
public class MacroPropertyCollection : ObservableDictionary<string, IMacroProperty>
|
||||
{
|
||||
public MacroPropertyCollection()
|
||||
: base(property => property.Alias)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A macro's property collection
|
||||
/// </summary>
|
||||
public class MacroPropertyCollection : ObservableDictionary<string, IMacroProperty>
|
||||
{
|
||||
public MacroPropertyCollection()
|
||||
: base(property => property.Alias)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +1,20 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for the three allowed BaseTypes
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
internal enum MacroPropertyTypeBaseTypes
|
||||
{
|
||||
[EnumMember]
|
||||
Int32,
|
||||
[EnumMember]
|
||||
Boolean,
|
||||
[EnumMember]
|
||||
String
|
||||
}
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for the three allowed BaseTypes
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
internal enum MacroPropertyTypeBaseTypes
|
||||
{
|
||||
[EnumMember]
|
||||
Int32,
|
||||
[EnumMember]
|
||||
Boolean,
|
||||
[EnumMember]
|
||||
String
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for the various types of Macros
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
internal enum MacroTypes
|
||||
{
|
||||
[EnumMember]
|
||||
Xslt = 1,
|
||||
[EnumMember]
|
||||
CustomControl = 2,
|
||||
[EnumMember]
|
||||
UserControl = 3,
|
||||
[EnumMember]
|
||||
Unknown = 4,
|
||||
[EnumMember]
|
||||
Python = 5,
|
||||
[EnumMember]
|
||||
Script = 6,
|
||||
[EnumMember]
|
||||
PartialView = 7
|
||||
}
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for the various types of Macros
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
internal enum MacroTypes
|
||||
{
|
||||
[EnumMember]
|
||||
Xslt = 1,
|
||||
[EnumMember]
|
||||
CustomControl = 2,
|
||||
[EnumMember]
|
||||
UserControl = 3,
|
||||
[EnumMember]
|
||||
Unknown = 4,
|
||||
[EnumMember]
|
||||
Python = 5,
|
||||
[EnumMember]
|
||||
Script = 6,
|
||||
[EnumMember]
|
||||
PartialView = 7
|
||||
}
|
||||
}
|
||||
+463
-453
@@ -1,454 +1,464 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Member object
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class Member : ContentBase, IMember
|
||||
{
|
||||
private readonly IMemberType _contentType;
|
||||
private string _contentTypeAlias;
|
||||
private string _username;
|
||||
private string _email;
|
||||
private string _password;
|
||||
private object _providerUserKey;
|
||||
private Type _userTypeKey;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for creating a Member object
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the content</param>
|
||||
/// <param name="contentType">ContentType for the current Content object</param>
|
||||
public Member(string name, IMemberType contentType)
|
||||
: base(name, -1, contentType, new PropertyCollection())
|
||||
{
|
||||
_contentType = contentType;
|
||||
}
|
||||
|
||||
public Member(string name, string email, string username, string password, int parentId, IMemberType contentType)
|
||||
: base(name, parentId, contentType, new PropertyCollection())
|
||||
{
|
||||
Mandate.ParameterNotNull(contentType, "contentType");
|
||||
|
||||
_contentType = contentType;
|
||||
_email = email;
|
||||
_username = username;
|
||||
_password = password;
|
||||
}
|
||||
|
||||
public Member(string name, string email, string username, string password, IContentBase parent, IMemberType contentType)
|
||||
: base(name, parent, contentType, new PropertyCollection())
|
||||
{
|
||||
Mandate.ParameterNotNull(contentType, "contentType");
|
||||
|
||||
_contentType = contentType;
|
||||
_email = email;
|
||||
_username = username;
|
||||
_password = password;
|
||||
}
|
||||
|
||||
private static readonly PropertyInfo DefaultContentTypeAliasSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.ContentTypeAlias);
|
||||
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.Password);
|
||||
private static readonly PropertyInfo ProviderUserKeySelector = ExpressionHelper.GetPropertyInfo<Member, object>(x => x.ProviderUserKey);
|
||||
private static readonly PropertyInfo UserTypeKeySelector = ExpressionHelper.GetPropertyInfo<Member, Type>(x => x.ProviderUserKeyType);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Username
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Username
|
||||
{
|
||||
get { return _username; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_username = value;
|
||||
return _username;
|
||||
}, _username, UsernameSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Email
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Email
|
||||
{
|
||||
get { return _email; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_email = value;
|
||||
return _email;
|
||||
}, _email, EmailSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Password
|
||||
{
|
||||
get { return _password; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_password = value;
|
||||
return _password;
|
||||
}, _password, PasswordSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Groups that Member is part of
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public IEnumerable<string> Groups { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password Question
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoPasswordRetrievalQuestionPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public string PasswordQuestion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Properties[Constants.Conventions.Member.PasswordQuestion].Value == null
|
||||
? string.Empty
|
||||
: Properties[Constants.Conventions.Member.PasswordQuestion].Value.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.PasswordQuestion].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password Answer
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoPasswordRetrievalAnswerPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public string PasswordAnswer
|
||||
{
|
||||
get
|
||||
{
|
||||
return Properties[Constants.Conventions.Member.PasswordAnswer].Value == null
|
||||
? string.Empty
|
||||
: Properties[Constants.Conventions.Member.PasswordAnswer].Value.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.PasswordAnswer].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the comments for the member
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoCommentPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public string Comments
|
||||
{
|
||||
get
|
||||
{
|
||||
return Properties[Constants.Conventions.Member.Comments].Value == null
|
||||
? string.Empty
|
||||
: Properties[Constants.Conventions.Member.Comments].Value.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.Comments].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Member is approved
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoApprovePropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public bool IsApproved
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.IsApproved].Value == null)
|
||||
return default(bool);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.IsApproved].Value is bool)
|
||||
return (bool)Properties[Constants.Conventions.Member.IsApproved].Value;
|
||||
|
||||
return (bool)Convert.ChangeType(Properties[Constants.Conventions.Member.IsApproved].Value, typeof(bool));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.IsApproved].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Member is locked out
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoLockPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public bool IsLockedOut
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.IsLockedOut].Value == null)
|
||||
return default(bool);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.IsLockedOut].Value is bool)
|
||||
return (bool)Properties[Constants.Conventions.Member.IsLockedOut].Value;
|
||||
|
||||
return (bool)Convert.ChangeType(Properties[Constants.Conventions.Member.IsLockedOut].Value, typeof(bool));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.IsLockedOut].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date for last login
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoLastLoginPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public DateTime LastLoginDate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.LastLoginDate].Value == null)
|
||||
return default(DateTime);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.LastLoginDate].Value is DateTime)
|
||||
return (DateTime)Properties[Constants.Conventions.Member.LastLoginDate].Value;
|
||||
|
||||
return (DateTime)Convert.ChangeType(Properties[Constants.Conventions.Member.LastLoginDate].Value, typeof(DateTime));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.LastLoginDate].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gest or sets the date for last password change
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoMemberLastPasswordChange
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public DateTime LastPasswordChangeDate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value == null)
|
||||
return default(DateTime);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value is DateTime)
|
||||
return (DateTime)Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value;
|
||||
|
||||
return (DateTime)Convert.ChangeType(Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value, typeof(DateTime));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date for when Member was locked out
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoMemberLastLockout
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public DateTime LastLockoutDate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.LastLockoutDate].Value == null)
|
||||
return default(DateTime);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.LastLockoutDate].Value is DateTime)
|
||||
return (DateTime)Properties[Constants.Conventions.Member.LastLockoutDate].Value;
|
||||
|
||||
return (DateTime)Convert.ChangeType(Properties[Constants.Conventions.Member.LastLockoutDate].Value, typeof(DateTime));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.LastLockoutDate].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of failed password attempts.
|
||||
/// This is the number of times the password was entered incorrectly upon login.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoFailedPasswordAttemptsPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public int FailedPasswordAttempts
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.FailedPasswordAttempts].Value == null)
|
||||
return default(int);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.FailedPasswordAttempts].Value is int)
|
||||
return (int)Properties[Constants.Conventions.Member.FailedPasswordAttempts].Value;
|
||||
|
||||
return (int)Convert.ChangeType(Properties[Constants.Conventions.Member.FailedPasswordAttempts].Value, typeof(int));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.LastLockoutDate].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// String alias of the default ContentType
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public virtual string ContentTypeAlias
|
||||
{
|
||||
get { return _contentTypeAlias; }
|
||||
internal set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_contentTypeAlias = value;
|
||||
return _contentTypeAlias;
|
||||
}, _contentTypeAlias, DefaultContentTypeAliasSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// User key from the Provider.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// When using standard umbraco provider this key will
|
||||
/// correspond to the guid UniqueId/Key.
|
||||
/// Otherwise it will the one available from the asp.net
|
||||
/// membership provider.
|
||||
/// </remarks>
|
||||
[DataMember]
|
||||
internal virtual object ProviderUserKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return _providerUserKey;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_providerUserKey = value;
|
||||
return _providerUserKey;
|
||||
}, _providerUserKey, ProviderUserKeySelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the provider user key.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The type of the provider user key.
|
||||
/// </value>
|
||||
[IgnoreDataMember]
|
||||
internal Type ProviderUserKeyType
|
||||
{
|
||||
get
|
||||
{
|
||||
return _userTypeKey;
|
||||
}
|
||||
private set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_userTypeKey = value;
|
||||
return _userTypeKey;
|
||||
}, _userTypeKey, UserTypeKeySelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the type of the provider user key.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
internal void SetProviderUserKeyType(Type type)
|
||||
{
|
||||
ProviderUserKeyType = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to call when Entity is being saved
|
||||
/// </summary>
|
||||
/// <remarks>Created date is set and a Unique key is assigned</remarks>
|
||||
internal override void AddingEntity()
|
||||
{
|
||||
base.AddingEntity();
|
||||
|
||||
if (Key == Guid.Empty)
|
||||
Key = Guid.NewGuid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ContentType used by this content object
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IMemberType ContentType
|
||||
{
|
||||
get { return _contentType; }
|
||||
}
|
||||
|
||||
public override void ChangeTrashedState(bool isTrashed, int parentId = -20)
|
||||
{
|
||||
throw new NotSupportedException("Members can't be trashed as no Recycle Bin exists, so use of this method is invalid");
|
||||
}
|
||||
|
||||
/* Internal experiment - only used for mapping queries.
|
||||
* Adding these to have first level properties instead of the Properties collection.
|
||||
*/
|
||||
internal string LongStringPropertyValue { get; set; }
|
||||
internal string ShortStringPropertyValue { get; set; }
|
||||
internal int IntegerropertyValue { get; set; }
|
||||
internal bool BoolPropertyValue { get; set; }
|
||||
internal DateTime DateTimePropertyValue { get; set; }
|
||||
internal string PropertyTypeAlias { get; set; }
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Member object
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class Member : ContentBase, IMember
|
||||
{
|
||||
private readonly IMemberType _contentType;
|
||||
private string _contentTypeAlias;
|
||||
private string _username;
|
||||
private string _email;
|
||||
private string _password;
|
||||
private object _providerUserKey;
|
||||
private Type _userTypeKey;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for creating a Member object
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the content</param>
|
||||
/// <param name="contentType">ContentType for the current Content object</param>
|
||||
public Member(string name, IMemberType contentType)
|
||||
: base(name, -1, contentType, new PropertyCollection())
|
||||
{
|
||||
_contentType = contentType;
|
||||
}
|
||||
|
||||
public Member(string name, string email, string username, string password, int parentId, IMemberType contentType)
|
||||
: base(name, parentId, contentType, new PropertyCollection())
|
||||
{
|
||||
Mandate.ParameterNotNull(contentType, "contentType");
|
||||
|
||||
_contentType = contentType;
|
||||
_email = email;
|
||||
_username = username;
|
||||
_password = password;
|
||||
}
|
||||
|
||||
public Member(string name, string email, string username, string password, IContentBase parent, IMemberType contentType)
|
||||
: base(name, parent, contentType, new PropertyCollection())
|
||||
{
|
||||
Mandate.ParameterNotNull(contentType, "contentType");
|
||||
|
||||
_contentType = contentType;
|
||||
_email = email;
|
||||
_username = username;
|
||||
_password = password;
|
||||
}
|
||||
|
||||
private static readonly PropertyInfo DefaultContentTypeAliasSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.ContentTypeAlias);
|
||||
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.Password);
|
||||
private static readonly PropertyInfo ProviderUserKeySelector = ExpressionHelper.GetPropertyInfo<Member, object>(x => x.ProviderUserKey);
|
||||
private static readonly PropertyInfo UserTypeKeySelector = ExpressionHelper.GetPropertyInfo<Member, Type>(x => x.ProviderUserKeyType);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Username
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Username
|
||||
{
|
||||
get { return _username; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_username = value;
|
||||
return _username;
|
||||
}, _username, UsernameSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Email
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Email
|
||||
{
|
||||
get { return _email; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_email = value;
|
||||
return _email;
|
||||
}, _email, EmailSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string Password
|
||||
{
|
||||
get { return _password; }
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_password = value;
|
||||
return _password;
|
||||
}, _password, PasswordSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Groups that Member is part of
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public IEnumerable<string> Groups { get; set; }
|
||||
|
||||
//TODO: When get/setting all of these properties we MUST:
|
||||
// * Check if we are using the umbraco membership provider, if so then we need to use the configured fields - not the explicit fields below
|
||||
// * If any of the fields don't exist, what should we do? Currently it will throw an exception!
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password Question
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoPasswordRetrievalQuestionPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public string PasswordQuestion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Properties[Constants.Conventions.Member.PasswordQuestion].Value == null
|
||||
? string.Empty
|
||||
: Properties[Constants.Conventions.Member.PasswordQuestion].Value.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.PasswordQuestion].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Password Answer
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoPasswordRetrievalAnswerPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public string PasswordAnswer
|
||||
{
|
||||
get
|
||||
{
|
||||
return Properties[Constants.Conventions.Member.PasswordAnswer].Value == null
|
||||
? string.Empty
|
||||
: Properties[Constants.Conventions.Member.PasswordAnswer].Value.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.PasswordAnswer].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the comments for the member
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoCommentPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public string Comments
|
||||
{
|
||||
get
|
||||
{
|
||||
return Properties[Constants.Conventions.Member.Comments].Value == null
|
||||
? string.Empty
|
||||
: Properties[Constants.Conventions.Member.Comments].Value.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.Comments].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Member is approved
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoApprovePropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public bool IsApproved
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.IsApproved].Value == null)
|
||||
return default(bool);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.IsApproved].Value is bool)
|
||||
return (bool)Properties[Constants.Conventions.Member.IsApproved].Value;
|
||||
|
||||
//TODO: Use TryConvertTo<T> instead
|
||||
return (bool)Convert.ChangeType(Properties[Constants.Conventions.Member.IsApproved].Value, typeof(bool));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.IsApproved].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Member is locked out
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoLockPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public bool IsLockedOut
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.IsLockedOut].Value == null)
|
||||
return default(bool);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.IsLockedOut].Value is bool)
|
||||
return (bool)Properties[Constants.Conventions.Member.IsLockedOut].Value;
|
||||
|
||||
//TODO: Use TryConvertTo<T> instead
|
||||
return (bool)Convert.ChangeType(Properties[Constants.Conventions.Member.IsLockedOut].Value, typeof(bool));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.IsLockedOut].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date for last login
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoLastLoginPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public DateTime LastLoginDate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.LastLoginDate].Value == null)
|
||||
return default(DateTime);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.LastLoginDate].Value is DateTime)
|
||||
return (DateTime)Properties[Constants.Conventions.Member.LastLoginDate].Value;
|
||||
|
||||
//TODO: Use TryConvertTo<T> instead
|
||||
return (DateTime)Convert.ChangeType(Properties[Constants.Conventions.Member.LastLoginDate].Value, typeof(DateTime));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.LastLoginDate].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gest or sets the date for last password change
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoMemberLastPasswordChange
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public DateTime LastPasswordChangeDate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value == null)
|
||||
return default(DateTime);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value is DateTime)
|
||||
return (DateTime)Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value;
|
||||
|
||||
//TODO: Use TryConvertTo<T> instead
|
||||
return (DateTime)Convert.ChangeType(Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value, typeof(DateTime));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.LastPasswordChangeDate].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date for when Member was locked out
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoMemberLastLockout
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public DateTime LastLockoutDate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.LastLockoutDate].Value == null)
|
||||
return default(DateTime);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.LastLockoutDate].Value is DateTime)
|
||||
return (DateTime)Properties[Constants.Conventions.Member.LastLockoutDate].Value;
|
||||
|
||||
//TODO: Use TryConvertTo<T> instead
|
||||
return (DateTime)Convert.ChangeType(Properties[Constants.Conventions.Member.LastLockoutDate].Value, typeof(DateTime));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.LastLockoutDate].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of failed password attempts.
|
||||
/// This is the number of times the password was entered incorrectly upon login.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Alias: umbracoFailedPasswordAttemptsPropertyTypeAlias
|
||||
/// Part of the standard properties collection.
|
||||
/// </remarks>
|
||||
[IgnoreDataMember]
|
||||
public int FailedPasswordAttempts
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Properties[Constants.Conventions.Member.FailedPasswordAttempts].Value == null)
|
||||
return default(int);
|
||||
|
||||
if (Properties[Constants.Conventions.Member.FailedPasswordAttempts].Value is int)
|
||||
return (int)Properties[Constants.Conventions.Member.FailedPasswordAttempts].Value;
|
||||
|
||||
//TODO: Use TryConvertTo<T> instead
|
||||
return (int)Convert.ChangeType(Properties[Constants.Conventions.Member.FailedPasswordAttempts].Value, typeof(int));
|
||||
}
|
||||
set
|
||||
{
|
||||
Properties[Constants.Conventions.Member.LastLockoutDate].Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// String alias of the default ContentType
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public virtual string ContentTypeAlias
|
||||
{
|
||||
get { return _contentTypeAlias; }
|
||||
internal set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_contentTypeAlias = value;
|
||||
return _contentTypeAlias;
|
||||
}, _contentTypeAlias, DefaultContentTypeAliasSelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// User key from the Provider.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// When using standard umbraco provider this key will
|
||||
/// correspond to the guid UniqueId/Key.
|
||||
/// Otherwise it will the one available from the asp.net
|
||||
/// membership provider.
|
||||
/// </remarks>
|
||||
[DataMember]
|
||||
internal virtual object ProviderUserKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return _providerUserKey;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_providerUserKey = value;
|
||||
return _providerUserKey;
|
||||
}, _providerUserKey, ProviderUserKeySelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the provider user key.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The type of the provider user key.
|
||||
/// </value>
|
||||
[IgnoreDataMember]
|
||||
internal Type ProviderUserKeyType
|
||||
{
|
||||
get
|
||||
{
|
||||
return _userTypeKey;
|
||||
}
|
||||
private set
|
||||
{
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_userTypeKey = value;
|
||||
return _userTypeKey;
|
||||
}, _userTypeKey, UserTypeKeySelector);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the type of the provider user key.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
internal void SetProviderUserKeyType(Type type)
|
||||
{
|
||||
ProviderUserKeyType = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to call when Entity is being saved
|
||||
/// </summary>
|
||||
/// <remarks>Created date is set and a Unique key is assigned</remarks>
|
||||
internal override void AddingEntity()
|
||||
{
|
||||
base.AddingEntity();
|
||||
|
||||
if (Key == Guid.Empty)
|
||||
Key = Guid.NewGuid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ContentType used by this content object
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IMemberType ContentType
|
||||
{
|
||||
get { return _contentType; }
|
||||
}
|
||||
|
||||
public override void ChangeTrashedState(bool isTrashed, int parentId = -20)
|
||||
{
|
||||
throw new NotSupportedException("Members can't be trashed as no Recycle Bin exists, so use of this method is invalid");
|
||||
}
|
||||
|
||||
/* Internal experiment - only used for mapping queries.
|
||||
* Adding these to have first level properties instead of the Properties collection.
|
||||
*/
|
||||
internal string LongStringPropertyValue { get; set; }
|
||||
internal string ShortStringPropertyValue { get; set; }
|
||||
internal int IntegerropertyValue { get; set; }
|
||||
internal bool BoolPropertyValue { get; set; }
|
||||
internal DateTime DateTimePropertyValue { get; set; }
|
||||
internal string PropertyTypeAlias { get; set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user