Compare commits
1181 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7dad078af4 | |||
| 9a89b6048a | |||
| 8c13b89c79 | |||
| d54e09c40b | |||
| c0d6c511e4 | |||
| 2da3ec27db | |||
| 5f10ed99aa | |||
| 48fa60039b | |||
| 20ceceffe0 | |||
| b73c7fbb16 | |||
| c96b866f1d | |||
| b724a185b7 | |||
| f94d280e27 | |||
| b2399e97cc | |||
| 5580523c08 | |||
| 6670f7036b | |||
| a59dd32dd1 | |||
| ee78e3815b | |||
| 2acfd64706 | |||
| df3d8d3757 | |||
| a6f6a321f9 | |||
| 03b0133b58 | |||
| 25cfceadc0 | |||
| 03969fd687 | |||
| 7788452fb7 | |||
| c7778467e3 | |||
| 0600d5c463 | |||
| 15c36a63d3 | |||
| bcba12abc8 | |||
| c0dd32d1f9 | |||
| 2411271ae0 | |||
| c87d0a6430 | |||
| c0051ba8cd | |||
| 2cf590d9c9 | |||
| 2729da2c08 | |||
| 9046319dc9 | |||
| fa27a37207 | |||
| 80f81ce379 | |||
| 3022293565 | |||
| 34889c147a | |||
| 7d17aef953 | |||
| 8af8a6d411 | |||
| dd736dce3a | |||
| cd4c738c04 | |||
| ed383bdaeb | |||
| 4874a71e72 | |||
| 58b8aacff1 | |||
| d4d5a355e3 | |||
| 24ef0dd961 | |||
| 0efb9b72e7 | |||
| dd680b6fd1 | |||
| 788ed68b5b | |||
| 89606d3a05 | |||
| 77319301c6 | |||
| 227bd1cd7e | |||
| 4790dc59a9 | |||
| de53dbffd1 | |||
| 68ac167ec3 | |||
| c8087d1f68 | |||
| c4c21b8b6e | |||
| a7c134a375 | |||
| 9cdea752e8 | |||
| de3c836ac1 | |||
| 2cdc89297f | |||
| 839a5b13b0 | |||
| 40cc4b90fc | |||
| ba54f96efd | |||
| f4a0bcfc96 | |||
| b5696de71e | |||
| a4d4cbd99f | |||
| 08a2c0d082 | |||
| f037f8541c | |||
| 10990e50e6 | |||
| 9dad4c9573 | |||
| 6318b85449 | |||
| 9d313898d0 | |||
| 0380b04b03 | |||
| f32e47a363 | |||
| 3ea7f8a226 | |||
| 2617016e3b | |||
| 90b3bf59e0 | |||
| aadae6334b | |||
| 0f7b902bba | |||
| b899ab6557 | |||
| 7c3ff7d746 | |||
| 332a95a27a | |||
| 4482879fc6 | |||
| 199bf0ff6e | |||
| 24915163ff | |||
| 1289d3255c | |||
| dc40b73fef | |||
| c1cc8a3824 | |||
| 9695ccea0a | |||
| bbcca7f3e5 | |||
| 7b4a82eb8d | |||
| 8393465e8a | |||
| 9ced66f208 | |||
| 633f56a7aa | |||
| 12d51b292c | |||
| e85ef38218 | |||
| 4775b638a4 | |||
| db3b8a1acd | |||
| 17906b505d | |||
| 7a644b6681 | |||
| 48c127fefd | |||
| 778d8e0afa | |||
| 59aa28bf3b | |||
| cea002fd61 | |||
| f8c1cc684b | |||
| 3663fd9f99 | |||
| f8ed9e60f6 | |||
| 00895ff7a9 | |||
| da778e277f | |||
| 6fcfd49cf0 | |||
| 6457a1a2ca | |||
| 4bbd278007 | |||
| f6677aa19e | |||
| a1bca2eba1 | |||
| 4c5cc93a67 | |||
| 7590bd86dd | |||
| 6b25e5299f | |||
| 76ab09bfc8 | |||
| d6f47366d4 | |||
| dc846e7ff6 | |||
| 322bd4e41e | |||
| 282550f402 | |||
| 699713346c | |||
| d4f28fcd85 | |||
| 11e946d61c | |||
| 341239648d | |||
| f3b23a15c9 | |||
| cc61c34cdf | |||
| 91b599b213 | |||
| ce6eb3d939 | |||
| ec5ca9087e | |||
| 8cfdcbdd05 | |||
| 4a72e8c3df | |||
| d747d16b75 | |||
| 106873732c | |||
| 462467a7d8 | |||
| ea12da99ea | |||
| 97a05008b3 | |||
| 69e1dd1c73 | |||
| 95f68b8bde | |||
| 485621b03a | |||
| 3f1b031789 | |||
| d0f125a51b | |||
| a4f7c49f50 | |||
| a378d0c202 | |||
| d235340ec6 | |||
| 93ca536b14 | |||
| dea78c5d13 | |||
| d06ff5f108 | |||
| d94fe7df68 | |||
| 11b53a5dcc | |||
| d4c0ea9c48 | |||
| 459d9b34e7 | |||
| 2ad86ec83d | |||
| 70ddf646be | |||
| 4de31249fd | |||
| 26c3bb05d6 | |||
| b1fe15ed56 | |||
| 83f1613eb8 | |||
| e8e6f5f807 | |||
| 920084b7c3 | |||
| ff2c71367f | |||
| 428efed7c3 | |||
| 7c59c71261 | |||
| a0c2914ce6 | |||
| dbb70a8646 | |||
| 6a423dd032 | |||
| 73e9ff04e8 | |||
| 201464cb44 | |||
| a68fed42ad | |||
| a427427564 | |||
| 2286c0899c | |||
| 55eea6e44f | |||
| ae257d0f50 | |||
| 28a01d61a6 | |||
| bc776d787e | |||
| 2f74dfe5cb | |||
| 84d2caf5d8 | |||
| 456e7d9fdf | |||
| dae66ad2d0 | |||
| 69d254a198 | |||
| b30555f5a4 | |||
| d5b6428cdc | |||
| 7d5bce76c2 | |||
| d4d77611eb | |||
| 662ed03f0a | |||
| fdac0ede45 | |||
| 83aa30d2c5 | |||
| 34b524aabb | |||
| 2e2ea57ba6 | |||
| 72004768cf | |||
| b8e98ae017 | |||
| 3c01dcb30c | |||
| 938b236f54 | |||
| aa439cacda | |||
| e643f2a0ba | |||
| 5b9a98ad6a | |||
| 3323138232 | |||
| cd0aa5e342 | |||
| f63ec81c47 | |||
| 5b63a8e9d9 | |||
| 71244b9bcd | |||
| fd1e369b2a | |||
| c256266432 | |||
| db087a9e78 | |||
| 4e33552a5c | |||
| da25970f79 | |||
| 0807597a3c | |||
| d564866b07 | |||
| 99a45d26ae | |||
| a32d38f7ea | |||
| 5bf9362c92 | |||
| d9925e3453 | |||
| e1106a9d67 | |||
| a8d7a1d01d | |||
| e62597521e | |||
| fa91321299 | |||
| 2d81691407 | |||
| 21f08ca491 | |||
| e202f21934 | |||
| 2936ff0bf9 | |||
| 55dbc82d75 | |||
| 8e4e575276 | |||
| 84752babc8 | |||
| e1ec49fd3c | |||
| 60a1116acd | |||
| a480d7bbe6 | |||
| 7316c5462a | |||
| 2a9960afb3 | |||
| ed899ec73d | |||
| 8f26f9385d | |||
| 599d367343 | |||
| 45241788b3 | |||
| a446cc224d | |||
| 8bfcd4ce3f | |||
| 07f9a9700d | |||
| 7e7acd0049 | |||
| 57985c26a2 | |||
| 504c1f7254 | |||
| 52ad36a6c2 | |||
| 01670e0832 | |||
| e1a93e9b3f | |||
| 2203db548a | |||
| ff66c90855 | |||
| b0779cb330 | |||
| e3f043794b | |||
| 25c021d0a9 | |||
| 8f35c8fb57 | |||
| 45e3b2acf4 | |||
| 082d116924 | |||
| 85ccea60ab | |||
| 49e5493d52 | |||
| a700258d92 | |||
| 712fb9f11a | |||
| c16a1c727d | |||
| 78bc12eb77 | |||
| 9c10145869 | |||
| 99c96bce86 | |||
| 70424183fa | |||
| da2bc6764b | |||
| d11a377f0f | |||
| d445f7cb0d | |||
| d02235b997 | |||
| 899d325ca1 | |||
| f1107b7a91 | |||
| a3f171e7b3 | |||
| 8b3e80a001 | |||
| 13a2d845c6 | |||
| c20c93e648 | |||
| 2c212cb16a | |||
| 848e8a6248 | |||
| 9dcba6a679 | |||
| accded4dfc | |||
| c8f80453b9 | |||
| d857743bf3 | |||
| 78bee017ca | |||
| f08320bd81 | |||
| a1fcdac896 | |||
| ae2d9e6c55 | |||
| 451be273a5 | |||
| bf7473145f | |||
| 01a309ef42 | |||
| bf4d0a8d01 | |||
| 3a919b67ea | |||
| 77fd2c9444 | |||
| 30042aae6d | |||
| 8bc9fb9242 | |||
| 482e90dbc0 | |||
| 0b61546633 | |||
| ca69e64846 | |||
| 6e60aa17dc | |||
| f60884e796 | |||
| d2dbd91b17 | |||
| 0a7bbfb1ca | |||
| 864994a56e | |||
| 3405c5001b | |||
| 4d8732d925 | |||
| 6751f108f0 | |||
| 0feb65c455 | |||
| 4eb9a54fa5 | |||
| 3b2a27dfb2 | |||
| ad66613011 | |||
| a1de100a93 | |||
| cbcbc128ff | |||
| 788a0241d8 | |||
| 25237995eb | |||
| ed75109829 | |||
| 6738a25bfa | |||
| aa9c753455 | |||
| 0e5f9b92e8 | |||
| 77fd4d383b | |||
| 98a03a0127 | |||
| 464130a102 | |||
| dfb324b003 | |||
| 966b8565ba | |||
| 2b774dbdf2 | |||
| cae600ac2f | |||
| 5e4702a4ab | |||
| 8442b2e8e7 | |||
| 64efd0abbc | |||
| b8f3f93d83 | |||
| ce9e851087 | |||
| 53d9a34996 | |||
| 2f79d4a71d | |||
| 6555fd5791 | |||
| 98d72da622 | |||
| c563629756 | |||
| acb3ecbbf7 | |||
| 2cbe6f5543 | |||
| 9beaaa825e | |||
| bf90edb5be | |||
| 94a506f8e8 | |||
| 4f68941f98 | |||
| 25de56a98b | |||
| b11135a096 | |||
| d4db32c0f2 | |||
| d54f35f5f7 | |||
| f163381399 | |||
| 86cb3e8695 | |||
| dcc50c3b53 | |||
| 0209b71182 | |||
| 6b92e47631 | |||
| 36ffebbb49 | |||
| d0bafc6184 | |||
| 801828df70 | |||
| 953c371580 | |||
| 83d3882b9a | |||
| c37777b289 | |||
| ef6a4139de | |||
| 98ceabaf7e | |||
| 85bcb7ad2b | |||
| adea6dd2f6 | |||
| cad0650223 | |||
| d8909fe09c | |||
| bf5acf6724 | |||
| 9bf33f0eea | |||
| 0155a094b1 | |||
| 08432e8b23 | |||
| 717f67874a | |||
| dc27368397 | |||
| de7900cd2e | |||
| c288c2b9a3 | |||
| 26032e46dd | |||
| caee5c6baf | |||
| ea9c37d500 | |||
| a1c223bc2b | |||
| 6afd9b37a6 | |||
| 2a66f95873 | |||
| 3330c617b4 | |||
| 2db45eaca3 | |||
| b876e34586 | |||
| 935436203e | |||
| 9580c8965f | |||
| e2cc342adf | |||
| ea785a6585 | |||
| 46a8e586ce | |||
| fa0f15f5c4 | |||
| 6a15c2603d | |||
| 60263c9040 | |||
| ba6a5825fa | |||
| 4e68380c32 | |||
| da87ba8bc7 | |||
| d34255b1fc | |||
| 9b6ab24890 | |||
| 0fdf69be8b | |||
| ee040eb04f | |||
| 71ca90d74b | |||
| fb42472f31 | |||
| d1e684cb40 | |||
| 98b41256c1 | |||
| bc446a63fe | |||
| 8a214b5181 | |||
| b6695b6953 | |||
| 8820fa1fdf | |||
| 91f087141b | |||
| 6265354327 | |||
| 86f39aee03 | |||
| 9190930f49 | |||
| 11ec43c5c1 | |||
| 1b83c5c180 | |||
| 8a98b66cfd | |||
| 9638bd8bd2 | |||
| 362717c05d | |||
| 16d9b9f527 | |||
| 3ae57100c8 | |||
| 6d33cf6c69 | |||
| 3e6273d073 | |||
| 8d98813440 | |||
| d0b409341e | |||
| 84489f612b | |||
| ee6c9a3b05 | |||
| d12162cca5 | |||
| 1117f96597 | |||
| d3f3e161e0 | |||
| 90d78d1b60 | |||
| 5673b1907b | |||
| bc9ebb24f9 | |||
| 084e9e00ce | |||
| 96e4f723b1 | |||
| 163a03986c | |||
| 7007389505 | |||
| 2336905dae | |||
| a2164819f5 | |||
| 6b345bfc75 | |||
| a699f32178 | |||
| e597886d0f | |||
| 10e53de029 | |||
| c9336ba32f | |||
| 55190b7318 | |||
| 0328ba1aec | |||
| 1accc6275a | |||
| ce80c9a244 | |||
| 2d9bd394ae | |||
| b3c291206a | |||
| 52629f829d | |||
| 3496c5aece | |||
| 613f56107d | |||
| 8fe0e4223b | |||
| 9abda14530 | |||
| 9df2979d7d | |||
| f4a81bfc04 | |||
| bff7aba778 | |||
| ade7278724 | |||
| f5835baa27 | |||
| d7f6bd0d20 | |||
| d92e5ca2e3 | |||
| 94465892ed | |||
| 4b59caf18f | |||
| a0994ff105 | |||
| 9b3a7b8abc | |||
| bb93f0a4a2 | |||
| 3c8be919da | |||
| 168893a888 | |||
| eb4076399e | |||
| 47a78c1bcb | |||
| dfdf85fc0b | |||
| 8862b99e6a | |||
| a1a1b9ebb5 | |||
| 5a26a52157 | |||
| 31903c8ead | |||
| e59b14b7e7 | |||
| cb869b9064 | |||
| df0c297f55 | |||
| e36dc368d9 | |||
| 656ba98b1b | |||
| 5c17201006 | |||
| d86a1946a7 | |||
| 18bf4a87b4 | |||
| 91475c7103 | |||
| 88934a3f14 | |||
| 80b5c99111 | |||
| 658a045168 | |||
| ccd438ba26 | |||
| 71863f8ba1 | |||
| 6df6e3bdad | |||
| 9019c49ee8 | |||
| a5240a852e | |||
| c74c269b9a | |||
| 0cbdebc9b0 | |||
| 4f655acda5 | |||
| 0cb396825f | |||
| 4257a89cc1 | |||
| 7300316780 | |||
| 94da555fea | |||
| ae47ad882d | |||
| 79d9412b31 | |||
| f6c39362cd | |||
| 48fb2a2fcc | |||
| 4562237a96 | |||
| 3420694cca | |||
| c68067eb09 | |||
| a8c73296ea | |||
| 805c1bf8d0 | |||
| 15119fc8d0 | |||
| e2f8a73561 | |||
| 4d9f6ccd22 | |||
| 9112c05477 | |||
| c0c624d62e | |||
| 306a30265e | |||
| 1ee6fc8514 | |||
| 1003ac42df | |||
| ca951aa56b | |||
| 6ea7b32363 | |||
| db4495cf50 | |||
| c35fa7c975 | |||
| ed8cccdf5a | |||
| 9cd8ce5626 | |||
| 990f271c63 | |||
| adfdbaec46 | |||
| 0f4436a465 | |||
| 8ccbf70b39 | |||
| ddd26f3ad4 | |||
| 316e7531a0 | |||
| 0f068f5fb1 | |||
| 8f6b76f9fc | |||
| 468c281d7d | |||
| 419531f373 | |||
| 3457768646 | |||
| f7cb188210 | |||
| 00518d0de7 | |||
| 892a8d2a8a | |||
| ced6c011aa | |||
| efc2008783 | |||
| acb987a451 | |||
| 4a1ea6e2d8 | |||
| cc23d57803 | |||
| 81fdae3dc4 | |||
| 2859eb560c | |||
| 7c5ad67a9f | |||
| 8c69bb400b | |||
| 0c33fa0421 | |||
| 69c3962f21 | |||
| 0605f9d7ba | |||
| 214c41f835 | |||
| 3853e086a0 | |||
| 24695948d2 | |||
| 5595d2ea73 | |||
| 7a42b5dae3 | |||
| cc8f07c0d8 | |||
| 67b9fcd295 | |||
| c44a129e68 | |||
| e4a8edd64c | |||
| e282d45397 | |||
| 215f2462e4 | |||
| 2babb2373d | |||
| b6d0b46332 | |||
| 870b611871 | |||
| ff8f9bb6f4 | |||
| ad1473e52f | |||
| 1de59f048b | |||
| 03060f7de9 | |||
| 4521e31ec5 | |||
| 0c4d574fe4 | |||
| b541fe6b3f | |||
| e9e83d3958 | |||
| 4bb0f41ead | |||
| 0469c206aa | |||
| d4c79ccf03 | |||
| 730c9c8403 | |||
| 87db6d672a | |||
| e6eb25b58a | |||
| c45b3b7c3a | |||
| bf6a74b36b | |||
| 40de02ca5d | |||
| ec86c92753 | |||
| cf444e1702 | |||
| 145229122c | |||
| 67ffeebe0d | |||
| 7d3a66de07 | |||
| 58f4d2a6c5 | |||
| f0256e2bd5 | |||
| 3ec6e8a1ea | |||
| 48cb51e1e1 | |||
| 91491e4627 | |||
| 97cdea8fea | |||
| 9397655395 | |||
| c03a1424be | |||
| 801458d05c | |||
| 6c2750b0cc | |||
| 5d9c7d9068 | |||
| 302e9ec11c | |||
| a44123f064 | |||
| 905cf830e6 | |||
| abc672e348 | |||
| c273c94d57 | |||
| 231b3062b8 | |||
| b4be203b2a | |||
| 44a39e7ca6 | |||
| 238f5fc5f3 | |||
| e8a2ddb2a4 | |||
| df4d2f8c3b | |||
| 9717a6962a | |||
| 56a8b771c1 | |||
| 86e82c7674 | |||
| 9ffaa8aabb | |||
| f88144cbbe | |||
| 9e7d2884b9 | |||
| fe31ed5cb2 | |||
| 4494d8cc91 | |||
| 967030a9c4 | |||
| 95c0f80df4 | |||
| 0e23c9e69f | |||
| 8388ec12cd | |||
| 81928a5948 | |||
| 15413a75fe | |||
| 720ed0f457 | |||
| 043139caae | |||
| 54642590cc | |||
| f4231b1692 | |||
| 144a4fdd62 | |||
| 334e7da40f | |||
| e177ad57cc | |||
| b01ed76350 | |||
| 732d37054b | |||
| d9195122d5 | |||
| 03e4ad6c4b | |||
| 31f4b32277 | |||
| a3ce5f82d4 | |||
| 843397d793 | |||
| bfd79277fd | |||
| 0811951c04 | |||
| 49aa6b40cc | |||
| 6b43c0c761 | |||
| 1346621a79 | |||
| 9f4d72e137 | |||
| 5baa721eb7 | |||
| ca58e8f98f | |||
| caa4f3ed45 | |||
| f5447e1bc1 | |||
| da64215bc5 | |||
| eb348d60a8 | |||
| a916686d2e | |||
| 6adf04eddc | |||
| 26059ebad0 | |||
| f48a218456 | |||
| fa2337f806 | |||
| c66b1f7e25 | |||
| 133d7c92cb | |||
| 10c0d26a17 | |||
| 328103c4ac | |||
| 8697829982 | |||
| b68f79d569 | |||
| 25b8a12aad | |||
| 3846d1a4f7 | |||
| 142a5ec922 | |||
| 3b53aca31f | |||
| 297f564b1d | |||
| 87f0586cdd | |||
| 582357557f | |||
| f779f3dbf4 | |||
| 7df39efa7b | |||
| cab8ea86fb | |||
| 7b99efb061 | |||
| ed3a5a7ee3 | |||
| e41e95d377 | |||
| bd0a1e66f2 | |||
| a784e36980 | |||
| 4121e3a427 | |||
| 315e9a0d03 | |||
| 7804e8aa44 | |||
| f42b7adc0e | |||
| 48d34af7bb | |||
| 12a23abbbf | |||
| 7a7f31b7a6 | |||
| 3c7fb8aeff | |||
| f43fa499bf | |||
| 34152867fa | |||
| 18e0aabdb2 | |||
| 8a822a8400 | |||
| 71d879842f | |||
| 0407bec67b | |||
| f5746a1a3c | |||
| ea6708e55a | |||
| 83528f932e | |||
| 7f5a117a67 | |||
| e709a759ed | |||
| 41da2fab98 | |||
| 38621c61ba | |||
| 6b36b01491 | |||
| 49164ce6ef | |||
| 9cbea5764d | |||
| f8503b4c68 | |||
| 0ff1c9915d | |||
| c58a9429e1 | |||
| 18efe25167 | |||
| 5c5a0e6140 | |||
| 05d5e981af | |||
| ea7d52a353 | |||
| 8136b3ecb0 | |||
| 13ea17c225 | |||
| c61c130ddf | |||
| 818c699d60 | |||
| f5ec2139f0 | |||
| 983d7610e4 | |||
| 504c477037 | |||
| 7b8932a5d6 | |||
| 504f53439a | |||
| e58c7f46c7 | |||
| 1953e23560 | |||
| c266f9f58e | |||
| 7296643f2d | |||
| 0057421f98 | |||
| bb5d373923 | |||
| be8e4b9fe5 | |||
| e6820ad52a | |||
| b6fd0489e2 | |||
| 936b903b24 | |||
| bba4db46d2 | |||
| ec30251271 | |||
| 173d298d21 | |||
| 98eeaca5d5 | |||
| 6ab03d4c98 | |||
| 7a172c4253 | |||
| b28f1d86c9 | |||
| 9058358004 | |||
| 6d4deb8da5 | |||
| 4da98c1697 | |||
| 7ae9a2bda6 | |||
| 95c4fb740a | |||
| ad4b90dbe5 | |||
| 0ce83630d7 | |||
| bc733132a6 | |||
| 58a0de086f | |||
| cc9ca02843 | |||
| 12e49f186e | |||
| 967df0949b | |||
| a0602e6b2a | |||
| c078a1c12f | |||
| 8cfb5915ac | |||
| 19595ba887 | |||
| 2b2891b6f4 | |||
| 0b41f1e85e | |||
| 1d42a9225f | |||
| 8012c909c0 | |||
| 7368cc6b28 | |||
| 68480ebd56 | |||
| 0d74642e56 | |||
| cce63d6eaa | |||
| 3090339962 | |||
| d9074da3fd | |||
| 8e89a43311 | |||
| 93e864494b | |||
| 1c16764605 | |||
| 69494c20f4 | |||
| caa0e82d77 | |||
| d2592bd79f | |||
| b90f28731c | |||
| c8264cff1e | |||
| 3400c52e45 | |||
| 613dd76f81 | |||
| 7c7ef42216 | |||
| 0e736a8d32 | |||
| 08ea69caae | |||
| 2380217c21 | |||
| 1231975a78 | |||
| 14e241bf21 | |||
| c3c755755d | |||
| 50d3b81ed9 | |||
| 371e4382cb | |||
| 45dde8717b | |||
| af256e754d | |||
| 2ec8d124fd | |||
| eb31ce3b44 | |||
| 8a65ea7e97 | |||
| e960f8dca9 | |||
| c5677233e3 | |||
| 9f80911b00 | |||
| f3df082695 | |||
| ac309f5a65 | |||
| 8aa9326e10 | |||
| fc47cdf9b0 | |||
| bad341613f | |||
| 863e8b5024 | |||
| f2d4e6541d | |||
| 2b066b3dbc | |||
| 1e1b8b7ae6 | |||
| 4021b680f8 | |||
| 2733dc3129 | |||
| 97ed172472 | |||
| 4ed496921a | |||
| be55c11554 | |||
| 228c8ac8e0 | |||
| 55a7f7c23b | |||
| b8034fa325 | |||
| 54b11ea871 | |||
| ad1075a1ce | |||
| 4c0f95a93a | |||
| c49560f39d | |||
| 1f01001d16 | |||
| 78141630b7 | |||
| 2c871e635f | |||
| e0321138ea | |||
| 7ce07cdd95 | |||
| 438e985d9e | |||
| 518353c877 | |||
| a39c1455e2 | |||
| 110521f0d8 | |||
| 5a0d7329b6 | |||
| 900dcfdc33 | |||
| cfb2d3c974 | |||
| d402f762ae | |||
| 62327a9b58 | |||
| 9d5f3089c8 | |||
| 4084ff8a24 | |||
| 23b214e4f9 | |||
| 88f79cfca5 | |||
| 893855f8bd | |||
| 0f3408c288 | |||
| afacdc12ad | |||
| 2c12b06bd7 | |||
| 00f86ffef7 | |||
| a9cf1aa874 | |||
| ad868b9598 | |||
| b3769e4117 | |||
| 7fcb982e33 | |||
| 6d1ccaa7a4 | |||
| 6035971a88 | |||
| 3aedb69490 | |||
| 699a88558e | |||
| ae66c422ab | |||
| 8194fb7b32 | |||
| ae0fa3bf14 | |||
| 0f32283601 | |||
| a2eda1e8dd | |||
| ca8a819590 | |||
| d3365bc751 | |||
| 5dbedcf67b | |||
| e1793ad95c | |||
| 9dd803fb73 | |||
| c63f152c8f | |||
| 58db323eee | |||
| fa2ed768db | |||
| 28e812580a | |||
| a2a3d2e6c7 | |||
| 01649c509f | |||
| 43603d0f97 | |||
| 872aff0c96 | |||
| 375fda2007 | |||
| 808efea246 | |||
| 5f5c8c7693 | |||
| 9464d2a648 | |||
| ef617fa5ed | |||
| e2ec9230b9 | |||
| 357187a7fd | |||
| b433d0a35c | |||
| 3d9ea6c359 | |||
| db0fd1e686 | |||
| 34510e288b | |||
| 6814aefb33 | |||
| dd0f510b5e | |||
| 34d7a13e14 | |||
| bcfdeeda77 | |||
| d87a426294 | |||
| d4be8036f0 | |||
| 9ccba9ec77 | |||
| 8e455257ef | |||
| 41b585aed4 | |||
| 2548e4c8dd | |||
| 2ef54c5bc4 | |||
| 7e1cc8c040 | |||
| e3284c8833 | |||
| 5f95957e5b | |||
| 7c76cbf509 | |||
| b12985558a | |||
| a26904a298 | |||
| 51061e10a9 | |||
| 0264a72762 | |||
| 7a0430e6ba | |||
| 89ebc80bd5 | |||
| ab2db0b37f | |||
| b2c260c42f | |||
| fd07dcccb7 | |||
| d1dfb738c9 | |||
| 3437d95eb4 | |||
| 5bf9bf5175 | |||
| 43f4f7f8f0 | |||
| 175f299253 | |||
| 4828869713 | |||
| 102b97fa82 | |||
| 1d4e80904e | |||
| 311639332d | |||
| 7437240d09 | |||
| 7a1d62967a | |||
| c43be77288 | |||
| b38acdd654 | |||
| 96d570e760 | |||
| ac29542f8e | |||
| 34011df80a | |||
| afbeb50d55 | |||
| 74a113646d | |||
| 6ab2f8300c | |||
| 7ff0e6bafb | |||
| 6c77000ba7 | |||
| 9bb5869cde | |||
| 1844b048be | |||
| eb9e7d0e31 | |||
| 73b8a0987d | |||
| 5d2ac582b7 | |||
| a3ad8e2cab | |||
| 03cf0113d5 | |||
| d3bfb5e94d | |||
| 5195822435 | |||
| e3bf5d3487 | |||
| 7422238087 | |||
| 6afead5207 | |||
| 5bc00e3e48 | |||
| 55c3653910 | |||
| d7b02f0a30 | |||
| 7f3ab15eaa | |||
| 09a2d660c7 | |||
| 3ba6d6b0a1 | |||
| eb6326487f | |||
| ea9975b2c1 | |||
| 229575d3b0 | |||
| 226d3715b9 | |||
| 0661b12b56 | |||
| 322c3e0664 | |||
| 549f0555ab | |||
| 8fcd2200d0 | |||
| fd8cd4be99 | |||
| 82107ab146 | |||
| 185e5d9b7f | |||
| 28f8194876 | |||
| 8db67c0ba3 | |||
| ce521c7624 | |||
| ef6e181eb1 | |||
| 142c4c09e1 | |||
| 3d0e74522d | |||
| fba6d8ec66 | |||
| 4230668c8b | |||
| 66e5843ef7 | |||
| bb4dd9c418 | |||
| 50b49f9ee2 | |||
| cf0eb87d03 | |||
| 75f2de2cc8 | |||
| 927bf1d3a2 | |||
| 24724ca6e8 | |||
| fbed14a9e0 | |||
| a0ade0e183 | |||
| 40fbcc5a99 | |||
| c04fee2aba | |||
| 8aa5a64883 | |||
| dfe89b50ae | |||
| db0a87e3ca | |||
| a75f6d2afd | |||
| b3b813a649 | |||
| bf401ed7a9 | |||
| 34699dc4e1 | |||
| 42fe4c77f6 | |||
| c76d09c9b0 | |||
| 03f9b89810 | |||
| c21dcb0279 | |||
| eec734783c | |||
| df416ccde4 | |||
| 9336d21c25 | |||
| 2d36341118 | |||
| 202f582661 | |||
| 6cacfe599f | |||
| 3822c83dbb | |||
| 07035f6b23 | |||
| 8b9397160b | |||
| 7bcf8c17e5 | |||
| 5ac4b2b305 | |||
| 07a52f659d | |||
| 5420be483c | |||
| 29afebdb60 | |||
| 9784a3d868 | |||
| 4b46cf9a42 | |||
| 2f2d55e24f | |||
| ada2492c44 | |||
| e9b137cde8 | |||
| da8469e4e4 | |||
| 16a4e425cb | |||
| ab092b8814 | |||
| 97a0e72e65 | |||
| 88da00cdd3 | |||
| 4b8042ceb1 | |||
| 7326541ce3 | |||
| d2c7420c4c | |||
| 39987d5f7d | |||
| 4cec6a3213 | |||
| 45f44e1797 | |||
| e2d04e2b3a | |||
| 934f58284a | |||
| 274e2c18e1 | |||
| d16a733d9d | |||
| 8609427d3c | |||
| f3937b8b15 | |||
| 3b618b475d | |||
| eae0087307 | |||
| bfb411a280 | |||
| 9aa9de5a7a | |||
| 231c50319f | |||
| 15cdc85e42 | |||
| 05c6166040 | |||
| 9789fbdb79 | |||
| e701f0d8a1 | |||
| 173d4c9655 | |||
| a0bf366c85 | |||
| a8bcb16303 | |||
| 5fd59a6450 | |||
| dba180d809 | |||
| aceef2b318 | |||
| d8bddd80bb | |||
| d8a0502055 | |||
| 4e1214085e | |||
| 9957bbfb5d | |||
| a9c130d498 | |||
| 964e18b84f | |||
| 45c344a0ca | |||
| 9a0451e1ad | |||
| 222f8b8744 | |||
| eba2ed842b | |||
| 180e93a3bf | |||
| 50f1a995e9 | |||
| e1cf330638 | |||
| 4d19826d98 | |||
| eec6fe2115 | |||
| 5ad8ebfa6e | |||
| ef2c7e2d3a | |||
| df04a90698 | |||
| 332220acc4 | |||
| 988e025d12 | |||
| 599872a310 | |||
| fbe49acc77 | |||
| 677983a59e | |||
| 92ae6c5b5d | |||
| fdafd07117 | |||
| 9f34c72cb4 | |||
| 5eb253c4eb | |||
| 7fbda1dc7d | |||
| 9bae8173fc | |||
| 8f66258a94 | |||
| aa8f7a9394 | |||
| 5c24759234 | |||
| b84a52c760 | |||
| 54c3e68f32 | |||
| 2e1e1eee1c | |||
| e60b621110 | |||
| 89ed75f5dc | |||
| ec294cefd8 | |||
| 16d8481ad9 | |||
| 601fef873a | |||
| 49a374dbca | |||
| 7edd7cbd8a | |||
| 51e9ef21aa | |||
| d0ebbf2359 | |||
| c8c2d2d601 | |||
| 8a93c8371c | |||
| 4fea55e751 | |||
| abe925b946 | |||
| c34f83e231 | |||
| fd2fe1939a | |||
| 81e56bed9e | |||
| 52457fea21 | |||
| 07ec9aa813 | |||
| ba89aec34f | |||
| 29533820ab | |||
| 4366500fad | |||
| ee6e1a9d8b | |||
| 3b95184f04 | |||
| 9da7e108da | |||
| cb491d45ab | |||
| 344b880ba7 | |||
| c958f12bc1 | |||
| 9a973d0ccc | |||
| b170053e87 | |||
| db4509de2b | |||
| 5c91b822e3 | |||
| e6ddf63e56 | |||
| 84ac029372 | |||
| 5d59741612 | |||
| 2ffd0413e8 | |||
| dc4e6ee01c | |||
| 23b6170106 | |||
| 1d8e217c6f | |||
| f430698e29 | |||
| bd7533f0bf | |||
| 748dddf25b | |||
| 48518d8f42 | |||
| d234297791 | |||
| 8b752dbc63 | |||
| 2d87a2ae2b | |||
| 05ea0b5ac4 | |||
| 15d84759f6 | |||
| c344e7247c | |||
| 74d84d909d | |||
| 30462d72e6 | |||
| b8849fc1b1 | |||
| d80f707b69 | |||
| 8d4d0d2f53 | |||
| 22993cf185 | |||
| c9717d22ea | |||
| cdcef49ff8 | |||
| 0b3136cf20 | |||
| b0e96b256a | |||
| 72a966b0fa | |||
| bf222f26cd | |||
| be9f4b70e2 | |||
| 0060f0019e | |||
| 632cd221d9 | |||
| 46d5215d9e | |||
| aa43656cb9 | |||
| e4837d1962 | |||
| 40868d7cd2 | |||
| 0fde3f7b5d | |||
| 76f0eac5f8 | |||
| 2352d258b9 | |||
| 2dc38a29cf | |||
| 1aa162e255 | |||
| 342999a678 | |||
| 5cb210c7b6 | |||
| b80ab20cb4 | |||
| bac6e71e7f | |||
| 9a36d74418 | |||
| 39eaa4a15e | |||
| 2fdf040f73 | |||
| aec956dd2e | |||
| 65bb1e1e20 | |||
| 3dabd73ec2 | |||
| 90e5440518 | |||
| 7cfd2d6593 | |||
| 6382515258 | |||
| fd2b9ce67d | |||
| 1284417a58 | |||
| b57642003c | |||
| 9ee59e8e38 | |||
| a5f81ae6c2 | |||
| 08cc608dc8 | |||
| 71839d53a6 | |||
| 7508613d13 | |||
| 9626e91c83 | |||
| 83b6375f04 | |||
| 52cd44a700 | |||
| 0c8ff187aa | |||
| 3af74bd4fd | |||
| c9e2e1e116 | |||
| c27f73e54a | |||
| cede13d180 | |||
| 3ffb2772b6 | |||
| e6f0d4e056 | |||
| 23c7eafaf5 | |||
| 90892ce818 | |||
| e62d1559b1 | |||
| 81934c47d2 | |||
| 80379e116d | |||
| 89081b86af | |||
| 216e2255f2 | |||
| 9db3dbd730 | |||
| 8a1dd96294 | |||
| 67bebd0d2d | |||
| 4f34fbd2c8 | |||
| 8cda6e4062 | |||
| d8209efefa | |||
| 00180d2120 | |||
| 66e768afee | |||
| bba109cb28 | |||
| 39ede8c47a | |||
| fec84b8ce3 | |||
| a00e5d54aa | |||
| 331813e370 | |||
| 6c36f43276 | |||
| e8f4e7663f | |||
| 9f116c00d5 | |||
| 7e61b25746 | |||
| 482750ab6a | |||
| 40d1099fbd | |||
| 2d050a0c88 | |||
| 103f4f33bd | |||
| 727f9355a0 | |||
| e269a0b9bb | |||
| 861b1cefe5 | |||
| 23301817bf | |||
| f5842c82a6 | |||
| 4baf3ed99a | |||
| 3c09cd7674 | |||
| 051f9b4744 |
@@ -51,6 +51,7 @@ _BuildOutput/*
|
||||
build/UmbracoCms.AllBinaries*zip
|
||||
build/UmbracoCms.WebPI*zip
|
||||
build/UmbracoCms*zip
|
||||
build/UmbracoExamine.PDF*zip
|
||||
build/*.nupkg
|
||||
src/Umbraco.Tests/config/applications.config
|
||||
src/Umbraco.Tests/config/trees.config
|
||||
@@ -78,6 +79,12 @@ src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/loader.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/main.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/app.js
|
||||
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.panel.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.palettes.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.loader.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.front.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.config.js
|
||||
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.js
|
||||
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.css
|
||||
@@ -110,3 +117,15 @@ src/Umbraco.Web.UI/umbraco/js/init.js
|
||||
build/ApiDocs/*
|
||||
build/ApiDocs/Output/*
|
||||
src/Umbraco.Web.UI.Client/bower_components/*
|
||||
/src/Umbraco.Web.UI/Umbraco/preview
|
||||
|
||||
#Ignore Rule for output of generated documentation files from Grunt docserve
|
||||
src/Umbraco.Web.UI.Client/docs/api
|
||||
src/*.boltdata/
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.loader.js
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.palettes.js
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.panel.js
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.config.js
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.front.js
|
||||
src/umbraco.sln.ide/*
|
||||
build/UmbracoCms.*/
|
||||
|
||||
@@ -24,7 +24,7 @@ ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %rel
|
||||
ECHO Installing the Microsoft.Bcl.Build package before anything else, otherwise you'd have to run build.cmd twice
|
||||
SET nuGetFolder=%CD%\..\src\packages\
|
||||
..\src\.nuget\NuGet.exe sources Remove -Name MyGetUmbracoCore
|
||||
..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/
|
||||
..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL
|
||||
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder%
|
||||
..\src\.nuget\NuGet.exe install ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder%
|
||||
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder%
|
||||
@@ -35,24 +35,17 @@ RD ..\src\Umbraco.Web.UI.Client\build /Q /S
|
||||
ECHO Removing existing built files to make sure everything is clean as a whistle
|
||||
RMDIR /Q /S _BuildOutput
|
||||
DEL /F /Q UmbracoCms.*.zip
|
||||
DEL /F /Q UmbracoExamine.*.zip
|
||||
DEL /F /Q UmbracoCms.*.nupkg
|
||||
DEL /F /Q webpihash.txt
|
||||
|
||||
ECHO Making sure Git is in the path so that the build can succeed
|
||||
CALL InstallGit.cmd
|
||||
ECHO Performing MSBuild and producing Umbraco binaries zip files
|
||||
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%
|
||||
|
||||
ECHO Adding dummy files to include in the NuGet package so that empty folders actually get created
|
||||
SET dummytext=This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete.
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\App_Code\dummy.txt
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\App_Data\dummy.txt
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\App_Plugins\dummy.txt
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\css\dummy.txt
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\masterpages\dummy.txt
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\media\dummy.txt
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\scripts\dummy.txt
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\usercontrols\dummy.txt
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\Views\Partials\dummy.txt
|
||||
ECHO %dummytext% > .\_BuildOutput\WebApp\Views\MacroPartials\dummy.txt
|
||||
ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project
|
||||
attrib +h ..\src\Umbraco.Web.UI.Client\node_modules
|
||||
|
||||
ECHO Adding Web.config transform files to the NuGet package
|
||||
REN .\_BuildOutput\WebApp\MacroScripts\Web.config Web.config.transform
|
||||
@@ -62,6 +55,7 @@ REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform
|
||||
ECHO Packing the NuGet release files
|
||||
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%
|
||||
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version%
|
||||
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoExamine.PDF.nuspec
|
||||
|
||||
IF ERRORLEVEL 1 GOTO :showerror
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<BuildZipFileName>UmbracoCms$(DECIMAL_BUILD_NUMBER).zip</BuildZipFileName>
|
||||
<BuildZipFileNameBin>UmbracoCms.AllBinaries$(DECIMAL_BUILD_NUMBER).zip</BuildZipFileNameBin>
|
||||
<BuildZipFileNameWebPi>UmbracoCms.WebPI$(DECIMAL_BUILD_NUMBER).zip</BuildZipFileNameWebPi>
|
||||
<BuildZipExaminePDFName>UmbracoExamine.PDF.0.6.0.zip</BuildZipExaminePDFName>
|
||||
<IncludeSymbols>False</IncludeSymbols>
|
||||
<BuildFolderRelativeToProjects>..\..\build\$(BuildFolder)</BuildFolderRelativeToProjects>
|
||||
<BuildFolderAbsolutePath>$(MSBuildProjectDirectory)\$(BuildFolder)</BuildFolderAbsolutePath>
|
||||
@@ -102,7 +103,6 @@
|
||||
<SystemFolders Include="$(WebAppFolder)Masterpages" />
|
||||
<SystemFolders Include="$(WebAppFolder)Scripts" />
|
||||
<SystemFolders Include="$(WebAppFolder)Css" />
|
||||
<SystemFolders Include="$(WebAppFolder)MacroScripts" />
|
||||
<SystemFolders Include="$(WebAppFolder)Xslt" />
|
||||
<SystemFolders Include="$(WebAppFolder)UserControls" />
|
||||
<SystemFolders Include="$(WebAppFolder)Views" />
|
||||
@@ -153,14 +153,22 @@
|
||||
<Exec Command="..\tools\7zip\7za.exe a -r %22$(BuildZipFileNameWebPi)%22 %22$(WebPiFolderAbsolutePath)*%22" />
|
||||
</Target>
|
||||
|
||||
<Target Name="ZipWebApp" DependsOnTargets="CreateSystemFolders" >
|
||||
<Target Name="ZipWebApp" DependsOnTargets="ZipUmbracoExaminePDF" >
|
||||
<Message Text="Starting to zip to $(buildDate)-$(BuildZipFileName)" Importance="high" />
|
||||
|
||||
<Exec Command="..\tools\7zip\7za.exe a -r %22$(BuildZipFileNameBin)%22 %22$(SolutionBinFolderAbsolutePath)*%22" />
|
||||
<Exec Command="..\tools\7zip\7za.exe a -r %22$(BuildZipFileName)%22 %22$(WebAppFolderAbsolutePath)*%22" />
|
||||
<Exec Command="..\tools\7zip\7za.exe a -r %22$(BuildZipFileNameBin)%22 %22$(SolutionBinFolderAbsolutePath)*%22 -x!dotLess.Core.dll" />
|
||||
<Exec Command="..\tools\7zip\7za.exe a -r %22$(BuildZipFileName)%22 %22$(WebAppFolderAbsolutePath)*%22 -x!dotLess.Core.dll" />
|
||||
|
||||
<Message Text="Finished zipping to build\$(BuildFolder)\$(buildDate)-$(BuildZipFileName)" Importance="high" />
|
||||
</Target>
|
||||
|
||||
<Target Name="ZipUmbracoExaminePDF" DependsOnTargets="CreateSystemFolders" >
|
||||
<Message Text="Starting to zip to $(buildDate)-$(BuildZipExaminePDFName)" Importance="high" />
|
||||
|
||||
<Exec Command="..\tools\7zip\7za.exe a -r %22$(BuildZipExaminePDFName)%22 %22$(ExaminePDFPath)*%22" />
|
||||
|
||||
<Message Text="Finished zipping to build\$(BuildFolder)\$(buildDate)-$(BuildZipExaminePDFName)" Importance="high" />
|
||||
</Target>
|
||||
|
||||
<Target Name="CreateSystemFolders" DependsOnTargets="CopyBelleBuild" Inputs="@(SystemFolders)" Outputs="%(Identity).Dummy">
|
||||
<MakeDir Directories="@(SystemFolders)" />
|
||||
@@ -223,7 +231,7 @@
|
||||
<!-- Copy the config files and rename them to *.config.transform -->
|
||||
<Target Name="CopyTransformedConfig" DependsOnTargets="CopyXmlDocumentation">
|
||||
<ItemGroup>
|
||||
<ConfigFiles Include="$(WebAppFolder)config\*.config" />
|
||||
<ConfigFiles Include="$(WebAppFolder)config\*.config;$(WebAppFolder)config\*.js" />
|
||||
<WebConfigTransformFile Include="$(WebAppFolder)Web.config" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
@ECHO OFF
|
||||
SET oldPath=%PATH%
|
||||
|
||||
git.exe 2> NUL
|
||||
if %ERRORLEVEL%==9009 GOTO :trydefaultpath
|
||||
GOTO :EOF
|
||||
|
||||
:trydefaultpath
|
||||
path=C:\Program Files (x86)\Git\cmd;%PATH%
|
||||
git.exe 2> NUL
|
||||
if %ERRORLEVEL%==9009 GOTO :showerror
|
||||
GOTO :EOF
|
||||
|
||||
:showerror
|
||||
path=%oldPath%
|
||||
ECHO Git is not in your path and could not be found in C:\Program Files (x86)\Git\bin
|
||||
set /p install=" Do you want to install Git through Chocolatey [y/n]? " %=%
|
||||
if %install%==y (
|
||||
GOTO :installgit
|
||||
) else (
|
||||
GOTO :cantcontinue
|
||||
)
|
||||
|
||||
:cantcontinue
|
||||
ECHO Can't complete the build without Git being in the path. Please add it to be able to continue.
|
||||
GOTO :EOF
|
||||
|
||||
:installgit
|
||||
ECHO Installing Chocolatey first
|
||||
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
|
||||
ECHO Installing Git through Chocolatey
|
||||
choco install git
|
||||
path=C:\Program Files (x86)\Git\cmd;%path%
|
||||
@@ -1,74 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>UmbracoCms.Core.AllBinaries</id>
|
||||
<version>6.1.2</version>
|
||||
<title>Umbraco Cms Core All Binaries</title>
|
||||
<authors>Morten Christensen</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
|
||||
<projectUrl>http://umbraco.com/</projectUrl>
|
||||
<iconUrl>http://umbraco.com/media/357769/100px_transparent.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains the core assemblies and all of the dependant assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms-package to setup Umbraco in Visual Studio as an ASP.NET project.</description>
|
||||
<summary>Contains the core assemblies and all of the dependant assemblies needed to run Umbraco Cms</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\_BuildOutput\bin\businesslogic.dll" target="lib\businesslogic.dll" />
|
||||
<file src="..\_BuildOutput\bin\AutoMapper.dll" target="lib\AutoMapper.dll" />
|
||||
<file src="..\_BuildOutput\bin\AutoMapper.Net4.dll" target="lib\AutoMapper.Net4.dll" />
|
||||
<file src="..\_BuildOutput\bin\businesslogic.dll" target="lib\businesslogic.dll" />
|
||||
<file src="..\_BuildOutput\bin\ClientDependency.Core.dll" target="lib\ClientDependency.Core.dll" />
|
||||
<file src="..\_BuildOutput\bin\ClientDependency.Core.Mvc.dll" target="lib\ClientDependency.Core.Mvc.dll" />
|
||||
<file src="..\_BuildOutput\bin\cms.dll" target="lib\cms.dll" />
|
||||
<file src="..\_BuildOutput\bin\controls.dll" target="lib\controls.dll" />
|
||||
<file src="..\_BuildOutput\bin\CookComputing.XmlRpcV2.dll" target="lib\CookComputing.XmlRpcV2.dll" />
|
||||
<file src="..\_BuildOutput\bin\Examine.dll" target="lib\Examine.dll" />
|
||||
<file src="..\_BuildOutput\bin\HtmlAgilityPack.dll" target="lib\HtmlAgilityPack.dll" />
|
||||
<file src="..\_BuildOutput\bin\ICSharpCode.SharpZipLib.dll" target="lib\ICSharpCode.SharpZipLib.dll" />
|
||||
<file src="..\_BuildOutput\bin\ImageProcessor.dll" target="lib\ImageProcessor.dll" />
|
||||
<file src="..\_BuildOutput\bin\ImageProcessor.Web.dll" target="lib\ImageProcessor.Web.dll" />
|
||||
<file src="..\_BuildOutput\bin\interfaces.dll" target="lib\interfaces.dll" />
|
||||
<file src="..\_BuildOutput\bin\log4net.dll" target="lib\log4net.dll" />
|
||||
<file src="..\_BuildOutput\bin\Lucene.Net.dll" target="lib\Lucene.Net.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\Microsoft.ApplicationBlocks.Data.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.Threading.Tasks.dll" target="lib\Microsoft.Threading.Tasks.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.Threading.Tasks.Extensions.dll" target="lib\Microsoft.Threading.Tasks.Extensions.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.Web.Helpers.dll" target="lib\Microsoft.Web.Helpers.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.Web.Infrastructure.dll" target="lib\Microsoft.Web.Infrastructure.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.Web.Mvc.FixedDisplayModes.dll" target="lib\Microsoft.Web.Mvc.FixedDisplayModes.dll" />
|
||||
<file src="..\_BuildOutput\bin\MiniProfiler.dll" target="lib\MiniProfiler.dll" />
|
||||
<file src="..\_BuildOutput\bin\MySql.Data.dll" target="lib\MySql.Data.dll" />
|
||||
<file src="..\_BuildOutput\bin\Newtonsoft.Json.dll" target="lib\Newtonsoft.Json.dll" />
|
||||
<file src="..\_BuildOutput\bin\NuGet.Core.dll" target="lib\NuGet.Core.dll" />
|
||||
<file src="..\_BuildOutput\bin\SQLCE4Umbraco.dll" target="lib\SQLCE4Umbraco.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Data.SqlServerCe.dll" target="lib\System.Data.SqlServerCe.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Data.SqlServerCe.Entity.dll" target="lib\System.Data.SqlServerCe.Entity.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.dll" target="lib\System.Net.Http.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.Extensions.dll" target="lib\System.Net.Http.Extensions.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.Formatting.dll" target="lib\System.Net.Http.Formatting.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.Primitives.dll" target="lib\System.Net.Http.Primitives.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.WebRequest.dll" target="lib\System.Net.Http.WebRequest.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Helpers.dll" target="lib\System.Web.Helpers.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Http.dll" target="lib\System.Web.Http.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Http.WebHost.dll" target="lib\System.Web.Http.WebHost.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Mvc.dll" target="lib\System.Web.Mvc.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Razor.dll" target="lib\System.Web.Razor.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.WebPages.Administration.dll" target="lib\System.Web.WebPages.Administration.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.WebPages.Deployment.dll" target="lib\System.Web.WebPages.Deployment.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.WebPages.dll" target="lib\System.Web.WebPages.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.WebPages.Razor.dll" target="lib\System.Web.WebPages.Razor.dll" />
|
||||
<file src="..\_BuildOutput\bin\TidyNet.dll" target="lib\TidyNet.dll" />
|
||||
<file src="..\_BuildOutput\bin\Umbraco.Core.dll" target="lib\Umbraco.Core.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.DataLayer.dll" target="lib\umbraco.DataLayer.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.dll" target="lib\umbraco.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.editorControls.dll" target="lib\umbraco.editorControls.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.MacroEngines.dll" target="lib\umbraco.MacroEngines.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.providers.dll" target="lib\umbraco.providers.dll" />
|
||||
<file src="..\_BuildOutput\bin\Umbraco.Web.UI.dll" target="lib\Umbraco.Web.UI.dll" />
|
||||
<file src="..\_BuildOutput\bin\UmbracoExamine.dll" target="lib\UmbracoExamine.dll" />
|
||||
<file src="..\_BuildOutput\bin\UrlRewritingNet.UrlRewriter.dll" target="lib\UrlRewritingNet.UrlRewriter.dll" />
|
||||
</files>
|
||||
<metadata>
|
||||
<id>UmbracoCms.Core.AllBinaries</id>
|
||||
<version>6.1.2</version>
|
||||
<title>Umbraco Cms Core All Binaries</title>
|
||||
<authors>Morten Christensen</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
|
||||
<projectUrl>http://umbraco.com/</projectUrl>
|
||||
<iconUrl>http://umbraco.com/media/357769/100px_transparent.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains the core assemblies and all of the dependant assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms-package to setup Umbraco in Visual Studio as an ASP.NET project.</description>
|
||||
<summary>Contains the core assemblies and all of the dependant assemblies needed to run Umbraco Cms</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\_BuildOutput\bin\businesslogic.dll" target="lib\businesslogic.dll" />
|
||||
<file src="..\_BuildOutput\bin\AutoMapper.dll" target="lib\AutoMapper.dll" />
|
||||
<file src="..\_BuildOutput\bin\AutoMapper.Net4.dll" target="lib\AutoMapper.Net4.dll" />
|
||||
<file src="..\_BuildOutput\bin\businesslogic.dll" target="lib\businesslogic.dll" />
|
||||
<file src="..\_BuildOutput\bin\ClientDependency.Core.dll" target="lib\ClientDependency.Core.dll" />
|
||||
<file src="..\_BuildOutput\bin\ClientDependency.Core.Mvc.dll" target="lib\ClientDependency.Core.Mvc.dll" />
|
||||
<file src="..\_BuildOutput\bin\cms.dll" target="lib\cms.dll" />
|
||||
<file src="..\_BuildOutput\bin\controls.dll" target="lib\controls.dll" />
|
||||
<file src="..\_BuildOutput\bin\CookComputing.XmlRpcV2.dll" target="lib\CookComputing.XmlRpcV2.dll" />
|
||||
<file src="..\_BuildOutput\bin\Examine.dll" target="lib\Examine.dll" />
|
||||
<file src="..\_BuildOutput\bin\HtmlAgilityPack.dll" target="lib\HtmlAgilityPack.dll" />
|
||||
<file src="..\_BuildOutput\bin\ICSharpCode.SharpZipLib.dll" target="lib\ICSharpCode.SharpZipLib.dll" />
|
||||
<file src="..\_BuildOutput\bin\ImageProcessor.dll" target="lib\ImageProcessor.dll" />
|
||||
<file src="..\_BuildOutput\bin\ImageProcessor.Web.dll" target="lib\ImageProcessor.Web.dll" />
|
||||
<file src="..\_BuildOutput\bin\interfaces.dll" target="lib\interfaces.dll" />
|
||||
<file src="..\_BuildOutput\bin\log4net.dll" target="lib\log4net.dll" />
|
||||
<file src="..\_BuildOutput\bin\Lucene.Net.dll" target="lib\Lucene.Net.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\Microsoft.ApplicationBlocks.Data.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.Threading.Tasks.dll" target="lib\Microsoft.Threading.Tasks.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.Threading.Tasks.Extensions.dll" target="lib\Microsoft.Threading.Tasks.Extensions.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.Web.Infrastructure.dll" target="lib\Microsoft.Web.Infrastructure.dll" />
|
||||
<file src="..\_BuildOutput\bin\Microsoft.Web.Mvc.FixedDisplayModes.dll" target="lib\Microsoft.Web.Mvc.FixedDisplayModes.dll" />
|
||||
<file src="..\_BuildOutput\bin\MiniProfiler.dll" target="lib\MiniProfiler.dll" />
|
||||
<file src="..\_BuildOutput\bin\MySql.Data.dll" target="lib\MySql.Data.dll" />
|
||||
<file src="..\_BuildOutput\bin\Newtonsoft.Json.dll" target="lib\Newtonsoft.Json.dll" />
|
||||
<file src="..\_BuildOutput\bin\NuGet.Core.dll" target="lib\NuGet.Core.dll" />
|
||||
<file src="..\_BuildOutput\bin\SQLCE4Umbraco.dll" target="lib\SQLCE4Umbraco.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Data.SqlServerCe.dll" target="lib\System.Data.SqlServerCe.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Data.SqlServerCe.Entity.dll" target="lib\System.Data.SqlServerCe.Entity.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.dll" target="lib\System.Net.Http.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.Extensions.dll" target="lib\System.Net.Http.Extensions.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.Formatting.dll" target="lib\System.Net.Http.Formatting.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.Primitives.dll" target="lib\System.Net.Http.Primitives.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Net.Http.WebRequest.dll" target="lib\System.Net.Http.WebRequest.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Helpers.dll" target="lib\System.Web.Helpers.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Http.dll" target="lib\System.Web.Http.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Http.WebHost.dll" target="lib\System.Web.Http.WebHost.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Mvc.dll" target="lib\System.Web.Mvc.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.Razor.dll" target="lib\System.Web.Razor.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.WebPages.Administration.dll" target="lib\System.Web.WebPages.Administration.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.WebPages.Deployment.dll" target="lib\System.Web.WebPages.Deployment.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.WebPages.dll" target="lib\System.Web.WebPages.dll" />
|
||||
<file src="..\_BuildOutput\bin\System.Web.WebPages.Razor.dll" target="lib\System.Web.WebPages.Razor.dll" />
|
||||
<file src="..\_BuildOutput\bin\TidyNet.dll" target="lib\TidyNet.dll" />
|
||||
<file src="..\_BuildOutput\bin\Umbraco.Core.dll" target="lib\Umbraco.Core.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.DataLayer.dll" target="lib\umbraco.DataLayer.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.dll" target="lib\umbraco.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.editorControls.dll" target="lib\umbraco.editorControls.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.MacroEngines.dll" target="lib\umbraco.MacroEngines.dll" />
|
||||
<file src="..\_BuildOutput\bin\umbraco.providers.dll" target="lib\umbraco.providers.dll" />
|
||||
<file src="..\_BuildOutput\bin\Umbraco.Web.UI.dll" target="lib\Umbraco.Web.UI.dll" />
|
||||
<file src="..\_BuildOutput\bin\UmbracoExamine.dll" target="lib\UmbracoExamine.dll" />
|
||||
<file src="..\_BuildOutput\bin\UrlRewritingNet.UrlRewriter.dll" target="lib\UrlRewritingNet.UrlRewriter.dll" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -1,71 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>UmbracoCms.Core</id>
|
||||
<version>7.0.0</version>
|
||||
<title>Umbraco Cms Core Binaries</title>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
|
||||
<projectUrl>http://umbraco.com/</projectUrl>
|
||||
<iconUrl>http://umbraco.com/media/357769/100px_transparent.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains the core assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms-package to setup Umbraco in Visual Studio as an ASP.NET project.</description>
|
||||
<summary>Contains the core assemblies needed to run Umbraco Cms</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\..\src\SQLCE4Umbraco\obj\Debug\SQLCE4Umbraco.dll" target="lib" />
|
||||
<file src="..\..\src\SQLCE4Umbraco\obj\Debug\SQLCE4Umbraco.pdb" target="lib" />
|
||||
<file src="..\..\src\SQLCE4Umbraco\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\SQLCE4Umbraco" />
|
||||
|
||||
<file src="..\..\src\umbraco.businesslogic\obj\Debug\businesslogic.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.businesslogic\obj\Debug\businesslogic.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.businesslogic\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.businesslogic" />
|
||||
|
||||
<file src="..\..\src\umbraco.cms\obj\Debug\cms.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.cms\obj\Debug\cms.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.cms\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.cms" />
|
||||
|
||||
<file src="..\..\src\umbraco.controls\obj\Debug\controls.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.controls\obj\Debug\controls.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.controls\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.controls" />
|
||||
|
||||
<file src="..\..\src\umbraco.interfaces\obj\Debug\interfaces.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.interfaces\obj\Debug\interfaces.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.interfaces\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.interfaces" />
|
||||
|
||||
<file src="..\..\src\Umbraco.Core\obj\Debug\Umbraco.Core.dll" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Core\obj\Debug\Umbraco.Core.pdb" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Core\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Core" />
|
||||
|
||||
<file src="..\..\src\umbraco.datalayer\obj\Debug\umbraco.DataLayer.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.datalayer\obj\Debug\umbraco.DataLayer.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.datalayer\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.datalayer" />
|
||||
|
||||
<file src="..\..\src\umbraco.editorControls\obj\Debug\umbraco.editorControls.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.editorControls\obj\Debug\umbraco.editorControls.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.editorControls\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.editorControls" />
|
||||
|
||||
<file src="..\..\src\umbraco.MacroEngines\obj\Debug\umbraco.MacroEngines.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.MacroEngines\obj\Debug\umbraco.MacroEngines.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.MacroEngines\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.MacroEngines" />
|
||||
|
||||
<file src="..\..\src\umbraco.providers\obj\Debug\umbraco.providers.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.providers\obj\Debug\umbraco.providers.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.providers\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.providers" />
|
||||
|
||||
<file src="..\..\src\Umbraco.Web\obj\Debug\umbraco.dll" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Web\obj\Debug\umbraco.pdb" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Web\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Web" />
|
||||
|
||||
<file src="..\..\src\bin\Debug\Umbraco.Web.UI.dll" target="lib" />
|
||||
<file src="..\..\src\bin\Debug\Umbraco.Web.UI.pdb" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Web.UI\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Web.UI" />
|
||||
|
||||
<file src="..\..\src\UmbracoExamine\obj\Debug\UmbracoExamine.dll" target="lib" />
|
||||
<file src="..\..\src\UmbracoExamine\obj\Debug\UmbracoExamine.pdb" target="lib" />
|
||||
<file src="..\..\src\UmbracoExamine\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\UmbracoExamine" />
|
||||
</files>
|
||||
<metadata>
|
||||
<id>UmbracoCms.Core</id>
|
||||
<version>7.0.0</version>
|
||||
<title>Umbraco Cms Core Binaries</title>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
|
||||
<projectUrl>http://umbraco.com/</projectUrl>
|
||||
<iconUrl>http://umbraco.com/media/357769/100px_transparent.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains the core assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms-package to setup Umbraco in Visual Studio as an ASP.NET project.</description>
|
||||
<summary>Contains the core assemblies needed to run Umbraco Cms</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\..\src\SQLCE4Umbraco\obj\Debug\SQLCE4Umbraco.dll" target="lib" />
|
||||
<file src="..\..\src\SQLCE4Umbraco\obj\Debug\SQLCE4Umbraco.pdb" target="lib" />
|
||||
<file src="..\..\src\SQLCE4Umbraco\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\SQLCE4Umbraco" />
|
||||
|
||||
<file src="..\..\src\umbraco.businesslogic\obj\Debug\businesslogic.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.businesslogic\obj\Debug\businesslogic.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.businesslogic\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.businesslogic" />
|
||||
|
||||
<file src="..\..\src\umbraco.cms\obj\Debug\cms.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.cms\obj\Debug\cms.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.cms\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.cms" />
|
||||
|
||||
<file src="..\..\src\umbraco.controls\obj\Debug\controls.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.controls\obj\Debug\controls.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.controls\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.controls" />
|
||||
|
||||
<file src="..\..\src\umbraco.interfaces\obj\Debug\interfaces.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.interfaces\obj\Debug\interfaces.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.interfaces\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.interfaces" />
|
||||
|
||||
<file src="..\..\src\Umbraco.Core\obj\Debug\Umbraco.Core.dll" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Core\obj\Debug\Umbraco.Core.pdb" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Core\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Core" />
|
||||
|
||||
<file src="..\..\src\umbraco.datalayer\obj\Debug\umbraco.DataLayer.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.datalayer\obj\Debug\umbraco.DataLayer.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.datalayer\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.datalayer" />
|
||||
|
||||
<file src="..\..\src\umbraco.editorControls\obj\Debug\umbraco.editorControls.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.editorControls\obj\Debug\umbraco.editorControls.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.editorControls\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.editorControls" />
|
||||
|
||||
<file src="..\..\src\umbraco.MacroEngines\obj\Debug\umbraco.MacroEngines.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.MacroEngines\obj\Debug\umbraco.MacroEngines.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.MacroEngines\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.MacroEngines" />
|
||||
|
||||
<file src="..\..\src\umbraco.providers\obj\Debug\umbraco.providers.dll" target="lib" />
|
||||
<file src="..\..\src\umbraco.providers\obj\Debug\umbraco.providers.pdb" target="lib" />
|
||||
<file src="..\..\src\umbraco.providers\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\umbraco.providers" />
|
||||
|
||||
<file src="..\..\src\Umbraco.Web\obj\Debug\umbraco.dll" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Web\obj\Debug\umbraco.pdb" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Web\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Web" />
|
||||
|
||||
<file src="..\..\src\bin\Debug\Umbraco.Web.UI.dll" target="lib" />
|
||||
<file src="..\..\src\bin\Debug\Umbraco.Web.UI.pdb" target="lib" />
|
||||
<file src="..\..\src\Umbraco.Web.UI\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Web.UI" />
|
||||
|
||||
<file src="..\..\src\UmbracoExamine\obj\Debug\UmbracoExamine.dll" target="lib" />
|
||||
<file src="..\..\src\UmbracoExamine\obj\Debug\UmbracoExamine.pdb" target="lib" />
|
||||
<file src="..\..\src\UmbracoExamine\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\UmbracoExamine" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -1,73 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>UmbracoCms.Core</id>
|
||||
<version>7.0.0</version>
|
||||
<title>Umbraco Cms Core Binaries</title>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
|
||||
<projectUrl>http://umbraco.com/</projectUrl>
|
||||
<iconUrl>http://umbraco.com/media/357769/100px_transparent.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains the core assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms-package to setup Umbraco in Visual Studio as an ASP.NET project.</description>
|
||||
<summary>Contains the core assemblies needed to run Umbraco Cms</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<dependencies>
|
||||
<dependency id="Microsoft.AspNet.Mvc" version="[4.0.40804.0,5.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi" version="[4.0.30506,5.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi.WebHost" version="[4.0.30506, 5.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi.Core" version="[4.0.30506, 5.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi.Client" version="[4.0.30506, 5.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" />
|
||||
<dependency id="Microsoft.Net.Http" version="[2.0.20710.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)" />
|
||||
<dependency id="SharpZipLib" version="[0.86.0, 1.0.0)" />
|
||||
<dependency id="MySql.Data" version="[6.6.5]" />
|
||||
<dependency id="xmlrpcnet" version="[2.5.0, 3.0.0)" />
|
||||
<dependency id="ClientDependency" version="[1.7.1.2, 2.0.0)" />
|
||||
<dependency id="ClientDependency-Mvc" version="[1.7.0.4, 2.0.0)" />
|
||||
<dependency id="AutoMapper" version="[3.0.0, 4.0.0)" />
|
||||
<dependency id="Newtonsoft.Json" version="[6.0.4, 7.0.0)" />
|
||||
<dependency id="Examine" version="[0.1.57, 1.0.0)" />
|
||||
<dependency id="ImageProcessor" version="[1.9.5, 3.0.0)" />
|
||||
<dependency id="ImageProcessor.Web" version="[3.3.1, 5.0.0)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\_BuildOutput\WebApp\bin\businesslogic.dll" target="lib\businesslogic.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\businesslogic.xml" target="lib\businesslogic.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\cms.dll" target="lib\cms.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\cms.xml" target="lib\cms.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\controls.dll" target="lib\controls.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\controls.xml" target="lib\controls.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\interfaces.dll" target="lib\interfaces.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\interfaces.xml" target="lib\interfaces.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\log4net.dll" target="lib\log4net.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\Microsoft.ApplicationBlocks.Data.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Microsoft.Web.Helpers.dll" target="lib\Microsoft.Web.Helpers.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\SQLCE4Umbraco.dll" target="lib\SQLCE4Umbraco.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.dll" target="lib\System.Data.SqlServerCe.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.Entity.dll" target="lib\System.Data.SqlServerCe.Entity.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\TidyNet.dll" target="lib\TidyNet.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.dll" target="lib\Umbraco.Core.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.xml" target="lib\Umbraco.Core.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.dll" target="lib\umbraco.DataLayer.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.xml" target="lib\umbraco.DataLayer.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.dll" target="lib\umbraco.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.xml" target="lib\umbraco.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.dll" target="lib\umbraco.editorControls.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.xml" target="lib\umbraco.editorControls.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.dll" target="lib\umbraco.MacroEngines.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.xml" target="lib\umbraco.MacroEngines.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.dll" target="lib\umbraco.providers.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.xml" target="lib\umbraco.providers.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.dll" target="lib\Umbraco.Web.UI.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.dll" target="lib\UmbracoExamine.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\UrlRewritingNet.UrlRewriter.dll" target="lib\UrlRewritingNet.UrlRewriter.dll" />
|
||||
<file src="tools\install.core.ps1" target="tools\install.ps1" />
|
||||
</files>
|
||||
<metadata>
|
||||
<id>UmbracoCms.Core</id>
|
||||
<version>7.0.0</version>
|
||||
<title>Umbraco Cms Core Binaries</title>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
|
||||
<projectUrl>http://umbraco.com/</projectUrl>
|
||||
<iconUrl>http://umbraco.com/media/357769/100px_transparent.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Contains the core assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms-package to setup Umbraco in Visual Studio as an ASP.NET project.</description>
|
||||
<summary>Contains the core assemblies needed to run Umbraco Cms</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<dependencies>
|
||||
<dependency id="Microsoft.AspNet.Mvc" version="[4.0.30506.0,6.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi" version="[4.0.30506,6.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi.WebHost" version="[4.0.30506, 6.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi.Core" version="[4.0.30506, 6.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi.Client" version="[4.0.30506, 6.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" />
|
||||
<dependency id="Microsoft.Net.Http" version="[2.0.20710.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)" />
|
||||
<dependency id="SharpZipLib" version="[0.86.0, 1.0.0)" />
|
||||
<dependency id="MySql.Data" version="[6.6.5]" />
|
||||
<dependency id="xmlrpcnet" version="[2.5.0, 3.0.0)" />
|
||||
<dependency id="ClientDependency" version="[1.8.2.1, 2.0.0)" />
|
||||
<dependency id="ClientDependency-Mvc" version="[1.8.0, 2.0.0)" />
|
||||
<dependency id="AutoMapper" version="[3.0.0, 4.0.0)" />
|
||||
<dependency id="Newtonsoft.Json" version="[6.0.5, 7.0.0)" />
|
||||
<dependency id="Examine" version="[0.1.60, 1.0.0)" />
|
||||
<dependency id="ImageProcessor" version="[1.9.5, 3.0.0)" />
|
||||
<dependency id="ImageProcessor.Web" version="[3.3.1, 5.0.0)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\_BuildOutput\WebApp\bin\businesslogic.dll" target="lib\businesslogic.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\businesslogic.xml" target="lib\businesslogic.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\cms.dll" target="lib\cms.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\cms.xml" target="lib\cms.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\controls.dll" target="lib\controls.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\controls.xml" target="lib\controls.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\interfaces.dll" target="lib\interfaces.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\interfaces.xml" target="lib\interfaces.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\log4net.dll" target="lib\log4net.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\Microsoft.ApplicationBlocks.Data.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\SQLCE4Umbraco.dll" target="lib\SQLCE4Umbraco.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.dll" target="lib\System.Data.SqlServerCe.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.Entity.dll" target="lib\System.Data.SqlServerCe.Entity.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\TidyNet.dll" target="lib\TidyNet.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.dll" target="lib\Umbraco.Core.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.xml" target="lib\Umbraco.Core.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.dll" target="lib\umbraco.DataLayer.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.xml" target="lib\umbraco.DataLayer.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.dll" target="lib\umbraco.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.xml" target="lib\umbraco.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.dll" target="lib\umbraco.editorControls.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.xml" target="lib\umbraco.editorControls.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.dll" target="lib\umbraco.MacroEngines.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.xml" target="lib\umbraco.MacroEngines.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.dll" target="lib\umbraco.providers.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.xml" target="lib\umbraco.providers.xml" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.dll" target="lib\Umbraco.Web.UI.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.dll" target="lib\UmbracoExamine.dll" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\UrlRewritingNet.UrlRewriter.dll" target="lib\UrlRewritingNet.UrlRewriter.dll" />
|
||||
<file src="tools\install.core.ps1" target="tools\install.ps1" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -1,46 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata minClientVersion="2.8">
|
||||
<id>UmbracoCms</id>
|
||||
<version>7.0.0</version>
|
||||
<title>Umbraco Cms</title>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
|
||||
<projectUrl>http://umbraco.com/</projectUrl>
|
||||
<iconUrl>http://umbraco.com/media/357769/100px_transparent.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Installs Umbraco Cms in your Visual Studio ASP.NET project</description>
|
||||
<summary>Installs Umbraco Cms in your Visual Studio ASP.NET project</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<dependencies>
|
||||
<dependency id="UmbracoCms.Core" version="[$version$]" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<metadata minClientVersion="2.8">
|
||||
<id>UmbracoCms</id>
|
||||
<version>7.0.0</version>
|
||||
<title>Umbraco Cms</title>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
|
||||
<projectUrl>http://umbraco.com/</projectUrl>
|
||||
<iconUrl>http://umbraco.com/media/357769/100px_transparent.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Installs Umbraco Cms in your Visual Studio ASP.NET project</description>
|
||||
<summary>Installs Umbraco Cms in your Visual Studio ASP.NET project</summary>
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<dependencies>
|
||||
<dependency id="UmbracoCms.Core" version="[$version$]" />
|
||||
<dependency id="Newtonsoft.Json" version="[6.0.5, 7.0.0)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<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" 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" />
|
||||
<file src="..\_BuildOutput\WebApp\usercontrols\**" target="Content\usercontrols" />
|
||||
<file src="..\_BuildOutput\WebApp\Views\**" target="Content\Views" exclude="..\_BuildOutput\WebApp\Views\Web.config" />
|
||||
<file src="..\_BuildOutput\WebApp\xslt\**" target="Content\xslt" />
|
||||
<file src="..\_BuildOutput\WebApp\default.aspx" target="Content\default.aspx" />
|
||||
<file src="..\_BuildOutput\WebApp\Web.config" target="Content\Web.config" />
|
||||
<file src="..\_BuildOutput\WebApp\Global.asax" target="Content\Global.asax" />
|
||||
<file src="..\_BuildOutput\WebApp\App_Browsers\**" target="UmbracoFiles\App_Browsers" />
|
||||
<file src="..\_BuildOutput\WebApp\App_Plugins\**" target="UmbracoFiles\App_Plugins" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\amd64\**" target="UmbracoFiles\bin\amd64" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\x86\**" target="UmbracoFiles\bin\x86" />
|
||||
<file src="..\_BuildOutput\WebApp\config\splashes\**" target="UmbracoFiles\config\splashes" />
|
||||
<file src="..\_BuildOutput\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
|
||||
<file src="..\_BuildOutput\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
|
||||
<file src="..\_BuildOutput\WebApp\Web.config" target="UmbracoFiles\Web.config" />
|
||||
<file src="..\_BuildOutput\Configs\**" target="Content\Config" exclude="..\_BuildOutput\Configs\Web.config.transform" />
|
||||
<file src="..\_BuildOutput\WebApp\Views\**" target="Content\Views" exclude="..\_BuildOutput\WebApp\Views\Web.config" />
|
||||
<file src="..\_BuildOutput\WebApp\default.aspx" target="Content\default.aspx" />
|
||||
<file src="..\_BuildOutput\WebApp\Global.asax" target="Content\Global.asax" />
|
||||
<file src="..\_BuildOutput\WebApp\Web.config" target="UmbracoFiles\Web.config" />
|
||||
<file src="..\_BuildOutput\WebApp\App_Browsers\**" target="UmbracoFiles\App_Browsers" />
|
||||
<file src="..\_BuildOutput\WebApp\App_Plugins\**" target="UmbracoFiles\App_Plugins" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\amd64\**" target="UmbracoFiles\bin\amd64" />
|
||||
<file src="..\_BuildOutput\WebApp\bin\x86\**" target="UmbracoFiles\bin\x86" />
|
||||
<file src="..\_BuildOutput\WebApp\config\splashes\**" target="UmbracoFiles\Config\splashes" />
|
||||
<file src="..\_BuildOutput\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
|
||||
<file src="..\_BuildOutput\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
|
||||
<file src="tools\install.ps1" target="tools\install.ps1" />
|
||||
<file src="tools\Readme.txt" target="tools\Readme.txt" />
|
||||
<file src="tools\Web.config.install.xdt" target="Content\Web.config.install.xdt" />
|
||||
<file src="tools\applications.config.install.xdt" target="Content\config\applications.config.install.xdt" />
|
||||
<file src="tools\ClientDependency.config.install.xdt" target="Content\config\ClientDependency.config.install.xdt" />
|
||||
<file src="tools\Dashboard.config.install.xdt" target="Content\config\Dashboard.config.install.xdt" />
|
||||
<file src="tools\trees.config.install.xdt" target="Content\config\trees.config.install.xdt" />
|
||||
<file src="tools\umbracoSettings.config.install.xdt" target="Content\config\umbracoSettings.config.install.xdt" />
|
||||
<file src="build\**" target="build" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>UmbracoExamine.PDF</id>
|
||||
<version>0.7.0</version>
|
||||
<authors>Umbraco HQ</authors>
|
||||
<owners>Umbraco HQ</owners>
|
||||
<licenseUrl>http://umbraco.codeplex.com/license</licenseUrl>
|
||||
<projectUrl>http://umbraco.com/</projectUrl>
|
||||
<iconUrl>http://umbraco.com/media/357769/100px_transparent.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>UmbracoExmine.PDF</description>
|
||||
<tags>umbraco</tags>
|
||||
<dependencies>
|
||||
<dependency id="UmbracoCms.Core" version="[7.0.0, 8.0.0)" />
|
||||
<dependency id="iTextSharp" version="[5.5.3, 6.0.0)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\_BuildOutput\UmbracoExamine.PDF\UmbracoExamine.PDF.dll" target="lib\UmbracoExamine.PDF.dll" />
|
||||
<file src="..\_BuildOutput\UmbracoExamine.PDF\UmbracoExamine.PDF.XML" target="lib\UmbracoExamine.PDF.XML" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<clientDependency xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<fileRegistration>
|
||||
<providers>
|
||||
<add name="CanvasProvider" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
</providers>
|
||||
</fileRegistration>
|
||||
</clientDependency>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0"?>
|
||||
<dashBoard xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<section alias="StartupSettingsDashboardSection" xdt:Locator="Match(alias)">
|
||||
<tab caption="Get Started" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
<tab caption="Welcome" xdt:Locator="Match(caption)" xdt:Transform="InsertIfMissing">
|
||||
<control showOnce="true" addPanel="true" panelCaption="" xdt:Transform="InsertIfMissing">
|
||||
views/dashboard/settings/settingsdashboardintro.html
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<section alias="StartupFormsDashboardSection" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing">
|
||||
<areas>
|
||||
<area>forms</area>
|
||||
</areas>
|
||||
<tab caption="Install Umbraco Forms">
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
views/dashboard/forms/formsdashboardintro.html
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<section alias="StartupDeveloperDashboardSection" xdt:Locator="Match(alias)">
|
||||
<tab caption="Get Started" xdt:Locator="Match(caption)" xdt:Transform="Replace">
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
views/dashboard/developer/developerdashboardvideos.html
|
||||
</control>
|
||||
</tab>
|
||||
<tab caption="Examine Management" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
</section>
|
||||
|
||||
<section alias="StartupDeveloperDashboardSection" xdt:Locator="Match(alias)">
|
||||
<tab caption="Examine Management" xdt:Locator="Match(caption)" xdt:Transform="InsertIfMissing">
|
||||
<control>
|
||||
views/dashboard/developer/examinemanagement.html
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<section alias="StartupMediaDashboardSection" xdt:Locator="Match(alias)">
|
||||
<tab caption="Get Started" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
<tab caption="Content" xdt:Locator="Match(caption)" xdt:Transform="InsertIfMissing" />
|
||||
<tab caption="Content" xdt:Locator="Match(caption)" xdt:Transform="Replace">
|
||||
<control showOnce="false" addPanel="false" panelCaption="">
|
||||
views/dashboard/media/mediafolderbrowser.html
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<section alias="StartupDashboardSection" xdt:Locator="Match(alias)">
|
||||
<tab caption="Get Started" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
<tab caption="Get Started" xdt:Transform="Insert">
|
||||
<access>
|
||||
<grant>admin</grant>
|
||||
</access>
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
views/dashboard/default/startupdashboardintro.html
|
||||
</control>
|
||||
</tab>
|
||||
<tab caption="Change password" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
<tab caption="Change Password" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
<tab caption="Change Password" xdt:Transform="Insert">
|
||||
<control showOnce="false" addPanel="false" panelCaption="">
|
||||
views/dashboard/ChangePassword.html
|
||||
</control>
|
||||
</tab>
|
||||
<tab caption="Last Edits" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
</section>
|
||||
|
||||
<section alias="StartupMemberDashboardSection" xdt:Locator="Match(alias)">
|
||||
<tab caption="Get Started" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
|
||||
<tab caption="Get Started" xdt:Transform="Insert">
|
||||
<control showOnce="true" addPanel="true" panelCaption="">
|
||||
views/dashboard/members/membersdashboardvideos.html
|
||||
</control>
|
||||
</tab>
|
||||
</section>
|
||||
|
||||
<section alias="uGoLiveDashboardSection" xdt:Locator="Match(alias)" xdt:Transform="Remove" />
|
||||
|
||||
<section alias="ExamineManagement" xdt:Locator="Match(alias)" xdt:Transform="Remove" />
|
||||
</dashBoard>
|
||||
@@ -1,26 +1,33 @@
|
||||
|
||||
_ _ __ __ ____ _____ _____ ____
|
||||
| | | | \/ | _ \| __ \ /\ / ____/ __ \
|
||||
| | | | \ / | |_) | |__) | / \ | | | | | |
|
||||
| | | | |\/| | _ <| _ / / /\ \| | | | | |
|
||||
| |__| | | | | |_) | | \ \ / ____ | |___| |__| |
|
||||
\____/|_| |_|____/|_| \_/_/ \_\_____\____/
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
A note about running Umbraco from Visual Studio.
|
||||
|
||||
Don't forget to build!
|
||||
|
||||
When upgrading your website using NuGet you should answer "No" to the questions to overwrite the Web.config
|
||||
file (and config files in the config folder).
|
||||
We will overwrite Web.config anyway but we keep a backup in the App_Data\NuGetBackup folder. There you'll
|
||||
find a folder with the current date and time in which the backup has been placed. Make sure to merge the
|
||||
new file with the old backup files before you proceed.
|
||||
The web.config will be overwritten by default to ensure that it has the necessary settings from the current release.
|
||||
|
||||
We've also overwritten all the files in the Umbraco and Umbraco_Client folder, these have also been backed up in
|
||||
App_Data\NuGetBackup. We didn't overwrite the UI.xml file nor did we remove any files or folders that you or a package
|
||||
might have added. Only the existing files were overwritten. If you customized anything then make sure to do a compare
|
||||
and merge with the NuGetBackup folder.
|
||||
We've done our best to transform your configuration files but in case something is not quite right: remember we
|
||||
backed up your files in App_Data\NuGetBackup so you can find the original files before they were transformed.
|
||||
|
||||
The config files found in the config folder will usually not be changed for patch releases, so they can usually be skipped,
|
||||
but the web.config will have to have its previous "umbracoConfigurationStatus"-appsetting and "umbracoDbDSN" connection string
|
||||
copied over (as a minimum).
|
||||
We've overwritten all the files in the Umbraco and Umbraco_Client folder, these have been backed up in
|
||||
App_Data\NuGetBackup. We didn't overwrite the UI.xml file nor did we remove any files or folders that you or
|
||||
a package might have added. Only the existing files were overwritten. If you customized anything then make
|
||||
sure to do a compare and merge with the NuGetBackup folder.
|
||||
|
||||
This nuget package includes build targets that extends the creation of a deploy package, which is generated by
|
||||
This NuGet package includes build targets that extend the creation of a deploy package, which is generated by
|
||||
Publishing from Visual Studio. The targets will only work once Publishing is configured, so if you don't use
|
||||
Publish this won't affect you.
|
||||
These things will now be automatically included when creating a deploy package or publishing to the file system:
|
||||
umbraco, umbraco_client, config\splashes and global.asax.
|
||||
The following items will now be automatically included when creating a deploy package or publishing to the file
|
||||
system: umbraco, umbraco_client, config\splashes and global.asax.
|
||||
|
||||
Please read the release notes on our.umbraco.org:
|
||||
http://our.umbraco.org/contribute/releases
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<configSections xdt:Transform="InsertIfMissing" />
|
||||
<configSections>
|
||||
<section name="BaseRestExtensions" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<section name="FileSystemProviders" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<section name="ExamineLuceneIndexSets" type="Examine.LuceneEngine.Config.IndexSets, Examine" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="SetAttributes(type,requirePermission)" />
|
||||
|
||||
<sectionGroup name="applicationSettings" xdt:Locator="Match(name)">
|
||||
<section name="umbraco.presentation.Properties.Settings" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
</sectionGroup>
|
||||
<sectionGroup name="system.web.webPages.razor" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<sectionGroup name="umbracoConfiguration" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing">
|
||||
<section name="settings" type="Umbraco.Core.Configuration.UmbracoSettings.UmbracoSettingsSection, Umbraco.Core" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
|
||||
<section name="BaseRestExtensions" type="Umbraco.Core.Configuration.BaseRest.BaseRestSection, Umbraco.Core" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
|
||||
<section name="FileSystemProviders" type="Umbraco.Core.Configuration.FileSystemProvidersSection, Umbraco.Core" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
|
||||
<section name="dashBoard" type="Umbraco.Core.Configuration.Dashboard.DashboardSection, Umbraco.Core" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<appSettings xdt:Transform="InsertIfMissing" />
|
||||
<appSettings>
|
||||
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
|
||||
</appSettings>
|
||||
|
||||
<umbracoConfiguration xdt:Transform="InsertIfMissing">
|
||||
<settings configSource="config\umbracoSettings.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
|
||||
<BaseRestExtensions configSource="config\BaseRestExtensions.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
|
||||
<FileSystemProviders configSource="config\FileSystemProviders.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
|
||||
<dashBoard configSource="config\Dashboard.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
|
||||
</umbracoConfiguration>
|
||||
|
||||
<FileSystemProviders xdt:Transform="Remove" />
|
||||
<BaseRestExtensions xdt:Transform="Remove" />
|
||||
|
||||
<system.data xdt:Transform="InsertIfMissing">
|
||||
<DbProviderFactories xdt:Transform="InsertIfMissing">
|
||||
<remove invariant="System.Data.SqlServerCe.4.0" xdt:Locator="Match(invariant)" xdt:Transform="InsertIfMissing" />
|
||||
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe" xdt:Locator="Match(invariant)" xdt:Transform="SetAttributes(invariant,description,type)" />
|
||||
<remove invariant="MySql.Data.MySqlClient" xdt:Locator="Match(invariant)" xdt:Transform="InsertIfMissing" />
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" xdt:Locator="Match(invariant)" xdt:Transform="SetAttributes(invariant,description,type)" />
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
<clientDependency xdt:Transform="RemoveAttributes(version)" />
|
||||
|
||||
<system.web xdt:Transform="InsertIfMissing" />
|
||||
<system.web>
|
||||
<siteMap xdt:Transform="Remove" />
|
||||
<membership defaultProvider="DefaultMembershipProvider" xdt:Locator="Match(defaultProvider)" xdt:Transform="Remove" />
|
||||
<roleManager defaultProvider="DefaultRoleProvider" xdt:Locator="Match(defaultProvider)" xdt:Transform="Remove"/>
|
||||
<profile defaultProvider="DefaultProfileProvider" xdt:Locator="Match(defaultProvider)" xdt:Transform="Remove"/>>
|
||||
<sessionState customProvider="DefaultSessionProvider" xdt:Locator="Match(customProvider)" xdt:Transform="Remove"/>
|
||||
<compilation xdt:Transform="InsertIfMissing" />
|
||||
<compilation>
|
||||
<assemblies xdt:Transform="InsertIfMissing" />
|
||||
<assemblies>
|
||||
<add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)"
|
||||
xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
|
||||
<compilation>
|
||||
<assemblies>
|
||||
<remove assembly="System.Web.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Net.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
|
||||
<xhtmlConformance xdt:Transform="Remove" />
|
||||
|
||||
<httpModules xdt:Transform="InsertIfMissing" />
|
||||
<httpModules>
|
||||
<add name="umbracoRequestModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<add name="umbracoBaseRequestModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<add name="viewstateMoverModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<add name=" UmbracoModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
|
||||
</httpModules>
|
||||
|
||||
<httpHandlers xdt:Transform="InsertIfMissing" />
|
||||
<httpHandlers>
|
||||
<add path="GoogleSpellChecker.ashx" xdt:Locator="Match(path)" xdt:Transform="Remove" />
|
||||
</httpHandlers>
|
||||
</system.web>
|
||||
|
||||
<system.webServer xdt:Transform="InsertIfMissing" />
|
||||
<system.webServer>
|
||||
<modules xdt:Transform="InsertIfMissing" />
|
||||
<modules runAllManagedModulesForAllRequests="true" xdt:Transform="SetAttributes(runAllManagedModulesForAllRequests)">
|
||||
<remove name="umbracoRequestModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<remove name="viewstateMoverModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<remove name="umbracoBaseRequestModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<remove name="WebDAVModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<!-- Inserts it as the first element. Also see http://stackoverflow.com/a/19041487/5018 -->
|
||||
<remove name="WebDAVModule" xdt:Locator="Match(name)" xdt:Transform="Insert" />
|
||||
|
||||
<add name="umbracoRequestModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<add name="viewstateMoverModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<add name="umbracoBaseRequestModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<add name=" UmbracoModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
|
||||
</modules>
|
||||
|
||||
<staticContent xdt:Transform="InsertIfMissing" />
|
||||
<staticContent>
|
||||
<remove fileExtension=".svg" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
|
||||
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
|
||||
<remove fileExtension=".woff" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
|
||||
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
|
||||
<remove fileExtension=".less" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
|
||||
<mimeMap fileExtension=".less" mimeType="text/css" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
|
||||
</staticContent>
|
||||
|
||||
<handlers>
|
||||
<remove name="SpellChecker" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<add name="SpellChecker" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
|
||||
<system.codedom xdt:Transform="Remove" />
|
||||
|
||||
<runtime xdt:Transform="InsertIfMissing" />
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" xdt:Transform="InsertIfMissing" />
|
||||
</runtime>
|
||||
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Net.Http')" xdt:Transform="Remove" />
|
||||
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='Newtonsoft.Json')" xdt:Transform="Remove" />
|
||||
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Web.Mvc')" xdt:Transform="Remove" />
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly xdt:Transform="Insert">
|
||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly xdt:Transform="Insert">
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly xdt:Transform="Insert">
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
<system.web.webPages.razor xdt:Transform="Remove" />
|
||||
|
||||
<location path="umbraco" xdt:Locator="Match(path)" xdt:Transform="InsertIfMissing" />
|
||||
<location path="umbraco" xdt:Locator="Match(path)">
|
||||
<system.webServer xdt:Transform="InsertIfMissing">
|
||||
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" xdt:Transform="SetAttributes(doStaticCompression,doDynamicCompression,dynamicCompressionBeforeCache)" />
|
||||
</system.webServer>
|
||||
</location>
|
||||
|
||||
<location path="App_Plugins" xdt:Locator="Match(path)" xdt:Transform="InsertIfMissing" />
|
||||
<location path="App_Plugins" xdt:Locator="Match(path)">
|
||||
<system.webServer xdt:Transform="InsertIfMissing">
|
||||
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" xdt:Transform="SetAttributes(doStaticCompression,doDynamicCompression,dynamicCompressionBeforeCache)" />
|
||||
</system.webServer>
|
||||
</location>
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<applications xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<add alias="content" icon="traycontent" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes(icon)" />
|
||||
<add alias="media" icon="traymedia" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes(icon)" />
|
||||
<add alias="settings" icon="traysettings" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes(icon)" />
|
||||
<add alias="developer" icon="traydeveloper" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes(icon)" />
|
||||
<add alias="users" icon="trayusers" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes(icon)" />
|
||||
<add alias="member" icon="traymember" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes(icon)" />
|
||||
<add alias="forms" name="Forms" icon="icon-umb-contour" sortOrder="6" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing" />
|
||||
<add alias="translation" icon="traytranslation" sortOrder="7" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes(icon,sortOrder)" />
|
||||
</applications>
|
||||
@@ -27,7 +27,6 @@ if ($project) {
|
||||
if(Test-Path $umbracoBinFolder\interfaces.dll) { Remove-Item $umbracoBinFolder\interfaces.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\log4net.dll) { Remove-Item $umbracoBinFolder\log4net.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\Microsoft.ApplicationBlocks.Data.dll) { Remove-Item $umbracoBinFolder\Microsoft.ApplicationBlocks.Data.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\Microsoft.Web.Helpers.dll) { Remove-Item $umbracoBinFolder\Microsoft.Web.Helpers.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\SQLCE4Umbraco.dll) { Remove-Item $umbracoBinFolder\SQLCE4Umbraco.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\System.Data.SqlServerCe.dll) { Remove-Item $umbracoBinFolder\System.Data.SqlServerCe.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\System.Data.SqlServerCe.Entity.dll) { Remove-Item $umbracoBinFolder\System.Data.SqlServerCe.Entity.dll -Force -Confirm:$false }
|
||||
|
||||
@@ -4,20 +4,25 @@ if ($project) {
|
||||
$dateTime = Get-Date -Format yyyyMMdd-HHmmss
|
||||
$backupPath = Join-Path (Split-Path $project.FullName -Parent) "\App_Data\NuGetBackup\$dateTime"
|
||||
$copyLogsPath = Join-Path $backupPath "CopyLogs"
|
||||
|
||||
$projectDestinationPath = Split-Path $project.FullName -Parent
|
||||
|
||||
# Create backup folder and logs folder if it doesn't exist yet
|
||||
New-Item -ItemType Directory -Force -Path $backupPath
|
||||
New-Item -ItemType Directory -Force -Path $copyLogsPath
|
||||
|
||||
# Create a backup of original web.config
|
||||
$projectDestinationPath = Split-Path $project.FullName -Parent
|
||||
$webConfigSource = Join-Path $projectDestinationPath "Web.config"
|
||||
Copy-Item $webConfigSource $backupPath -Force
|
||||
|
||||
# Copy Web.config from package to project folder
|
||||
$umbracoFilesPath = Join-Path $rootPath "UmbracoFiles\Web.config"
|
||||
Copy-Item $umbracoFilesPath $projectDestinationPath -Force
|
||||
|
||||
# Backup config files folder
|
||||
$configFolder = Join-Path $projectDestinationPath "Config"
|
||||
if(Test-Path $configFolder) {
|
||||
$umbracoBackupPath = Join-Path $backupPath "Config"
|
||||
New-Item -ItemType Directory -Force -Path $umbracoBackupPath
|
||||
|
||||
robocopy $configFolder $umbracoBackupPath /e /LOG:$copyLogsPath\ConfigBackup.log
|
||||
}
|
||||
|
||||
# Copy umbraco and umbraco_files from package to project folder
|
||||
# This is only done when these folders already exist because we
|
||||
# only want to do this for upgrades
|
||||
@@ -42,7 +47,93 @@ if ($project) {
|
||||
robocopy $umbracoClientFolder $umbracoClientBackupPath /e /LOG:$copyLogsPath\UmbracoClientBackup.log
|
||||
robocopy $umbracoClientFolderSource $umbracoClientFolder /is /it /e /LOG:$copyLogsPath\UmbracoClientCopy.log
|
||||
}
|
||||
|
||||
$copyWebconfig = $false
|
||||
|
||||
# SJ - What can I say: big up for James Newton King for teaching us a hack for detecting if this is a new install vs. an upgrade!
|
||||
# https://github.com/JamesNK/Newtonsoft.Json/pull/387 - would never have seen this without the controversial pull request..
|
||||
Try
|
||||
{
|
||||
# see if user is installing from VS NuGet console
|
||||
# get reference to the window, the console host and the input history
|
||||
# copy web.config if "install-package UmbracoCms" was last input
|
||||
# this is in a try-catch as they might be using the regular NuGet dialog
|
||||
# instead of package manager console
|
||||
|
||||
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
|
||||
|
||||
$consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
|
||||
|
||||
$props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
|
||||
|
||||
$hostInfo = $prop.GetValue($consoleWindow)
|
||||
|
||||
$history = $hostInfo.WpfConsole.InputHistory.History
|
||||
|
||||
$lastCommand = $history | select -last 1
|
||||
|
||||
if ($lastCommand)
|
||||
{
|
||||
$lastCommand = $lastCommand.Trim().ToLower()
|
||||
if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("umbracocms"))
|
||||
{
|
||||
$copyWebconfig = $true
|
||||
}
|
||||
}
|
||||
}
|
||||
Catch { }
|
||||
|
||||
Try
|
||||
{
|
||||
# user is installing from VS NuGet dialog
|
||||
# get reference to the window, then smart output console provider
|
||||
# copy web.config if messages in buffered console contains "installing...UmbracoCms" in last operation
|
||||
|
||||
$instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor [System.Reflection.BindingFlags]::NonPublic)
|
||||
$consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$instance = $instanceField.GetValue($null)
|
||||
|
||||
$consoleProvider = $consoleField.GetValue($instance)
|
||||
|
||||
$console = $consoleProvider.CreateOutputConsole($false)
|
||||
|
||||
$messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$messages = $messagesField.GetValue($console)
|
||||
|
||||
$operations = $messages -split "=============================="
|
||||
|
||||
$lastOperation = $operations | select -last 1
|
||||
|
||||
if ($lastOperation)
|
||||
{
|
||||
$lastOperation = $lastOperation.ToLower()
|
||||
$lines = $lastOperation -split "`r`n"
|
||||
$installMatch = $lines | ? { $_.Contains("...umbracocms ") } | select -first 1
|
||||
|
||||
if ($installMatch)
|
||||
{
|
||||
$copyWebconfig = $true
|
||||
}
|
||||
}
|
||||
}
|
||||
Catch { }
|
||||
|
||||
if($copyWebconfig -eq $true)
|
||||
{
|
||||
$packageWebConfigSource = Join-Path $rootPath "UmbracoFiles\Web.config"
|
||||
$destinationWebConfig = Join-Path $projectDestinationPath "Web.config"
|
||||
Copy-Item $packageWebConfigSource $destinationWebConfig -Force
|
||||
}
|
||||
|
||||
$installFolder = Join-Path $projectDestinationPath "Install"
|
||||
if(Test-Path $installFolder) {
|
||||
Remove-Item $installFolder -Force -Recurse -Confirm:$false
|
||||
}
|
||||
|
||||
# Open readme.txt file
|
||||
$DTE.ItemOperations.OpenFile($toolsPath + '\Readme.txt')
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
<trees xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<add initialize="true" sortOrder="0" alias="content" application="content" title="Content" iconClosed="icon-folder" iconOpen="icon-folder" type="Umbraco.Web.Trees.ContentTreeController, umbraco" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add alias="content" xdt:Locator="Match(alias)" xdt:Transform="RemoveAttributes(silent)" />
|
||||
<add initialize="false" sortOrder="0" alias="contentRecycleBin" application="content" title="Recycle Bin" iconClosed="icon-folder" iconOpen="icon-folder" type="umbraco.cms.presentation.Trees.ContentRecycleBin, umbraco" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add initialize="true" sortOrder="0" alias="media" application="media" title="Media" iconClosed="icon-folder" iconOpen="icon-folder" type="Umbraco.Web.Trees.MediaTreeController, umbraco" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add initialize="false" sortOrder="0" alias="mediaRecycleBin" application="media" title="Recycle Bin" iconClosed="icon-folder" iconOpen="icon-folder" type="umbraco.cms.presentation.Trees.MediaRecycleBin, umbraco" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="settings" alias="stylesheets" title="Stylesheets" type="umbraco.loadStylesheets, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="0" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="settings" alias="stylesheetProperty" title="Stylesheet Property" type="umbraco.loadStylesheetProperty, umbraco" iconClosed="" iconOpen="" initialize="false" sortOrder="0" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="settings" alias="templates" title="Templates" type="umbraco.loadTemplates, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="1" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="settings" alias="partialViews" title="Partial Views" silent="false" initialize="true" iconClosed="icon-folder" iconOpen="icon-folder" type="Umbraco.Web.Trees.PartialViewsTree, umbraco" sortOrder="2" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="settings" alias="scripts" title="Scripts" type="umbraco.loadScripts, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="3" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="settings" alias="dictionary" title="Dictionary" type="umbraco.loadDictionary, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="4" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add alias="dictionary" xdt:Locator="Match(alias)" xdt:Transform="RemoveAttributes(action)" />
|
||||
<add application="settings" alias="languages" title="Languages" type="umbraco.loadLanguages, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="5" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="settings" alias="mediaTypes" title="Media Types" type="umbraco.loadMediaTypes, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="6" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="settings" alias="nodeTypes" title="Document Types" type="umbraco.loadNodeTypes, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="7" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add initialize="true" sortOrder="0" alias="datatype" application="developer" title="Data Types" iconClosed="icon-folder" iconOpen="icon-folder" type="Umbraco.Web.Trees.DataTypeTreeController, umbraco" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="developer" alias="macros" title="Macros" type="umbraco.loadMacros, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="2" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="developer" alias="packager" title="Packages" type="umbraco.loadPackager, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="3" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="developer" alias="packagerPackages" title="Packager Packages" type="umbraco.loadPackages, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" initialize="false" sortOrder="3" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="developer" alias="relationTypes" title="Relation Types" type="umbraco.loadRelationTypes, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="4" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="developer" alias="xslt" title="XSLT Files" type="umbraco.loadXslt, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="5" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="developer" alias="partialViewMacros" type="Umbraco.Web.Trees.PartialViewMacrosTree, umbraco" silent="false" initialize="true" sortOrder="6" title="Partial View Macro Files" iconClosed="icon-folder" iconOpen="icon-folder" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="users" alias="users" title="Users" type="umbraco.loadUsers, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="0" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="users" alias="userTypes" title="User Types" type="umbraco.cms.presentation.Trees.UserTypes, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="1" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="users" alias="userPermissions" title="User Permissions" type="umbraco.cms.presentation.Trees.UserPermissions, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="2" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add initialize="true" sortOrder="0" alias="member" application="member" title="Members" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MemberTreeController, umbraco" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="member" alias="memberGroup" title="Member Groups" type="umbraco.loadMemberGroups, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="1" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add application="member" alias="memberType" title="Member Types" type="umbraco.loadMemberTypes, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="2" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add silent="false" initialize="true" sortOrder="1" alias="openTasks" application="translation" title="Tasks assigned to you" iconClosed="icon-folder" iconOpen="icon-folder" type="umbraco.loadOpenTasks, umbraco" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add alias="openTasks" xdt:Locator="Match(alias)" xdt:Transform="RemoveAttributes(action)" />
|
||||
<add silent="false" initialize="true" sortOrder="2" alias="yourTasks" application="translation" title="Tasks created by you" iconClosed="icon-folder" iconOpen="icon-folder" type="umbraco.loadYourTasks, umbraco" xdt:Locator="Match(alias)" xdt:Transform="SetAttributes()" />
|
||||
<add alias="yourTasks" xdt:Locator="Match(alias)" xdt:Transform="RemoveAttributes(action)" />
|
||||
<add application="developer" alias="python" xdt:Locator="Match(alias)" xdt:Transform="Remove" />
|
||||
</trees>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<settings xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<content>
|
||||
<EnableCanvasEditing xdt:Transform="Remove" />
|
||||
</content>
|
||||
|
||||
<webservices xdt:Transform="Remove" />
|
||||
</settings>
|
||||
@@ -1,2 +1,2 @@
|
||||
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
|
||||
7.1.9
|
||||
7.2.2
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<actionScriptProperties analytics="false" mainApplicationPath="DesktopMediaUploader.mxml" projectUUID="9115d8c5-0cb4-4a34-8702-48456cca7762" version="6">
|
||||
<compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="true" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
|
||||
<compilerSourcePath/>
|
||||
<libraryPath defaultLinkType="0">
|
||||
<libraryPathEntry kind="4" path="">
|
||||
<excludedEntries>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
|
||||
</excludedEntries>
|
||||
</libraryPathEntry>
|
||||
<libraryPathEntry kind="1" linkType="1" path="libs"/>
|
||||
</libraryPath>
|
||||
<sourceAttachmentPath/>
|
||||
</compiler>
|
||||
<applications>
|
||||
<application path="DesktopMediaUploader.mxml">
|
||||
<airExcludes>
|
||||
<airExclude path="assets/dmu_orange.fla"/>
|
||||
<airExclude path="assets/logo.psd"/>
|
||||
<airExclude path="assets/icon-128-old.png"/>
|
||||
<airExclude path="assets/icon-128.psd"/>
|
||||
</airExcludes>
|
||||
</application>
|
||||
</applications>
|
||||
<modules/>
|
||||
<buildCSSFiles/>
|
||||
</actionScriptProperties>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>DesktopMediaUploader</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.adobe.flexbuilder.project.flexbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.adobe.flexbuilder.project.apollobuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.adobe.flexbuilder.project.apollonature</nature>
|
||||
<nature>com.adobe.flexbuilder.project.flexnature</nature>
|
||||
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -1,3 +0,0 @@
|
||||
#Tue Jul 20 11:35:49 BST 2010
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=utf-8
|
||||
@@ -1,154 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<application xmlns="http://ns.adobe.com/air/application/2.0">
|
||||
|
||||
<!-- Adobe AIR Application Descriptor File Template.
|
||||
|
||||
Specifies parameters for identifying, installing, and launching AIR applications.
|
||||
|
||||
xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/2.0
|
||||
The last segment of the namespace specifies the version
|
||||
of the AIR runtime required for this application to run.
|
||||
|
||||
minimumPatchLevel - The minimum patch level of the AIR runtime required to run
|
||||
the application. Optional.
|
||||
-->
|
||||
|
||||
<!-- A universally unique application identifier. Must be unique across all AIR applications.
|
||||
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
|
||||
<id>org.umbraco.DesktopMediaUploader</id>
|
||||
|
||||
<!-- Used as the filename for the application. Required. -->
|
||||
<filename>Desktop Media Uploader</filename>
|
||||
|
||||
<!-- The name that is displayed in the AIR application installer.
|
||||
May have multiple values for each language. See samples or xsd schema file. Optional. -->
|
||||
<name>Desktop Media Uploader</name>
|
||||
|
||||
<!-- An application version designator (such as "v1", "2.5", or "Alpha 1"). Required. -->
|
||||
<version>v2.1.0</version>
|
||||
|
||||
<!-- Description, displayed in the AIR application installer.
|
||||
May have multiple values for each language. See samples or xsd schema file. Optional. -->
|
||||
<description>
|
||||
This application allows you to upload media to an Umbraco website directly from your desktop.
|
||||
</description>
|
||||
|
||||
<!-- Copyright information. Optional -->
|
||||
<copyright>2010 Umbraco.org</copyright>
|
||||
|
||||
<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
|
||||
<!-- <publisherID></publisherID> -->
|
||||
|
||||
<!-- Settings for the application's initial window. Required. -->
|
||||
<initialWindow>
|
||||
<!-- The main SWF or HTML file of the application. Required. -->
|
||||
<!-- Note: In Flash Builder, the SWF reference is set automatically. -->
|
||||
<content>DesktopMediaUploader.swf</content>
|
||||
|
||||
<!-- The title of the main window. Optional. -->
|
||||
<!-- <title></title> -->
|
||||
|
||||
<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
|
||||
<!-- <systemChrome></systemChrome> -->
|
||||
|
||||
<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
|
||||
<!-- <transparent></transparent> -->
|
||||
|
||||
<!-- Whether the window is initially visible. Optional. Default false. -->
|
||||
<!-- <visible></visible> -->
|
||||
|
||||
<!-- Whether the user can minimize the window. Optional. Default true. -->
|
||||
<!-- <minimizable></minimizable> -->
|
||||
|
||||
<!-- Whether the user can maximize the window. Optional. Default true. -->
|
||||
<!-- <maximizable></maximizable> -->
|
||||
|
||||
<!-- Whether the user can resize the window. Optional. Default true. -->
|
||||
<!-- <resizable></resizable> -->
|
||||
|
||||
<!-- The window's initial width in pixels. Optional. -->
|
||||
<!-- <width></width> -->
|
||||
|
||||
<!-- The window's initial height in pixels. Optional. -->
|
||||
<!-- <height></height> -->
|
||||
|
||||
<!-- The window's initial x position. Optional. -->
|
||||
<!-- <x></x> -->
|
||||
|
||||
<!-- The window's initial y position. Optional. -->
|
||||
<!-- <y></y> -->
|
||||
|
||||
<!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
|
||||
<!-- <minSize></minSize> -->
|
||||
|
||||
<!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
|
||||
<!-- <maxSize></maxSize> -->
|
||||
</initialWindow>
|
||||
|
||||
<!-- We recommend omitting the supportedProfiles element, -->
|
||||
<!-- which in turn permits your application to be deployed to all -->
|
||||
<!-- devices supported by AIR. If you wish to restrict deployment -->
|
||||
<!-- (i.e., to only mobile devices) then add this element and list -->
|
||||
<!-- only the profiles which your application does support. -->
|
||||
<!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->
|
||||
|
||||
<!-- The subpath of the standard default installation location to use. Optional. -->
|
||||
<!-- <installFolder></installFolder> -->
|
||||
|
||||
<!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
|
||||
<!-- <programMenuFolder></programMenuFolder> -->
|
||||
|
||||
<!-- The icon the system uses for the application. For at least one resolution,
|
||||
|
||||
specify the path to a PNG file included in the AIR package. Optional. -->
|
||||
<icon>
|
||||
|
||||
<image16x16>assets/icon-16.png</image16x16>
|
||||
|
||||
<image32x32>assets/icon-32.png</image32x32>
|
||||
|
||||
<image48x48>assets/icon-48.png</image48x48>
|
||||
|
||||
<image128x128>assets/icon-128.png</image128x128>
|
||||
|
||||
</icon>
|
||||
|
||||
<!-- Whether the application handles the update when a user double-clicks an update version
|
||||
of the AIR file (true), or the default AIR application installer handles the update (false).
|
||||
Optional. Default false. -->
|
||||
<!-- <customUpdateUI></customUpdateUI> -->
|
||||
|
||||
<!-- Whether the application can be launched when the user clicks a link in a web browser.
|
||||
Optional. Default false. -->
|
||||
<allowBrowserInvocation>true</allowBrowserInvocation>
|
||||
|
||||
<!-- Listing of file types for which the application can register. Optional. -->
|
||||
<!-- <fileTypes> -->
|
||||
|
||||
<!-- Defines one file type. Optional. -->
|
||||
<!-- <fileType> -->
|
||||
|
||||
<!-- The name that the system displays for the registered file type. Required. -->
|
||||
<!-- <name></name> -->
|
||||
|
||||
<!-- The extension to register. Required. -->
|
||||
<!-- <extension></extension> -->
|
||||
|
||||
<!-- The description of the file type. Optional. -->
|
||||
<!-- <description></description> -->
|
||||
|
||||
<!-- The MIME content type. -->
|
||||
<!-- <contentType></contentType> -->
|
||||
|
||||
<!-- The icon to display for the file type. Optional. -->
|
||||
<!-- <icon>
|
||||
<image16x16></image16x16>
|
||||
<image32x32></image32x32>
|
||||
<image48x48></image48x48>
|
||||
<image128x128></image128x128>
|
||||
</icon> -->
|
||||
|
||||
<!-- </fileType> -->
|
||||
<!-- </fileTypes> -->
|
||||
|
||||
</application>
|
||||
@@ -1,90 +0,0 @@
|
||||
/* CSS file */
|
||||
@namespace s "library://ns.adobe.com/flex/spark";
|
||||
@namespace mx "library://ns.adobe.com/flex/mx";
|
||||
|
||||
|
||||
global
|
||||
{
|
||||
focus-color: #EEB470;
|
||||
selection-color: #EEB470;
|
||||
roll-over-color: #EEEEEE;
|
||||
}
|
||||
|
||||
mx|Tree
|
||||
{
|
||||
textSelectedColor: #ffffff;
|
||||
textRollOverColor: #000000;
|
||||
selection-color: #f36f21;
|
||||
roll-over-color: #cccccc;
|
||||
}
|
||||
|
||||
#grpSignInForm s|Label
|
||||
{
|
||||
paddingTop: 5px;
|
||||
}
|
||||
|
||||
#grpSignInForm s|CheckBox s|Label
|
||||
{
|
||||
paddingTop: 0;
|
||||
}
|
||||
|
||||
.header
|
||||
{
|
||||
borderColor: #7a7a7a;
|
||||
backgroundColor: #7a7a7a;
|
||||
paddingTop: 25px;
|
||||
paddingBottom: 25px;
|
||||
paddingLeft: 25px;
|
||||
paddingRight: 25px;
|
||||
}
|
||||
|
||||
.header mx|Label
|
||||
{
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.header s|DropDownList
|
||||
{
|
||||
skinClass: ClassReference('org.umbraco.desktopmediauploader.skins.HeaderDropDownListSkin');
|
||||
color: #ffffff;
|
||||
content-background-color: #7a7a7a;
|
||||
roll-over-color: #f36f22;
|
||||
}
|
||||
|
||||
.header s|DropDownList s|Label
|
||||
{
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#btnSignIn,
|
||||
#btnUpload
|
||||
{
|
||||
cornerRadius: 5px;
|
||||
borderThickness: 2px;
|
||||
downSkin: Embed(source="assets/dmu_orange.swf", symbol="Button_downSkin");
|
||||
overSkin: Embed(source="assets/dmu_orange.swf", symbol="Button_overSkin");
|
||||
upSkin: Embed(source="assets/dmu_orange.swf", symbol="Button_upSkin");
|
||||
paddingLeft: 20px;
|
||||
paddingRight: 20px;
|
||||
paddingTop: 7px;
|
||||
paddingBottom: 7px;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
text-roll-over-color: #ffffff;
|
||||
text-selected-color: #ffffff;
|
||||
text-disabled-color: #cccccc;
|
||||
}
|
||||
|
||||
.signOutButton
|
||||
{
|
||||
skinClass: ClassReference('org.umbraco.desktopmediauploader.skins.SignOutButtonSkin');
|
||||
}
|
||||
|
||||
.removeButton
|
||||
{
|
||||
skinClass: ClassReference('org.umbraco.desktopmediauploader.skins.RemoveButtonSkin');
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
|
||||
xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:mx="library://ns.adobe.com/flex/mx"
|
||||
skinClass="org.umbraco.desktopmediauploader.skins.ApplicationSkin"
|
||||
width="330" height="600" showStatusBar="false"
|
||||
xmlns:views="org.umbraco.desktopmediauploader.views.*"
|
||||
windowComplete="init();" >
|
||||
|
||||
<fx:Style source="DesktopMediaUploader.css"/>
|
||||
|
||||
<fx:Script>
|
||||
<![CDATA[
|
||||
|
||||
import org.umbraco.desktopmediauploader.events.*;
|
||||
import org.umbraco.desktopmediauploader.util.*;
|
||||
|
||||
import mx.controls.Alert;
|
||||
|
||||
protected function init():void
|
||||
{
|
||||
StageHelper.stage = stage;
|
||||
|
||||
NativeApplication.nativeApplication.addEventListener(BrowserInvokeEvent.BROWSER_INVOKE, app_BrowserInvoke);
|
||||
|
||||
vwSignIn.addEventListener(SignedInEvent.SIGNED_IN, vwSignIn_SignedIn);
|
||||
vwUpload.addEventListener(SignedOutEvent.SIGNED_OUT, vwUpload_SignOut);
|
||||
|
||||
vwSignIn.init();
|
||||
}
|
||||
|
||||
protected function app_BrowserInvoke(e:BrowserInvokeEvent):void
|
||||
{
|
||||
vwSignIn.visible = true;
|
||||
vwUpload.visible = false;
|
||||
}
|
||||
|
||||
protected function vwSignIn_SignedIn(e:SignedInEvent):void
|
||||
{
|
||||
vwSignIn.visible = false;
|
||||
vwUpload.visible = true;
|
||||
}
|
||||
|
||||
protected function vwUpload_SignOut(e:SignedOutEvent):void
|
||||
{
|
||||
vwSignIn.visible = true;
|
||||
vwUpload.visible = false;
|
||||
}
|
||||
|
||||
]]>
|
||||
</fx:Script>
|
||||
|
||||
<fx:Declarations>
|
||||
<!-- Place non-visual elements (e.g., services, value objects) here -->
|
||||
</fx:Declarations>
|
||||
|
||||
|
||||
<views:SignInView id="vwSignIn" left="0" top="0" right="0" bottom="0">
|
||||
</views:SignInView>
|
||||
|
||||
<views:UploadView id="vwUpload" left="0" top="0" bottom="0" right="0"
|
||||
visible="false">
|
||||
</views:UploadView>
|
||||
|
||||
</s:WindowedApplication>
|
||||
@@ -1,21 +0,0 @@
|
||||
package
|
||||
{
|
||||
public class Model
|
||||
{
|
||||
[Bindable] public static var url:String;
|
||||
[Bindable] public static var username:String;
|
||||
[Bindable] public static var password:String;
|
||||
[Bindable] public static var ticket:String;
|
||||
|
||||
[Bindable] public static var displayName:String;
|
||||
[Bindable] public static var umbracoPath:String;
|
||||
[Bindable] public static var maxRequestLength:Number;
|
||||
|
||||
[Bindable] public static var currentFolder:XML;
|
||||
|
||||
[Bindable] public static var folderId:Number = 0;
|
||||
[Bindable] public static var folderName:String = "";
|
||||
[Bindable] public static var folderPath:String = "";
|
||||
[Bindable] public static var replaceExisting:Boolean = false;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 655 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 778 B |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,122 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
|
||||
xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:mx="library://ns.adobe.com/flex/mx"
|
||||
width="260" height="350" title="Select a folder..." creationComplete="folderPickerDialog_CreationComplete(event)"
|
||||
close="folderPickerDialog_Close(event)" borderVisible="true" chromeColor="#EEEEEE" borderColor="#666666">
|
||||
<s:layout>
|
||||
<s:VerticalLayout/>
|
||||
</s:layout>
|
||||
|
||||
<fx:Script>
|
||||
<![CDATA[
|
||||
import org.umbraco.desktopmediauploader.events.*;
|
||||
import org.umbraco.desktopmediauploader.net.*;
|
||||
|
||||
import mx.controls.Alert;
|
||||
import mx.events.CloseEvent;
|
||||
import mx.events.FlexEvent;
|
||||
import mx.managers.*;
|
||||
|
||||
protected function folderPickerDialog_CreationComplete(event:FlexEvent):void
|
||||
{
|
||||
CursorManager.setBusyCursor();
|
||||
|
||||
DmuRequest.makeRequest(DmuRequestAction.FOLDER_LIST,
|
||||
folderListLoader_Complete,
|
||||
folderListLoader_Error);
|
||||
}
|
||||
|
||||
protected function folderListLoader_Complete(event:DmuRequestEvent):void
|
||||
{
|
||||
CursorManager.removeBusyCursor();
|
||||
|
||||
var xml:XML = event.result;
|
||||
|
||||
trFolders.dataProvider = xml.folder;
|
||||
trFolders.labelField = "@name";
|
||||
trFolders.validateNow();
|
||||
|
||||
// Reselect current folder
|
||||
if (Model.folderId)
|
||||
{
|
||||
var node:XMLList = xml..folder.(@id == Model.folderId.toString());
|
||||
if (node.length() > 0)
|
||||
{
|
||||
expandParents(node[0]);
|
||||
|
||||
trFolders.selectedItem = node[0];
|
||||
|
||||
var idx:int = trFolders.getItemIndex(node[0]);
|
||||
trFolders.scrollToIndex(idx);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.folderId = undefined;
|
||||
Model.folderName = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function folderListLoader_Error(event:Event):void
|
||||
{
|
||||
CursorManager.removeBusyCursor();
|
||||
|
||||
Alert.show("Unable to load folder list", "Ooops!");
|
||||
}
|
||||
|
||||
protected function folderPickerDialog_Close(event:CloseEvent):void
|
||||
{
|
||||
PopUpManager.removePopUp(this);
|
||||
}
|
||||
|
||||
|
||||
protected function trFolders_DoubleClick(event:MouseEvent):void
|
||||
{
|
||||
var item:XML = trFolders.selectedItem as XML;
|
||||
|
||||
Model.currentFolder = item;
|
||||
Model.folderId = item.@id;
|
||||
Model.folderName = item.@name;
|
||||
|
||||
var pathItem:XML = item;
|
||||
var path:String = pathItem.@name;
|
||||
while(pathItem.parent())
|
||||
{
|
||||
pathItem = pathItem.parent();
|
||||
|
||||
if(pathItem.@name != undefined)
|
||||
{
|
||||
path = pathItem.@name +"/"+ path;
|
||||
}
|
||||
}
|
||||
|
||||
Model.folderPath = path;
|
||||
|
||||
PopUpManager.removePopUp(this);
|
||||
}
|
||||
|
||||
private function expandParents(node:XML):void
|
||||
{
|
||||
if (node && !trFolders.isItemOpen(node))
|
||||
{
|
||||
trFolders.expandItem(node, true);
|
||||
expandParents(node.parent());
|
||||
}
|
||||
}
|
||||
|
||||
]]>
|
||||
</fx:Script>
|
||||
|
||||
<fx:Declarations>
|
||||
<!-- Place non-visual elements (e.g., services, value objects) here -->
|
||||
</fx:Declarations>
|
||||
|
||||
<mx:Tree width="100%" height="100%" id="trFolders"
|
||||
defaultLeafIcon="@Embed('assets/folder.png')"
|
||||
folderClosedIcon="@Embed('assets/folder.png')"
|
||||
folderOpenIcon="@Embed('assets/folder-open.png')"
|
||||
paddingLeft="5" paddingRight="5" paddingTop="2" paddingBottom="2"
|
||||
doubleClickEnabled="true" doubleClick="trFolders_DoubleClick(event)" borderVisible="false"></mx:Tree>
|
||||
|
||||
</s:TitleWindow>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
|
||||
xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:mx="library://ns.adobe.com/flex/mx"
|
||||
backgroundColor="#e7e7e7" borderColor="#CCCCCC"
|
||||
width="100%" height="30">
|
||||
|
||||
<fx:Declarations>
|
||||
<!-- Place non-visual elements (e.g., services, value objects) here -->
|
||||
</fx:Declarations>
|
||||
|
||||
<fx:Script>
|
||||
<![CDATA[
|
||||
|
||||
[Bindable] public var totalItems:int;
|
||||
|
||||
protected function btnUploadRemove_Click(event:MouseEvent):void
|
||||
{
|
||||
dispatchEvent(new Event(Event.CANCEL));
|
||||
}
|
||||
|
||||
]]>
|
||||
</fx:Script>
|
||||
|
||||
<mx:Image left="7" source="@Embed('assets/information.png')" width="16" height="16" verticalCenter="0"/>
|
||||
<mx:Label id="lblUploadName" text="Total of {totalItems} File{(totalItems == 1)? '' : 's'}" fontWeight="bold" fontSize="12" color="#999999" left="27" truncateToFit="true" minWidth="0" right="35" verticalCenter="0"/>
|
||||
<s:Button id="btnUploadRemove" width="16" height="16" top="5" right="5" useHandCursor="true" buttonMode="true" styleName="removeButton" click="btnUploadRemove_Click(event)" />
|
||||
|
||||
</s:BorderContainer>
|
||||
@@ -1,144 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
|
||||
xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:mx="library://ns.adobe.com/flex/mx"
|
||||
backgroundColor="#F5F5F5" borderColor="#CCCCCC"
|
||||
borderColor.Error="#C50101" backgroundColor.Error="#F3DBDB"
|
||||
height.Ready="45" height="60" width="100%">
|
||||
|
||||
<s:layout>
|
||||
<s:BasicLayout/>
|
||||
</s:layout>
|
||||
|
||||
<fx:Script>
|
||||
<![CDATA[
|
||||
|
||||
import org.umbraco.desktopmediauploader.events.*;
|
||||
import org.umbraco.desktopmediauploader.net.*;
|
||||
import org.umbraco.desktopmediauploader.util.*;
|
||||
|
||||
import flash.desktop.*;
|
||||
import flash.events.*;
|
||||
import flash.filesystem.*;
|
||||
import flash.net.*;
|
||||
|
||||
import org.osmf.utils.URL;
|
||||
|
||||
[Bindable] public var file:FileReference;
|
||||
[Bindable] public var path:String;
|
||||
|
||||
[Bindable] public var uploading:Boolean = false;;
|
||||
[Bindable] public var uploaded:Boolean = false;
|
||||
|
||||
public function get fullPath():String
|
||||
{
|
||||
return path + "/" + file.name;
|
||||
}
|
||||
|
||||
protected function btnUploadRemove_Click(event:MouseEvent):void
|
||||
{
|
||||
cancel();
|
||||
}
|
||||
|
||||
protected function file_Complete(event:DataEvent):void
|
||||
{
|
||||
uploading = false;
|
||||
|
||||
var result:String = StringHelper.cleanXmlString(event.data);
|
||||
var xml:XML = new XML(result);
|
||||
if (xml.@success == "true")
|
||||
{
|
||||
uploaded = true;
|
||||
|
||||
dispatchEvent(new Event(Event.COMPLETE));
|
||||
}
|
||||
else
|
||||
{
|
||||
file_SecurityError(new SecurityErrorEvent(SecurityErrorEvent.SECURITY_ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
protected function file_Progress(event:ProgressEvent):void
|
||||
{
|
||||
dispatchEvent(event);
|
||||
}
|
||||
|
||||
protected function file_HttpError(event:HTTPStatusEvent):void
|
||||
{
|
||||
setCurrentState("Error");
|
||||
|
||||
dispatchEvent(event);
|
||||
}
|
||||
|
||||
protected function file_IOError(event:IOErrorEvent):void
|
||||
{
|
||||
setCurrentState("Error");
|
||||
|
||||
dispatchEvent(event);
|
||||
}
|
||||
|
||||
protected function file_SecurityError(event:SecurityErrorEvent):void
|
||||
{
|
||||
setCurrentState("Error");
|
||||
|
||||
dispatchEvent(event);
|
||||
}
|
||||
|
||||
public function upload():void
|
||||
{
|
||||
setCurrentState("Uploading");
|
||||
|
||||
uploading = true;
|
||||
|
||||
var vars:URLVariables = new URLVariables();
|
||||
vars.parentNodeId = Model.folderId;
|
||||
vars.replaceExisting = Model.replaceExisting ? "1" : "0";
|
||||
vars.path = path;
|
||||
|
||||
var req:URLRequest = DmuRequest.getRequest(DmuRequestAction.UPLOAD, vars);
|
||||
|
||||
file.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, file_Complete);
|
||||
file.addEventListener(ProgressEvent.PROGRESS, file_Progress);
|
||||
file.addEventListener(HTTPStatusEvent.HTTP_STATUS, file_HttpError);
|
||||
file.addEventListener(IOErrorEvent.IO_ERROR, file_IOError);
|
||||
file.addEventListener(SecurityErrorEvent.SECURITY_ERROR, file_SecurityError);
|
||||
file.upload(req);
|
||||
}
|
||||
|
||||
public function pause():void
|
||||
{
|
||||
if (uploading)
|
||||
file.cancel();
|
||||
|
||||
uploading = false;
|
||||
}
|
||||
|
||||
public function cancel():void
|
||||
{
|
||||
pause();
|
||||
|
||||
dispatchEvent(new Event(Event.CANCEL));
|
||||
}
|
||||
|
||||
private function trim( s:String ):String
|
||||
{
|
||||
return s.replace( /^([\s|\t|\n]+)?(.*)([\s|\t|\n]+)?$/gm, "$2" );
|
||||
}
|
||||
|
||||
]]>
|
||||
</fx:Script>
|
||||
|
||||
<s:states>
|
||||
<s:State name="Ready"/>
|
||||
<s:State name="Uploading"/>
|
||||
<s:State name="Error"/>
|
||||
</s:states>
|
||||
|
||||
<mx:Image top="6" left="5" source="@Embed('assets/page.png')"/>
|
||||
<mx:Label id="lblUploadName" text="{file.name}" fontWeight="bold" color="#000000" left="40" top="4" truncateToFit="true" minWidth="0" right="35" />
|
||||
<s:Button id="btnUploadRemove" width="16" height="16" top="5" right="5" useHandCursor="true" buttonMode="true" click="btnUploadRemove_Click(event)" styleName="removeButton" />
|
||||
<mx:ProgressBar id="pbUploadProgress" labelPlacement="top" label="" source="{file}" bottom="5" left="5" right="5" excludeFrom="Ready" />
|
||||
<mx:Label id="lblUploadPath" left="40" top="20" right="35" fontSize="11" color="#CCCCCC" truncateToFit="true" minWidth="0" fontAntiAliasType="advanced" fontGridFitType="pixel" fontThickness="200" fontSharpness="400"
|
||||
htmlText="<font color='#666666'>{Model.folderPath.replace(/\//g, ' › ')}</font>{path.replace(/\//g, ' › ')}"/>
|
||||
|
||||
</s:BorderContainer>
|
||||
@@ -1,19 +0,0 @@
|
||||
package org.umbraco.desktopmediauploader.events
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class DmuRequestEvent extends Event
|
||||
{
|
||||
public static const SUCCESS:String = "success";
|
||||
public static const ERROR:String = "error";
|
||||
|
||||
public var result:XML;
|
||||
|
||||
public function DmuRequestEvent(type:String, result:XML = null, bubbles:Boolean=false, cancelable:Boolean=false)
|
||||
{
|
||||
super(type, bubbles, cancelable);
|
||||
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package org.umbraco.desktopmediauploader.events
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class SignedInEvent extends Event
|
||||
{
|
||||
public static const SIGNED_IN:String = "signedIn";
|
||||
|
||||
public function SignedInEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
|
||||
{
|
||||
super(type, bubbles, cancelable);
|
||||
}
|
||||
|
||||
override public function clone():Event {
|
||||
return new SignedInEvent(type, bubbles, cancelable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package org.umbraco.desktopmediauploader.events
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class SignedOutEvent extends Event
|
||||
{
|
||||
public static const SIGNED_OUT:String = "signedOut";
|
||||
|
||||
public function SignedOutEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
|
||||
{
|
||||
super(type, bubbles, cancelable);
|
||||
}
|
||||
|
||||
override public function clone():Event {
|
||||
return new SignedOutEvent(type, bubbles, cancelable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package org.umbraco.desktopmediauploader.net
|
||||
{
|
||||
import org.umbraco.desktopmediauploader.events.*;
|
||||
import org.umbraco.desktopmediauploader.util.*;
|
||||
|
||||
import flash.events.*;
|
||||
import flash.net.*;
|
||||
|
||||
public class DmuRequest extends EventDispatcher
|
||||
{
|
||||
public function DmuRequest(action:String, vars:URLVariables = null, target:IEventDispatcher = null)
|
||||
{
|
||||
super(target);
|
||||
|
||||
var req:URLRequest = getRequest(action, vars);
|
||||
|
||||
var loader:URLLoader = new URLLoader();
|
||||
loader.addEventListener(Event.COMPLETE, loader_Success);
|
||||
loader.addEventListener(IOErrorEvent.IO_ERROR, loader_Error);
|
||||
loader.load(req);
|
||||
}
|
||||
|
||||
private function loader_Success(event:Event):void
|
||||
{
|
||||
var loader:URLLoader = event.target as URLLoader;
|
||||
if (loader != null)
|
||||
{
|
||||
var result:String = StringHelper.cleanXmlString(loader.data);
|
||||
var xml:XML = new XML(result);
|
||||
if (xml.@success == "true")
|
||||
{
|
||||
dispatchEvent(new DmuRequestEvent(DmuRequestEvent.SUCCESS, xml));
|
||||
}
|
||||
else
|
||||
{
|
||||
loader_Error();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
loader_Error();
|
||||
}
|
||||
}
|
||||
|
||||
private function loader_Error(event:IOErrorEvent = null):void
|
||||
{
|
||||
dispatchEvent(new DmuRequestEvent(DmuRequestEvent.ERROR));
|
||||
}
|
||||
|
||||
public static function getRequest(action:String, vars:URLVariables = null):URLRequest
|
||||
{
|
||||
var loaderUrl:String = Model.url +"/umbraco/webservices/mediauploader.ashx";
|
||||
|
||||
if (vars == null)
|
||||
vars = new URLVariables();
|
||||
|
||||
vars.action = action;
|
||||
vars.username = Model.username;
|
||||
vars.password = Model.password;
|
||||
vars.ticket = Model.ticket;
|
||||
|
||||
var req:URLRequest = new URLRequest(loaderUrl);
|
||||
req.data = vars;
|
||||
req.method = URLRequestMethod.POST;
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
public static function makeRequest(action:String, successCallback:Function, errorCallback:Function,
|
||||
vars:URLVariables = null):void
|
||||
{
|
||||
var req:DmuRequest = new DmuRequest(action, vars);
|
||||
req.addEventListener(DmuRequestEvent.SUCCESS, successCallback);
|
||||
req.addEventListener(DmuRequestEvent.ERROR, errorCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package org.umbraco.desktopmediauploader.net
|
||||
{
|
||||
public class DmuRequestAction
|
||||
{
|
||||
public static var CONFIG:String = "config";
|
||||
public static var FOLDER_LIST:String = "folderList";
|
||||
public static var UPLOAD:String = "upload";
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- http://blog.flexexamples.com/2009/03/13/setting-a-linear-gradient-background-on-an-fxapplication-container-in-flex-gumbo/ -->
|
||||
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
|
||||
xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
|
||||
alpha.disabled="0.5"
|
||||
alpha.disabledWithControlBar="0.5">
|
||||
|
||||
<s:states>
|
||||
<s:State name="normal" />
|
||||
<s:State name="disabled" />
|
||||
<s:State name="normalWithControlBar" />
|
||||
<s:State name="disabledWithControlBar" />
|
||||
<s:State name="normalAndInactive" />
|
||||
</s:states>
|
||||
|
||||
<fx:Metadata>
|
||||
<![CDATA[
|
||||
[HostComponent("spark.components.Application")]
|
||||
]]>
|
||||
</fx:Metadata>
|
||||
|
||||
<!-- fill -->
|
||||
<!---
|
||||
A rectangle with a solid color fill that forms the background of the application.
|
||||
The color of the fill is set to the Application's backgroundColor property.
|
||||
-->
|
||||
<s:Rect id="backgroundRect" left="0" right="0" top="0" bottom="0" >
|
||||
<s:fill>
|
||||
<s:LinearGradient rotation="90">
|
||||
<s:GradientEntry color="#cccccc" />
|
||||
<s:GradientEntry color="#eeeeee" ratio="0.2" />
|
||||
<s:GradientEntry color="#ffffff" ratio="0.8" />
|
||||
</s:LinearGradient>
|
||||
</s:fill>
|
||||
</s:Rect>
|
||||
|
||||
<s:Group left="0" right="0" top="0" bottom="0">
|
||||
<s:layout>
|
||||
<s:VerticalLayout gap="0" horizontalAlign="justify" />
|
||||
</s:layout>
|
||||
|
||||
<s:Group id="topGroup" minWidth="0" minHeight="0"
|
||||
includeIn="normalWithControlBar, disabledWithControlBar" >
|
||||
|
||||
<!-- layer 0: control bar highlight -->
|
||||
<s:Rect left="0" right="0" top="0" bottom="1" >
|
||||
<s:stroke>
|
||||
<s:LinearGradientStroke rotation="90" weight="1">
|
||||
<s:GradientEntry color="0xFFFFFF" />
|
||||
<s:GradientEntry color="0xD8D8D8" />
|
||||
</s:LinearGradientStroke>
|
||||
</s:stroke>
|
||||
</s:Rect>
|
||||
|
||||
<!-- layer 1: control bar fill -->
|
||||
<s:Rect left="1" right="1" top="1" bottom="2" >
|
||||
<s:fill>
|
||||
<s:LinearGradient rotation="90">
|
||||
<s:GradientEntry color="0xEDEDED" />
|
||||
<s:GradientEntry color="0xCDCDCD" />
|
||||
</s:LinearGradient>
|
||||
</s:fill>
|
||||
</s:Rect>
|
||||
|
||||
<!-- layer 2: control bar divider line -->
|
||||
<s:Rect left="0" right="0" bottom="0" height="1" alpha="0.55">
|
||||
<s:fill>
|
||||
<s:SolidColor color="0x000000" />
|
||||
</s:fill>
|
||||
</s:Rect>
|
||||
|
||||
<!-- layer 3: control bar -->
|
||||
<s:Group id="controlBarGroup" left="0" right="0" top="1" bottom="1" minWidth="0" minHeight="0">
|
||||
<s:layout>
|
||||
<s:HorizontalLayout paddingLeft="10" paddingRight="10" paddingTop="7" paddingBottom="7" gap="10" />
|
||||
</s:layout>
|
||||
</s:Group>
|
||||
</s:Group>
|
||||
|
||||
<s:Group id="contentGroup" width="100%" height="100%" minWidth="0" minHeight="0" />
|
||||
|
||||
</s:Group>
|
||||
|
||||
</s:Skin>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
|
||||
ADOBE SYSTEMS INCORPORATED
|
||||
Copyright 2009 Adobe Systems Incorporated
|
||||
All Rights Reserved.
|
||||
|
||||
NOTICE: Adobe permits you to use, modify, and distribute this file
|
||||
in accordance with the terms of the license agreement accompanying it.
|
||||
|
||||
-->
|
||||
|
||||
<!--- The default skin class for a Spark DefaultItemRenderer class.
|
||||
|
||||
@langversion 3.0
|
||||
@playerversion Flash 10
|
||||
@playerversion AIR 1.5
|
||||
@productversion Flex 4
|
||||
-->
|
||||
<s:ItemRenderer focusEnabled="false" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" useHandCursor="true" buttonMode="true">
|
||||
|
||||
<s:states>
|
||||
<s:State name="normal" />
|
||||
<s:State name="hovered" />
|
||||
<s:State name="selected" />
|
||||
<s:State name="normalAndShowsCaret"/>
|
||||
<s:State name="hoveredAndShowsCaret"/>
|
||||
<s:State name="selectedAndShowsCaret"/>
|
||||
</s:states>
|
||||
|
||||
<s:Rect left="0" right="0" top="0" bottom="0">
|
||||
<s:stroke.normalAndShowsCaret>
|
||||
<s:SolidColorStroke
|
||||
color="{getStyle('selectionColor')}"
|
||||
weight="1"/>
|
||||
</s:stroke.normalAndShowsCaret>
|
||||
<s:stroke.hoveredAndShowsCaret>
|
||||
<s:SolidColorStroke
|
||||
color="{getStyle('selectionColor')}"
|
||||
weight="1"/>
|
||||
</s:stroke.hoveredAndShowsCaret>
|
||||
<s:stroke.selectedAndShowsCaret>
|
||||
<s:SolidColorStroke
|
||||
color="{getStyle('selectionColor')}"
|
||||
weight="1"/>
|
||||
</s:stroke.selectedAndShowsCaret>
|
||||
<s:fill>
|
||||
<s:SolidColor
|
||||
color.normal="0x9a9a9a"
|
||||
color.normalAndShowsCaret="0x9a9a9a"
|
||||
color.hovered="{getStyle('rollOverColor')}"
|
||||
color.hoveredAndShowsCaret="{getStyle('rollOverColor')}"
|
||||
color.selected="{getStyle('selectionColor')}"
|
||||
color.selectedAndShowsCaret="{getStyle('selectionColor')}"
|
||||
/>
|
||||
</s:fill>
|
||||
</s:Rect>
|
||||
<s:Label id="labelDisplay" verticalCenter="0" left="5" right="5" top="6" bottom="4"/>
|
||||
|
||||
</s:ItemRenderer>
|
||||
@@ -1,58 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
ADOBE SYSTEMS INCORPORATED
|
||||
Copyright 2009 Adobe Systems Incorporated
|
||||
All Rights Reserved.
|
||||
|
||||
NOTICE: Adobe permits you to use, modify, and distribute this file
|
||||
in accordance with the terms of the license agreement accompanying it.
|
||||
|
||||
-->
|
||||
<!--- The default skin class for the anchor button on a Spark DropDownList component.
|
||||
|
||||
@see spark.components.DropDownList
|
||||
@see spark.skins.spark.DropDownListSkin
|
||||
|
||||
@langversion 3.0
|
||||
@playerversion Flash 10
|
||||
@playerversion AIR 1.5
|
||||
@productversion Flex 4
|
||||
-->
|
||||
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:fb="http://ns.adobe.com/flashbuilder/2009" minWidth="21" minHeight="21">
|
||||
|
||||
<fx:Metadata>
|
||||
<![CDATA[
|
||||
/**
|
||||
* @copy spark.skins.spark.ApplicationSkin#hostComponent
|
||||
*/
|
||||
[HostComponent("spark.components.Button")]
|
||||
]]>
|
||||
</fx:Metadata>
|
||||
|
||||
|
||||
<!-- states -->
|
||||
<s:states>
|
||||
<s:State name="up" />
|
||||
<s:State name="over" />
|
||||
<s:State name="down" />
|
||||
<s:State name="disabled" />
|
||||
</s:states>
|
||||
|
||||
<!-- Layer 2: innerFill -->
|
||||
<s:Rect id="innerFill" left="0" right="0" top="0" bottom="0" radiusX="0">
|
||||
<s:fill>
|
||||
<s:SolidColor color="0x9a9a9a" color.up="0x8a8a8a" />
|
||||
</s:fill>
|
||||
</s:Rect>
|
||||
|
||||
<!-- layer 8: arrow -->
|
||||
<!--- The arrow graphic displayed in the anchor button. -->
|
||||
<s:Path right="6" verticalCenter="0" id="arrow"
|
||||
data="M 7.03 0.5 C 7.43 0.9 7.43 1.55 7.03 1.95 L 4.64 4.34 C 4.24 4.74 3.59 4.74 3.19 4.34 L 0.8 1.95 C 0.4 1.55 0.4 0.9 0.8 0.5 L 7.03 0.5 Z">
|
||||
<s:fill>
|
||||
<s:SolidColor color="0xFFFFFF" />
|
||||
</s:fill>
|
||||
</s:Path>
|
||||
</s:Skin>
|
||||
@@ -1,92 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
|
||||
ADOBE SYSTEMS INCORPORATED
|
||||
Copyright 2009 Adobe Systems Incorporated
|
||||
All Rights Reserved.
|
||||
|
||||
NOTICE: Adobe permits you to use, modify, and distribute this file
|
||||
in accordance with the terms of the license agreement accompanying it.
|
||||
|
||||
-->
|
||||
<!--- The default skin class for the Spark DropDownList component.
|
||||
The skin for the anchor button for a DropDownList component
|
||||
is defined by the DropDownListButtonSkin class.
|
||||
|
||||
@see spark.components.DropDownList
|
||||
@see spark.skins.spark.DropDownListButtonSkin
|
||||
|
||||
@langversion 3.0
|
||||
@playerversion Flash 10
|
||||
@playerversion AIR 1.5
|
||||
@productversion Flex 4
|
||||
-->
|
||||
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabled=".5">
|
||||
|
||||
<!-- host component -->
|
||||
<fx:Metadata>
|
||||
<![CDATA[
|
||||
/**
|
||||
* @copy spark.skins.spark.ApplicationSkin#hostComponent
|
||||
*/
|
||||
[HostComponent("spark.components.DropDownList")]
|
||||
]]>
|
||||
</fx:Metadata>
|
||||
|
||||
<s:states>
|
||||
<s:State name="normal" />
|
||||
<s:State name="open" />
|
||||
<s:State name="disabled" />
|
||||
</s:states>
|
||||
|
||||
<!---
|
||||
The PopUpAnchor control that opens the drop-down list.
|
||||
-->
|
||||
<s:PopUpAnchor id="popUp" displayPopUp.normal="false" displayPopUp.open="true" includeIn="open"
|
||||
left="0" right="0" top="0" bottom="0" itemDestructionPolicy="auto"
|
||||
popUpPosition="below" popUpWidthMatchesAnchorWidth="true">
|
||||
|
||||
<!---
|
||||
The drop down area of the skin.
|
||||
This includes borders, background colors, scrollers, and filters.
|
||||
-->
|
||||
<s:Group id="dropDown" maxHeight="134" >
|
||||
|
||||
<!-- fill -->
|
||||
<!---
|
||||
Defines the appearance of drop-down list's background fill.
|
||||
-->
|
||||
<s:Rect id="background" left="0" right="0" top="0" bottom="0" >
|
||||
<s:fill>
|
||||
<!---
|
||||
The color of the drop down's background fill.
|
||||
The default color is 0xFFFFFF.
|
||||
-->
|
||||
<s:SolidColor id="bgFill" color="0x9a9a9a" />
|
||||
</s:fill>
|
||||
</s:Rect>
|
||||
|
||||
<s:Scroller id="scroller" left="0" top="0" right="0" bottom="0" hasFocusableChildren="false" minViewportInset="1">
|
||||
<!---
|
||||
The container for the data items in the drop-down list.
|
||||
-->
|
||||
<s:DataGroup id="dataGroup" itemRenderer="org.umbraco.desktopmediauploader.skins.DefaultItemRenderer">
|
||||
<s:layout>
|
||||
<s:VerticalLayout gap="0" horizontalAlign="contentJustify"/>
|
||||
</s:layout>
|
||||
</s:DataGroup>
|
||||
</s:Scroller>
|
||||
</s:Group>
|
||||
</s:PopUpAnchor>
|
||||
|
||||
<!--- The anchor button used by the DropDownList. The default skin is DropDownListButtonSkin. -->
|
||||
<s:Button id="openButton" left="0" right="0" top="0" bottom="0" focusEnabled="false"
|
||||
skinClass="org.umbraco.desktopmediauploader.skins.HeaderDropDownListButtonSkin" />
|
||||
|
||||
<!--- The prompt area of the DropDownList. -->
|
||||
<s:Label id="labelDisplay" verticalAlign="middle" maxDisplayedLines="1"
|
||||
mouseEnabled="false" mouseChildren="false"
|
||||
left="5" right="20" top="2" bottom="2" width="75" verticalCenter="1" />
|
||||
|
||||
</s:Skin>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
|
||||
xmlns:mx="library://ns.adobe.com/flex/mx"
|
||||
minWidth="21" minHeight="21" alpha.disabled="0.5">
|
||||
|
||||
<!-- host component -->
|
||||
<fx:Metadata>
|
||||
<![CDATA[
|
||||
[HostComponent("spark.components.Button")]
|
||||
]]>
|
||||
</fx:Metadata>
|
||||
|
||||
<!-- states -->
|
||||
<s:states>
|
||||
<s:State name="up" />
|
||||
<s:State name="over" />
|
||||
<s:State name="down" />
|
||||
<s:State name="disabled" />
|
||||
</s:states>
|
||||
|
||||
<mx:Image source="@Embed('assets/cross-grey.png')"
|
||||
source.over="@Embed('assets/cross.png')"
|
||||
/>
|
||||
|
||||
</s:SparkSkin>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
|
||||
xmlns:mx="library://ns.adobe.com/flex/mx"
|
||||
minWidth="21" minHeight="21" alpha.disabled="0.5">
|
||||
|
||||
<!-- host component -->
|
||||
<fx:Metadata>
|
||||
<![CDATA[
|
||||
[HostComponent("spark.components.Button")]
|
||||
]]>
|
||||
</fx:Metadata>
|
||||
|
||||
<!-- states -->
|
||||
<s:states>
|
||||
<s:State name="up" />
|
||||
<s:State name="over" />
|
||||
<s:State name="down" />
|
||||
<s:State name="disabled" />
|
||||
</s:states>
|
||||
|
||||
<mx:Image source="@Embed('assets/power.png')"
|
||||
source.over="@Embed('assets/power-over.png')"
|
||||
/>
|
||||
|
||||
</s:SparkSkin>
|
||||
@@ -1,176 +0,0 @@
|
||||
package org.umbraco.desktopmediauploader.util
|
||||
{
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
public class Base64
|
||||
{
|
||||
private static const _encodeChars:Vector.<int> = InitEncoreChar();
|
||||
private static const _decodeChars:Vector.<int> = InitDecodeChar();
|
||||
|
||||
public static function encode(data:ByteArray):String
|
||||
{
|
||||
var out:ByteArray = new ByteArray();
|
||||
//Presetting the length keep the memory smaller and optimize speed since there is no "grow" needed
|
||||
out.length = (2 + data.length - ((data.length + 2) % 3)) * 4 / 3; //Preset length //1.6 to 1.5 ms
|
||||
var i:int = 0;
|
||||
var r:int = data.length % 3;
|
||||
var len:int = data.length - r;
|
||||
var c:int; //read (3) character AND write (4) characters
|
||||
|
||||
while (i < len)
|
||||
{
|
||||
//Read 3 Characters (8bit * 3 = 24 bits)
|
||||
c = data[i++] << 16 | data[i++] << 8 | data[i++];
|
||||
|
||||
//Cannot optimize this to read int because of the positioning overhead. (as3 bytearray seek is slow)
|
||||
//Convert to 4 Characters (6 bit * 4 = 24 bits)
|
||||
c = (_encodeChars[c >>> 18] << 24) | (_encodeChars[c >>> 12 & 0x3f] << 16) | (_encodeChars[c >>> 6 & 0x3f] << 8 ) | _encodeChars[c & 0x3f];
|
||||
|
||||
//Optimization: On older and slower computer, do one write Int instead of 4 write byte: 1.5 to 0.71 ms
|
||||
out.writeInt(c);
|
||||
/*
|
||||
out.writeByte(_encodeChars[c >> 18] );
|
||||
out.writeByte(_encodeChars[c >> 12 & 0x3f]);
|
||||
out.writeByte(_encodeChars[c >> 6 & 0x3f]);
|
||||
out.writeByte(_encodeChars[c & 0x3f]);
|
||||
*/
|
||||
}
|
||||
|
||||
if (r == 1) //Need two "=" padding
|
||||
{
|
||||
//Read one char, write two chars, write padding
|
||||
c = data[i];
|
||||
c = (_encodeChars[c >>> 2] << 24) | (_encodeChars[(c & 0x03) << 4] << 16) | 61 << 8 | 61;
|
||||
out.writeInt(c);
|
||||
}
|
||||
else if (r == 2) //Need one "=" padding
|
||||
{
|
||||
c = data[i++] << 8 | data[i];
|
||||
c = (_encodeChars[c >>> 10] << 24) | (_encodeChars[c >>> 4 & 0x3f] << 16) | (_encodeChars[(c & 0x0f) << 2] << 8 ) | 61;
|
||||
out.writeInt(c);
|
||||
}
|
||||
|
||||
out.position = 0;
|
||||
return out.readUTFBytes(out.length);
|
||||
}
|
||||
|
||||
public static function decode(str:String):ByteArray
|
||||
{
|
||||
var c1:int;
|
||||
var c2:int;
|
||||
var c3:int;
|
||||
var c4:int;
|
||||
var i:int;
|
||||
var len:int;
|
||||
var out:ByteArray;
|
||||
len = str.length;
|
||||
i = 0;
|
||||
out = new ByteArray();
|
||||
var byteString:ByteArray = new ByteArray();
|
||||
byteString.writeUTFBytes(str);
|
||||
while (i < len)
|
||||
{
|
||||
//c1
|
||||
do
|
||||
{
|
||||
c1 = _decodeChars[byteString[i++]];
|
||||
} while (i < len && c1 == -1);
|
||||
if (c1 == -1) break;
|
||||
|
||||
//c2
|
||||
do
|
||||
{
|
||||
c2 = _decodeChars[byteString[i++]];
|
||||
} while (i < len && c2 == -1);
|
||||
if (c2 == -1) break;
|
||||
|
||||
out.writeByte((c1 << 2) | ((c2 & 0x30) >> 4));
|
||||
|
||||
//c3
|
||||
do
|
||||
{
|
||||
c3 = byteString[i++];
|
||||
if (c3 == 61) return out;
|
||||
|
||||
c3 = _decodeChars[c3];
|
||||
} while (i < len && c3 == -1);
|
||||
if (c3 == -1) break;
|
||||
|
||||
out.writeByte(((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2));
|
||||
|
||||
//c4
|
||||
do {
|
||||
c4 = byteString[i++];
|
||||
if (c4 == 61) return out;
|
||||
|
||||
c4 = _decodeChars[c4];
|
||||
} while (i < len && c4 == -1);
|
||||
if (c4 == -1) break;
|
||||
|
||||
out.writeByte(((c3 & 0x03) << 6) | c4);
|
||||
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
public static function encodeString(value : String) : String
|
||||
{
|
||||
const source : ByteArray = new ByteArray();
|
||||
source.writeUTFBytes(value);
|
||||
return encode(source);
|
||||
}
|
||||
|
||||
public static function decodeToString(str : String) : String
|
||||
{
|
||||
return decode(str).toString();
|
||||
}
|
||||
|
||||
public static function InitEncoreChar() : Vector.<int>
|
||||
{
|
||||
var encodeChars:Vector.<int> = new Vector.<int>();
|
||||
|
||||
// We could push the number directly, but i think it's nice to see the characters (with no overhead on encode/decode)
|
||||
var chars:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
for (var i:int = 0; i < 64; i++)
|
||||
{
|
||||
encodeChars.push(chars.charCodeAt(i));
|
||||
}
|
||||
/*
|
||||
encodeChars.push(
|
||||
65, 66, 67, 68, 69, 70, 71, 72,
|
||||
73, 74, 75, 76, 77, 78, 79, 80,
|
||||
81, 82, 83, 84, 85, 86, 87, 88,
|
||||
89, 90, 97, 98, 99, 100, 101, 102,
|
||||
103, 104, 105, 106, 107, 108, 109, 110,
|
||||
111, 112, 113, 114, 115, 116, 117, 118,
|
||||
119, 120, 121, 122, 48, 49, 50, 51,
|
||||
52, 53, 54, 55, 56, 57, 43, 47);
|
||||
*/
|
||||
return encodeChars;
|
||||
}
|
||||
|
||||
public static function InitDecodeChar() : Vector.<int>
|
||||
{
|
||||
var decodeChars:Vector.<int> = new Vector.<int>();
|
||||
|
||||
decodeChars.push(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
|
||||
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
|
||||
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
|
||||
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
|
||||
return decodeChars;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package org.umbraco.desktopmediauploader.util
|
||||
{
|
||||
import flash.display.Stage;
|
||||
import flash.events.Event;
|
||||
|
||||
public class StageHelper
|
||||
{
|
||||
private static var _stage:Stage;
|
||||
private static var _resizeListenerSet:Boolean = false;
|
||||
|
||||
[Bindable]
|
||||
public static var stageWidth:int = 0;
|
||||
|
||||
[Bindable]
|
||||
public static var stageHeight:int = 0;
|
||||
|
||||
public function StageHelper()
|
||||
{ }
|
||||
|
||||
public static function set stage(value:Stage):void
|
||||
{
|
||||
_stage = value;
|
||||
|
||||
addResizeListener();
|
||||
|
||||
stage_resize();
|
||||
}
|
||||
|
||||
private static function addResizeListener():void
|
||||
{
|
||||
if (_resizeListenerSet)
|
||||
return;
|
||||
|
||||
if(!_stage)
|
||||
return;
|
||||
|
||||
_stage.addEventListener(Event.RESIZE, stage_resize);
|
||||
_resizeListenerSet = true;
|
||||
}
|
||||
|
||||
private static function stage_resize(e:Event = null):void
|
||||
{
|
||||
stageWidth = _stage.stageWidth;
|
||||
stageHeight = _stage.stageHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package org.umbraco.desktopmediauploader.util
|
||||
{
|
||||
import mx.utils.*;
|
||||
|
||||
public class StringHelper
|
||||
{
|
||||
public static function cleanXmlString(str:String):String
|
||||
{
|
||||
// Remove any Byte Order Markers
|
||||
str = str.replace(String.fromCharCode(65279), "");
|
||||
|
||||
// Trim whitespace
|
||||
return StringUtil.trim(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,206 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
|
||||
xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:mx="library://ns.adobe.com/flex/mx"
|
||||
width="100%" height="100%"
|
||||
show="vwSignIn_ShowHandler(event);">
|
||||
|
||||
<s:layout>
|
||||
<s:BasicLayout/>
|
||||
</s:layout>
|
||||
|
||||
<fx:Script>
|
||||
<![CDATA[
|
||||
import org.umbraco.desktopmediauploader.events.*;
|
||||
import org.umbraco.desktopmediauploader.net.*;
|
||||
import org.umbraco.desktopmediauploader.util.*;
|
||||
|
||||
import mx.controls.Alert;
|
||||
import mx.managers.*;
|
||||
import mx.events.FlexEvent;
|
||||
|
||||
|
||||
public function init():void
|
||||
{
|
||||
NativeApplication.nativeApplication.addEventListener(BrowserInvokeEvent.BROWSER_INVOKE, app_BrowserInvoke);
|
||||
|
||||
reset();
|
||||
|
||||
if(chkAutoSignIn.selected)
|
||||
{
|
||||
doSignIn();
|
||||
}
|
||||
}
|
||||
|
||||
protected function vwSignIn_ShowHandler(event:FlexEvent):void
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
protected function app_BrowserInvoke(e:BrowserInvokeEvent):void
|
||||
{
|
||||
var encLaunchArg:String = unescape(e.arguments[0]);
|
||||
var launchArg:String = Base64.decodeToString(encLaunchArg);
|
||||
var launchArgs:Array = launchArg.split(";");
|
||||
|
||||
Model.url = parseUrl(launchArgs[0]);
|
||||
Model.username = launchArgs[1];
|
||||
Model.password = "";
|
||||
Model.ticket = launchArgs[2];
|
||||
|
||||
// Ok, time to hit the server
|
||||
CursorManager.setBusyCursor();
|
||||
this.enabled = false;
|
||||
|
||||
// Authenticate credentials
|
||||
// NB: As every request authenticates anyway, just load config
|
||||
// and if it fails, assume login was invalid
|
||||
DmuRequest.makeRequest(DmuRequestAction.CONFIG,
|
||||
configRequest_Success,
|
||||
configRequest_Error);
|
||||
}
|
||||
|
||||
protected function reset():void
|
||||
{
|
||||
chkRememberMe.selected = (getEncryptedValue("dmu_rememberme") == "true");
|
||||
chkRememberPassword.selected = (getEncryptedValue("dmu_rememberpassword") == "true");
|
||||
chkAutoSignIn.selected = (getEncryptedValue("dmu_autosignin") == "true");
|
||||
|
||||
if (chkRememberMe.selected)
|
||||
{
|
||||
txtUrl.text = getEncryptedValue("dmu_url");
|
||||
txtUsername.text = getEncryptedValue("dmu_username");
|
||||
if (chkRememberPassword.selected)
|
||||
{
|
||||
txtPassword.text = getEncryptedValue("dmu_password");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function txtPassword_Enter(event:Event):void
|
||||
{
|
||||
doSignIn();
|
||||
}
|
||||
|
||||
protected function btnSignIn_clickHandler(event:MouseEvent=null):void
|
||||
{
|
||||
doSignIn();
|
||||
}
|
||||
|
||||
protected function configRequest_Success(event:DmuRequestEvent):void
|
||||
{
|
||||
this.enabled = true;
|
||||
CursorManager.removeBusyCursor();
|
||||
|
||||
var xml:XML = event.result;
|
||||
|
||||
// Store config
|
||||
Model.displayName = xml.displayName;
|
||||
Model.umbracoPath = xml.umbracoPath;
|
||||
Model.maxRequestLength = Number(xml.maxRequestLength);
|
||||
|
||||
// Remember login
|
||||
if(!Model.ticket || Model.ticket == "")
|
||||
{
|
||||
setEncryptedValue("dmu_url", (chkRememberMe.selected)? Model.url : null);
|
||||
setEncryptedValue("dmu_username", (chkRememberMe.selected)? Model.username : null);
|
||||
setEncryptedValue("dmu_password", (chkRememberMe.selected && chkRememberPassword.selected) ? Model.password : null);
|
||||
setEncryptedValue("dmu_rememberme", chkRememberMe.selected.toString());
|
||||
setEncryptedValue("dmu_rememberpassword", chkRememberPassword.selected.toString());
|
||||
setEncryptedValue("dmu_autosignin", chkAutoSignIn.selected.toString());
|
||||
}
|
||||
|
||||
dispatchEvent(new SignedInEvent(SignedInEvent.SIGNED_IN));
|
||||
}
|
||||
|
||||
protected function configRequest_Error(event:Event):void
|
||||
{
|
||||
this.enabled = true;
|
||||
CursorManager.removeBusyCursor();
|
||||
|
||||
Alert.show("Invalid login", "Ooops!");
|
||||
}
|
||||
|
||||
private function doSignIn():void
|
||||
{
|
||||
Model.url = parseUrl(txtUrl.text);
|
||||
Model.username = txtUsername.text;
|
||||
Model.password = txtPassword.text;
|
||||
Model.ticket = "";
|
||||
|
||||
// Ok, time to hit the server
|
||||
CursorManager.setBusyCursor();
|
||||
this.enabled = false;
|
||||
|
||||
// Authenticate credentials
|
||||
// NB: As every request authenticates anyway, just load config
|
||||
// and if it fails, assume login was invalid
|
||||
DmuRequest.makeRequest(DmuRequestAction.CONFIG,
|
||||
configRequest_Success,
|
||||
configRequest_Error);
|
||||
}
|
||||
|
||||
private function parseUrl(url:String):String
|
||||
{
|
||||
var urlPattern:RegExp = /^((?P<scheme>https?):\/\/)(?P<hostname>[^:\/\s]+)(?P<port>:([^\/]*))?((?P<path>(\/\w+)*\/)(?P<filename>[-\w.]+[^#?\s]*)?(?P<query>\?([^#]*))?(?P<fragment>#(.*))?)?$/gi;
|
||||
var result:Array = urlPattern.exec(url.toLowerCase());
|
||||
if (result != null && result.length > 0)
|
||||
{
|
||||
var parsedUrl:String = result.scheme + "://" + result.hostname + result.port + result.path + result.filename;
|
||||
|
||||
while(parsedUrl.substr(parsedUrl.length - 1) == "/")
|
||||
{
|
||||
parsedUrl = parsedUrl.substr(0, parsedUrl.length - 1);
|
||||
}
|
||||
|
||||
return parsedUrl;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
private function setEncryptedValue(key:String, value:String):void
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
var data:ByteArray = new ByteArray();
|
||||
data.writeUTFBytes(value);
|
||||
EncryptedLocalStore.setItem(key, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
EncryptedLocalStore.removeItem(key);
|
||||
}
|
||||
}
|
||||
|
||||
private function getEncryptedValue(key:String):String
|
||||
{
|
||||
var data:ByteArray = EncryptedLocalStore.getItem(key);
|
||||
return (data != null) ? data.readUTFBytes(data.length) : null;
|
||||
}
|
||||
|
||||
]]>
|
||||
</fx:Script>
|
||||
|
||||
<fx:Metadata>
|
||||
[Event(name="signedIn", type="org.umbraco.desktopmediauploader.events.SignedInEvent")]
|
||||
</fx:Metadata>
|
||||
|
||||
<fx:Declarations>
|
||||
<!-- Place non-visual elements (e.g., services, value objects) here -->
|
||||
</fx:Declarations>
|
||||
|
||||
<mx:Image horizontalCenter="0" source="@Embed('assets/logo.png')" verticalCenter="-145"/>
|
||||
<s:VGroup id="grpSignInForm" height="200" bottom="105" left="25" right="25">
|
||||
<s:Label text="URL" fontWeight="bold"/>
|
||||
<s:TextInput width="100%" id="txtUrl" text="@{Model.url}"/>
|
||||
<s:Label text="Username" fontWeight="bold"/>
|
||||
<s:TextInput width="100%" id="txtUsername" text="@{Model.username}"/>
|
||||
<s:Label text="Password" fontWeight="bold"/>
|
||||
<s:TextInput width="100%" id="txtPassword" displayAsPassword="true" text="@{Model.password}" enter="txtPassword_Enter(event)" />
|
||||
<s:CheckBox label="Remember Me" id="chkRememberMe" change="(!chkRememberMe.selected) ? chkRememberPassword.selected = chkAutoSignIn.selected = false : null"/>
|
||||
<s:CheckBox label="Remember Password" id="chkRememberPassword" enabled="{chkRememberMe.selected}" change="(!chkRememberPassword.selected) ? chkAutoSignIn.selected = false : null"/>
|
||||
<s:CheckBox label="Sign In Automaticaly" id="chkAutoSignIn" enabled="{chkRememberPassword.selected}"/>
|
||||
</s:VGroup>
|
||||
<mx:Button label="Sign In" bottom="25" id="btnSignIn" click="btnSignIn_clickHandler(event)" left="25" right="25" height="35" useHandCursor="true" buttonMode="true" styleName=""/>
|
||||
|
||||
</s:Group>
|
||||
@@ -1,331 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
|
||||
xmlns:s="library://ns.adobe.com/flex/spark"
|
||||
xmlns:mx="library://ns.adobe.com/flex/mx"
|
||||
xmlns:components="org.umbraco.desktopmediauploader.components.*"
|
||||
width="100%" height="100%"
|
||||
creationComplete="vwUpload_CreationCompleteHandler(event)"
|
||||
show="vwUpload_ShowHandler(event);">
|
||||
|
||||
<s:layout>
|
||||
<s:BasicLayout/>
|
||||
</s:layout>
|
||||
|
||||
<fx:Script>
|
||||
<![CDATA[
|
||||
import org.umbraco.desktopmediauploader.components.*;
|
||||
import org.umbraco.desktopmediauploader.events.*;
|
||||
import org.umbraco.desktopmediauploader.net.*;
|
||||
import org.umbraco.desktopmediauploader.util.*;
|
||||
|
||||
import flash.desktop.*;
|
||||
import flash.events.*;
|
||||
import flash.filesystem.File;
|
||||
import flash.net.*;
|
||||
|
||||
import mx.collections.Sort;
|
||||
import mx.collections.SortField;
|
||||
import mx.controls.Alert;
|
||||
import mx.controls.Menu;
|
||||
import mx.core.ScrollPolicy;
|
||||
import mx.events.FlexEvent;
|
||||
import mx.managers.*;
|
||||
|
||||
import spark.events.IndexChangeEvent;
|
||||
|
||||
[Bindable] public var currentUploadItem:UploadItem;
|
||||
[Bindable] public var uploadItems:ArrayCollection;
|
||||
|
||||
[Bindable] private var uploading:Boolean = false;
|
||||
|
||||
protected function vwUpload_CreationCompleteHandler(event:FlexEvent):void
|
||||
{
|
||||
uploadItems = new ArrayCollection();
|
||||
|
||||
addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, vwUpload_DragEnter);
|
||||
addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, vwUpload_DragDrop);
|
||||
|
||||
dmuStatus.addEventListener(Event.CANCEL, dmuStatus_Cancel);
|
||||
}
|
||||
|
||||
protected function vwUpload_ShowHandler(event:FlexEvent):void
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
private function vwUpload_DragEnter(e:NativeDragEvent) :void
|
||||
{
|
||||
var valid:Boolean = false;
|
||||
if(e.clipboard.hasFormat(ClipboardFormats.FILE_LIST_FORMAT))
|
||||
{
|
||||
// Only allow drop if at least 1 file is valid
|
||||
var files:Array = e.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
|
||||
for each (var f:File in files)
|
||||
{
|
||||
if (isValidFile(f))
|
||||
{
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (valid)
|
||||
NativeDragManager.acceptDragDrop(this);
|
||||
}
|
||||
}
|
||||
|
||||
private function vwUpload_DragDrop(e:NativeDragEvent) :void
|
||||
{
|
||||
var files:Array = e.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
|
||||
|
||||
addFilesToQueue(files);
|
||||
|
||||
// Sort alphabeticlly
|
||||
var sf:SortField = new SortField("fullPath", true);
|
||||
var s:Sort = new Sort();
|
||||
s.fields = [sf];
|
||||
|
||||
uploadItems.sort = s;
|
||||
uploadItems.refresh();
|
||||
|
||||
for(var i:int = 0; i < uploadItems.length; i++)
|
||||
{
|
||||
grpUploadItemContainer.addElement(uploadItems[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private function reset():void
|
||||
{
|
||||
Model.currentFolder = undefined;
|
||||
Model.folderId = undefined;
|
||||
Model.folderName = undefined;
|
||||
Model.folderPath = undefined;
|
||||
|
||||
uploading = false;
|
||||
currentUploadItem == null;
|
||||
|
||||
dmuStatus_Cancel();
|
||||
}
|
||||
|
||||
private function isValidFile(file:File, path:String = ""):Boolean
|
||||
{
|
||||
var queued:Boolean = false;
|
||||
|
||||
var i:int = uploadItems.length;
|
||||
while(i--)
|
||||
{
|
||||
var uploadItem:UploadItem = uploadItems[i] as UploadItem;
|
||||
if (uploadItem != null && uploadItem.file.name == file.name && uploadItem.path == path && uploadItem.file.size == file.size)
|
||||
{
|
||||
queued = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Handle .lnk files?
|
||||
// TODO: What to do with zip files?
|
||||
return (!file.isSymbolicLink &&
|
||||
!file.isPackage &&
|
||||
!file.isHidden &&
|
||||
!queued &&
|
||||
file.size <= (Model.maxRequestLength * 1024));
|
||||
}
|
||||
|
||||
private function addFilesToQueue(files:Array, path:String = ""):void
|
||||
{
|
||||
for each (var f:File in files)
|
||||
{
|
||||
if(f.isDirectory)
|
||||
{
|
||||
addFilesToQueue(f.getDirectoryListing(), path + "/" + f.name)
|
||||
}
|
||||
else if (isValidFile(f, path))
|
||||
{
|
||||
addFileToQueue(FileReference(f), path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function addFileToQueue(file:FileReference, path:String):void
|
||||
{
|
||||
var uploadItem:UploadItem = new UploadItem();
|
||||
uploadItem.file = file;
|
||||
uploadItem.path = path;
|
||||
uploadItem.addEventListener(Event.COMPLETE, uploadItem_Complete);
|
||||
uploadItem.addEventListener(Event.CANCEL, uploadItem_Cancel);
|
||||
uploadItem.addEventListener(HTTPStatusEvent.HTTP_STATUS, uploadItem_Error);
|
||||
uploadItem.addEventListener(IOErrorEvent.IO_ERROR, uploadItem_Error);
|
||||
uploadItem.addEventListener(SecurityErrorEvent.SECURITY_ERROR, uploadItem_Error);
|
||||
|
||||
grpUploadItemContainer.addElement(uploadItem);
|
||||
uploadItems.addItem(uploadItem);
|
||||
}
|
||||
|
||||
protected function ddlConnectedTo_Close(e:Event):void
|
||||
{
|
||||
var oldIndex:Number = ddlConnectedTo.selectedIndex;
|
||||
ddlConnectedTo.selectedIndex = -1;
|
||||
|
||||
if (oldIndex >= 0)
|
||||
{
|
||||
switch(ddlConnectedTo.dataProvider[oldIndex])
|
||||
{
|
||||
case "Launch Site":
|
||||
navigateToURL(new URLRequest(Model.url));
|
||||
break;
|
||||
case "Launch Admin":
|
||||
navigateToURL(new URLRequest(Model.url + Model.umbracoPath + "/"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function btnSignOut_Click(e:Event):void
|
||||
{
|
||||
if (uploading)
|
||||
Alert.show("Unable to sign out whilst uploading files.", "Ooops!");
|
||||
else
|
||||
dispatchEvent(new SignedOutEvent(SignedOutEvent.SIGNED_OUT));
|
||||
}
|
||||
|
||||
protected function uploadItem_Complete(e:Event):void
|
||||
{
|
||||
uploadItem_Cancel(e);
|
||||
|
||||
uploading = false;
|
||||
currentUploadItem == null;
|
||||
|
||||
if (uploadItems.length > 0)
|
||||
btnUpload_Click();
|
||||
else
|
||||
Alert.show("Upload complete.", "Woo hoo!");
|
||||
}
|
||||
|
||||
protected function uploadItem_Cancel(e:Event):void
|
||||
{
|
||||
var uploadItem:UploadItem = e.target as UploadItem;
|
||||
|
||||
var i:uint = uploadItems.length;
|
||||
while(i--)
|
||||
{
|
||||
var uploadItem2:UploadItem = uploadItems[i] as UploadItem;
|
||||
if(uploadItem2.file.name == uploadItem.file.name && uploadItem2.path == uploadItem.path)
|
||||
{
|
||||
grpUploadItemContainer.removeElement(uploadItem);
|
||||
uploadItems.removeItemAt(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function uploadItem_Error(e:Event):void
|
||||
{
|
||||
// TODO: Move item to bottom?
|
||||
}
|
||||
|
||||
protected function dmuStatus_Cancel(event:Event = null):void
|
||||
{
|
||||
var i:uint = uploadItems.length;
|
||||
while(i--)
|
||||
{
|
||||
uploadItems[i].cancel();
|
||||
}
|
||||
}
|
||||
|
||||
protected function btnUploadTo_Click(event:MouseEvent):void
|
||||
{
|
||||
var win:FolderPickerDialog = PopUpManager.createPopUp(this, FolderPickerDialog, true) as FolderPickerDialog;
|
||||
|
||||
PopUpManager.centerPopUp(win);
|
||||
}
|
||||
|
||||
|
||||
protected function btnUpload_Click(event:MouseEvent = null):void
|
||||
{
|
||||
var uploadItem:UploadItem;
|
||||
var i:int;
|
||||
|
||||
if (!uploading)
|
||||
{
|
||||
uploading = false;
|
||||
currentUploadItem = null;
|
||||
|
||||
for(i = 0; i < uploadItems.length; i++)
|
||||
{
|
||||
uploadItem = uploadItems[i] as UploadItem;
|
||||
if (!uploadItem.uploaded)
|
||||
{
|
||||
currentUploadItem = uploadItem;
|
||||
currentUploadItem.upload();
|
||||
uploading = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i = 0; i < uploadItems.length; i++)
|
||||
{
|
||||
uploadItem = uploadItems[i] as UploadItem;
|
||||
if (!uploadItem.uploaded)
|
||||
{
|
||||
uploadItem.pause();
|
||||
}
|
||||
}
|
||||
|
||||
uploading = false;
|
||||
currentUploadItem = null;
|
||||
}
|
||||
}
|
||||
|
||||
]]>
|
||||
</fx:Script>
|
||||
|
||||
<fx:Metadata>
|
||||
[Event(name="signedOut", type="org.umbraco.desktopmediauploader.events.SignedOutEvent")]
|
||||
</fx:Metadata>
|
||||
|
||||
<fx:Declarations>
|
||||
<fx:Array id="uploadMenuItems">
|
||||
<fx:Object label="Clear Queue" />
|
||||
<fx:Object type="separator" />
|
||||
<fx:Object label="Overwrite existing files" type="check" />
|
||||
<fx:Object label="Auto extract zip files" type="check" />
|
||||
</fx:Array>
|
||||
</fx:Declarations>
|
||||
|
||||
<s:BorderContainer top="0" left="0" right="0" height="70" styleName="header">
|
||||
<mx:Image source="@Embed('assets/icon-48.png')" x="10" y="10" />
|
||||
<mx:Label id="lblName" text="{Model.displayName}" left="64" y="10" right="50" truncateToFit="true" minWidth="0" />
|
||||
<s:DropDownList id="ddlConnectedTo" prompt="{Model.url}" close="ddlConnectedTo_Close(event)" x="65" y="33" typicalItem="{Model.url}" maxWidth="{StageHelper.stageWidth - 90}" open="ddlConnectedTo.scroller.setStyle('horizontalScrollPolicy', ScrollPolicy.OFF);" useHandCursor="true" buttonMode="true">
|
||||
<mx:ArrayCollection>
|
||||
<fx:String>Launch Site</fx:String>
|
||||
<fx:String>Launch Admin</fx:String>
|
||||
</mx:ArrayCollection>
|
||||
</s:DropDownList>
|
||||
<s:Button id="btnSignOut" width="13" height="15" top="11" right="25" useHandCursor="true" buttonMode="true" styleName="signOutButton" click="btnSignOut_Click(event)" />
|
||||
|
||||
</s:BorderContainer>
|
||||
|
||||
<s:VGroup top="90" left="25" right="25" gap="5">
|
||||
<s:Label text="Upload files to..."/>
|
||||
<s:Button id="btnUploadTo" label="{(Model.folderPath) ? Model.folderPath.replace(/\//g, ' › ') : 'Please select...'}" width="100%" click="btnUploadTo_Click(event)" creationComplete="btnUploadTo.labelDisplay.setStyle('textAlign','left')" height="25" useHandCursor="true" buttonMode="true" />
|
||||
</s:VGroup>
|
||||
|
||||
<s:BorderContainer top="150" left="25" right="25" bottom="100" borderColor="#CCCCCC" backgroundColor="#FFFFFF">
|
||||
<s:Scroller width="100%" height="100%">
|
||||
<s:Group id="grpUploadItemContainer">
|
||||
<s:layout>
|
||||
<s:VerticalLayout paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5" gap="5"/>
|
||||
</s:layout>
|
||||
<components:StatusItem id="dmuStatus" visible="{uploadItems.length > 0}" includeInLayout="{uploadItems.length > 0}" totalItems="{uploadItems.length}" />
|
||||
<s:Label text="Drag Files and Folders Here To Upload" verticalAlign="middle" textAlign="center"
|
||||
width="100%" height="100%" fontSize="20" color="#CCCCCC" id="lblInstructions"
|
||||
paddingLeft="20" paddingRight="20" paddingTop="20" paddingBottom="20"
|
||||
visible="{uploadItems.length == 0}" includeInLayout="{uploadItems.length == 0}"/>
|
||||
</s:Group>
|
||||
</s:Scroller>
|
||||
</s:BorderContainer>
|
||||
<s:CheckBox x="25" bottom="73" label="Overwrite existing files with the same filename?" id="chkReplace" selected="@{Model.replaceExisting}" color="#333333"/>
|
||||
<mx:Button id="btnUpload" label="{!uploading ? 'Upload' : 'Cancel'}" useHandCursor="{btnUpload.enabled}" buttonMode="{btnUpload.enabled}" bottom="25" enabled="{uploadItems.length > 0 && Model.folderId}" styleName="orange" height="35" left="25" right="25" click="btnUpload_Click(event)"/>
|
||||
</s:Group>
|
||||
@@ -230,11 +230,13 @@ namespace SqlCE4Umbraco
|
||||
commandText, parameters));
|
||||
}
|
||||
|
||||
|
||||
internal IRecordsReader ExecuteReader(string commandText)
|
||||
{
|
||||
return ExecuteReader(commandText, new SqlCEParameter(string.Empty, string.Empty));
|
||||
}
|
||||
|
||||
|
||||
internal int ExecuteNonQuery(string commandText)
|
||||
{
|
||||
return ExecuteNonQuery(commandText, new SqlCEParameter(string.Empty, string.Empty));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Umbraco.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OVerridable method to execute when All resolvers have been initialized but resolution is not frozen so they can be modified in this method
|
||||
/// Overridable method to execute when All resolvers have been initialized but resolution is not frozen so they can be modified in this method
|
||||
/// </summary>
|
||||
/// <param name="umbracoApplication"></param>
|
||||
/// <param name="applicationContext"></param>
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
public class UmbracoVersion
|
||||
{
|
||||
private static readonly Version Version = new Version("7.1.9");
|
||||
private static readonly Version Version = new Version("7.2.2");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current version of Umbraco.
|
||||
|
||||
@@ -41,6 +41,11 @@
|
||||
/// Application alias for the users section.
|
||||
/// </summary>
|
||||
public const string Users = "users";
|
||||
|
||||
/// <summary>
|
||||
/// Application alias for the users section.
|
||||
/// </summary>
|
||||
public const string Forms = "forms";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -66,10 +71,26 @@
|
||||
/// <summary>
|
||||
/// alias for the datatype tree.
|
||||
/// </summary>
|
||||
public const string DataTypes = "datatype";
|
||||
public const string DataTypes = "datatype";
|
||||
|
||||
/// <summary>
|
||||
/// alias for the dictionary tree.
|
||||
/// </summary>
|
||||
public const string Dictionary = "dictionary";
|
||||
|
||||
//TODO: Fill in the rest!
|
||||
|
||||
/// <summary>
|
||||
/// alias for the media tree.
|
||||
/// </summary>
|
||||
public const string Templates = "template";
|
||||
|
||||
public const string RelationTypes = "relationTypes";
|
||||
|
||||
public const string Xslt = "xslt";
|
||||
|
||||
public const string Languages = "languages";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,16 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
public static class Conventions
|
||||
{
|
||||
public static class DataTypes
|
||||
{
|
||||
public const string ListViewPrefix = "List View - ";
|
||||
}
|
||||
|
||||
public static class PropertyGroups
|
||||
{
|
||||
public const string ListViewGroupName = "umbContainerView";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constants for Umbraco Content property aliases.
|
||||
/// </summary>
|
||||
@@ -267,6 +277,8 @@ namespace Umbraco.Core
|
||||
public const string DefaultAlias = "Member";
|
||||
|
||||
public const string SystemDefaultProtectType = "_umbracoSystemDefaultProtectType";
|
||||
|
||||
public const string AllMembersListId = "all-members";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -130,6 +130,12 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
public const string FolderBrowserAlias = "Umbraco.FolderBrowser";
|
||||
|
||||
/// <summary>
|
||||
/// Alias for the grid datatype.
|
||||
/// </summary>
|
||||
public const string GridAlias = "Umbraco.Grid";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Guid for the Image Cropper datatype.
|
||||
/// </summary>
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
/// </summary>
|
||||
public const int RecycleBinMedia = -21;
|
||||
|
||||
public const int DefaultContentListViewDataTypeId = -95;
|
||||
public const int DefaultMediaListViewDataTypeId = -96;
|
||||
public const int DefaultMembersListViewDataTypeId = -97;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Dictionary
|
||||
/// <summary>
|
||||
/// Resolves the current CultureDictionaryFactory
|
||||
/// </summary>
|
||||
internal sealed class CultureDictionaryFactoryResolver : SingleObjectResolverBase<CultureDictionaryFactoryResolver, ICultureDictionaryFactory>
|
||||
public sealed class CultureDictionaryFactoryResolver : SingleObjectResolverBase<CultureDictionaryFactoryResolver, ICultureDictionaryFactory>
|
||||
{
|
||||
internal CultureDictionaryFactoryResolver(ICultureDictionaryFactory factory)
|
||||
: base(factory)
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Dictionary
|
||||
/// <summary>
|
||||
/// Represents a dictionary based on a specific culture
|
||||
/// </summary>
|
||||
internal interface ICultureDictionary
|
||||
public interface ICultureDictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the dictionary value based on the key supplied
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core.Dictionary
|
||||
{
|
||||
internal interface ICultureDictionaryFactory
|
||||
public interface ICultureDictionaryFactory
|
||||
{
|
||||
ICultureDictionary CreateDictionary();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Logging;
|
||||
|
||||
namespace Umbraco.Core.Dynamics
|
||||
@@ -34,38 +35,42 @@ namespace Umbraco.Core.Dynamics
|
||||
FoundExtensionMethod
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to invoke a member based on the dynamic instance
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="thisObject">The object instance to invoke the extension method for</param>
|
||||
/// <param name="binder"></param>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// First tries to find a property with the binder name, if that fails it will try to find a static or instance method
|
||||
/// on the object that matches the binder name
|
||||
/// </remarks>
|
||||
public static Attempt<TryInvokeMemberResult> TryInvokeMember<T>(T thisObject, InvokeMemberBinder binder, object[] args)
|
||||
/// <summary>
|
||||
/// Attempts to invoke a member based on the dynamic instance
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="runtimeCache"></param>
|
||||
/// <param name="thisObject">The object instance to invoke the extension method for</param>
|
||||
/// <param name="binder"></param>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// First tries to find a property with the binder name, if that fails it will try to find a static or instance method
|
||||
/// on the object that matches the binder name
|
||||
/// </remarks>
|
||||
public static Attempt<TryInvokeMemberResult> TryInvokeMember<T>(IRuntimeCacheProvider runtimeCache, T thisObject, InvokeMemberBinder binder, object[] args)
|
||||
{
|
||||
return TryInvokeMember<T>(thisObject, binder, args, null);
|
||||
return TryInvokeMember<T>(runtimeCache, thisObject, binder, args, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to invoke a member based on the dynamic instance
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="thisObject">The object instance to invoke the extension method for</param>
|
||||
/// <param name="binder"></param>
|
||||
/// <param name="args"></param>
|
||||
/// <param name="findExtensionMethodsOnTypes">The types to scan for extension methods </param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// First tries to find a property with the binder name, if that fails it will try to find a static or instance method
|
||||
/// on the object that matches the binder name, if that fails it will then attempt to invoke an extension method
|
||||
/// based on the binder name and the extension method types to scan.
|
||||
/// </remarks>
|
||||
public static Attempt<TryInvokeMemberResult> TryInvokeMember<T>(T thisObject,
|
||||
/// <summary>
|
||||
/// Attempts to invoke a member based on the dynamic instance
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="runtimeCache"></param>
|
||||
/// <param name="thisObject">The object instance to invoke the extension method for</param>
|
||||
/// <param name="binder"></param>
|
||||
/// <param name="args"></param>
|
||||
/// <param name="findExtensionMethodsOnTypes">The types to scan for extension methods </param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// First tries to find a property with the binder name, if that fails it will try to find a static or instance method
|
||||
/// on the object that matches the binder name, if that fails it will then attempt to invoke an extension method
|
||||
/// based on the binder name and the extension method types to scan.
|
||||
/// </remarks>
|
||||
public static Attempt<TryInvokeMemberResult> TryInvokeMember<T>(
|
||||
IRuntimeCacheProvider runtimeCache,
|
||||
T thisObject,
|
||||
InvokeMemberBinder binder,
|
||||
object[] args,
|
||||
IEnumerable<Type> findExtensionMethodsOnTypes)
|
||||
@@ -76,9 +81,9 @@ namespace Umbraco.Core.Dynamics
|
||||
{
|
||||
//Property?
|
||||
result = typeof(T).InvokeMember(binder.Name,
|
||||
System.Reflection.BindingFlags.Instance |
|
||||
System.Reflection.BindingFlags.Public |
|
||||
System.Reflection.BindingFlags.GetProperty,
|
||||
BindingFlags.Instance |
|
||||
BindingFlags.Public |
|
||||
BindingFlags.GetProperty,
|
||||
null,
|
||||
thisObject,
|
||||
args);
|
||||
@@ -90,10 +95,10 @@ namespace Umbraco.Core.Dynamics
|
||||
{
|
||||
//Static or Instance Method?
|
||||
result = typeof(T).InvokeMember(binder.Name,
|
||||
System.Reflection.BindingFlags.Instance |
|
||||
System.Reflection.BindingFlags.Public |
|
||||
System.Reflection.BindingFlags.Static |
|
||||
System.Reflection.BindingFlags.InvokeMethod,
|
||||
BindingFlags.Instance |
|
||||
BindingFlags.Public |
|
||||
BindingFlags.Static |
|
||||
BindingFlags.InvokeMethod,
|
||||
null,
|
||||
thisObject,
|
||||
args);
|
||||
@@ -105,7 +110,7 @@ namespace Umbraco.Core.Dynamics
|
||||
{
|
||||
try
|
||||
{
|
||||
result = FindAndExecuteExtensionMethod(thisObject, args, binder.Name, findExtensionMethodsOnTypes);
|
||||
result = FindAndExecuteExtensionMethod(runtimeCache, thisObject, args, binder.Name, findExtensionMethodsOnTypes);
|
||||
return Attempt.Succeed(new TryInvokeMemberResult(result, TryInvokeMemberSuccessReason.FoundExtensionMethod));
|
||||
}
|
||||
catch (TargetInvocationException ext)
|
||||
@@ -138,16 +143,19 @@ namespace Umbraco.Core.Dynamics
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to find an extension method that matches the name and arguments based on scanning the Type's passed in
|
||||
/// to the findMethodsOnTypes parameter
|
||||
/// </summary>
|
||||
/// <param name="thisObject">The instance object to execute the extension method for</param>
|
||||
/// <param name="args"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="findMethodsOnTypes"></param>
|
||||
/// <returns></returns>
|
||||
internal static object FindAndExecuteExtensionMethod<T>(T thisObject,
|
||||
/// <summary>
|
||||
/// Attempts to find an extension method that matches the name and arguments based on scanning the Type's passed in
|
||||
/// to the findMethodsOnTypes parameter
|
||||
/// </summary>
|
||||
/// <param name="runtimeCache"></param>
|
||||
/// <param name="thisObject">The instance object to execute the extension method for</param>
|
||||
/// <param name="args"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="findMethodsOnTypes"></param>
|
||||
/// <returns></returns>
|
||||
internal static object FindAndExecuteExtensionMethod<T>(
|
||||
IRuntimeCacheProvider runtimeCache,
|
||||
T thisObject,
|
||||
object[] args,
|
||||
string name,
|
||||
IEnumerable<Type> findMethodsOnTypes)
|
||||
@@ -158,7 +166,7 @@ namespace Umbraco.Core.Dynamics
|
||||
MethodInfo toExecute = null;
|
||||
foreach (var t in findMethodsOnTypes)
|
||||
{
|
||||
toExecute = ExtensionMethodFinder.FindExtensionMethod(t, args, name, false);
|
||||
toExecute = ExtensionMethodFinder.FindExtensionMethod(runtimeCache, t, args, name, false);
|
||||
if (toExecute != null)
|
||||
break;
|
||||
}
|
||||
@@ -166,6 +174,13 @@ namespace Umbraco.Core.Dynamics
|
||||
if (toExecute != null)
|
||||
{
|
||||
var genericArgs = (new[] { (object)thisObject }).Concat(args);
|
||||
|
||||
// else we'd get an exception w/ message "Late bound operations cannot
|
||||
// be performed on types or methods for which ContainsGenericParameters is true."
|
||||
// because MakeGenericMethod must be used to obtain an actual method that can run
|
||||
if (toExecute.ContainsGenericParameters)
|
||||
throw new InvalidOperationException("Method contains generic parameters, something's wrong.");
|
||||
|
||||
result = toExecute.Invoke(null, genericArgs.ToArray());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Collections;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
|
||||
namespace Umbraco.Core.Dynamics
|
||||
{
|
||||
@@ -162,8 +163,10 @@ namespace Umbraco.Core.Dynamics
|
||||
return true; //anyway
|
||||
}
|
||||
|
||||
var runtimeCache = ApplicationContext.Current != null ? ApplicationContext.Current.ApplicationCache.RuntimeCache : new NullCacheProvider();
|
||||
|
||||
//ok, now lets try to match by member, property, extensino method
|
||||
var attempt = DynamicInstanceHelper.TryInvokeMember(this, binder, args, new[]
|
||||
var attempt = DynamicInstanceHelper.TryInvokeMember(runtimeCache, this, binder, args, new[]
|
||||
{
|
||||
typeof (IEnumerable<DynamicXml>),
|
||||
typeof (IEnumerable<XElement>),
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Compilation;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Collections;
|
||||
using System.Linq.Expressions;
|
||||
using System.Web.Services.Description;
|
||||
using Umbraco.Core.Cache;
|
||||
|
||||
namespace Umbraco.Core.Dynamics
|
||||
{
|
||||
@@ -14,279 +15,152 @@ namespace Umbraco.Core.Dynamics
|
||||
/// </summary>
|
||||
internal static class ExtensionMethodFinder
|
||||
{
|
||||
private static readonly MethodInfo[] AllExtensionMethods;
|
||||
/// <summary>
|
||||
/// The static cache for extension methods found that match the criteria that we are looking for
|
||||
/// </summary>
|
||||
private static readonly ConcurrentDictionary<Tuple<Type, string, int>, MethodInfo[]> MethodCache = new ConcurrentDictionary<Tuple<Type, string, int>, MethodInfo[]>();
|
||||
|
||||
static ExtensionMethodFinder()
|
||||
{
|
||||
AllExtensionMethods = TypeFinder.GetAssembliesWithKnownExclusions()
|
||||
/// <summary>
|
||||
/// Returns the enumerable of all extension method info's in the app domain = USE SPARINGLY!!!
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// We cache this as a sliding 5 minute exiration, in unit tests there's over 1100 methods found, surely that will eat up a bit of memory so we want
|
||||
/// to make sure we give it back.
|
||||
/// </remarks>
|
||||
private static IEnumerable<MethodInfo> GetAllExtensionMethodsInAppDomain(IRuntimeCacheProvider runtimeCacheProvider)
|
||||
{
|
||||
if (runtimeCacheProvider == null) throw new ArgumentNullException("runtimeCacheProvider");
|
||||
|
||||
return runtimeCacheProvider.GetCacheItem<MethodInfo[]>(typeof (ExtensionMethodFinder).Name, () => TypeFinder.GetAssembliesWithKnownExclusions()
|
||||
// assemblies that contain extension methods
|
||||
.Where(a => a.IsDefined(typeof(ExtensionAttribute), false))
|
||||
.Where(a => a.IsDefined(typeof (ExtensionAttribute), false))
|
||||
// types that contain extension methods
|
||||
.SelectMany(a => a.GetTypes()
|
||||
.Where(t => t.IsDefined(typeof(ExtensionAttribute), false) && t.IsSealed && t.IsGenericType == false && t.IsNested == false))
|
||||
.Where(t => t.IsDefined(typeof (ExtensionAttribute), false) && t.IsSealed && t.IsGenericType == false && t.IsNested == false))
|
||||
// actual extension methods
|
||||
.SelectMany(t => t.GetMethods(BindingFlags.Static | BindingFlags.Public)
|
||||
.Where(m => m.IsDefined(typeof(ExtensionAttribute), false)))
|
||||
.Where(m => m.IsDefined(typeof (ExtensionAttribute), false)))
|
||||
// and also IEnumerable<T> extension methods - because the assembly is excluded
|
||||
.Concat(typeof(Enumerable).GetMethods(BindingFlags.Static | BindingFlags.Public))
|
||||
.ToArray();
|
||||
}
|
||||
.Concat(typeof (Enumerable).GetMethods(BindingFlags.Static | BindingFlags.Public))
|
||||
//If we don't do this then we'll be scanning all assemblies each time!
|
||||
.ToArray(),
|
||||
|
||||
//only cache for 5 minutes
|
||||
timeout: TimeSpan.FromMinutes(5),
|
||||
|
||||
// ORIGINAL CODE IS NOT COMPLETE, DOES NOT HANDLE GENERICS, ETC...
|
||||
|
||||
// so this is an attempt at fixing things, but it's not done yet
|
||||
// and do we really want to do this? extension methods are not supported on dynamics, period
|
||||
// we should use strongly typed content instead of dynamics.
|
||||
|
||||
/*
|
||||
|
||||
// get all extension methods for type thisType, with name name,
|
||||
// accepting argsCount arguments (not counting the instance of thisType).
|
||||
private static IEnumerable<MethodInfo> GetExtensionMethods(Type thisType, string name, int argsCount)
|
||||
{
|
||||
var key = string.Format("{0}.{1}::{2}", thisType.FullName, name, argsCount);
|
||||
|
||||
var types = thisType.GetBaseTypes(true); // either do this OR have MatchFirstParameter handle the stuff... F*XME
|
||||
|
||||
var methods = AllExtensionMethods
|
||||
.Where(m => m.Name == name)
|
||||
.Where(m => m.GetParameters().Length == argsCount)
|
||||
.Where(m => MatchFirstParameter(thisType, m.GetParameters()[0].ParameterType));
|
||||
|
||||
// f*xme - is this what we should cache?
|
||||
return methods;
|
||||
//each time this is accessed it will be for 5 minutes longer
|
||||
isSliding:true);
|
||||
}
|
||||
|
||||
// find out whether the first parameter is a match for thisType
|
||||
private static bool MatchFirstParameter(Type thisType, Type firstParameterType)
|
||||
{
|
||||
return MethodArgZeroHasCorrectTargetType(null, firstParameterType, thisType);
|
||||
}
|
||||
|
||||
// get the single extension method for type thisType, with name name,
|
||||
// that accepts the arguments in args (which does not contain the instance of thisType).
|
||||
public static MethodInfo GetExtensionMethod(Type thisType, string name, object[] args)
|
||||
{
|
||||
MethodInfo result = null;
|
||||
foreach (var method in GetExtensionMethods(thisType, name, args.Length).Where(m => MatchParameters(m, args)))
|
||||
{
|
||||
if (result == null)
|
||||
result = method;
|
||||
else
|
||||
throw new AmbiguousMatchException("More than one matching extension method was found.");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// find out whether the method can accept the arguments
|
||||
private static bool MatchParameters(MethodInfo method, IList<object> args)
|
||||
{
|
||||
var parameters = method.GetParameters();
|
||||
|
||||
var i = 0;
|
||||
for (; i < parameters.Length; ++i)
|
||||
{
|
||||
if (MatchParameter(parameters[i].ParameterType, args[i].GetType()) == false)
|
||||
break;
|
||||
}
|
||||
return (i == parameters.Length);
|
||||
}
|
||||
|
||||
internal static bool MatchParameter(Type parameterType, Type argumentType)
|
||||
{
|
||||
// public static int DoSomething<T>(Foo foo, T t1, T t2)
|
||||
// DoSomething(foo, t1, t2) => how can we match?!
|
||||
return parameterType == argumentType; // f*xme of course!
|
||||
}
|
||||
*
|
||||
*/
|
||||
|
||||
// BELOW IS THE ORIGINAL CODE...
|
||||
|
||||
/// <summary>
|
||||
/// Returns all extension methods found matching the definition
|
||||
/// </summary>
|
||||
/// <param name="thisType"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="argumentCount"></param>
|
||||
/// <param name="argsContainsThis"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// TODO: NOTE: This will be an intensive method to call!! Results should be cached!
|
||||
/// </remarks>
|
||||
private static IEnumerable<MethodInfo> GetAllExtensionMethods(Type thisType, string name, int argumentCount, bool argsContainsThis)
|
||||
{
|
||||
// at *least* we can cache the extension methods discovery
|
||||
var candidates = AllExtensionMethods;
|
||||
|
||||
/*
|
||||
//only scan assemblies we know to contain extension methods (user assemblies)
|
||||
var assembliesToScan = TypeFinder.GetAssembliesWithKnownExclusions();
|
||||
|
||||
//get extension methods from runtime
|
||||
var candidates = (
|
||||
from assembly in assembliesToScan
|
||||
where assembly.IsDefined(typeof(ExtensionAttribute), false)
|
||||
from type in assembly.GetTypes()
|
||||
where (type.IsDefined(typeof(ExtensionAttribute), false)
|
||||
&& type.IsSealed && !type.IsGenericType && !type.IsNested)
|
||||
from method in type.GetMethods(BindingFlags.Static | BindingFlags.Public)
|
||||
// this filters extension methods
|
||||
where method.IsDefined(typeof(ExtensionAttribute), false)
|
||||
select method
|
||||
);
|
||||
|
||||
//add the extension methods defined in IEnumerable
|
||||
candidates = candidates.Concat(typeof(Enumerable).GetMethods(BindingFlags.Static | BindingFlags.Public));
|
||||
*/
|
||||
|
||||
//filter by name
|
||||
var methodsByName = candidates.Where(m => m.Name == name);
|
||||
|
||||
var isGenericAndRightParamCount = methodsByName.Where(m => m.GetParameters().Length == argumentCount + (argsContainsThis ? 0 : 1));
|
||||
|
||||
//find the right overload that can take genericParameterType
|
||||
//which will be either DynamicNodeList or List<DynamicNode> which is IEnumerable`
|
||||
|
||||
var withGenericParameterType = isGenericAndRightParamCount.Select(m => new { m, t = FirstParameterType(m) });
|
||||
|
||||
var methodsWhereArgZeroIsTargetType = (from method in withGenericParameterType
|
||||
where
|
||||
method.t != null && MethodArgZeroHasCorrectTargetType(method.m, method.t, thisType)
|
||||
select method);
|
||||
|
||||
return methodsWhereArgZeroIsTargetType.Select(mt => mt.m);
|
||||
}
|
||||
|
||||
private static bool MethodArgZeroHasCorrectTargetType(MethodInfo method, Type firstArgumentType, Type thisType)
|
||||
{
|
||||
//This is done with seperate method calls because you can't debug/watch lamdas - if you're trying to figure
|
||||
//out why the wrong method is returned, it helps to be able to see each boolean result
|
||||
|
||||
return
|
||||
|
||||
// is it defined on me?
|
||||
MethodArgZeroHasCorrectTargetTypeTypeMatchesExactly(method, firstArgumentType, thisType) ||
|
||||
|
||||
// or on any of my interfaces?
|
||||
MethodArgZeroHasCorrectTargetTypeAnInterfaceMatches(method, firstArgumentType, thisType) ||
|
||||
|
||||
// or on any of my base types?
|
||||
MethodArgZeroHasCorrectTargetTypeIsASubclassOf(method, firstArgumentType, thisType) ||
|
||||
|
||||
//share a common interface (e.g. IEnumerable)
|
||||
MethodArgZeroHasCorrectTargetTypeShareACommonInterface(method, firstArgumentType, thisType);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static bool MethodArgZeroHasCorrectTargetTypeShareACommonInterface(MethodInfo method, Type firstArgumentType, Type thisType)
|
||||
{
|
||||
Type[] interfaces = firstArgumentType.GetInterfaces();
|
||||
if (interfaces.Length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool result = interfaces.All(i => thisType.GetInterfaces().Contains(i));
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool MethodArgZeroHasCorrectTargetTypeIsASubclassOf(MethodInfo method, Type firstArgumentType, Type thisType)
|
||||
{
|
||||
bool result = thisType.IsSubclassOf(firstArgumentType);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool MethodArgZeroHasCorrectTargetTypeAnInterfaceMatches(MethodInfo method, Type firstArgumentType, Type thisType)
|
||||
{
|
||||
bool result = thisType.GetInterfaces().Contains(firstArgumentType);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool MethodArgZeroHasCorrectTargetTypeTypeMatchesExactly(MethodInfo method, Type firstArgumentType, Type thisType)
|
||||
{
|
||||
bool result = (thisType == firstArgumentType);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Type FirstParameterType(MethodInfo m)
|
||||
{
|
||||
ParameterInfo[] p = m.GetParameters();
|
||||
if (p.Any())
|
||||
{
|
||||
return p.First().ParameterType;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static MethodInfo DetermineMethodFromParams(IEnumerable<MethodInfo> methods, Type genericType, IEnumerable<object> args)
|
||||
/// <summary>
|
||||
/// Returns all extension methods found matching the definition
|
||||
/// </summary>
|
||||
/// <param name="runtimeCache">
|
||||
/// The runtime cache is used to temporarily cache all extension methods found in the app domain so that
|
||||
/// while we search for individual extension methods, the process will be reasonably 'quick'. We then statically
|
||||
/// cache the MethodInfo's that we are looking for and then the runtime cache will expire and give back all that memory.
|
||||
/// </param>
|
||||
/// <param name="thisType"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="argumentCount">
|
||||
/// The arguments EXCLUDING the 'this' argument in an extension method
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// NOTE: This will be an intensive method to call! Results will be cached based on the key (args) of this method
|
||||
/// </remarks>
|
||||
internal static IEnumerable<MethodInfo> GetAllExtensionMethods(IRuntimeCacheProvider runtimeCache, Type thisType, string name, int argumentCount)
|
||||
{
|
||||
var key = new Tuple<Type, string, int>(thisType, name, argumentCount);
|
||||
|
||||
return MethodCache.GetOrAdd(key, tuple =>
|
||||
{
|
||||
var candidates = GetAllExtensionMethodsInAppDomain(runtimeCache);
|
||||
|
||||
// filter by name
|
||||
var filtr1 = candidates.Where(m => m.Name == name);
|
||||
|
||||
// filter by args count
|
||||
// ensure we add + 1 to the arg count because the 'this' arg is not included in the count above!
|
||||
var filtr2 = filtr1.Where(m => m.GetParameters().Length == argumentCount + 1);
|
||||
|
||||
// filter by first parameter type (target of the extension method)
|
||||
// ie find the right overload that can take genericParameterType
|
||||
// (which will be either DynamicNodeList or List<DynamicNode> which is IEnumerable)
|
||||
var filtr3 = filtr2.Select(x =>
|
||||
{
|
||||
var t = x.GetParameters()[0].ParameterType; // exists because of +1 above
|
||||
var bindings = new Dictionary<string, Type>();
|
||||
if (TypeHelper.MatchType(thisType, t, bindings) == false) return null;
|
||||
|
||||
// create the generic method if necessary
|
||||
if (x.ContainsGenericParameters == false) return x;
|
||||
var targs = t.GetGenericArguments().Select(y => bindings[y.Name]).ToArray();
|
||||
return x.MakeGenericMethod(targs);
|
||||
}).Where(x => x != null);
|
||||
|
||||
return filtr3.ToArray();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private static MethodInfo DetermineMethodFromParams(IEnumerable<MethodInfo> methods, Type genericType, IEnumerable<object> args)
|
||||
{
|
||||
if (!methods.Any())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
MethodInfo methodToExecute = null;
|
||||
if (methods.Count() > 1)
|
||||
{
|
||||
//Given the args, lets get the types and compare the type sequence to try and find the correct overload
|
||||
var argTypes = args.ToList().ConvertAll(o =>
|
||||
{
|
||||
var oe = (o as Expression);
|
||||
if (oe != null)
|
||||
{
|
||||
return oe.Type.FullName;
|
||||
}
|
||||
return o.GetType().FullName;
|
||||
});
|
||||
var methodsWithArgTypes = methods.Select(method => new { method, types = method.GetParameters().Select(pi => pi.ParameterType.FullName) });
|
||||
var firstMatchingOverload = methodsWithArgTypes.FirstOrDefault(m => m.types.SequenceEqual(argTypes));
|
||||
if (firstMatchingOverload != null)
|
||||
{
|
||||
methodToExecute = firstMatchingOverload.method;
|
||||
}
|
||||
}
|
||||
|
||||
if (methodToExecute == null)
|
||||
{
|
||||
var firstMethod = methods.FirstOrDefault();
|
||||
// NH: this is to ensure that it's always the correct one being chosen when using the LINQ extension methods
|
||||
if (methods.Count() > 1)
|
||||
{
|
||||
var firstGenericMethod = methods.FirstOrDefault(x => x.IsGenericMethodDefinition);
|
||||
if (firstGenericMethod != null)
|
||||
{
|
||||
firstMethod = firstGenericMethod;
|
||||
}
|
||||
}
|
||||
//Given the args, lets get the types and compare the type sequence to try and find the correct overload
|
||||
var argTypes = args.Select(o =>
|
||||
{
|
||||
var oe = (o as Expression);
|
||||
return oe != null ? oe.Type : o.GetType();
|
||||
});
|
||||
|
||||
var methodsWithArgTypes = methods.Select(method => new
|
||||
{
|
||||
method,
|
||||
//skip the first arg because that is the extension method type ('this') that we are looking for
|
||||
types = method.GetParameters().Select(pi => pi.ParameterType).Skip(1)
|
||||
});
|
||||
|
||||
//This type comparer will check
|
||||
var typeComparer = new DelegateEqualityComparer<Type>(
|
||||
//Checks if the argument type passed in can be assigned from the parameter type in the method. For
|
||||
// example, if the argument type is HtmlHelper<MyModel> but the method parameter type is HtmlHelper then
|
||||
// it will match because the argument is assignable to that parameter type and will be able to execute
|
||||
TypeHelper.IsTypeAssignableFrom,
|
||||
//This will not ever execute but if it does we need to get the hash code of the string because the hash
|
||||
// code of a type is random
|
||||
type => type.FullName.GetHashCode());
|
||||
|
||||
var firstMatchingOverload = methodsWithArgTypes
|
||||
.FirstOrDefault(m => m.types.SequenceEqual(argTypes, typeComparer));
|
||||
|
||||
if (firstMatchingOverload != null)
|
||||
{
|
||||
methodToExecute = firstMatchingOverload.method;
|
||||
}
|
||||
|
||||
if (firstMethod != null)
|
||||
{
|
||||
if (firstMethod.IsGenericMethodDefinition)
|
||||
{
|
||||
if (genericType != null)
|
||||
{
|
||||
methodToExecute = firstMethod.MakeGenericMethod(genericType);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
methodToExecute = firstMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
return methodToExecute;
|
||||
}
|
||||
|
||||
public static MethodInfo FindExtensionMethod(Type thisType, object[] args, string name, bool argsContainsThis)
|
||||
public static MethodInfo FindExtensionMethod(IRuntimeCacheProvider runtimeCache, Type thisType, object[] args, string name, bool argsContainsThis)
|
||||
{
|
||||
Type genericType = null;
|
||||
if (thisType.IsGenericType)
|
||||
{
|
||||
genericType = thisType.GetGenericArguments()[0];
|
||||
}
|
||||
}
|
||||
|
||||
var methods = GetAllExtensionMethods(thisType, name, args.Length, argsContainsThis).ToArray();
|
||||
return DetermineMethodFromParams(methods, genericType, args);
|
||||
args = args
|
||||
//if the args contains 'this', remove the first one since that is 'this' and we don't want to use
|
||||
//that in the method searching
|
||||
.Skip(argsContainsThis ? 1 : 0)
|
||||
.ToArray();
|
||||
|
||||
var methods = GetAllExtensionMethods(runtimeCache, thisType, name, args.Length).ToArray();
|
||||
|
||||
return DetermineMethodFromParams(methods, genericType, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Umbraco.Core.Dynamics
|
||||
foreach (string prop in props)
|
||||
{
|
||||
// use reflection (not ComponentModel) to mirror LINQ
|
||||
PropertyInfo pi = type.GetProperty(prop);
|
||||
PropertyInfo pi = type.GetProperty(prop, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance);
|
||||
expr = Expression.Property(expr, pi);
|
||||
type = pi.PropertyType;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Umbraco.Core
|
||||
/// <remarks>
|
||||
/// Taken from http://damieng.com/blog/2010/10/17/enums-better-syntax-improved-performance-and-tryparse-in-net-3-5
|
||||
/// </remarks>
|
||||
internal static class Enum<T> where T : struct
|
||||
public static class Enum<T> where T : struct
|
||||
{
|
||||
private static readonly IEnumerable<T> All = Enum.GetValues(typeof(T)).Cast<T>();
|
||||
private static readonly Dictionary<string, T> InsensitiveNames = All.ToDictionary(k => Enum.GetName(typeof(T), k).ToLowerInvariant());
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Umbraco.Core.Events
|
||||
/// <param name="canCancel"></param>
|
||||
public DeleteEventArgs(IEnumerable<TEntity> eventObject, bool canCancel) : base(eventObject, canCancel)
|
||||
{
|
||||
MediaFilesToDelete = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -19,6 +20,7 @@ namespace Umbraco.Core.Events
|
||||
/// <param name="eventObject"></param>
|
||||
public DeleteEventArgs(IEnumerable<TEntity> eventObject) : base(eventObject)
|
||||
{
|
||||
MediaFilesToDelete = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -28,6 +30,7 @@ namespace Umbraco.Core.Events
|
||||
public DeleteEventArgs(TEntity eventObject)
|
||||
: base(new List<TEntity> { eventObject })
|
||||
{
|
||||
MediaFilesToDelete = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -38,6 +41,7 @@ namespace Umbraco.Core.Events
|
||||
public DeleteEventArgs(TEntity eventObject, bool canCancel)
|
||||
: base(new List<TEntity> { eventObject }, canCancel)
|
||||
{
|
||||
MediaFilesToDelete = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -46,7 +50,12 @@ namespace Umbraco.Core.Events
|
||||
public IEnumerable<TEntity> DeletedEntities
|
||||
{
|
||||
get { return EventObject; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A list of media files that can be added to during a deleted operation for which Umbraco will ensure are removed
|
||||
/// </summary>
|
||||
public List<string> MediaFilesToDelete { get; private set; }
|
||||
}
|
||||
|
||||
public class DeleteEventArgs : CancellableEventArgs
|
||||
|
||||
@@ -1,10 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core.Events
|
||||
{
|
||||
public class RecycleBinEventArgs : CancellableEventArgs
|
||||
{
|
||||
public RecycleBinEventArgs(Guid nodeObjectType, Dictionary<int, IEnumerable<Property>> allPropertyData, bool emptiedSuccessfully)
|
||||
: base(false)
|
||||
{
|
||||
AllPropertyData = allPropertyData;
|
||||
NodeObjectType = nodeObjectType;
|
||||
Ids = AllPropertyData.Select(x => x.Key);
|
||||
RecycleBinEmptiedSuccessfully = emptiedSuccessfully;
|
||||
Files = new List<string>();
|
||||
}
|
||||
|
||||
public RecycleBinEventArgs(Guid nodeObjectType, Dictionary<int, IEnumerable<Property>> allPropertyData)
|
||||
: base(true)
|
||||
{
|
||||
AllPropertyData = allPropertyData;
|
||||
NodeObjectType = nodeObjectType;
|
||||
Ids = AllPropertyData.Select(x => x.Key);
|
||||
Files = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Backwards compatibility constructor
|
||||
/// </summary>
|
||||
/// <param name="nodeObjectType"></param>
|
||||
/// <param name="allPropertyData"></param>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="emptiedSuccessfully"></param>
|
||||
internal RecycleBinEventArgs(Guid nodeObjectType, Dictionary<int, IEnumerable<Property>> allPropertyData, List<string> files, bool emptiedSuccessfully)
|
||||
: base(false)
|
||||
{
|
||||
AllPropertyData = allPropertyData;
|
||||
NodeObjectType = nodeObjectType;
|
||||
Ids = AllPropertyData.Select(x => x.Key);
|
||||
RecycleBinEmptiedSuccessfully = emptiedSuccessfully;
|
||||
Files = files;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Backwards compatibility constructor
|
||||
/// </summary>
|
||||
/// <param name="nodeObjectType"></param>
|
||||
/// <param name="allPropertyData"></param>
|
||||
/// <param name="files"></param>
|
||||
internal RecycleBinEventArgs(Guid nodeObjectType, Dictionary<int, IEnumerable<Property>> allPropertyData, List<string> files)
|
||||
: base(true)
|
||||
{
|
||||
AllPropertyData = allPropertyData;
|
||||
NodeObjectType = nodeObjectType;
|
||||
Ids = AllPropertyData.Select(x => x.Key);
|
||||
Files = files;
|
||||
}
|
||||
|
||||
[Obsolete("Use the other ctor that specifies all property data instead")]
|
||||
public RecycleBinEventArgs(Guid nodeObjectType, IEnumerable<int> ids, List<string> files, bool emptiedSuccessfully)
|
||||
: base(false)
|
||||
{
|
||||
@@ -14,6 +68,7 @@ namespace Umbraco.Core.Events
|
||||
RecycleBinEmptiedSuccessfully = emptiedSuccessfully;
|
||||
}
|
||||
|
||||
[Obsolete("Use the other ctor that specifies all property data instead")]
|
||||
public RecycleBinEventArgs(Guid nodeObjectType, IEnumerable<int> ids, List<string> files)
|
||||
: base(true)
|
||||
{
|
||||
@@ -37,8 +92,16 @@ namespace Umbraco.Core.Events
|
||||
/// Gets the list of Files that should be deleted as part
|
||||
/// of emptying the Recycle Bin.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This list can be appended to during an event handling operation, generally this is done based on the property data contained in these event args
|
||||
/// </remarks>
|
||||
public List<string> Files { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of all property data associated with a content id
|
||||
/// </summary>
|
||||
public Dictionary<int, IEnumerable<Property>> AllPropertyData { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Boolean indicating whether the Recycle Bin was emptied successfully
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Exceptions
|
||||
{
|
||||
public class InvalidCompositionException : Exception
|
||||
{
|
||||
public string ContentTypeAlias { get; set; }
|
||||
|
||||
public string AddedCompositionAlias { get; set; }
|
||||
|
||||
public string PropertyTypeAlias { get; set; }
|
||||
|
||||
public override string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format(
|
||||
"InvalidCompositionException - ContentType with alias '{0}' was added as a Compsition to ContentType with alias '{1}', " +
|
||||
"but there was a conflict on the PropertyType alias '{2}'. " +
|
||||
"PropertyTypes must have a unique alias across all Compositions in order to compose a valid ContentType Composition.",
|
||||
AddedCompositionAlias, ContentTypeAlias, PropertyTypeAlias);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,51 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace Umbraco.Core.IO
|
||||
{
|
||||
{
|
||||
public static class FileSystemExtensions
|
||||
{
|
||||
public static long GetSize(this IFileSystem fs, string path)
|
||||
{
|
||||
using (var s = fs.OpenFile(path))
|
||||
{
|
||||
var size = s.Length;
|
||||
s.Close();
|
||||
|
||||
return size;
|
||||
/// <summary>
|
||||
/// Attempts to open the file at <code>filePath</code> up to <code>maxRetries</code> times,
|
||||
/// with a thread sleep time of <code>sleepPerRetryInMilliseconds</code> between retries.
|
||||
/// </summary>
|
||||
public static FileStream OpenReadWithRetry(this FileInfo file, int maxRetries = 5, int sleepPerRetryInMilliseconds = 50)
|
||||
{
|
||||
var retries = maxRetries;
|
||||
|
||||
while (retries > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
return File.OpenRead(file.FullName);
|
||||
}
|
||||
catch(IOException)
|
||||
{
|
||||
retries--;
|
||||
|
||||
if (retries == 0)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
Thread.Sleep(sleepPerRetryInMilliseconds);
|
||||
}
|
||||
}
|
||||
|
||||
throw new ArgumentException("Retries must be greater than zero");
|
||||
}
|
||||
|
||||
public static long GetSize(this IFileSystem fs, string path)
|
||||
{
|
||||
using (var file = fs.OpenFile(path))
|
||||
{
|
||||
using (var sr = new StreamReader(file))
|
||||
{
|
||||
var str = sr.ReadToEnd();
|
||||
return str.Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,14 +58,14 @@ namespace Umbraco.Core.IO
|
||||
}
|
||||
|
||||
public static string GetExtension(this IFileSystem fs, string path)
|
||||
{
|
||||
return Path.GetExtension(fs.GetFullPath(path));
|
||||
}
|
||||
{
|
||||
return Path.GetExtension(fs.GetFullPath(path));
|
||||
}
|
||||
|
||||
public static string GetFileName(this IFileSystem fs, string path)
|
||||
{
|
||||
return Path.GetFileName(fs.GetFullPath(path));
|
||||
}
|
||||
{
|
||||
return Path.GetFileName(fs.GetFullPath(path));
|
||||
}
|
||||
|
||||
//TODO: Currently this is the only way to do this
|
||||
internal static void CreateFolder(this IFileSystem fs, string folderPath)
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.IO;
|
||||
namespace Umbraco.Core.IO
|
||||
{
|
||||
//TODO: There is no way to create a directory here without creating a file in a directory and then deleting it
|
||||
//TODO: Should probably implement a rename?
|
||||
|
||||
public interface IFileSystem
|
||||
{
|
||||
@@ -15,8 +16,7 @@ namespace Umbraco.Core.IO
|
||||
void DeleteDirectory(string path, bool recursive);
|
||||
|
||||
bool DirectoryExists(string path);
|
||||
|
||||
|
||||
|
||||
void AddFile(string path, Stream stream);
|
||||
|
||||
void AddFile(string path, Stream stream, bool overrideIfExists);
|
||||
|
||||
@@ -90,15 +90,17 @@ namespace Umbraco.Core.IO
|
||||
|
||||
public void AddFile(string path, Stream stream, bool overrideIfExists)
|
||||
{
|
||||
var exists = FileExists(path);
|
||||
var fsRelativePath = GetRelativePath(path);
|
||||
|
||||
var exists = FileExists(fsRelativePath);
|
||||
if (exists && overrideIfExists == false) throw new InvalidOperationException(string.Format("A file at path '{0}' already exists", path));
|
||||
|
||||
EnsureDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
EnsureDirectory(Path.GetDirectoryName(fsRelativePath));
|
||||
|
||||
if (stream.CanSeek)
|
||||
stream.Seek(0, 0);
|
||||
|
||||
using (var destination = (Stream)File.Create(GetFullPath(path)))
|
||||
using (var destination = (Stream)File.Create(GetFullPath(fsRelativePath)))
|
||||
stream.CopyTo(destination);
|
||||
}
|
||||
|
||||
@@ -109,12 +111,14 @@ namespace Umbraco.Core.IO
|
||||
|
||||
public IEnumerable<string> GetFiles(string path, string filter)
|
||||
{
|
||||
path = EnsureTrailingSeparator(GetFullPath(path));
|
||||
var fsRelativePath = GetRelativePath(path);
|
||||
|
||||
var fullPath = EnsureTrailingSeparator(GetFullPath(fsRelativePath));
|
||||
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(path))
|
||||
return Directory.EnumerateFiles(path, filter).Select(GetRelativePath);
|
||||
if (Directory.Exists(fullPath))
|
||||
return Directory.EnumerateFiles(fullPath, filter).Select(GetRelativePath);
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
@@ -167,6 +171,12 @@ namespace Umbraco.Core.IO
|
||||
|
||||
public string GetFullPath(string path)
|
||||
{
|
||||
//if the path starts with a '/' then it's most likely not a FS relative path which is required so convert it
|
||||
if (path.StartsWith("/"))
|
||||
{
|
||||
path = GetRelativePath(path);
|
||||
}
|
||||
|
||||
return !path.StartsWith(RootPath)
|
||||
? Path.Combine(RootPath, path)
|
||||
: path;
|
||||
|
||||
@@ -154,12 +154,8 @@ namespace Umbraco.Core.IO
|
||||
EnsureFileSupportsResizing();
|
||||
|
||||
using (var fs = _fs.OpenFile(Path))
|
||||
using (var image = Image.FromStream(fs))
|
||||
{
|
||||
|
||||
var fileWidth = image.Width;
|
||||
var fileHeight = image.Height;
|
||||
_size = new Size(fileWidth, fileHeight);
|
||||
_size = ImageHelper.GetDimensions(fs);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Umbraco.Core
|
||||
/// <summary>
|
||||
/// Helper class for mandating values, for example on method parameters.
|
||||
/// </summary>
|
||||
internal static class Mandate
|
||||
public static class Mandate
|
||||
{
|
||||
/// <summary>
|
||||
/// Mandates that the specified parameter is not null.
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Umbraco.Core.Manifest
|
||||
public IEnumerable<PackageManifest> GetManifests()
|
||||
{
|
||||
//get all Manifest.js files in the appropriate folders
|
||||
var manifestFileContents = GetAllManfifestFileContents(_pluginsDir);
|
||||
var manifestFileContents = GetAllManifestFileContents(_pluginsDir);
|
||||
return CreateManifests(manifestFileContents.ToArray());
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Umbraco.Core.Manifest
|
||||
/// </summary>
|
||||
/// <param name="currDir"></param>
|
||||
/// <returns></returns>
|
||||
private IEnumerable<string> GetAllManfifestFileContents(DirectoryInfo currDir)
|
||||
private IEnumerable<string> GetAllManifestFileContents(DirectoryInfo currDir)
|
||||
{
|
||||
var depth = FolderDepth(_pluginsDir, currDir);
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Umbraco.Core.Manifest
|
||||
var result = new List<string>();
|
||||
foreach (var d in dirs)
|
||||
{
|
||||
result.AddRange(GetAllManfifestFileContents(d));
|
||||
result.AddRange(GetAllManifestFileContents(d));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,405 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Media.Exif
|
||||
{
|
||||
/// <summary>
|
||||
/// An endian-aware converter for converting between base data types
|
||||
/// and an array of bytes.
|
||||
/// </summary>
|
||||
internal class BitConverterEx
|
||||
{
|
||||
#region Public Enums
|
||||
/// <summary>
|
||||
/// Represents the byte order.
|
||||
/// </summary>
|
||||
public enum ByteOrder
|
||||
{
|
||||
LittleEndian = 1,
|
||||
BigEndian = 2,
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Member Variables
|
||||
private ByteOrder mFrom, mTo;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public BitConverterEx(ByteOrder from, ByteOrder to)
|
||||
{
|
||||
mFrom = from;
|
||||
mTo = to;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Indicates the byte order in which data is stored in this platform.
|
||||
/// </summary>
|
||||
public static ByteOrder SystemByteOrder
|
||||
{
|
||||
get
|
||||
{
|
||||
return (BitConverter.IsLittleEndian ? ByteOrder.LittleEndian : ByteOrder.BigEndian);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Predefined Values
|
||||
/// <summary>
|
||||
/// Returns a bit converter that converts between little-endian and system byte-order.
|
||||
/// </summary>
|
||||
public static BitConverterEx LittleEndian
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BitConverterEx(ByteOrder.LittleEndian, BitConverterEx.SystemByteOrder);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a bit converter that converts between big-endian and system byte-order.
|
||||
/// </summary>
|
||||
public static BitConverterEx BigEndian
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BitConverterEx(ByteOrder.BigEndian, BitConverterEx.SystemByteOrder);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a bit converter that does not do any byte-order conversion.
|
||||
/// </summary>
|
||||
public static BitConverterEx SystemEndian
|
||||
{
|
||||
get
|
||||
{
|
||||
return new BitConverterEx(BitConverterEx.SystemByteOrder, BitConverterEx.SystemByteOrder);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Static Methods
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a Unicode character.
|
||||
/// </summary>
|
||||
public static char ToChar(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = CheckData(value, startIndex, 2, from, to);
|
||||
return BitConverter.ToChar(data, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 16-bit unsigned integer.
|
||||
/// </summary>
|
||||
public static ushort ToUInt16(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = CheckData(value, startIndex, 2, from, to);
|
||||
return BitConverter.ToUInt16(data, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 32-bit unsigned integer.
|
||||
/// </summary>
|
||||
public static uint ToUInt32(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = CheckData(value, startIndex, 4, from, to);
|
||||
return BitConverter.ToUInt32(data, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 64-bit unsigned integer.
|
||||
/// </summary>
|
||||
public static ulong ToUInt64(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = CheckData(value, startIndex, 8, from, to);
|
||||
return BitConverter.ToUInt64(data, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 16-bit signed integer.
|
||||
/// </summary>
|
||||
public static short ToInt16(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = CheckData(value, startIndex, 2, from, to);
|
||||
return BitConverter.ToInt16(data, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 32-bit signed integer.
|
||||
/// </summary>
|
||||
public static int ToInt32(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = CheckData(value, startIndex, 4, from, to);
|
||||
return BitConverter.ToInt32(data, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 64-bit signed integer.
|
||||
/// </summary>
|
||||
public static long ToInt64(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = CheckData(value, startIndex, 8, from, to);
|
||||
return BitConverter.ToInt64(data, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a single precision floating number.
|
||||
/// </summary>
|
||||
public static float ToSingle(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = CheckData(value, startIndex, 4, from, to);
|
||||
return BitConverter.ToSingle(data, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a double precision floating number.
|
||||
/// </summary>
|
||||
public static double ToDouble(byte[] value, long startIndex, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = CheckData(value, startIndex, 8, from, to);
|
||||
return BitConverter.ToDouble(data, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 16-bit unsigned integer to an array of bytes.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(ushort value, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(value);
|
||||
data = CheckData(data, from, to);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 32-bit unsigned integer to an array of bytes.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(uint value, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(value);
|
||||
data = CheckData(data, from, to);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 64-bit unsigned integer to an array of bytes.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(ulong value, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(value);
|
||||
data = CheckData(data, from, to);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 16-bit signed integer to an array of bytes.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(short value, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(value);
|
||||
data = CheckData(data, from, to);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 32-bit signed integer to an array of bytes.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int value, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(value);
|
||||
data = CheckData(data, from, to);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 64-bit signed integer to an array of bytes.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(long value, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(value);
|
||||
data = CheckData(data, from, to);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given single precision floating-point number to an array of bytes.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(float value, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(value);
|
||||
data = CheckData(data, from, to);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given double precision floating-point number to an array of bytes.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(double value, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(value);
|
||||
data = CheckData(data, from, to);
|
||||
return data;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Instance Methods
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 16-bit unsigned integer.
|
||||
/// </summary>
|
||||
public char ToChar(byte[] value, long startIndex)
|
||||
{
|
||||
return BitConverterEx.ToChar(value, startIndex, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 16-bit unsigned integer.
|
||||
/// </summary>
|
||||
public ushort ToUInt16(byte[] value, long startIndex)
|
||||
{
|
||||
return BitConverterEx.ToUInt16(value, startIndex, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 32-bit unsigned integer.
|
||||
/// </summary>
|
||||
public uint ToUInt32(byte[] value, long startIndex)
|
||||
{
|
||||
return BitConverterEx.ToUInt32(value, startIndex, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 64-bit unsigned integer.
|
||||
/// </summary>
|
||||
public ulong ToUInt64(byte[] value, long startIndex)
|
||||
{
|
||||
return BitConverterEx.ToUInt64(value, startIndex, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 16-bit signed integer.
|
||||
/// </summary>
|
||||
public short ToInt16(byte[] value, long startIndex)
|
||||
{
|
||||
return BitConverterEx.ToInt16(value, startIndex, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 32-bit signed integer.
|
||||
/// </summary>
|
||||
public int ToInt32(byte[] value, long startIndex)
|
||||
{
|
||||
return BitConverterEx.ToInt32(value, startIndex, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a 64-bit signed integer.
|
||||
/// </summary>
|
||||
public long ToInt64(byte[] value, long startIndex)
|
||||
{
|
||||
return BitConverterEx.ToInt64(value, startIndex, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a single precision floating number.
|
||||
/// </summary>
|
||||
public float ToSingle(byte[] value, long startIndex)
|
||||
{
|
||||
return BitConverterEx.ToSingle(value, startIndex, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of bytes to a double precision floating number.
|
||||
/// </summary>
|
||||
public double ToDouble(byte[] value, long startIndex)
|
||||
{
|
||||
return BitConverterEx.ToDouble(value, startIndex, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 16-bit unsigned integer to an array of bytes.
|
||||
/// </summary>
|
||||
public byte[] GetBytes(ushort value)
|
||||
{
|
||||
return BitConverterEx.GetBytes(value, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 32-bit unsigned integer to an array of bytes.
|
||||
/// </summary>
|
||||
public byte[] GetBytes(uint value)
|
||||
{
|
||||
return BitConverterEx.GetBytes(value, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 64-bit unsigned integer to an array of bytes.
|
||||
/// </summary>
|
||||
public byte[] GetBytes(ulong value)
|
||||
{
|
||||
return BitConverterEx.GetBytes(value, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 16-bit signed integer to an array of bytes.
|
||||
/// </summary>
|
||||
public byte[] GetBytes(short value)
|
||||
{
|
||||
return BitConverterEx.GetBytes(value, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 32-bit signed integer to an array of bytes.
|
||||
/// </summary>
|
||||
public byte[] GetBytes(int value)
|
||||
{
|
||||
return BitConverterEx.GetBytes(value, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given 64-bit signed integer to an array of bytes.
|
||||
/// </summary>
|
||||
public byte[] GetBytes(long value)
|
||||
{
|
||||
return BitConverterEx.GetBytes(value, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given single precision floating-point number to an array of bytes.
|
||||
/// </summary>
|
||||
public byte[] GetBytes(float value)
|
||||
{
|
||||
return BitConverterEx.GetBytes(value, mFrom, mTo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given double precision floating-point number to an array of bytes.
|
||||
/// </summary>
|
||||
public byte[] GetBytes(double value)
|
||||
{
|
||||
return BitConverterEx.GetBytes(value, mFrom, mTo);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Helpers
|
||||
/// <summary>
|
||||
/// Reverse the array of bytes as needed.
|
||||
/// </summary>
|
||||
private static byte[] CheckData(byte[] value, long startIndex, long length, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
byte[] data = new byte[length];
|
||||
Array.Copy(value, startIndex, data, 0, length);
|
||||
if (from != to)
|
||||
Array.Reverse(data);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reverse the array of bytes as needed.
|
||||
/// </summary>
|
||||
private static byte[] CheckData(byte[] value, ByteOrder from, ByteOrder to)
|
||||
{
|
||||
return CheckData(value, 0, value.Length, from, to);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,357 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace Umbraco.Core.Media.Exif
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts between exif data types and array of bytes.
|
||||
/// </summary>
|
||||
internal class ExifBitConverter : BitConverterEx
|
||||
{
|
||||
#region Constructors
|
||||
public ExifBitConverter(ByteOrder from, ByteOrder to)
|
||||
: base(from, to)
|
||||
{
|
||||
;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Static Methods
|
||||
/// <summary>
|
||||
/// Returns an ASCII string converted from the given byte array.
|
||||
/// </summary>
|
||||
public static string ToAscii(byte[] data, bool endatfirstnull, Encoding encoding)
|
||||
{
|
||||
int len = data.Length;
|
||||
if (endatfirstnull)
|
||||
{
|
||||
len = Array.IndexOf(data, (byte)0);
|
||||
if (len == -1) len = data.Length;
|
||||
}
|
||||
return encoding.GetString(data, 0, len);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an ASCII string converted from the given byte array.
|
||||
/// </summary>
|
||||
public static string ToAscii(byte[] data, Encoding encoding)
|
||||
{
|
||||
return ToAscii(data, true, encoding);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string converted from the given byte array.
|
||||
/// from the numeric value of each byte.
|
||||
/// </summary>
|
||||
public static string ToString(byte[] data)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (byte b in data)
|
||||
sb.Append(b);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a DateTime object converted from the given byte array.
|
||||
/// </summary>
|
||||
public static DateTime ToDateTime(byte[] data, bool hastime)
|
||||
{
|
||||
string str = ToAscii(data, Encoding.ASCII);
|
||||
string[] parts = str.Split(new char[] { ':', ' ' });
|
||||
try
|
||||
{
|
||||
if (hastime && parts.Length == 6)
|
||||
{
|
||||
// yyyy:MM:dd HH:mm:ss
|
||||
// This is the expected format though some cameras
|
||||
// can use single digits. See Issue 21.
|
||||
return new DateTime(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]), int.Parse(parts[4]), int.Parse(parts[5]));
|
||||
}
|
||||
else if (!hastime && parts.Length == 3)
|
||||
{
|
||||
// yyyy:MM:dd
|
||||
return new DateTime(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]));
|
||||
}
|
||||
else
|
||||
{
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
catch (ArgumentOutOfRangeException)
|
||||
{
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a DateTime object converted from the given byte array.
|
||||
/// </summary>
|
||||
public static DateTime ToDateTime(byte[] data)
|
||||
{
|
||||
return ToDateTime(data, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an unsigned rational number converted from the first
|
||||
/// eight bytes of the given byte array. The first four bytes are
|
||||
/// assumed to be the numerator and the next four bytes are the
|
||||
/// denumerator.
|
||||
/// Numbers are converted from the given byte-order to platform byte-order.
|
||||
/// </summary>
|
||||
public static MathEx.UFraction32 ToURational(byte[] data, ByteOrder frombyteorder)
|
||||
{
|
||||
byte[] num = new byte[4];
|
||||
byte[] den = new byte[4];
|
||||
Array.Copy(data, 0, num, 0, 4);
|
||||
Array.Copy(data, 4, den, 0, 4);
|
||||
return new MathEx.UFraction32(ToUInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder), ToUInt32(den, 0, frombyteorder, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a signed rational number converted from the first
|
||||
/// eight bytes of the given byte array. The first four bytes are
|
||||
/// assumed to be the numerator and the next four bytes are the
|
||||
/// denumerator.
|
||||
/// Numbers are converted from the given byte-order to platform byte-order.
|
||||
/// </summary>
|
||||
public static MathEx.Fraction32 ToSRational(byte[] data, ByteOrder frombyteorder)
|
||||
{
|
||||
byte[] num = new byte[4];
|
||||
byte[] den = new byte[4];
|
||||
Array.Copy(data, 0, num, 0, 4);
|
||||
Array.Copy(data, 4, den, 0, 4);
|
||||
return new MathEx.Fraction32(ToInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder), ToInt32(den, 0, frombyteorder, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an array of 16-bit unsigned integers converted from
|
||||
/// the given byte array.
|
||||
/// Numbers are converted from the given byte-order to platform byte-order.
|
||||
/// </summary>
|
||||
public static ushort[] ToUShortArray(byte[] data, int count, ByteOrder frombyteorder)
|
||||
{
|
||||
ushort[] numbers = new ushort[count];
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
byte[] num = new byte[2];
|
||||
Array.Copy(data, i * 2, num, 0, 2);
|
||||
numbers[i] = ToUInt16(num, 0, frombyteorder, BitConverterEx.SystemByteOrder);
|
||||
}
|
||||
return numbers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an array of 32-bit unsigned integers converted from
|
||||
/// the given byte array.
|
||||
/// Numbers are converted from the given byte-order to platform byte-order.
|
||||
/// </summary>
|
||||
public static uint[] ToUIntArray(byte[] data, int count, ByteOrder frombyteorder)
|
||||
{
|
||||
uint[] numbers = new uint[count];
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
byte[] num = new byte[4];
|
||||
Array.Copy(data, i * 4, num, 0, 4);
|
||||
numbers[i] = ToUInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder);
|
||||
}
|
||||
return numbers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an array of 32-bit signed integers converted from
|
||||
/// the given byte array.
|
||||
/// Numbers are converted from the given byte-order to platform byte-order.
|
||||
/// </summary>
|
||||
public static int[] ToSIntArray(byte[] data, int count, ByteOrder byteorder)
|
||||
{
|
||||
int[] numbers = new int[count];
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
byte[] num = new byte[4];
|
||||
Array.Copy(data, i * 4, num, 0, 4);
|
||||
numbers[i] = ToInt32(num, 0, byteorder, BitConverterEx.SystemByteOrder);
|
||||
}
|
||||
return numbers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an array of unsigned rational numbers converted from
|
||||
/// the given byte array.
|
||||
/// Numbers are converted from the given byte-order to platform byte-order.
|
||||
/// </summary>
|
||||
public static MathEx.UFraction32[] ToURationalArray(byte[] data, int count, ByteOrder frombyteorder)
|
||||
{
|
||||
MathEx.UFraction32[] numbers = new MathEx.UFraction32[count];
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
byte[] num = new byte[4];
|
||||
byte[] den = new byte[4];
|
||||
Array.Copy(data, i * 8, num, 0, 4);
|
||||
Array.Copy(data, i * 8 + 4, den, 0, 4);
|
||||
numbers[i].Set(ToUInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder), ToUInt32(den, 0, frombyteorder, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
return numbers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an array of signed rational numbers converted from
|
||||
/// the given byte array.
|
||||
/// Numbers are converted from the given byte-order to platform byte-order.
|
||||
/// </summary>
|
||||
public static MathEx.Fraction32[] ToSRationalArray(byte[] data, int count, ByteOrder frombyteorder)
|
||||
{
|
||||
MathEx.Fraction32[] numbers = new MathEx.Fraction32[count];
|
||||
for (uint i = 0; i < count; i++)
|
||||
{
|
||||
byte[] num = new byte[4];
|
||||
byte[] den = new byte[4];
|
||||
Array.Copy(data, i * 8, num, 0, 4);
|
||||
Array.Copy(data, i * 8 + 4, den, 0, 4);
|
||||
numbers[i].Set(ToInt32(num, 0, frombyteorder, BitConverterEx.SystemByteOrder), ToInt32(den, 0, frombyteorder, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
return numbers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given ascii string to an array of bytes optionally adding a null terminator.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(string value, bool addnull, Encoding encoding)
|
||||
{
|
||||
if (addnull) value += '\0';
|
||||
return encoding.GetBytes(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given ascii string to an array of bytes without adding a null terminator.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(string value, Encoding encoding)
|
||||
{
|
||||
return GetBytes(value, false, encoding);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given datetime to an array of bytes with a null terminator.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(DateTime value, bool hastime)
|
||||
{
|
||||
string str = "";
|
||||
if (hastime)
|
||||
str = value.ToString("yyyy:MM:dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
|
||||
else
|
||||
str = value.ToString("yyyy:MM:dd", System.Globalization.CultureInfo.InvariantCulture);
|
||||
return GetBytes(str, true, Encoding.ASCII);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given unsigned rational number to an array of bytes.
|
||||
/// Numbers are converted from the platform byte-order to the given byte-order.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(MathEx.UFraction32 value, ByteOrder tobyteorder)
|
||||
{
|
||||
byte[] num = GetBytes(value.Numerator, BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
byte[] den = GetBytes(value.Denominator, BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
byte[] data = new byte[8];
|
||||
Array.Copy(num, 0, data, 0, 4);
|
||||
Array.Copy(den, 0, data, 4, 4);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given signed rational number to an array of bytes.
|
||||
/// Numbers are converted from the platform byte-order to the given byte-order.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(MathEx.Fraction32 value, ByteOrder tobyteorder)
|
||||
{
|
||||
byte[] num = GetBytes(value.Numerator, BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
byte[] den = GetBytes(value.Denominator, BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
byte[] data = new byte[8];
|
||||
Array.Copy(num, 0, data, 0, 4);
|
||||
Array.Copy(den, 0, data, 4, 4);
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of 16-bit unsigned integers to an array of bytes.
|
||||
/// Numbers are converted from the platform byte-order to the given byte-order.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(ushort[] value, ByteOrder tobyteorder)
|
||||
{
|
||||
byte[] data = new byte[2 * value.Length];
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
byte[] num = GetBytes(value[i], BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
Array.Copy(num, 0, data, i * 2, 2);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of 32-bit unsigned integers to an array of bytes.
|
||||
/// Numbers are converted from the platform byte-order to the given byte-order.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(uint[] value, ByteOrder tobyteorder)
|
||||
{
|
||||
byte[] data = new byte[4 * value.Length];
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
byte[] num = GetBytes(value[i], BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
Array.Copy(num, 0, data, i * 4, 4);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of 32-bit signed integers to an array of bytes.
|
||||
/// Numbers are converted from the platform byte-order to the given byte-order.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int[] value, ByteOrder tobyteorder)
|
||||
{
|
||||
byte[] data = new byte[4 * value.Length];
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
byte[] num = GetBytes(value[i], BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
Array.Copy(num, 0, data, i * 4, 4);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of unsigned rationals to an array of bytes.
|
||||
/// Numbers are converted from the platform byte-order to the given byte-order.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(MathEx.UFraction32[] value, ByteOrder tobyteorder)
|
||||
{
|
||||
byte[] data = new byte[8 * value.Length];
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
byte[] num = GetBytes(value[i].Numerator, BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
byte[] den = GetBytes(value[i].Denominator, BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
Array.Copy(num, 0, data, i * 8, 4);
|
||||
Array.Copy(den, 0, data, i * 8 + 4, 4);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the given array of signed rationals to an array of bytes.
|
||||
/// Numbers are converted from the platform byte-order to the given byte-order.
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(MathEx.Fraction32[] value, ByteOrder tobyteorder)
|
||||
{
|
||||
byte[] data = new byte[8 * value.Length];
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
byte[] num = GetBytes(value[i].Numerator, BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
byte[] den = GetBytes(value[i].Denominator, BitConverterEx.SystemByteOrder, tobyteorder);
|
||||
Array.Copy(num, 0, data, i * 8, 4);
|
||||
Array.Copy(den, 0, data, i * 8 + 4, 4);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Media.Exif
|
||||
{
|
||||
internal enum Compression : ushort
|
||||
{
|
||||
Uncompressed = 1,
|
||||
CCITT1D = 2,
|
||||
Group3Fax = 3,
|
||||
Group4Fax = 4,
|
||||
LZW = 5,
|
||||
JPEG = 6,
|
||||
PackBits = 32773,
|
||||
}
|
||||
|
||||
internal enum PhotometricInterpretation : ushort
|
||||
{
|
||||
WhiteIsZero = 0,
|
||||
BlackIsZero = 1,
|
||||
RGB = 2,
|
||||
RGBPalette = 3,
|
||||
TransparencyMask = 4,
|
||||
CMYK = 5,
|
||||
YCbCr = 6,
|
||||
CIELab = 8,
|
||||
}
|
||||
|
||||
internal enum Orientation : ushort
|
||||
{
|
||||
Normal = 1,
|
||||
MirroredVertically = 2,
|
||||
Rotated180 = 3,
|
||||
MirroredHorizontally = 4,
|
||||
RotatedLeftAndMirroredVertically = 5,
|
||||
RotatedRight = 6,
|
||||
RotatedLeft = 7,
|
||||
RotatedRightAndMirroredVertically = 8,
|
||||
}
|
||||
|
||||
internal enum PlanarConfiguration : ushort
|
||||
{
|
||||
ChunkyFormat = 1,
|
||||
PlanarFormat = 2,
|
||||
}
|
||||
|
||||
internal enum YCbCrPositioning : ushort
|
||||
{
|
||||
Centered = 1,
|
||||
CoSited = 2,
|
||||
}
|
||||
|
||||
internal enum ResolutionUnit : ushort
|
||||
{
|
||||
Inches = 2,
|
||||
Centimeters = 3,
|
||||
}
|
||||
|
||||
internal enum ColorSpace : ushort
|
||||
{
|
||||
sRGB = 1,
|
||||
Uncalibrated = 0xfff,
|
||||
}
|
||||
|
||||
internal enum ExposureProgram : ushort
|
||||
{
|
||||
NotDefined = 0,
|
||||
Manual = 1,
|
||||
Normal = 2,
|
||||
AperturePriority = 3,
|
||||
ShutterPriority = 4,
|
||||
/// <summary>
|
||||
/// Biased toward depth of field.
|
||||
/// </summary>
|
||||
Creative = 5,
|
||||
/// <summary>
|
||||
/// Biased toward fast shutter speed.
|
||||
/// </summary>
|
||||
Action = 6,
|
||||
/// <summary>
|
||||
/// For closeup photos with the background out of focus.
|
||||
/// </summary>
|
||||
Portrait = 7,
|
||||
/// <summary>
|
||||
/// For landscape photos with the background in focus.
|
||||
/// </summary>
|
||||
Landscape = 8,
|
||||
}
|
||||
|
||||
internal enum MeteringMode : ushort
|
||||
{
|
||||
Unknown = 0,
|
||||
Average = 1,
|
||||
CenterWeightedAverage = 2,
|
||||
Spot = 3,
|
||||
MultiSpot = 4,
|
||||
Pattern = 5,
|
||||
Partial = 6,
|
||||
Other = 255,
|
||||
}
|
||||
|
||||
internal enum LightSource : ushort
|
||||
{
|
||||
Unknown = 0,
|
||||
Daylight = 1,
|
||||
Fluorescent = 2,
|
||||
Tungsten = 3,
|
||||
Flash = 4,
|
||||
FineWeather = 9,
|
||||
CloudyWeather = 10,
|
||||
Shade = 11,
|
||||
/// <summary>
|
||||
/// D 5700 – 7100K
|
||||
/// </summary>
|
||||
DaylightFluorescent = 12,
|
||||
/// <summary>
|
||||
/// N 4600 – 5400K
|
||||
/// </summary>
|
||||
DayWhiteFluorescent = 13,
|
||||
/// <summary>
|
||||
/// W 3900 – 4500K
|
||||
/// </summary>
|
||||
CoolWhiteFluorescent = 14,
|
||||
/// <summary>
|
||||
/// WW 3200 – 3700K
|
||||
/// </summary>
|
||||
WhiteFluorescent = 15,
|
||||
StandardLightA = 17,
|
||||
StandardLightB = 18,
|
||||
StandardLightC = 19,
|
||||
D55 = 20,
|
||||
D65 = 21,
|
||||
D75 = 22,
|
||||
D50 = 23,
|
||||
ISOStudioTungsten = 24,
|
||||
OtherLightSource = 255,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
internal enum Flash : ushort
|
||||
{
|
||||
FlashDidNotFire = 0,
|
||||
StrobeReturnLightNotDetected = 4,
|
||||
StrobeReturnLightDetected = 2,
|
||||
FlashFired = 1,
|
||||
CompulsoryFlashMode = 8,
|
||||
AutoMode = 16,
|
||||
NoFlashFunction = 32,
|
||||
RedEyeReductionMode = 64,
|
||||
}
|
||||
|
||||
internal enum SensingMethod : ushort
|
||||
{
|
||||
NotDefined = 1,
|
||||
OneChipColorAreaSensor = 2,
|
||||
TwoChipColorAreaSensor = 3,
|
||||
ThreeChipColorAreaSensor = 4,
|
||||
ColorSequentialAreaSensor = 5,
|
||||
TriLinearSensor = 7,
|
||||
ColorSequentialLinearSensor = 8,
|
||||
}
|
||||
|
||||
internal enum FileSource : byte // UNDEFINED
|
||||
{
|
||||
DSC = 3,
|
||||
}
|
||||
|
||||
internal enum SceneType : byte // UNDEFINED
|
||||
{
|
||||
DirectlyPhotographedImage = 1,
|
||||
}
|
||||
|
||||
internal enum CustomRendered : ushort
|
||||
{
|
||||
NormalProcess = 0,
|
||||
CustomProcess = 1,
|
||||
}
|
||||
|
||||
internal enum ExposureMode : ushort
|
||||
{
|
||||
Auto = 0,
|
||||
Manual = 1,
|
||||
AutoBracket = 2,
|
||||
}
|
||||
|
||||
internal enum WhiteBalance : ushort
|
||||
{
|
||||
Auto = 0,
|
||||
Manual = 1,
|
||||
}
|
||||
|
||||
internal enum SceneCaptureType : ushort
|
||||
{
|
||||
Standard = 0,
|
||||
Landscape = 1,
|
||||
Portrait = 2,
|
||||
NightScene = 3,
|
||||
}
|
||||
|
||||
internal enum GainControl : ushort
|
||||
{
|
||||
None = 0,
|
||||
LowGainUp = 1,
|
||||
HighGainUp = 2,
|
||||
LowGainDown = 3,
|
||||
HighGainDown = 4,
|
||||
}
|
||||
|
||||
internal enum Contrast : ushort
|
||||
{
|
||||
Normal = 0,
|
||||
Soft = 1,
|
||||
Hard = 2,
|
||||
}
|
||||
|
||||
internal enum Saturation : ushort
|
||||
{
|
||||
Normal = 0,
|
||||
Low = 1,
|
||||
High = 2,
|
||||
}
|
||||
|
||||
internal enum Sharpness : ushort
|
||||
{
|
||||
Normal = 0,
|
||||
Soft = 1,
|
||||
Hard = 2,
|
||||
}
|
||||
|
||||
internal enum SubjectDistanceRange : ushort
|
||||
{
|
||||
Unknown = 0,
|
||||
Macro = 1,
|
||||
CloseView = 2,
|
||||
DistantView = 3,
|
||||
}
|
||||
|
||||
internal enum GPSLatitudeRef : byte // ASCII
|
||||
{
|
||||
North = 78, // 'N'
|
||||
South = 83, // 'S'
|
||||
}
|
||||
|
||||
internal enum GPSLongitudeRef : byte // ASCII
|
||||
{
|
||||
West = 87, // 'W'
|
||||
East = 69, // 'E'
|
||||
}
|
||||
|
||||
internal enum GPSAltitudeRef : byte
|
||||
{
|
||||
AboveSeaLevel = 0,
|
||||
BelowSeaLevel = 1,
|
||||
}
|
||||
|
||||
internal enum GPSStatus : byte // ASCII
|
||||
{
|
||||
MeasurementInProgress = 65, // 'A'
|
||||
MeasurementInteroperability = 86, // 'V'
|
||||
}
|
||||
|
||||
internal enum GPSMeasureMode : byte // ASCII
|
||||
{
|
||||
TwoDimensional = 50, // '2'
|
||||
ThreeDimensional = 51, // '3'
|
||||
}
|
||||
|
||||
internal enum GPSSpeedRef : byte // ASCII
|
||||
{
|
||||
KilometersPerHour = 75, // 'K'
|
||||
MilesPerHour = 77, // 'M'
|
||||
Knots = 78, // 'N'
|
||||
}
|
||||
|
||||
internal enum GPSDirectionRef : byte // ASCII
|
||||
{
|
||||
TrueDirection = 84, // 'T'
|
||||
MagneticDirection = 77, // 'M'
|
||||
}
|
||||
|
||||
internal enum GPSDistanceRef : byte // ASCII
|
||||
{
|
||||
Kilometers = 75, // 'K'
|
||||
Miles = 77, // 'M'
|
||||
Knots = 78, // 'N'
|
||||
}
|
||||
|
||||
internal enum GPSDifferential : ushort
|
||||
{
|
||||
MeasurementWithoutDifferentialCorrection = 0,
|
||||
DifferentialCorrectionApplied = 1,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Media.Exif
|
||||
{
|
||||
/// <summary>
|
||||
/// The exception that is thrown when the format of the JPEG/Exif file
|
||||
/// could not be understood.
|
||||
/// </summary>
|
||||
internal class NotValidExifFileException : Exception
|
||||
{
|
||||
public NotValidExifFileException()
|
||||
: base("Not a valid JPEG/Exif file.")
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public NotValidExifFileException(string message)
|
||||
: base(message)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The exception that is thrown when the IFD section ID could not be understood.
|
||||
/// </summary>
|
||||
internal class UnknownIFDSectionException : Exception
|
||||
{
|
||||
public UnknownIFDSectionException()
|
||||
: base("Unknown IFD section.")
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public UnknownIFDSectionException(string message)
|
||||
: base(message)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The exception that is thrown when an invalid enum type is given to an
|
||||
/// ExifEnumProperty.
|
||||
/// </summary>
|
||||
internal class UnknownEnumTypeException : Exception
|
||||
{
|
||||
public UnknownEnumTypeException()
|
||||
: base("Unknown enum type.")
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public UnknownEnumTypeException(string message)
|
||||
: base(message)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The exception that is thrown when the 0th IFD section does not contain any fields.
|
||||
/// </summary>
|
||||
internal class IFD0IsEmptyException : Exception
|
||||
{
|
||||
public IFD0IsEmptyException()
|
||||
: base("0th IFD section cannot be empty.")
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public IFD0IsEmptyException(string message)
|
||||
: base(message)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,373 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace Umbraco.Core.Media.Exif
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an enumerated value.
|
||||
/// </summary>
|
||||
internal class ExifEnumProperty<T> : ExifProperty
|
||||
{
|
||||
protected T mValue;
|
||||
protected bool mIsBitField;
|
||||
protected override object _Value { get { return Value; } set { Value = (T)value; } }
|
||||
public new T Value { get { return mValue; } set { mValue = value; } }
|
||||
public bool IsBitField { get { return mIsBitField; } }
|
||||
|
||||
static public implicit operator T(ExifEnumProperty<T> obj) { return (T)obj.mValue; }
|
||||
|
||||
public override string ToString() { return mValue.ToString(); }
|
||||
|
||||
public ExifEnumProperty(ExifTag tag, T value, bool isbitfield)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
mIsBitField = isbitfield;
|
||||
}
|
||||
|
||||
public ExifEnumProperty(ExifTag tag, T value)
|
||||
: this(tag, value, false)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
ushort tagid = ExifTagFactory.GetTagID(mTag);
|
||||
|
||||
Type type = typeof(T);
|
||||
Type basetype = Enum.GetUnderlyingType(type);
|
||||
|
||||
if (type == typeof(FileSource) || type == typeof(SceneType))
|
||||
{
|
||||
// UNDEFINED
|
||||
return new ExifInterOperability(tagid, 7, 1, new byte[] { (byte)((object)mValue) });
|
||||
}
|
||||
else if (type == typeof(GPSLatitudeRef) || type == typeof(GPSLongitudeRef) ||
|
||||
type == typeof(GPSStatus) || type == typeof(GPSMeasureMode) ||
|
||||
type == typeof(GPSSpeedRef) || type == typeof(GPSDirectionRef) ||
|
||||
type == typeof(GPSDistanceRef))
|
||||
{
|
||||
// ASCII
|
||||
return new ExifInterOperability(tagid, 2, 2, new byte[] { (byte)((object)mValue), 0 });
|
||||
}
|
||||
else if (basetype == typeof(byte))
|
||||
{
|
||||
// BYTE
|
||||
return new ExifInterOperability(tagid, 1, 1, new byte[] { (byte)((object)mValue) });
|
||||
}
|
||||
else if (basetype == typeof(ushort))
|
||||
{
|
||||
// SHORT
|
||||
return new ExifInterOperability(tagid, 3, 1, ExifBitConverter.GetBytes((ushort)((object)mValue), BitConverterEx.SystemByteOrder, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
else
|
||||
throw new UnknownEnumTypeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an ASCII string. (EXIF Specification: UNDEFINED) Used for the UserComment field.
|
||||
/// </summary>
|
||||
internal class ExifEncodedString : ExifProperty
|
||||
{
|
||||
protected string mValue;
|
||||
private Encoding mEncoding;
|
||||
protected override object _Value { get { return Value; } set { Value = (string)value; } }
|
||||
public new string Value { get { return mValue; } set { mValue = value; } }
|
||||
public Encoding Encoding { get { return mEncoding; } set { mEncoding = value; } }
|
||||
|
||||
static public implicit operator string(ExifEncodedString obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString() { return mValue; }
|
||||
|
||||
public ExifEncodedString(ExifTag tag, string value, Encoding encoding)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
mEncoding = encoding;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
string enc = "";
|
||||
if (mEncoding == null)
|
||||
enc = "\0\0\0\0\0\0\0\0";
|
||||
else if (mEncoding.EncodingName == "US-ASCII")
|
||||
enc = "ASCII\0\0\0";
|
||||
else if (mEncoding.EncodingName == "Japanese (JIS 0208-1990 and 0212-1990)")
|
||||
enc = "JIS\0\0\0\0\0";
|
||||
else if (mEncoding.EncodingName == "Unicode")
|
||||
enc = "Unicode\0";
|
||||
else
|
||||
enc = "\0\0\0\0\0\0\0\0";
|
||||
|
||||
byte[] benc = Encoding.ASCII.GetBytes(enc);
|
||||
byte[] bstr = (mEncoding == null ? Encoding.ASCII.GetBytes(mValue) : mEncoding.GetBytes(mValue));
|
||||
byte[] data = new byte[benc.Length + bstr.Length];
|
||||
Array.Copy(benc, 0, data, 0, benc.Length);
|
||||
Array.Copy(bstr, 0, data, benc.Length, bstr.Length);
|
||||
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, (uint)data.Length, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an ASCII string formatted as DateTime. (EXIF Specification: ASCII) Used for the date time fields.
|
||||
/// </summary>
|
||||
internal class ExifDateTime : ExifProperty
|
||||
{
|
||||
protected DateTime mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (DateTime)value; } }
|
||||
public new DateTime Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public implicit operator DateTime(ExifDateTime obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString() { return mValue.ToString("yyyy.MM.dd HH:mm:ss"); }
|
||||
|
||||
public ExifDateTime(ExifTag tag, DateTime value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 2, (uint)20, ExifBitConverter.GetBytes(mValue, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the exif version as a 4 byte ASCII string. (EXIF Specification: UNDEFINED)
|
||||
/// Used for the ExifVersion, FlashpixVersion, InteroperabilityVersion and GPSVersionID fields.
|
||||
/// </summary>
|
||||
internal class ExifVersion : ExifProperty
|
||||
{
|
||||
protected string mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (string)value; } }
|
||||
public new string Value { get { return mValue; } set { mValue = value.Substring(0, 4); } }
|
||||
|
||||
public ExifVersion(ExifTag tag, string value)
|
||||
: base(tag)
|
||||
{
|
||||
if (value.Length > 4)
|
||||
mValue = value.Substring(0, 4);
|
||||
else if (value.Length < 4)
|
||||
mValue = value + new string(' ', 4 - value.Length);
|
||||
else
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return mValue;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mTag == ExifTag.ExifVersion || mTag == ExifTag.FlashpixVersion || mTag == ExifTag.InteroperabilityVersion)
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, 4, Encoding.ASCII.GetBytes(mValue));
|
||||
else
|
||||
{
|
||||
byte[] data = new byte[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
data[i] = byte.Parse(mValue[0].ToString());
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, 4, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the location and area of the subject (EXIF Specification: 2xSHORT)
|
||||
/// The coordinate values, width, and height are expressed in relation to the
|
||||
/// upper left as origin, prior to rotation processing as per the Rotation tag.
|
||||
/// </summary>
|
||||
internal class ExifPointSubjectArea : ExifUShortArray
|
||||
{
|
||||
protected new ushort[] Value { get { return mValue; } set { mValue = value; } }
|
||||
public ushort X { get { return mValue[0]; } set { mValue[0] = value; } }
|
||||
public ushort Y { get { return mValue[1]; } set { mValue[1] = value; } }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendFormat("({0:d}, {1:d})", mValue[0], mValue[1]);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public ExifPointSubjectArea(ExifTag tag, ushort[] value)
|
||||
: base(tag, value)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public ExifPointSubjectArea(ExifTag tag, ushort x, ushort y)
|
||||
: base(tag, new ushort[] { x, y })
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the location and area of the subject (EXIF Specification: 3xSHORT)
|
||||
/// The coordinate values, width, and height are expressed in relation to the
|
||||
/// upper left as origin, prior to rotation processing as per the Rotation tag.
|
||||
/// </summary>
|
||||
internal class ExifCircularSubjectArea : ExifPointSubjectArea
|
||||
{
|
||||
public ushort Diamater { get { return mValue[2]; } set { mValue[2] = value; } }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendFormat("({0:d}, {1:d}) {2:d}", mValue[0], mValue[1], mValue[2]);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public ExifCircularSubjectArea(ExifTag tag, ushort[] value)
|
||||
: base(tag, value)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public ExifCircularSubjectArea(ExifTag tag, ushort x, ushort y, ushort d)
|
||||
: base(tag, new ushort[] { x, y, d })
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the location and area of the subject (EXIF Specification: 4xSHORT)
|
||||
/// The coordinate values, width, and height are expressed in relation to the
|
||||
/// upper left as origin, prior to rotation processing as per the Rotation tag.
|
||||
/// </summary>
|
||||
internal class ExifRectangularSubjectArea : ExifPointSubjectArea
|
||||
{
|
||||
public ushort Width { get { return mValue[2]; } set { mValue[2] = value; } }
|
||||
public ushort Height { get { return mValue[3]; } set { mValue[3] = value; } }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendFormat("({0:d}, {1:d}) ({2:d} x {3:d})", mValue[0], mValue[1], mValue[2], mValue[3]);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public ExifRectangularSubjectArea(ExifTag tag, ushort[] value)
|
||||
: base(tag, value)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public ExifRectangularSubjectArea(ExifTag tag, ushort x, ushort y, ushort w, ushort h)
|
||||
: base(tag, new ushort[] { x, y, w, h })
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents GPS latitudes and longitudes (EXIF Specification: 3xRATIONAL)
|
||||
/// </summary>
|
||||
internal class GPSLatitudeLongitude : ExifURationalArray
|
||||
{
|
||||
protected new MathEx.UFraction32[] Value { get { return mValue; } set { mValue = value; } }
|
||||
public MathEx.UFraction32 Degrees { get { return mValue[0]; } set { mValue[0] = value; } }
|
||||
public MathEx.UFraction32 Minutes { get { return mValue[1]; } set { mValue[1] = value; } }
|
||||
public MathEx.UFraction32 Seconds { get { return mValue[2]; } set { mValue[2] = value; } }
|
||||
|
||||
public static explicit operator float(GPSLatitudeLongitude obj) { return obj.ToFloat(); }
|
||||
public float ToFloat()
|
||||
{
|
||||
return (float)Degrees + ((float)Minutes) / 60.0f + ((float)Seconds) / 3600.0f;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0:F2}°{1:F2}'{2:F2}\"", (float)Degrees, (float)Minutes, (float)Seconds);
|
||||
}
|
||||
|
||||
public GPSLatitudeLongitude(ExifTag tag, MathEx.UFraction32[] value)
|
||||
: base(tag, value)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public GPSLatitudeLongitude(ExifTag tag, float d, float m, float s)
|
||||
: base(tag, new MathEx.UFraction32[] { new MathEx.UFraction32(d), new MathEx.UFraction32(m), new MathEx.UFraction32(s) })
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a GPS time stamp as UTC (EXIF Specification: 3xRATIONAL)
|
||||
/// </summary>
|
||||
internal class GPSTimeStamp : ExifURationalArray
|
||||
{
|
||||
protected new MathEx.UFraction32[] Value { get { return mValue; } set { mValue = value; } }
|
||||
public MathEx.UFraction32 Hour { get { return mValue[0]; } set { mValue[0] = value; } }
|
||||
public MathEx.UFraction32 Minute { get { return mValue[1]; } set { mValue[1] = value; } }
|
||||
public MathEx.UFraction32 Second { get { return mValue[2]; } set { mValue[2] = value; } }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0:F2}:{1:F2}:{2:F2}\"", (float)Hour, (float)Minute, (float)Second);
|
||||
}
|
||||
|
||||
public GPSTimeStamp(ExifTag tag, MathEx.UFraction32[] value)
|
||||
: base(tag, value)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public GPSTimeStamp(ExifTag tag, float h, float m, float s)
|
||||
: base(tag, new MathEx.UFraction32[] { new MathEx.UFraction32(h), new MathEx.UFraction32(m), new MathEx.UFraction32(s) })
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an ASCII string. (EXIF Specification: BYTE)
|
||||
/// Used by Windows XP.
|
||||
/// </summary>
|
||||
internal class WindowsByteString : ExifProperty
|
||||
{
|
||||
protected string mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (string)value; } }
|
||||
public new string Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public implicit operator string(WindowsByteString obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString() { return mValue; }
|
||||
|
||||
public WindowsByteString(ExifTag tag, string value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
byte[] data = Encoding.Unicode.GetBytes(mValue);
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 1, (uint)data.Length, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Umbraco.Core.Media.Exif
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a custom type descriptor for an ExifFile instance.
|
||||
/// </summary>
|
||||
internal sealed class ExifFileTypeDescriptionProvider : TypeDescriptionProvider
|
||||
{
|
||||
public ExifFileTypeDescriptionProvider()
|
||||
: this(TypeDescriptor.GetProvider(typeof(ImageFile)))
|
||||
{
|
||||
}
|
||||
|
||||
public ExifFileTypeDescriptionProvider(TypeDescriptionProvider parent)
|
||||
: base(parent)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a custom type descriptor for the given type and object.
|
||||
/// </summary>
|
||||
/// <param name="objectType">The type of object for which to retrieve the type descriptor.</param>
|
||||
/// <param name="instance">An instance of the type. Can be null if no instance was passed to the <see cref="T:System.ComponentModel.TypeDescriptor"/>.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="T:System.ComponentModel.ICustomTypeDescriptor"/> that can provide metadata for the type.
|
||||
/// </returns>
|
||||
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
|
||||
{
|
||||
return new ExifFileTypeDescriptor(base.GetTypeDescriptor(objectType, instance), instance);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Expands ExifProperty objects contained in an ExifFile as seperate properties.
|
||||
/// </summary>
|
||||
internal sealed class ExifFileTypeDescriptor : CustomTypeDescriptor
|
||||
{
|
||||
ImageFile owner;
|
||||
|
||||
public ExifFileTypeDescriptor(ICustomTypeDescriptor parent, object instance)
|
||||
: base(parent)
|
||||
{
|
||||
owner = (ImageFile)instance;
|
||||
}
|
||||
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
|
||||
{
|
||||
return GetProperties();
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a collection of property descriptors for the object represented by this type descriptor.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="T:System.ComponentModel.PropertyDescriptorCollection"/> containing the property descriptions for the object represented by this type descriptor. The default is <see cref="F:System.ComponentModel.PropertyDescriptorCollection.Empty"/>.
|
||||
/// </returns>
|
||||
public override PropertyDescriptorCollection GetProperties()
|
||||
{
|
||||
// Enumerate the original set of properties and create our new set with it
|
||||
List<PropertyDescriptor> properties = new List<PropertyDescriptor>();
|
||||
|
||||
foreach (ExifProperty prop in owner.Properties)
|
||||
{
|
||||
ExifPropertyDescriptor pd = new ExifPropertyDescriptor(prop);
|
||||
properties.Add(pd);
|
||||
}
|
||||
|
||||
// Finally return the list
|
||||
return new PropertyDescriptorCollection(properties.ToArray(), true);
|
||||
}
|
||||
}
|
||||
internal sealed class ExifPropertyDescriptor : PropertyDescriptor
|
||||
{
|
||||
object originalValue;
|
||||
ExifProperty linkedProperty;
|
||||
|
||||
public ExifPropertyDescriptor(ExifProperty property)
|
||||
: base(property.Name, new Attribute[] { new BrowsableAttribute(true) })
|
||||
{
|
||||
linkedProperty = property;
|
||||
originalValue = property.Value;
|
||||
}
|
||||
|
||||
public override bool CanResetValue(object component)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override Type ComponentType
|
||||
{
|
||||
get { return typeof(JPEGFile); }
|
||||
}
|
||||
|
||||
public override object GetValue(object component)
|
||||
{
|
||||
return linkedProperty.Value;
|
||||
}
|
||||
|
||||
public override bool IsReadOnly
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override Type PropertyType
|
||||
{
|
||||
get { return linkedProperty.Value.GetType(); }
|
||||
}
|
||||
|
||||
public override void ResetValue(object component)
|
||||
{
|
||||
linkedProperty.Value = originalValue;
|
||||
}
|
||||
|
||||
public override void SetValue(object component, object value)
|
||||
{
|
||||
linkedProperty.Value = value;
|
||||
}
|
||||
|
||||
public override bool ShouldSerializeValue(object component)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
namespace Umbraco.Core.Media.Exif
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents interoperability data for an exif tag in the platform byte order.
|
||||
/// </summary>
|
||||
internal struct ExifInterOperability
|
||||
{
|
||||
private ushort mTagID;
|
||||
private ushort mTypeID;
|
||||
private uint mCount;
|
||||
private byte[] mData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tag ID defined in the Exif standard.
|
||||
/// </summary>
|
||||
public ushort TagID { get { return mTagID; } }
|
||||
/// <summary>
|
||||
/// Gets the type code defined in the Exif standard.
|
||||
/// <list type="bullet">
|
||||
/// <item>1 = BYTE (byte)</item>
|
||||
/// <item>2 = ASCII (byte array)</item>
|
||||
/// <item>3 = SHORT (ushort)</item>
|
||||
/// <item>4 = LONG (uint)</item>
|
||||
/// <item>5 = RATIONAL (2 x uint: numerator, denominator)</item>
|
||||
/// <item>6 = BYTE (sbyte)</item>
|
||||
/// <item>7 = UNDEFINED (byte array)</item>
|
||||
/// <item>8 = SSHORT (short)</item>
|
||||
/// <item>9 = SLONG (int)</item>
|
||||
/// <item>10 = SRATIONAL (2 x int: numerator, denominator)</item>
|
||||
/// <item>11 = FLOAT (float)</item>
|
||||
/// <item>12 = DOUBLE (double)</item>
|
||||
/// </list>
|
||||
/// </summary>
|
||||
public ushort TypeID { get { return mTypeID; } }
|
||||
/// <summary>
|
||||
/// Gets the byte count or number of components.
|
||||
/// </summary>
|
||||
public uint Count { get { return mCount; } }
|
||||
/// <summary>
|
||||
/// Gets the field value as an array of bytes.
|
||||
/// </summary>
|
||||
public byte[] Data { get { return mData; } }
|
||||
/// <summary>
|
||||
/// Returns the string representation of this instance.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Tag: {0}, Type: {1}, Count: {2}, Data Length: {3}", mTagID, mTypeID, mCount, mData.Length);
|
||||
}
|
||||
|
||||
public ExifInterOperability(ushort tagid, ushort typeid, uint count, byte[] data)
|
||||
{
|
||||
mTagID = tagid;
|
||||
mTypeID = typeid;
|
||||
mCount = count;
|
||||
mData = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,578 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace Umbraco.Core.Media.Exif
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the abstract base class for an Exif property.
|
||||
/// </summary>
|
||||
internal abstract class ExifProperty
|
||||
{
|
||||
protected ExifTag mTag;
|
||||
protected IFD mIFD;
|
||||
protected string mName;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Exif tag associated with this property.
|
||||
/// </summary>
|
||||
public ExifTag Tag { get { return mTag; } }
|
||||
/// <summary>
|
||||
/// Gets the IFD section contaning this property.
|
||||
/// </summary>
|
||||
public IFD IFD { get { return mIFD; } }
|
||||
/// <summary>
|
||||
/// Gets or sets the name of this property.
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mName == null || mName.Length == 0)
|
||||
return ExifTagFactory.GetTagName(mTag);
|
||||
else
|
||||
return mName;
|
||||
}
|
||||
set
|
||||
{
|
||||
mName = value;
|
||||
}
|
||||
}
|
||||
protected abstract object _Value { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the value of this property.
|
||||
/// </summary>
|
||||
public object Value { get { return _Value; } set { _Value = value; } }
|
||||
/// <summary>
|
||||
/// Gets interoperability data for this property.
|
||||
/// </summary>
|
||||
public abstract ExifInterOperability Interoperability { get; }
|
||||
|
||||
public ExifProperty(ExifTag tag)
|
||||
{
|
||||
mTag = tag;
|
||||
mIFD = ExifTagFactory.GetTagIFD(tag);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an 8-bit unsigned integer. (EXIF Specification: BYTE)
|
||||
/// </summary>
|
||||
internal class ExifByte : ExifProperty
|
||||
{
|
||||
protected byte mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = Convert.ToByte(value); } }
|
||||
public new byte Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public implicit operator byte(ExifByte obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString() { return mValue.ToString(); }
|
||||
|
||||
public ExifByte(ExifTag tag, byte value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 1, 1, new byte[] { mValue });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an array of 8-bit unsigned integers. (EXIF Specification: BYTE with count > 1)
|
||||
/// </summary>
|
||||
internal class ExifByteArray : ExifProperty
|
||||
{
|
||||
protected byte[] mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (byte[])value; } }
|
||||
public new byte[] Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public implicit operator byte[](ExifByteArray obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append('[');
|
||||
foreach (byte b in mValue)
|
||||
{
|
||||
sb.Append(b);
|
||||
sb.Append(' ');
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
sb.Append(']');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public ExifByteArray(ExifTag tag, byte[] value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 1, (uint)mValue.Length, mValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an ASCII string. (EXIF Specification: ASCII)
|
||||
/// </summary>
|
||||
internal class ExifAscii : ExifProperty
|
||||
{
|
||||
protected string mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (string)value; } }
|
||||
public new string Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
public Encoding Encoding { get; private set; }
|
||||
|
||||
static public implicit operator string(ExifAscii obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString() { return mValue; }
|
||||
|
||||
public ExifAscii(ExifTag tag, string value, Encoding encoding)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
Encoding = encoding;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 2, (uint)mValue.Length + 1, ExifBitConverter.GetBytes(mValue, true, Encoding));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 16-bit unsigned integer. (EXIF Specification: SHORT)
|
||||
/// </summary>
|
||||
internal class ExifUShort : ExifProperty
|
||||
{
|
||||
protected ushort mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = Convert.ToUInt16(value); } }
|
||||
public new ushort Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public implicit operator ushort(ExifUShort obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString() { return mValue.ToString(); }
|
||||
|
||||
public ExifUShort(ExifTag tag, ushort value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 3, 1, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an array of 16-bit unsigned integers.
|
||||
/// (EXIF Specification: SHORT with count > 1)
|
||||
/// </summary>
|
||||
internal class ExifUShortArray : ExifProperty
|
||||
{
|
||||
protected ushort[] mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (ushort[])value; } }
|
||||
public new ushort[] Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public implicit operator ushort[](ExifUShortArray obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append('[');
|
||||
foreach (ushort b in mValue)
|
||||
{
|
||||
sb.Append(b);
|
||||
sb.Append(' ');
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
sb.Append(']');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public ExifUShortArray(ExifTag tag, ushort[] value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 3, (uint)mValue.Length, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 32-bit unsigned integer. (EXIF Specification: LONG)
|
||||
/// </summary>
|
||||
internal class ExifUInt : ExifProperty
|
||||
{
|
||||
protected uint mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = Convert.ToUInt32(value); } }
|
||||
public new uint Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public implicit operator uint(ExifUInt obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString() { return mValue.ToString(); }
|
||||
|
||||
public ExifUInt(ExifTag tag, uint value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 4, 1, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an array of 16-bit unsigned integers.
|
||||
/// (EXIF Specification: LONG with count > 1)
|
||||
/// </summary>
|
||||
internal class ExifUIntArray : ExifProperty
|
||||
{
|
||||
protected uint[] mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (uint[])value; } }
|
||||
public new uint[] Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public implicit operator uint[](ExifUIntArray obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append('[');
|
||||
foreach (uint b in mValue)
|
||||
{
|
||||
sb.Append(b);
|
||||
sb.Append(' ');
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
sb.Append(']');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public ExifUIntArray(ExifTag tag, uint[] value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 3, (uint)mValue.Length, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a rational number defined with a 32-bit unsigned numerator
|
||||
/// and denominator. (EXIF Specification: RATIONAL)
|
||||
/// </summary>
|
||||
internal class ExifURational : ExifProperty
|
||||
{
|
||||
protected MathEx.UFraction32 mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (MathEx.UFraction32)value; } }
|
||||
public new MathEx.UFraction32 Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
public override string ToString() { return mValue.ToString(); }
|
||||
public float ToFloat() { return (float)mValue; }
|
||||
|
||||
static public explicit operator float(ExifURational obj) { return (float)obj.mValue; }
|
||||
|
||||
public uint[] ToArray()
|
||||
{
|
||||
return new uint[] { mValue.Numerator, mValue.Denominator };
|
||||
}
|
||||
|
||||
public ExifURational(ExifTag tag, uint numerator, uint denominator)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = new MathEx.UFraction32(numerator, denominator);
|
||||
}
|
||||
|
||||
public ExifURational(ExifTag tag, MathEx.UFraction32 value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 5, 1, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an array of unsigned rational numbers.
|
||||
/// (EXIF Specification: RATIONAL with count > 1)
|
||||
/// </summary>
|
||||
internal class ExifURationalArray : ExifProperty
|
||||
{
|
||||
protected MathEx.UFraction32[] mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (MathEx.UFraction32[])value; } }
|
||||
public new MathEx.UFraction32[] Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public explicit operator float[](ExifURationalArray obj)
|
||||
{
|
||||
float[] result = new float[obj.mValue.Length];
|
||||
for (int i = 0; i < obj.mValue.Length; i++)
|
||||
result[i] = (float)obj.mValue[i];
|
||||
return result;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append('[');
|
||||
foreach (MathEx.UFraction32 b in mValue)
|
||||
{
|
||||
sb.Append(b.ToString());
|
||||
sb.Append(' ');
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
sb.Append(']');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public ExifURationalArray(ExifTag tag, MathEx.UFraction32[] value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 5, (uint)mValue.Length, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a byte array that can take any value. (EXIF Specification: UNDEFINED)
|
||||
/// </summary>
|
||||
internal class ExifUndefined : ExifProperty
|
||||
{
|
||||
protected byte[] mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (byte[])value; } }
|
||||
public new byte[] Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public implicit operator byte[](ExifUndefined obj) { return obj.mValue; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append('[');
|
||||
foreach (byte b in mValue)
|
||||
{
|
||||
sb.Append(b);
|
||||
sb.Append(' ');
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
sb.Append(']');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public ExifUndefined(ExifTag tag, byte[] value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, (uint)mValue.Length, mValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 32-bit signed integer. (EXIF Specification: SLONG)
|
||||
/// </summary>
|
||||
internal class ExifSInt : ExifProperty
|
||||
{
|
||||
protected int mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = Convert.ToInt32(value); } }
|
||||
public new int Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
public override string ToString() { return mValue.ToString(); }
|
||||
|
||||
static public implicit operator int(ExifSInt obj) { return obj.mValue; }
|
||||
|
||||
public ExifSInt(ExifTag tag, int value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 9, 1, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an array of 32-bit signed integers.
|
||||
/// (EXIF Specification: SLONG with count > 1)
|
||||
/// </summary>
|
||||
internal class ExifSIntArray : ExifProperty
|
||||
{
|
||||
protected int[] mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (int[])value; } }
|
||||
public new int[] Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append('[');
|
||||
foreach (int b in mValue)
|
||||
{
|
||||
sb.Append(b);
|
||||
sb.Append(' ');
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
sb.Append(']');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
static public implicit operator int[](ExifSIntArray obj) { return obj.mValue; }
|
||||
|
||||
public ExifSIntArray(ExifTag tag, int[] value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 9, (uint)mValue.Length, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a rational number defined with a 32-bit signed numerator
|
||||
/// and denominator. (EXIF Specification: SRATIONAL)
|
||||
/// </summary>
|
||||
internal class ExifSRational : ExifProperty
|
||||
{
|
||||
protected MathEx.Fraction32 mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (MathEx.Fraction32)value; } }
|
||||
public new MathEx.Fraction32 Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
public override string ToString() { return mValue.ToString(); }
|
||||
public float ToFloat() { return (float)mValue; }
|
||||
|
||||
static public explicit operator float(ExifSRational obj) { return (float)obj.mValue; }
|
||||
|
||||
public int[] ToArray()
|
||||
{
|
||||
return new int[] { mValue.Numerator, mValue.Denominator };
|
||||
}
|
||||
|
||||
public ExifSRational(ExifTag tag, int numerator, int denominator)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = new MathEx.Fraction32(numerator, denominator);
|
||||
}
|
||||
|
||||
public ExifSRational(ExifTag tag, MathEx.Fraction32 value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 10, 1, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an array of signed rational numbers.
|
||||
/// (EXIF Specification: SRATIONAL with count > 1)
|
||||
/// </summary>
|
||||
internal class ExifSRationalArray : ExifProperty
|
||||
{
|
||||
protected MathEx.Fraction32[] mValue;
|
||||
protected override object _Value { get { return Value; } set { Value = (MathEx.Fraction32[])value; } }
|
||||
public new MathEx.Fraction32[] Value { get { return mValue; } set { mValue = value; } }
|
||||
|
||||
static public explicit operator float[](ExifSRationalArray obj)
|
||||
{
|
||||
float[] result = new float[obj.mValue.Length];
|
||||
for (int i = 0; i < obj.mValue.Length; i++)
|
||||
result[i] = (float)obj.mValue[i];
|
||||
return result;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append('[');
|
||||
foreach (MathEx.Fraction32 b in mValue)
|
||||
{
|
||||
sb.Append(b.ToString());
|
||||
sb.Append(' ');
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
sb.Append(']');
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public ExifSRationalArray(ExifTag tag, MathEx.Fraction32[] value)
|
||||
: base(tag)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public override ExifInterOperability Interoperability
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 10, (uint)mValue.Length, ExifBitConverter.GetBytes(mValue, BitConverterEx.SystemByteOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,380 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Umbraco.Core.Media.Exif
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of <see cref="ExifProperty"/> objects.
|
||||
/// </summary>
|
||||
internal class ExifPropertyCollection : IDictionary<ExifTag, ExifProperty>
|
||||
{
|
||||
#region Member Variables
|
||||
private ImageFile parent;
|
||||
private Dictionary<ExifTag, ExifProperty> items;
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
internal ExifPropertyCollection (ImageFile parentFile)
|
||||
{
|
||||
parent = parentFile;
|
||||
items = new Dictionary<ExifTag, ExifProperty> ();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets the number of elements contained in the collection.
|
||||
/// </summary>
|
||||
public int Count {
|
||||
get { return items.Count; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets a collection containing the keys in this collection.
|
||||
/// </summary>
|
||||
public ICollection<ExifTag> Keys {
|
||||
get { return items.Keys; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets a collection containing the values in this collection.
|
||||
/// </summary>
|
||||
public ICollection<ExifProperty> Values {
|
||||
get { return items.Values; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
public ExifProperty this[ExifTag key] {
|
||||
get { return items[key]; }
|
||||
set {
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, value);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ExifProperty Collection Setters
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
public void Set (ExifTag key, byte value)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, new ExifByte (key, value));
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
public void Set (ExifTag key, string value)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
if (key == ExifTag.WindowsTitle || key == ExifTag.WindowsTitle || key == ExifTag.WindowsComment || key == ExifTag.WindowsAuthor || key == ExifTag.WindowsKeywords || key == ExifTag.WindowsSubject) {
|
||||
items.Add (key, new WindowsByteString (key, value));
|
||||
} else {
|
||||
items.Add (key, new ExifAscii (key, value, parent.Encoding));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
public void Set (ExifTag key, ushort value)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, new ExifUShort (key, value));
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
public void Set (ExifTag key, int value)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, new ExifSInt (key, value));
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
public void Set (ExifTag key, uint value)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, new ExifUInt (key, value));
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
public void Set (ExifTag key, float value)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, new ExifURational (key, new MathEx.UFraction32 (value)));
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
public void Set (ExifTag key, double value)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, new ExifURational (key, new MathEx.UFraction32 (value)));
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
public void Set (ExifTag key, object value)
|
||||
{
|
||||
Type type = value.GetType ();
|
||||
if (type.IsEnum) {
|
||||
Type etype = typeof(ExifEnumProperty<>).MakeGenericType (new Type[] { type });
|
||||
object prop = Activator.CreateInstance (etype, new object[] { key, value });
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, (ExifProperty)prop);
|
||||
} else
|
||||
throw new ArgumentException ("No exif property exists for this tag.", "value");
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
/// <param name="encoding">String encoding.</param>
|
||||
public void Set (ExifTag key, string value, Encoding encoding)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, new ExifEncodedString (key, value, encoding));
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="value">The value of tag.</param>
|
||||
public void Set (ExifTag key, DateTime value)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, new ExifDateTime (key, value));
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the <see cref="ExifProperty"/> with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The tag to set.</param>
|
||||
/// <param name="d">Angular degrees (or clock hours for a timestamp).</param>
|
||||
/// <param name="m">Angular minutes (or clock minutes for a timestamp).</param>
|
||||
/// <param name="s">Angular seconds (or clock seconds for a timestamp).</param>
|
||||
public void Set (ExifTag key, float d, float m, float s)
|
||||
{
|
||||
if (items.ContainsKey (key))
|
||||
items.Remove (key);
|
||||
items.Add (key, new ExifURationalArray (key, new MathEx.UFraction32[] { new MathEx.UFraction32 (d), new MathEx.UFraction32 (m), new MathEx.UFraction32 (s) }));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Instance Methods
|
||||
/// <summary>
|
||||
/// Adds the specified item to the collection.
|
||||
/// </summary>
|
||||
/// <param name="item">The <see cref="ExifProperty"/> to add to the collection.</param>
|
||||
public void Add (ExifProperty item)
|
||||
{
|
||||
ExifProperty oldItem = null;
|
||||
if (items.TryGetValue (item.Tag, out oldItem))
|
||||
items[item.Tag] = item;
|
||||
else
|
||||
items.Add (item.Tag, item);
|
||||
}
|
||||
/// <summary>
|
||||
/// Removes all items from the collection.
|
||||
/// </summary>
|
||||
public void Clear ()
|
||||
{
|
||||
items.Clear ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Determines whether the collection contains an element with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The key to locate in the collection.</param>
|
||||
/// <returns>
|
||||
/// true if the collection contains an element with the key; otherwise, false.
|
||||
/// </returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="key"/> is null.</exception>
|
||||
public bool ContainsKey (ExifTag key)
|
||||
{
|
||||
return items.ContainsKey (key);
|
||||
}
|
||||
/// <summary>
|
||||
/// Removes the element with the specified key from the collection.
|
||||
/// </summary>
|
||||
/// <param name="key">The key of the element to remove.</param>
|
||||
/// <returns>
|
||||
/// true if the element is successfully removed; otherwise, false. This method also returns false if <paramref name="key"/> was not found in the original collection.
|
||||
/// </returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="key"/> is null.</exception>
|
||||
public bool Remove (ExifTag key)
|
||||
{
|
||||
return items.Remove (key);
|
||||
}
|
||||
/// <summary>
|
||||
/// Removes all items with the given IFD from the collection.
|
||||
/// </summary>
|
||||
/// <param name="ifd">The IFD section to remove.</param>
|
||||
public void Remove (IFD ifd)
|
||||
{
|
||||
List<ExifTag> toRemove = new List<ExifTag> ();
|
||||
foreach (KeyValuePair<ExifTag, ExifProperty> item in items) {
|
||||
if (item.Value.IFD == ifd)
|
||||
toRemove.Add (item.Key);
|
||||
}
|
||||
foreach (ExifTag tag in toRemove)
|
||||
items.Remove (tag);
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the value associated with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The key whose value to get.</param>
|
||||
/// <param name="value">When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the <paramref name="value"/> parameter. This parameter is passed uninitialized.</param>
|
||||
/// <returns>
|
||||
/// true if the collection contains an element with the specified key; otherwise, false.
|
||||
/// </returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="key"/> is null.</exception>
|
||||
public bool TryGetValue (ExifTag key, out ExifProperty value)
|
||||
{
|
||||
return items.TryGetValue (key, out value);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns an enumerator that iterates through a collection.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection.
|
||||
/// </returns>
|
||||
public IEnumerator<ExifProperty> GetEnumerator ()
|
||||
{
|
||||
return Values.GetEnumerator ();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Hidden Interface
|
||||
/// <summary>
|
||||
/// Adds an element with the provided key and value to the <see cref="T:System.Collections.Generic.IDictionary`2"/>.
|
||||
/// </summary>
|
||||
/// <param name="key">The object to use as the key of the element to add.</param>
|
||||
/// <param name="value">The object to use as the value of the element to add.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="key"/> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">An element with the same key already exists in the <see cref="T:System.Collections.Generic.IDictionary`2"/>.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IDictionary`2"/> is read-only.</exception>
|
||||
void IDictionary<ExifTag, ExifProperty>.Add (ExifTag key, ExifProperty value)
|
||||
{
|
||||
Add (value);
|
||||
}
|
||||
/// <summary>
|
||||
/// Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1"/>.
|
||||
/// </summary>
|
||||
/// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.</exception>
|
||||
void ICollection<KeyValuePair<ExifTag, ExifProperty>>.Add (KeyValuePair<ExifTag, ExifProperty> item)
|
||||
{
|
||||
Add (item.Value);
|
||||
}
|
||||
bool ICollection<KeyValuePair<ExifTag, ExifProperty>>.Contains (KeyValuePair<ExifTag, ExifProperty> item)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Copies the elements of the <see cref="T:System.Collections.Generic.ICollection`1"/> to an <see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
|
||||
/// </summary>
|
||||
/// <param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:System.Collections.Generic.ICollection`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
|
||||
/// <param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="array"/> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="arrayIndex"/> is less than 0.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="array"/> is multidimensional.-or-<paramref name="arrayIndex"/> is equal to or greater than the length of <paramref name="array"/>.-or-The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1"/> is greater than the available space from <paramref name="arrayIndex"/> to the end of the destination <paramref name="array"/>.-or-Type <paramref name="T"/> cannot be cast automatically to the type of the destination <paramref name="array"/>.</exception>
|
||||
void ICollection<KeyValuePair<ExifTag, ExifProperty>>.CopyTo (KeyValuePair<ExifTag, ExifProperty>[] array, int arrayIndex)
|
||||
{
|
||||
if (array == null)
|
||||
throw new ArgumentNullException ("array");
|
||||
if (arrayIndex < 0)
|
||||
throw new ArgumentOutOfRangeException ("arrayIndex");
|
||||
if (array.Rank > 1)
|
||||
throw new ArgumentException ("Destination array is multidimensional.", "array");
|
||||
if (arrayIndex >= array.Length)
|
||||
throw new ArgumentException ("arrayIndex is equal to or greater than the length of destination array", "array");
|
||||
if (arrayIndex + items.Count > array.Length)
|
||||
throw new ArgumentException ("There is not enough space in destination array.", "array");
|
||||
|
||||
int i = 0;
|
||||
foreach (KeyValuePair<ExifTag, ExifProperty> item in items) {
|
||||
if (i >= arrayIndex) {
|
||||
array[i] = item;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.
|
||||
/// </summary>
|
||||
/// <returns>true if the <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only; otherwise, false.</returns>
|
||||
bool ICollection<KeyValuePair<ExifTag, ExifProperty>>.IsReadOnly {
|
||||
get { return false; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
|
||||
/// </summary>
|
||||
/// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
|
||||
/// <returns>
|
||||
/// true if <paramref name="item"/> was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false. This method also returns false if <paramref name="item"/> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1"/>.
|
||||
/// </returns>
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.</exception>
|
||||
bool ICollection<KeyValuePair<ExifTag, ExifProperty>>.Remove (KeyValuePair<ExifTag, ExifProperty> item)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns an enumerator that iterates through a collection.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection.
|
||||
/// </returns>
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
|
||||
{
|
||||
return GetEnumerator ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns an enumerator that iterates through the collection.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection.
|
||||
/// </returns>
|
||||
IEnumerator<KeyValuePair<ExifTag, ExifProperty>> IEnumerable<KeyValuePair<ExifTag, ExifProperty>>.GetEnumerator ()
|
||||
{
|
||||
return items.GetEnumerator ();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||