mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f0db6b551 | ||
|
|
db1f8f193e | ||
|
|
2a1ea43f4f | ||
|
|
a4455e3f30 | ||
|
|
b5ffea4ee2 | ||
|
|
f12bca6432 | ||
|
|
8594aa5558 | ||
|
|
f0afb017f7 | ||
|
|
314581e888 | ||
|
|
ea6e288bca | ||
|
|
1f21c2668b | ||
|
|
7ec2e18907 | ||
|
|
1e44ddf80c | ||
|
|
db545706f5 | ||
|
|
89c6198dab | ||
|
|
59aa23f847 | ||
|
|
c095b052d9 | ||
|
|
fad04e5265 | ||
|
|
13320bfb6b | ||
|
|
16ec731a80 | ||
|
|
f157a946e8 | ||
|
|
5a9fcf1c4f | ||
|
|
ead0797e43 | ||
|
|
4ec4a564e6 | ||
|
|
b4ff470fda | ||
|
|
0305ecc846 | ||
|
|
eb8965458e | ||
|
|
544d9defeb | ||
|
|
7769949627 | ||
|
|
79aae4e91e | ||
|
|
875085a576 | ||
|
|
464d99efee | ||
|
|
ef0e31f171 | ||
|
|
e67543ba67 | ||
|
|
b76e1498d1 | ||
|
|
3918d71392 | ||
|
|
0cb993900a | ||
|
|
fe1f469a15 | ||
|
|
c148129bd9 | ||
|
|
114dcd4c27 | ||
|
|
b12c11330b | ||
|
|
99f0d27705 | ||
|
|
b2b4e687a2 | ||
|
|
6ac813aeec | ||
|
|
ce0aeca153 | ||
|
|
79bc748bc3 | ||
|
|
b533e9d4d6 | ||
|
|
8df50f0a41 | ||
|
|
3ba86a68ad | ||
|
|
825f31d939 | ||
|
|
3dc7aa9132 | ||
|
|
f91bb446ef | ||
|
|
c5b1bb53c4 | ||
|
|
2bbefc17f4 | ||
|
|
57f64df400 | ||
|
|
6d1edcc097 | ||
|
|
5a26321c22 | ||
|
|
c499ff3b51 | ||
|
|
69bb122b82 | ||
|
|
0936098eb5 | ||
|
|
55c9ab6a39 | ||
|
|
636ed33ad5 | ||
|
|
f726ea6038 | ||
|
|
d506c0911d | ||
|
|
383931b0ac | ||
|
|
7e2eecd0d0 | ||
|
|
3b996b920f | ||
|
|
e1072fa87e | ||
|
|
3350778a00 | ||
|
|
5feab0a69a | ||
|
|
f48ee288b9 | ||
|
|
d845777e9d | ||
|
|
4eea199abb | ||
|
|
621c256867 | ||
|
|
23e5b795c3 | ||
|
|
764e2b9db0 | ||
|
|
5bb9f62508 | ||
|
|
784686c87e | ||
|
|
e6a5308498 | ||
|
|
b3d6aded2a | ||
|
|
7c508a6f59 | ||
|
|
a70b90adb0 | ||
|
|
cec5ae1ae9 | ||
|
|
a02ac6a4ad | ||
|
|
7496998985 | ||
|
|
1bc4619881 | ||
|
|
a3fc216cd1 | ||
|
|
c223ac0456 | ||
|
|
a29ff00f6e | ||
|
|
58d5f4b1e1 | ||
|
|
605ce25a5d | ||
|
|
5effc7c4c8 | ||
|
|
00008d5186 | ||
|
|
0fbb4f9b23 | ||
|
|
f4ba006995 | ||
|
|
f779a4dc96 | ||
|
|
f72695f958 | ||
|
|
bdb14f3711 | ||
|
|
d16f2f3722 | ||
|
|
5b52c01d8f | ||
|
|
9297c6d626 | ||
|
|
60789fe78f | ||
|
|
79f64cde76 | ||
|
|
f71e7daac7 | ||
|
|
3240745d32 | ||
|
|
a825320f7c | ||
|
|
833088d020 | ||
|
|
6caf7d27e4 | ||
|
|
ddee62a7a3 | ||
|
|
ba145fa703 | ||
|
|
08296f179d | ||
|
|
90d9c9150b | ||
|
|
5564a7150f | ||
|
|
847f6606b2 | ||
|
|
739c956f27 | ||
|
|
f0d95fe8cf | ||
|
|
62b6fc8944 | ||
|
|
dbbe86f0a0 | ||
|
|
cc2e1d4b5b | ||
|
|
1c77488486 | ||
|
|
9c62305b01 | ||
|
|
d63fd1df4c | ||
|
|
448aa3dc72 | ||
|
|
b8e96d3f03 | ||
|
|
dcbbeb8b65 | ||
|
|
3514aead26 | ||
|
|
ec4ed8f7f2 | ||
|
|
a64ba556e1 | ||
|
|
1ccb7b53e5 | ||
|
|
7f9719631b | ||
|
|
e843f2d74c | ||
|
|
a451bdcd42 | ||
|
|
1900d8f0a5 | ||
|
|
cae5963b24 | ||
|
|
f724b1997e | ||
|
|
5338b6acef | ||
|
|
bc65df29a9 | ||
|
|
f48010a829 | ||
|
|
b28320f23e | ||
|
|
95c1a2c5e6 | ||
|
|
614ac1d780 | ||
|
|
a3a13dc7cb | ||
|
|
39578cca29 | ||
|
|
6212395019 | ||
|
|
620189bcbf | ||
|
|
629d4b8e9c | ||
|
|
2c157e3a86 | ||
|
|
873e6ce0a2 | ||
|
|
5131a50222 | ||
|
|
ad6cc0a389 | ||
|
|
7e0c8b4274 | ||
|
|
3cc3d7fd6e | ||
|
|
de0ca53667 | ||
|
|
aad8256f80 | ||
|
|
7a2d4a0992 | ||
|
|
201e873e5d | ||
|
|
31fd17e8a2 | ||
|
|
efc8e8c584 | ||
|
|
838b6c5e41 | ||
|
|
e65af8b086 | ||
|
|
5b8934a193 | ||
|
|
777e0e5d46 | ||
|
|
02fbd6d229 | ||
|
|
d3773c8a5d | ||
|
|
9b030eaa82 | ||
|
|
1f5f382ffd | ||
|
|
914cb0a99d | ||
|
|
fca5a4e021 | ||
|
|
e8129d33d0 | ||
|
|
0e17974c40 | ||
|
|
d10b5a6587 | ||
|
|
48a31481b3 | ||
|
|
b0c6742743 | ||
|
|
42f3785d41 | ||
|
|
2355191fda | ||
|
|
83e5a79086 | ||
|
|
cdb31069de | ||
|
|
b886279b63 | ||
|
|
076eac9fdd | ||
|
|
a6deecb38d | ||
|
|
a8405b7892 | ||
|
|
967ca29ff0 | ||
|
|
428eb1b337 | ||
|
|
73226678cc | ||
|
|
654c0d002a | ||
|
|
fe734b4b38 | ||
|
|
9df0d00487 | ||
|
|
8599b48ed8 | ||
|
|
a3e3a655fe | ||
|
|
1d5a5d348b | ||
|
|
94622644f1 | ||
|
|
a432fe0de1 | ||
|
|
8e2be15c61 | ||
|
|
c19ac071d6 | ||
|
|
2ef8be005e | ||
|
|
980ee60024 | ||
|
|
15d2979366 | ||
|
|
25690e339c | ||
|
|
ae20fcc018 | ||
|
|
6b073ef5d7 | ||
|
|
2e98ca93d0 | ||
|
|
e60f5b9896 | ||
|
|
bce9fe8164 | ||
|
|
1ae95f3ec7 | ||
|
|
2e3e2d1740 | ||
|
|
8f7ce12d41 | ||
|
|
93aaeca08a | ||
|
|
d0d6490732 | ||
|
|
7af9728f5f | ||
|
|
b431f22584 | ||
|
|
d3dadbbd8d | ||
|
|
40d171c197 | ||
|
|
e7609febb3 | ||
|
|
78ec56451c | ||
|
|
0c7c6652a7 | ||
|
|
bc89db47d6 | ||
|
|
60f2732c4b | ||
|
|
4aa80ca2af | ||
|
|
58aeae86da | ||
|
|
4b10f5831b | ||
|
|
db0d827424 | ||
|
|
df021b96c7 | ||
|
|
d7044e8a8a | ||
|
|
9ded121123 | ||
|
|
8482be0aef | ||
|
|
4eea63fd16 | ||
|
|
c30103c5ec | ||
|
|
b51535e43f | ||
|
|
c4e8361bdf | ||
|
|
9b5e527bf5 | ||
|
|
beaeaad347 | ||
|
|
20bf43868e | ||
|
|
0792fc1a6d | ||
|
|
b936987419 | ||
|
|
27ac138a66 | ||
|
|
41e8d17219 | ||
|
|
bc53601431 | ||
|
|
f55334e816 | ||
|
|
a3f73ce252 | ||
|
|
1203967cdf | ||
|
|
568d8fcd01 | ||
|
|
d720f20fd0 | ||
|
|
ae78b31e9e | ||
|
|
41785d5763 | ||
|
|
5dc1d5b45f | ||
|
|
58dd6011a8 | ||
|
|
797b28bbf8 | ||
|
|
da30b9cce8 | ||
|
|
1d085448a2 | ||
|
|
8e23e5f682 | ||
|
|
337d2be637 | ||
|
|
9762d5bab0 | ||
|
|
ea63c7d9e2 | ||
|
|
d5fb889e15 | ||
|
|
71bac88f6c | ||
|
|
e86ff448b8 | ||
|
|
89fd33f0a3 | ||
|
|
34b57b5ef2 | ||
|
|
dc0e35c21b | ||
|
|
b7625dd45d | ||
|
|
10f375d325 | ||
|
|
433d12e01a | ||
|
|
ada835f12f | ||
|
|
451e834b2b | ||
|
|
f91d740dc1 | ||
|
|
926b1a1224 | ||
|
|
5d772df810 | ||
|
|
841e1cc7b2 | ||
|
|
879d8fbdcd | ||
|
|
a275fb4618 | ||
|
|
981fe2cef9 | ||
|
|
82828beee5 | ||
|
|
c2b988119c | ||
|
|
6aaf27ebc5 | ||
|
|
eb692e0eda | ||
|
|
7ae7b6a09f | ||
|
|
46145d061c | ||
|
|
fdd9676283 | ||
|
|
686fdaac38 | ||
|
|
5c0779502a | ||
|
|
a226b353f8 | ||
|
|
46d978a6af | ||
|
|
390086fddc | ||
|
|
182b17c5a6 | ||
|
|
d499df96e0 | ||
|
|
e1645a45a6 | ||
|
|
7a2ae61405 | ||
|
|
5e017a3f3f | ||
|
|
df53b8e04d | ||
|
|
39587eadc8 | ||
|
|
706b7b3304 | ||
|
|
e587984615 | ||
|
|
99a25b98bd | ||
|
|
166d18cf51 | ||
|
|
07b1a51bc6 | ||
|
|
377280f5b5 | ||
|
|
cda63d0706 | ||
|
|
590d1b39e5 | ||
|
|
5d13212687 | ||
|
|
5821325879 | ||
|
|
29bdfb20ab | ||
|
|
5d592bb366 | ||
|
|
2571837c88 | ||
|
|
f69bd81f97 | ||
|
|
594edb6fd8 | ||
|
|
cfd9e478ee | ||
|
|
f00c428bbe | ||
|
|
8e35e3a7b9 | ||
|
|
5ac344ac00 | ||
|
|
918a74cce2 | ||
|
|
fd59368b78 | ||
|
|
61402fe1a2 | ||
|
|
9258732319 | ||
|
|
64e6cf7460 | ||
|
|
51f8013b8a | ||
|
|
1f73687f90 | ||
|
|
1eb5d4634b | ||
|
|
63c75e1f0e | ||
|
|
763d5b92a2 | ||
|
|
1473503ae7 | ||
|
|
df5afd9d37 | ||
|
|
630c4a5800 | ||
|
|
fbe4a7a52f | ||
|
|
c545c4f6cc | ||
|
|
6348ceadfe | ||
|
|
930d8df78d | ||
|
|
fd9537549a | ||
|
|
694f875483 | ||
|
|
8fbc5fca48 | ||
|
|
c6d8f736e3 | ||
|
|
2000882245 | ||
|
|
52218604b0 | ||
|
|
fe58460445 | ||
|
|
0b7186d44d | ||
|
|
0ff9d1d988 | ||
|
|
cda9448ef0 | ||
|
|
4387ccd8db | ||
|
|
845496d205 | ||
|
|
4c82ee69ae | ||
|
|
6af1fe9bdf | ||
|
|
c5f048f1c7 | ||
|
|
8543293ad2 | ||
|
|
c7fa63baee | ||
|
|
763b5774f2 | ||
|
|
0cf7fde104 | ||
|
|
e9e9fb22e2 | ||
|
|
488ca42f3e | ||
|
|
e324c6452d | ||
|
|
01714dfb49 | ||
|
|
a9a7df0439 | ||
|
|
d5634eb360 | ||
|
|
c724358425 | ||
|
|
ce46a3e791 | ||
|
|
1c256c7686 | ||
|
|
60d72a0f50 | ||
|
|
920f482d9c | ||
|
|
b6d7af01cf | ||
|
|
f4c02305c8 | ||
|
|
a7888c627c | ||
|
|
3d1ea510c1 | ||
|
|
868857b075 | ||
|
|
fedcadcafd | ||
|
|
d9d9bb6675 | ||
|
|
18ce6facb7 | ||
|
|
8e91ed0203 | ||
|
|
1c4362e658 | ||
|
|
7187b5f041 | ||
|
|
e11681b16e | ||
|
|
b843881827 | ||
|
|
a481294ce7 | ||
|
|
ed99b91dda | ||
|
|
d7bda5dd8f | ||
|
|
6e4193fc42 | ||
|
|
c3572782b7 | ||
|
|
5918028c17 | ||
|
|
8fb465e560 | ||
|
|
9096fdf8c0 | ||
|
|
1cffa9bea3 | ||
|
|
b272797408 | ||
|
|
dcfad7ede7 | ||
|
|
48c0213c19 | ||
|
|
045bda5f2e | ||
|
|
5aa72841ea | ||
|
|
98dad4b1be | ||
|
|
49c0d13a3f | ||
|
|
9c8a33be2e | ||
|
|
eddf7d74d8 | ||
|
|
a880449fbc | ||
|
|
d81e88dbbc | ||
|
|
f73e4954e9 | ||
|
|
92954a18d3 | ||
|
|
376a1a0908 | ||
|
|
3f705b0c1e | ||
|
|
6d4d947a18 | ||
|
|
f9a5f1f8bb | ||
|
|
c815067fde | ||
|
|
53ea503c26 | ||
|
|
2366f340fd | ||
|
|
5505a96205 | ||
|
|
c1a1833e3b | ||
|
|
9c32fb39a8 | ||
|
|
a80cb630dd | ||
|
|
ece54edd18 | ||
|
|
35c33c2804 | ||
|
|
389cd4bee6 | ||
|
|
a80dd5cb26 | ||
|
|
886f18c732 | ||
|
|
ef43ef882a | ||
|
|
63ef7bccd2 | ||
|
|
4863ad2d71 | ||
|
|
219c7642e5 | ||
|
|
b839d66b10 | ||
|
|
362af3afae | ||
|
|
caba817083 | ||
|
|
6ff6f22bc2 | ||
|
|
33ac496fc8 | ||
|
|
ebebc496df | ||
|
|
a1f1e7e966 | ||
|
|
3f6d1d848c | ||
|
|
acb4421b8b | ||
|
|
8050bf79b1 | ||
|
|
e27296d935 | ||
|
|
2891b0badc | ||
|
|
3b9e702ba9 | ||
|
|
58d5c73846 | ||
|
|
2a0582c8bf | ||
|
|
0a5f3a447e | ||
|
|
d63f33d197 | ||
|
|
093db10b18 | ||
|
|
0199cca9da | ||
|
|
452cfa4ca5 | ||
|
|
68a9e6f96d | ||
|
|
78ef9ef5dc | ||
|
|
4ee28e267c | ||
|
|
2a37c57394 | ||
|
|
97064f82ad | ||
|
|
8d75eddbf5 | ||
|
|
07ef78ce07 | ||
|
|
9889b5435f | ||
|
|
b26d6e1e11 | ||
|
|
31c202887f | ||
|
|
4b38835edf | ||
|
|
d7948ad01a | ||
|
|
72df0c550b | ||
|
|
85ed858a24 | ||
|
|
f05c761b71 | ||
|
|
78d1184ee5 | ||
|
|
38ade84160 | ||
|
|
2f34bc1499 | ||
|
|
06bb07d6d0 | ||
|
|
1fd7a5bbd1 | ||
|
|
31c994a6de | ||
|
|
76bf457206 | ||
|
|
8e85dddebb | ||
|
|
bf76aa56e1 | ||
|
|
4e9468ab1a | ||
|
|
a4f95a85b1 | ||
|
|
fc27d088b0 | ||
|
|
40f19f2cdf | ||
|
|
43d7f24f1c | ||
|
|
e09de1116e | ||
|
|
8e87f4f56f | ||
|
|
fc38d2816d | ||
|
|
71d6ccb2b7 | ||
|
|
93d3ee72e7 | ||
|
|
23d85fcce6 | ||
|
|
411a88af6b | ||
|
|
ae076ef087 | ||
|
|
aff2d37425 | ||
|
|
384690ac59 | ||
|
|
f345a60ef8 | ||
|
|
eee4f0aa5e | ||
|
|
bd8a904eca | ||
|
|
963b4479a8 | ||
|
|
08234aa2b8 | ||
|
|
b3d003c0b5 | ||
|
|
e3ec9e0570 | ||
|
|
afd1f8e068 | ||
|
|
d113def524 | ||
|
|
424ef47428 | ||
|
|
e4eba3b888 | ||
|
|
18377cc045 | ||
|
|
2cfc9fd1a6 | ||
|
|
056d6258c8 | ||
|
|
b057401f91 | ||
|
|
c80e9ca5df | ||
|
|
8fa2cc52ba | ||
|
|
dc2bd0825c | ||
|
|
ebe5f0fecd | ||
|
|
685f14f961 | ||
|
|
7d6c1a502b | ||
|
|
deafc750cf | ||
|
|
a91a4d1e89 | ||
|
|
7f7df1e6e5 | ||
|
|
46564e3d34 | ||
|
|
8fb70a7097 | ||
|
|
5803915c37 | ||
|
|
45714addb2 | ||
|
|
b42293fb4e | ||
|
|
e2f1bdeecf | ||
|
|
8d29a839ff | ||
|
|
21374e28f0 | ||
|
|
212f3d1ec3 | ||
|
|
60d500f43f | ||
|
|
24a8b73609 | ||
|
|
5e047389dc | ||
|
|
ac80cad773 | ||
|
|
385339b14e | ||
|
|
17948dace8 | ||
|
|
127cb9906a | ||
|
|
1064dbd97c | ||
|
|
ea80e51e0e | ||
|
|
a949f0ec65 | ||
|
|
d825bb749c | ||
|
|
e0fa4d24c4 | ||
|
|
cb58b2b711 | ||
|
|
72c08f9073 | ||
|
|
11cfcaa8ed | ||
|
|
c41929b248 | ||
|
|
ae86534696 | ||
|
|
230d91760e | ||
|
|
8817b5ade4 | ||
|
|
22eb65b8be | ||
|
|
1a5e1ba0a5 | ||
|
|
f7739f9bf1 | ||
|
|
961d3a1514 | ||
|
|
842499ec02 | ||
|
|
fb4afb54ed | ||
|
|
7004cfd5d7 | ||
|
|
4e4824afab | ||
|
|
7f0542b133 | ||
|
|
9f187b5dd0 |
No files matched your search
@@ -1,3 +1,36 @@
|
||||
2002-12-27 Jeroen Janssen <[email protected]>
|
||||
* fixed url for System.Windows.Forms in the class status
|
||||
|
||||
2002-12-18 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* configure.in: moved struct tm field tm_gmtoff check before the check
|
||||
for timezone global variable. This makes Timezone work for me (debian
|
||||
sid, linux, x86, which has both the field and the global variables).
|
||||
|
||||
2002-12-10 Daniel Morgan <[email protected]>
|
||||
|
||||
* doc/oracle: added file which is
|
||||
a new web page oracle.html
|
||||
|
||||
* doc/ado-net: clean up and add link
|
||||
to oracle.html
|
||||
|
||||
* doc/web/commands
|
||||
* doc/web/makefile: added oracle.html
|
||||
|
||||
2002-12-10 Daniel Morgan <[email protected]>
|
||||
|
||||
* man/Makefile.am: changed sqlsharpcli.1 to sqlsharp.1
|
||||
|
||||
* man/sqlsharpcli.1: renamed to sqlsharp.1
|
||||
|
||||
2002-12-09 Tim Haynes <[email protected]>
|
||||
|
||||
* mono/jit/jit.c
|
||||
* mono/metadata/icall.c: added mono_install_get_config_dir() to
|
||||
utilize the MONO_CFG_DIR environment variable for specifying
|
||||
different machine.configs.
|
||||
|
||||
2002-12-06 Duncan Mak <[email protected]>
|
||||
|
||||
* data/Makefile.am (EXTRA_DIST): Add machine.config
|
||||
|
||||
@@ -1,3 +1,159 @@
|
||||
Hello!
|
||||
|
||||
Version 0.17 of Mono has been released.
|
||||
|
||||
There are plenty of new features, bug fixes, new classes,
|
||||
performance improvements, optimizations and much more
|
||||
available in this release.
|
||||
|
||||
* Stats
|
||||
|
||||
2605 cvs commits to the Mono repository since October 1st, an
|
||||
average of 37 commits per day including weekends.
|
||||
|
||||
212 commits to the Mono module.
|
||||
1438 commits to the MCS module.
|
||||
|
||||
* Mono Improvements:
|
||||
|
||||
Work has begun to make the runtime run a finalizer thread and
|
||||
invoke all the finalizers from this thread. This is the same
|
||||
behavior as Java and the Microsoft runtime, but it is disabled
|
||||
on this build.
|
||||
|
||||
Integrated the s390 work from Neale Ferguson.
|
||||
|
||||
Beginning of the work for pre-compiling code (Ahead of time
|
||||
compilation) for Mono (based on the early work of Zoltan).
|
||||
|
||||
New option `--noboundscheck' for benchmark purposes, it
|
||||
disables array bound checks.
|
||||
|
||||
Uses mmap instead of SysV shared memory for the Windows API
|
||||
emulation layer.
|
||||
|
||||
Plenty of bug fixes, improvements and integration with the
|
||||
upper layer class libraries.
|
||||
|
||||
New exception handling code uses the GCC native support for
|
||||
stack-walking if available and gives big performance boost
|
||||
(15% on mcs bootstrap).
|
||||
|
||||
A lot of the work in the new release of Mono is required for
|
||||
the Mono Debugger (which will be released separately). The
|
||||
Mono debugger is interesting, because it can debug both
|
||||
managed and unmanaged applications, but it only supports the
|
||||
JITer for debugging.
|
||||
|
||||
Dick, Dietmar, Gonzalo, Martin and Paolo were in charge of
|
||||
most of these changes.
|
||||
|
||||
* Compiler improvements:
|
||||
|
||||
Many bug fixes as usual, better C# compliancy.
|
||||
|
||||
Performance improvements. The new release of the Mono C#
|
||||
compiler is 37% faster than the previous version (self-compile
|
||||
is down to 8 seconds). On my P4 1.8Ghz machine, the Mono C#
|
||||
compiler compiles (342,000 lines per minute).
|
||||
|
||||
Thanks to go Ravi and Martin for helping out with the bug
|
||||
fixing hunt.
|
||||
|
||||
* Cryptography and Security classes
|
||||
|
||||
Sebastien Pouliot and Andrew Birkett were extremely busy
|
||||
during the past two months working on the cryptography
|
||||
classes, many of the crypto providers are now working
|
||||
|
||||
Jackson on the other hand helped us with the security
|
||||
classes, he said about those:
|
||||
|
||||
`Writing security classes is the most exciting thing I have
|
||||
ever done, I can not wait to write more of them'.
|
||||
|
||||
* ASP.NET:
|
||||
|
||||
We have now moved the code from the XSP server (which was our
|
||||
test bed for ASP.NET) into the right classes inside
|
||||
System.Web, and now any web server that was built by using the
|
||||
System.Web hosting interfaces can be used with Mono.
|
||||
|
||||
The sample XSP server still exists, but it is now just a
|
||||
simple implementation of the WorkerRequest and ApplicationHost
|
||||
classes and can be used to test drive ASP.NET. A big thanks
|
||||
goes to Gonzalo who worked on this night and day (mostly
|
||||
night).
|
||||
|
||||
Gaurav keeps helping us with the Web.Design classes, and
|
||||
improving the existing web controls.
|
||||
|
||||
* ADO.NET:
|
||||
|
||||
New providers are available in this release. The relentless
|
||||
System.Data team (Brian, Dan, Rodrigo, Tim and Ville) are
|
||||
hacking non-stop on the databse code. Improving existing
|
||||
providers, and new providers.
|
||||
|
||||
The new providers on this release:
|
||||
|
||||
* Oracle
|
||||
* MS SQL
|
||||
* ODBC
|
||||
* Sybase
|
||||
* Sqlite (for embedded use).
|
||||
|
||||
Many regression tests have been added as well (Ville has been
|
||||
doing a great job here).
|
||||
|
||||
Stuart Caborn contributed Writing XML from a DataSet.
|
||||
|
||||
* System.XML:
|
||||
|
||||
Atsushi has taken the lead in fixing and plugging the missing
|
||||
parts of the System.XML namespace, many fixes, many
|
||||
improvements.
|
||||
|
||||
* CodeDom and the C# provider.
|
||||
|
||||
Jackson Harper has been helping us with the various interface
|
||||
classes from the CodeDOM to the C# compiler, in this release
|
||||
a new assembly joins us: Cscompmgd. It is a simple assembly,
|
||||
and hence Microsoft decided not to waste an entire "System"
|
||||
"dot" on it.
|
||||
|
||||
* Testing
|
||||
|
||||
Nick Drochak has integrated the new NUnit 2.0 system.
|
||||
|
||||
* Monograph:
|
||||
|
||||
Monograph now has a --stats option to get statistics on
|
||||
assembly code.
|
||||
|
||||
|
||||
CVS Contributors to this release:
|
||||
|
||||
Alejandro Sanchez, Alp Toker, Andrew Birkett, Atsushi Enomoto,
|
||||
Brian Ritchie, Cesar Octavio Lopez Nataren, Chris Toshok,
|
||||
Daniel Morgan, Daniel Stodden, Dennis Hayes, Dick Porter,
|
||||
Diego Sevilla, Dietmar Maurer, Duncan Mak, Eduardo Garcia,
|
||||
Ettore Perazzoli, Gaurav Vaish, Gonzalo Paniagua, Jackson
|
||||
Harper, Jaime Anguiano, Johannes Roith, John Sohn, Jonathan
|
||||
Pryor, Kristian Rietveld, Mads Pultz, Mark Crichton, Martin
|
||||
Baulig, Martin Willemoes Hansen, Miguel de Icaza, Mike
|
||||
Kestner, Nick Drochak, Nick Zigarovich, Paolo Molaro, Patrik
|
||||
Torstensson, Phillip Pearson, Piers Haken, Rachel Hestilow,
|
||||
Radek Doulik, Rafael Teixeira, Ravi Pratap, Rodrigo Moya,
|
||||
Sebastien Pouliot, Tim Coleman, Tim Haynes, Ville Palo,
|
||||
Vladimir Vukicevic, and Zoltan Varga.
|
||||
|
||||
(Am sorry, I could not track everyone from the ChangeLog
|
||||
messages, I apologize in advance for the missing
|
||||
contributors).
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Hello!
|
||||
|
||||
Version 0.16 of Mono has been released! This is mostly a bug
|
||||
|
||||
@@ -19,4 +19,3 @@
|
||||
#undef MONO_SIZEOF_SUNPATH
|
||||
#undef NEED_LINK_UNLINK
|
||||
#undef PTHREAD_POINTER_ID
|
||||
#undef MONO_USE_EXC_TABLES
|
||||
+24
-15
@@ -4,6 +4,13 @@ AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono, 0.17)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
#
|
||||
# These are the flags that need to be stored in the mono.pc file for
|
||||
# compiling code that will embed Mono
|
||||
#
|
||||
libmono_cflags=""
|
||||
AC_SUBST(libmono_cflags)
|
||||
|
||||
# Thread configuration inspired by sleepycat's db
|
||||
AC_MSG_CHECKING([host platform characteristics])
|
||||
case "$host" in
|
||||
@@ -18,6 +25,7 @@ case "$host" in
|
||||
*-*-*bsd*)
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
|
||||
libmono_cflags="-D_THREAD_SAFE"
|
||||
LDFLAGS="$LDFLAGS -pthread"
|
||||
AC_DEFINE(NEED_LINK_UNLINK)
|
||||
AC_DEFINE(PTHREAD_POINTER_ID)
|
||||
@@ -25,14 +33,15 @@ case "$host" in
|
||||
;;
|
||||
*-*-linux*)
|
||||
platform_win32=no
|
||||
AC_DEFINE(MONO_USE_EXC_TABLES)
|
||||
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -fexceptions"
|
||||
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -DMONO_USE_EXC_TABLES -D_GNU_SOURCE -D_REENTRANT -fexceptions"
|
||||
libmono_cflags="-DMONO_USE_EXC_TABLES -fexceptions -D_REENTRANT"
|
||||
libdl="-ldl"
|
||||
;;
|
||||
*-*-solaris*)
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
|
||||
AC_DEFINE(NEED_LINK_UNLINK)
|
||||
libmono_cflags="-D_REENTRANT"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_WARN([*** Please add $host to configure.in checks!])
|
||||
@@ -369,24 +378,24 @@ if test x$platform_win32 = xno; then
|
||||
dnl ********************************
|
||||
dnl *** Checks for timezone stuff **
|
||||
dnl ********************************
|
||||
AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
|
||||
AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
|
||||
AC_TRY_COMPILE([
|
||||
#include <time.h>
|
||||
], [
|
||||
timezone = 1;
|
||||
], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
|
||||
if test $ac_cv_var_timezone = yes; then
|
||||
AC_DEFINE(HAVE_TIMEZONE)
|
||||
], [
|
||||
struct tm tm;
|
||||
tm.tm_gmtoff = 1;
|
||||
], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
|
||||
if test $ac_cv_struct_tm_gmtoff = yes; then
|
||||
AC_DEFINE(HAVE_TM_GMTOFF)
|
||||
else
|
||||
AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
|
||||
AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
|
||||
AC_TRY_COMPILE([
|
||||
#include <time.h>
|
||||
], [
|
||||
struct tm tm;
|
||||
tm.tm_gmtoff = 1;
|
||||
], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
|
||||
if test $ac_cv_struct_tm_gmtoff = yes; then
|
||||
AC_DEFINE(HAVE_TM_GMTOFF)
|
||||
], [
|
||||
timezone = 1;
|
||||
], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
|
||||
if test $ac_cv_var_timezone = yes; then
|
||||
AC_DEFINE(HAVE_TIMEZONE)
|
||||
else
|
||||
AC_ERROR(unable to find a way to determine timezone)
|
||||
fi
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
<configSections>
|
||||
<section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System" />
|
||||
|
||||
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System" />
|
||||
<sectionGroup name="system.web">
|
||||
<section name="httpHandlers" type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web" />
|
||||
<section name="httpModules" type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web" />
|
||||
<section name="machineKey" type="System.Web.Configuration.MachineKeyConfigHandler, System.Web" />
|
||||
<section name="authentication" type="System.Web.Configuration.AuthenticationConfigHandler, System.Web" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web>
|
||||
@@ -20,7 +23,16 @@
|
||||
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler" />
|
||||
</httpHandlers>
|
||||
<httpModules>
|
||||
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
|
||||
</httpModules>
|
||||
<authentication mode="Forms">
|
||||
<forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
|
||||
<credentials passwordFormat="Clear">
|
||||
<!--<user name="gonzalo" password="gonz"/>-->
|
||||
</credentials>
|
||||
</forms>
|
||||
</authentication>
|
||||
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
|
||||
</system.web>
|
||||
|
||||
<appSettings>
|
||||
@@ -28,5 +40,8 @@
|
||||
<!--<remove key="a key defined higher in the hierarchy" /> -->
|
||||
<!--<clear/> Removes all defined settings -->
|
||||
</appSettings>
|
||||
<system.diagnostics>
|
||||
<trace autoflush="false" indentsize="4" />
|
||||
</system.diagnostics>
|
||||
</configuration>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 448 B |
+40
-122
@@ -23,6 +23,7 @@
|
||||
<ul>
|
||||
<li><a href="http://www.go-mono.com/mysql.html">MySQL</a>
|
||||
<li><a href="http://www.go-mono.com/odbc.html">ODBC</a>
|
||||
<li><a href="http://www.go-mono.com/oracle.html">Oracle</a>
|
||||
<li><a href="http://www.go-mono.com/oledb.html">OLE DB</a>
|
||||
<li><a href="http://www.go-mono.com/postgresql.html">PostgreSQL</a>
|
||||
<li><a href="http://www.go-mono.com/sqlclient.html">Microsoft SQL Server</a>
|
||||
@@ -33,42 +34,43 @@
|
||||
some of these databases are supported via the ODBC or OLEDB providers.
|
||||
<ul>
|
||||
<li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a>
|
||||
<li>miniSQL
|
||||
<li><a href="http://www.oracle.com/">Oracle</a> - could be done by creating C# bindings to OCI (Oracle C Call Level Interface)
|
||||
<li>BerkeleyDB (Sleepycat)
|
||||
<li><a href="http://www.sapdb.org/">SapDB</a>
|
||||
<li>Microsoft Access - could be done by creating C# bindings to <a href="http://mdbtools.sourceforge.net">MDB Tools</a>
|
||||
<li>dbase or xbase type database files
|
||||
<li>Others, of course, are welcomed...
|
||||
|
||||
<li><a href="http://www.hughes.com.au/">miniSQL</a></li>
|
||||
<li><a href="http://www.sleepycat.com/">BerkeleyDB (Sleepycat)</a></li>
|
||||
<li><a href="http://www.sapdb.org/">SapDB</a></li>
|
||||
<li>Microsoft Access - could be done by creating C# bindings to <a href="http://mdbtools.sourceforge.net">MDB Tools</a></li>
|
||||
<li>dbase or xbase type database files</li>
|
||||
<li>Others are welcome</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<br>
|
||||
<li>Modify Pre-existing ADO.NET Providers to work with Mono. This may
|
||||
require fixing or implementing areas of Mono too.
|
||||
<ul>
|
||||
<li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a>
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> a PostgreSQL provider
|
||||
written in 100% C#
|
||||
<li><a href="http://sourceforge.net/projects/mysqldrivercs/">MySQLDriverCS</a> is a MySQL provider written in C#
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a MySQL Manager provider written in C#
|
||||
<li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a></li>
|
||||
<li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> is a PostgreSQL Managed data provider written
|
||||
in 100% C# and does not require a client library </li>
|
||||
<li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a MySQL Manager data provider written in 100% C# and does not
|
||||
require a client library</li>
|
||||
<li><a href="http://sourceforge.net/projects/mysqldrivercs/">MySQLDriverCS</a> is a MySQL data provider written in C#</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<br>
|
||||
<li>Create Tools for Configuration, Testing, and Entering SQL Queries
|
||||
<ul>
|
||||
<li><b>SQL# CLI - a command-line tool</b> to execute SQL commands,
|
||||
<li><b>SQL# CLI - a command-line tool</b> written in C# to
|
||||
execute SQL commands,
|
||||
test connection strings, and connect to various ADO.NET
|
||||
providers in Mono. The SQL# CLI can be found in
|
||||
mcs/tools/SqlSharp/SqlSharpCli.cs
|
||||
It is written in C# and runs on Mono and .NET
|
||||
|
||||
<li><p><b>SQL# GUI - a GUI tool</b> to execute SQL commands.
|
||||
mcs/tools/SqlSharp/SqlSharpCli.cs</li>
|
||||
<li><p><b>SQL# GUI - a GUI tool</b> written in C# to
|
||||
execute SQL commands.
|
||||
Currently, there is SQL# For GTK# which
|
||||
can be found at
|
||||
mcs/tools/SqlSharp/gui/gtk-sharp. It has a SQL editor with
|
||||
syntax hi lighting of SQL keywords
|
||||
|
||||
mcs/tools/SqlSharp/gui/gtk-sharp
|
||||
It has a SQL editor with
|
||||
syntax hi lighting of SQL keywords</li>
|
||||
<li><b>Configuration Command-Line and GUI Tools for ADO.NET</b>.
|
||||
These tools have not been started. The tools would be written in
|
||||
C# and run on Mono. The
|
||||
@@ -76,13 +78,13 @@
|
||||
<ul>
|
||||
<li>setup DSNs for the ODBC and OLE-DB
|
||||
providers and configurations for
|
||||
their underlying libraries (unixODBC and libgda)
|
||||
their underlying libraries (unixODBC and libgda)</li>
|
||||
<li>setup configurations for the Mono.Data.ProviderFactory
|
||||
that Brian Ritchie created
|
||||
that Brian Ritchie created</li>
|
||||
<li>setup native database client library configurations too, such as,
|
||||
freetds.conf for Microsoft SQL Server and Sybase
|
||||
freetds.conf for Microsoft SQL Server and Sybase</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
@@ -95,6 +97,18 @@
|
||||
<p><b>DataSet, DataAdaptor, DataTable, DataRelation, DataRow, DataColumn,
|
||||
DataColumnCollection, DataRowCollection, and others</b> need more work. There are
|
||||
many classes that are just stubs and need to be implemented.
|
||||
|
||||
<p><b>XML support in System.Data</b> needs work. This involves working on
|
||||
the classes: DataSet, XmlDataDocument, and the method ExecuteXmlReader() that
|
||||
exists in a provider's class that implements IDbCommand, and others.
|
||||
Stuart Caborn has started the XML support in a DataSet. Tim Coleman started
|
||||
XML support in the ExecuteXmlReader() in a SqlCommand.
|
||||
|
||||
<p><b>ADO.NET Provider Factory</b> has been started by Brian Ritchie. The
|
||||
Provider Factory is used to dynamically create
|
||||
connections, commands, parameters, and data adapters based on configuration information. This
|
||||
provider factory can also provide utility functions needed by a lot of
|
||||
providers but are not exposed via the provider.
|
||||
|
||||
<p><b>Integration with ASP.NET</b> has not been started, such as, data binding
|
||||
to a System.Web.UI.WebControls.DataGrid. This may involve implementing many classes
|
||||
@@ -135,103 +149,7 @@
|
||||
gtk+ widgets (GUI controls) for data access. There are some nifty widgets
|
||||
(GUI controls) that can be used, such as, GnomeDbGrid, GnomeDbBrowswer,
|
||||
GnomeDbSqlEditor, GnomeDbList, GnomeDbLogin, GnomeDbReportEditor, GnomeDbTableEditor,
|
||||
GnomeDbCombo, and GnomeDbForm. Rodrigo Moya is the best person to contact.
|
||||
|
||||
<p><b>XML support in System.Data</b> needs work. This involves working on
|
||||
the classes: DataSet, XmlDataDocument, and the method ExecuteXmlReader() that
|
||||
exists in a provider's class that implements IDbCommand, and others.
|
||||
Stuart Caborn has started the XML support in a DataSet. Tim Coleman started
|
||||
XML support in the ExecuteXmlReader() in a SqlCommand.
|
||||
|
||||
<p><b>ADO.NET Provider Factory</b> has been started by Brian Ritchie. The
|
||||
Provider Factory is used to dynamically create data provider
|
||||
connections and data adapters based on configuration information. This
|
||||
provider factory can also provide utility functions needed by a lot of
|
||||
providers but are not exposed via the provider.
|
||||
|
||||
<p><b>ADO.NET Multiplexor Provider</b> needs to be created. It can use the
|
||||
ADO.NET Provider Factory to create its connections and adapters, but the
|
||||
Multiplexor Provider is a Generic Provider that internally uses an existing
|
||||
provider based on configuration options. This is not
|
||||
part of Microsoft .NET, but it needs to be able to run on Microsoft .NET
|
||||
and Mono. This provider can be a generic provider, much like the ODBC.NET and
|
||||
OLEDB.NET providers are, but be written in 100% C# and be configurable via
|
||||
a configuration file. This provider will multiplex to other providers
|
||||
that exist. If one does not exist for a given DBMS,
|
||||
default to the ODBC or OLEDB .NET provider.
|
||||
|
||||
<p>According to Gonzalo, this is how the configuration could be implemented for
|
||||
the Provider Factory and Multiplexor Provider.
|
||||
|
||||
<p>After some work done in System.Configuration, you can now do something
|
||||
like:
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
// Get an instance of the multiplexor from machine.config file
|
||||
// Can be overriden in the application config file
|
||||
object o = ConnectionSettings.GetConfig
|
||||
("mono.data/multiplexor");
|
||||
if (o == null)
|
||||
--- error
|
||||
|
||||
Multiplexor mp = (Multiplexor) o;
|
||||
|
||||
// may be a string [] argument can help passing arguments
|
||||
IDbConnection cnc = mp.CreateConnection (providerName);
|
||||
</pre>
|
||||
|
||||
<p>and in the machine.config file:
|
||||
|
||||
<pre>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="mono.data"
|
||||
type="Mono.Data.MultiplexorSectionHandler,Mono.Data"/>
|
||||
....
|
||||
</configSections>
|
||||
...
|
||||
<sectionGroup name="mono.data">
|
||||
<multiplexor>
|
||||
<add provider="PostgreSQL"
|
||||
type="Mono.Data.PostgreSQLClient,Mono.Data"
|
||||
validate="false"
|
||||
parameters="USER=xxx;HOST=127.0.0.1;DBNAME=xxx"/>
|
||||
</multiplexor>
|
||||
</sectionGroup>
|
||||
</configuration>
|
||||
</pre>
|
||||
|
||||
<p>validate="false" tells MultiplexorSectionHandler not to load the Type
|
||||
until an instance is required. You can add more attributes or whatever
|
||||
inside <multiplexor> as long as MultiplexorSectionHandler parses it.
|
||||
|
||||
<pre>
|
||||
public class MultiplexorSectionHandler :
|
||||
IConfigurationSectionHandler
|
||||
{
|
||||
public object Create (object parent,
|
||||
object configContext,
|
||||
XmlNode section)
|
||||
{
|
||||
Multiplexor mp;
|
||||
// Here you get the ChildNodes and
|
||||
// set up a Multiplexor
|
||||
// instance that will hold the information
|
||||
// needed to create
|
||||
// instances of each provider. Only one
|
||||
// instance will be
|
||||
// created by the config system.
|
||||
return mp;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<p>This way, if our providers works with MS, the user can test them in both
|
||||
MS and mono by just adding a few lines to machine.config (i still have
|
||||
to upload a default machine.config file for mono). And this is the .NET
|
||||
way of doing it (of course, if you prefer, you can use the other config
|
||||
file. I just wanted to make people aware of this feature that now works
|
||||
on mono).
|
||||
GnomeDbCombo, and GnomeDbForm. Rodrigo Moya is the best person to contact.
|
||||
|
||||
<p><b>Building System.Data</b>
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
Support runtime for Visual Basic applications
|
||||
|
||||
<li><a
|
||||
href="http://www.go-mono.com/class-status-Windows.Forms.html">Windows.Forms</a>:
|
||||
href="http://www.go-mono.com/class-status-System.Windows.Forms.html">Windows.Forms</a>:
|
||||
there is also a <a
|
||||
href="http://lists.ximian.com/mailman/listinfo/mono-winforms-list">mailing
|
||||
list available</a>
|
||||
|
||||
+280
@@ -0,0 +1,280 @@
|
||||
* Cryptography
|
||||
|
||||
In the .NET framework cryptography can be found under a number of
|
||||
namespaces in several assemblies.
|
||||
|
||||
** Assembly: corlib
|
||||
|
||||
*** Namespace: <b>System.Security.Cryptography</b>
|
||||
|
||||
Thanks to the work of many people this namespace is almost complete.
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
* Every classes are present.
|
||||
|
||||
* Most classes have their unit tests.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
<ul>
|
||||
* Support for adding/modifying algorithms and OID using the
|
||||
<code>machine.config</code> configuration file (in progress).
|
||||
|
||||
* RNGCryptoServiceProvider is currently only working on Linux.
|
||||
The current implementation reside in Mono's runtime and use
|
||||
the <code>/dev/[u]random</code> device (which do not exists
|
||||
under Windows). A Windows alternative is in the work...
|
||||
|
||||
* Keypair persistance for RSA and DSA. This persistance must
|
||||
somehow be linked with X509 certificate stores (in planning).
|
||||
|
||||
* <code>PasswordDeriveBytes</code> is currently limited to
|
||||
generating keys with the maximum length equals to the hash
|
||||
output (as specified in PKCS #5). However the framework
|
||||
implementation allows for longer keys to be generated. Also
|
||||
the algorithms used by CryptDeriveKey (used by Windows
|
||||
applications) are unknown.
|
||||
|
||||
* Analyse the current coverage of the unit tests on the
|
||||
cryptographic classes and complete the unit tests.
|
||||
|
||||
* Optimizations (performance) on most class are possible. Some
|
||||
have been done using the Community Edition of BoundChecker
|
||||
(a free VisualStudio addon) - recommanded!
|
||||
</ul>
|
||||
|
||||
**** Notes
|
||||
<ul>
|
||||
* All cryptographic algorithms are entirely managed, including
|
||||
classes named <code>*CryptoServiceProvider</code>, with the
|
||||
exception of <code>RNGCryptoServiceProvider</code> (which
|
||||
resides in the runtime).
|
||||
</ul>
|
||||
|
||||
|
||||
*** Namespace: <b>System.Security.Cryptography.X509Certificates</b>
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
* X.509 certificates are parsed using 100% managed code.
|
||||
|
||||
* Software Publisher Certificates (SPC) used by Authenticode
|
||||
(tm) to sign assemblies are supported (extraction from PE
|
||||
files) but <b>not</b> validated.
|
||||
|
||||
* Tests are generated from a set of existing certificates
|
||||
(about a dozen) each having different properties. Another
|
||||
set of certificates (more than 300) are used for a more
|
||||
complete test (but isn't part of the test suite for size
|
||||
and time consideration).
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
<ul>
|
||||
* Authenticode(tm) support is incomplete. We can extract the
|
||||
certificates from PE files but cannot validate the signature
|
||||
nor the certificate chain (and we're still missing some trust
|
||||
anchors).
|
||||
|
||||
* Integration with CryptoAPI isn't possible as long as the
|
||||
<code>X509Certificate(IntPtr)</code> constructor isn't
|
||||
completed.
|
||||
</ul>
|
||||
|
||||
**** Notes
|
||||
<ul>
|
||||
* <b>There's no validation of the certificates</b> done in this
|
||||
class (this isn't a restriction of Mono!). This means that
|
||||
certificate signatures and validity dates are never checked!
|
||||
|
||||
* The newer X509Certificate class included in Microsoft's Web
|
||||
Service Enhancement (WSE) is a little better (as it includes
|
||||
validation).
|
||||
|
||||
* Microsoft implementation of <code>X509Certificate</code> is
|
||||
done by using CryptoAPI. From the exceptions thrown
|
||||
Authenticode(tm) support is done via COM.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
** Assembly: System.Security
|
||||
|
||||
*** Namespace: <b>System.Security.Cryptography.Xml</b>
|
||||
|
||||
This namespace implements the XML Digital Signature specification from
|
||||
W3C.
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
* All classes are present but some are only stubbed.
|
||||
|
||||
* Most classes have their unit tests.
|
||||
|
||||
* This assembly is present in CVS but isn't (yet) part of the
|
||||
build.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
<ul>
|
||||
* All the transforms needs to be done. But this requires far
|
||||
more XML knowledge than crypto.
|
||||
|
||||
* Fix the tests (see notes) then include the assembly into the
|
||||
build process.
|
||||
</ul>
|
||||
|
||||
**** Notes
|
||||
<ul>
|
||||
* Many current tests fails because the XML generated by Mono
|
||||
isn't exactly the same as the one produced by the Microsoft
|
||||
implementation (but 100% equivalent). We'll either have to
|
||||
change the XML code or the tests.
|
||||
|
||||
* Testing is difficult because the classes use CryptoConfig
|
||||
to create the required cryptographic objects. When running
|
||||
the unit tests the CryptoConfig executing is the one in
|
||||
mscorlib (not Mono's one) so it doesn't return the expected
|
||||
objects. This results in InvalidCastException.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
** Assembly: Mono.Security.Win32
|
||||
|
||||
This assembly is to provide maximum compatibility with CryptoAPI to
|
||||
application running with Mono's runtime on the Windows operating
|
||||
system.
|
||||
|
||||
<b>This assembly should NEVER be used directly by any application</b>.
|
||||
The classes should only be used by modifying the <code>machine.config
|
||||
</code> configuration file (and then only if this increased
|
||||
compatibility is required by an application).
|
||||
|
||||
*** Namespace: Mono.Security.Cryptography
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
* A RNGCryptoServiceProvider built on top of CryptoAPI.
|
||||
|
||||
* Not (yet) commited in CVS.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
<ul>
|
||||
* Unmanaged versions of hash algorithms (SHA1 and MD5).
|
||||
* Unmanaged versions of symmetric encryption algorithms
|
||||
(like DES, TripleDES, RC2 and others present in CryptoAPI).
|
||||
* Unmanaged versions of asymmetric algorithms (like DSA and
|
||||
RSA) which persist their keypair into the specified CSP.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
** Assembly: Microsoft.Web.Services
|
||||
|
||||
Microsoft Web Service Enhancement (WSE), known as Web Service
|
||||
Development Kit (WSDK) in it's beta days, is an add-on the .NET
|
||||
framework that implements WS-Security (and other WS-* specifications).
|
||||
It also includes improved support for XML Signature (replacing and/or
|
||||
extending <code>System.Security.Cryptography.Xml</code>) and X509
|
||||
certificates.
|
||||
|
||||
Note: WSE is distributed as an add-on because the WS-Security
|
||||
specification isn't yet completed by OASIS.
|
||||
|
||||
<b>There are some licensing issues to consider before stating to
|
||||
implement WS-Security. All contributors must sign an agreement with
|
||||
Microsoft before commiting anything related to WS-Security into CVS.
|
||||
</b>
|
||||
|
||||
*** Namespace: Microsoft.Web.Services.Security
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
* Nothing (yet) commited in CVS.
|
||||
</ul>
|
||||
|
||||
*** Namespace: Microsoft.Web.Services.Security.X509
|
||||
|
||||
**** Status
|
||||
<ul>
|
||||
* Nothing (yet) commited in CVS.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
<ul>
|
||||
* We need to define certificate stores (for both users and
|
||||
machines). These sames stores must be linked with asymmetric
|
||||
keypairs. This could also be used to store the SPC roots.
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
** Other stuff
|
||||
|
||||
There are other, not so visible, uses of cryptography both inside and
|
||||
outside the class library - such as:
|
||||
|
||||
<ul>
|
||||
* SSL/TLS for secure communication (investigation under way).
|
||||
|
||||
* Assembly signing (and verification) using StrongNames.
|
||||
|
||||
* Assembly signing (and verification) using Authenticode(tm).
|
||||
</ul>
|
||||
|
||||
|
||||
*** Tools
|
||||
|
||||
There are many tools in the .NET framework that indirectly interacts
|
||||
with some cryptographic classes. Mono will eventually need these tools.
|
||||
|
||||
**** Status
|
||||
|
||||
The following tools are complete:
|
||||
<ul>
|
||||
* <code>secutil</code> is a tool to extract certificates and
|
||||
strongnames from assemblies in a format that can be easily
|
||||
re-used in source code (C# or VB.NET syntax).
|
||||
|
||||
* <code>cert2spc</code> is a tool to transform multiple X.509
|
||||
certificates (a chain) into a Software Publisher Certificate
|
||||
(SPC) - which is a long name for a simple PKCS#7 file.
|
||||
</ul>
|
||||
|
||||
**** TODO
|
||||
The following tools are still missing or incomplete:
|
||||
<ul>
|
||||
* <code>monosn</code> is a clone of the <code>sn</code> to manage
|
||||
strongnames. This tools is part of the runtime (not the class
|
||||
library) and as such is written in C.
|
||||
|
||||
* <code>signcode</code> and <code>chktrust</code> for signing
|
||||
and validating Authenticode(tm) signatures on assemblies.
|
||||
|
||||
* <code>makecert</code> to create X.509 test certificates that
|
||||
can be used (once transformed in SPC) to sign assemblies.
|
||||
|
||||
* Other tools like a, GUI-based, certificate manager...
|
||||
</ul>
|
||||
|
||||
Note that many of the tools requires the class library and/or the
|
||||
runtime to be ready for them.
|
||||
|
||||
<hr>
|
||||
** How to Help
|
||||
|
||||
Complete any of the TODO (and feel good about it ;-).
|
||||
|
||||
Add missing unit tests to classes or methods.
|
||||
|
||||
Write some documentation on the cryptographic classes for MonkeyGuide
|
||||
(as I'm not a good writer - but you must be a good reader if you got to
|
||||
this part).
|
||||
|
||||
Optimization can also be done on algorithms as crypto is never fast
|
||||
enough. Just be sure to test every optimization (using the unit test)
|
||||
carefully - it's so fast to break an algorithm ;-).
|
||||
|
||||
Contact Sebastien Pouliot (<a href="mailto:[email protected]">home</a>
|
||||
, <a href="mailto:[email protected]">work</a>) if you need additional
|
||||
informations about the status of the cryptographic classes.
|
||||
|
||||
+191
-74
@@ -6,12 +6,147 @@
|
||||
href="runtime.html">Runtime</a> description for more details
|
||||
on this part of the project.
|
||||
|
||||
The software is also available on the `Mono' channel in <a href="http://www.ximian.com/products/redcarpet/">Red Carpet</a>.
|
||||
|
||||
Some useful links: <a
|
||||
href="http://www.go-mono.org/mono-beginning.html">Resources/Beginning
|
||||
section</a>, the <a
|
||||
href="http://www.go-mono.org/faq.html">FAQ</a> and the <a
|
||||
href="http://geneura.ugr.es/~jaime/deploy/mono-common-problems.html">
|
||||
Mono Common Problems</a>.
|
||||
href="http://www.go-mono.org/faq.html">FAQ</a>.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
<td>
|
||||
<b>Release 0.17</b><br>
|
||||
<a href="archive/mono-0.17">Release notes</a><br>
|
||||
Dec 9th, 2002.
|
||||
</td>
|
||||
<td>
|
||||
<table cellspacing="1" cellpadding="3">
|
||||
<tr bgcolor="#BBBBBB">
|
||||
<td>
|
||||
<b>Source Code</b>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li><a href="archive/mcs-0.17.tar.gz">Mono Class Libraries and C# Compiler.</a>
|
||||
<li><a href="archive/mono-0.17.tar.gz">Mono Runtime</a>
|
||||
<li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
|
||||
<li><a href="archive/xsp-0.2.tar.gz">XSP web server</a> <b><font color="#dd0000">New!</font></b>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr bgcolor="#BBBBBB">
|
||||
<td>
|
||||
<b>Source RPMs</b><br>
|
||||
(No RPMS for XSP).
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
|
||||
<li><a href="archive/mono-0.17-2.src.rpm">mono-0.17-2.src.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.3/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-73-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-0.17-2.i386.rpm">mono-0.17-2.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-devel-0.17-2.i386.rpm">mono-devel-0.17-2.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-72-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-0.17-2.i386.rpm">mono-0.17-2.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-devel-0.17-2.i386.rpm">mono-devel-0.17-2.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.1/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-71-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-0.17-2.i386.rpm">mono-0.17-2.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-devel-0.17-2.i386.rpm">mono-devel-0.17-2.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Mandrake 8.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-6.1-1.i586.rpm">libgc-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-devel-6.1-1.i586.rpm">libgc-devel-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-0.17-2.i586.rpm">mono-0.17-2.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-devel-0.17-2.i586.rpm">mono-devel-0.17-2.i586.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>SuSE 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/suse-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-0.17-1.i386.rpm">mono-0.17-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-devel-0.17-1.i386.rpm">mono-devel-0.17-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-0.17-2.i386.rpm">mono-0.17-2.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-devel-0.17-2.i386.rpm">mono-devel-0.17-2.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Windows Setup Wizard (NT/2000/XP)</b>
|
||||
<ul>
|
||||
<li><a href="archive/mono-0.17-stable.exe">Mono-Setup</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Debian packages</b>
|
||||
<ul>
|
||||
<li><a href="http://www.atoker.com/mono/">Alp's web site</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr bgcolor="#CCCCC">
|
||||
<td>
|
||||
<b>Regression Tests</b><br>
|
||||
</td>
|
||||
<td>
|
||||
You can get binaries for the Mono Regression Test
|
||||
Suite <a href="archive/mono-tests.tar.gz">here</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
* Older Releases:
|
||||
|
||||
We provide binaries for older releases until we have packages for the new release.
|
||||
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
@@ -49,66 +184,6 @@
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.3/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-73-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-0.16-1.i386.rpm">mono-0.16-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-devel-0.16-1.i386.rpm">mono-devel-0.16-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-72-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-0.16-1.i386.rpm">mono-0.16-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-devel-0.16-1.i386.rpm">mono-devel-0.16-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.1/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-71-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-0.16-1.i386.rpm">mono-0.16-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-devel-0.16-1.i386.rpm">mono-devel-0.16-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Mandrake 8.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-6.1-1.i586.rpm">libgc-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-devel-6.1-1.i586.rpm">libgc-devel-6.1-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-0.16-1.i586.rpm">mono-0.16-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-devel-0.16-1.i586.rpm">mono-devel-0.16-1.i586.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>SuSE 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/suse-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-0.16-1.i386.rpm">mono-0.16-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-devel-0.16-1.i386.rpm">mono-devel-0.16-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-0.16-1.i386.rpm">mono-0.16-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-80-i386/mono-devel-0.16-1.i386.rpm">mono-devel-0.16-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Linux s390</b>
|
||||
@@ -121,12 +196,6 @@
|
||||
<li><a href="archive/s390/mono-devel-0.16-1.s390.rpm">mono-devel-0.16-1.s390.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Windows Setup Wizard (NT/2000/XP)</b>
|
||||
<ul>
|
||||
<li><a href="archive/mono-0.16-stable.exe">Mono-Setup</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -144,11 +213,6 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
* Older Releases:
|
||||
|
||||
We provide binaries for older releases until we have packages for the new release.
|
||||
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
@@ -231,6 +295,21 @@
|
||||
The <a href="anoncvs.html">anoncvs</a> mirrors provided by
|
||||
Hispalinux are updated every six hours.
|
||||
|
||||
* Compiling the code
|
||||
|
||||
There are a number of ways of compiling Mono
|
||||
|
||||
<ul>
|
||||
<li>From the <a href="#scripts">scripts</A>
|
||||
|
||||
<LI><a href="#install">Manually</a> for the first time.
|
||||
|
||||
<li>Manually, <a href="#upgrade">while upgrading</a> to CVS
|
||||
</ul>
|
||||
|
||||
(which is an easy way to get the latest CVS information)
|
||||
|
||||
<a name="scripts">
|
||||
* Compiling with scripts
|
||||
|
||||
There are scripts to help build mono for both Unix and Windows. Get
|
||||
@@ -309,6 +388,7 @@
|
||||
|
||||
You can change /usr/local to something else if you want.
|
||||
</ul>
|
||||
|
||||
|
||||
*** On Windows, to install and work on the compiler and the class libraries:
|
||||
|
||||
@@ -431,3 +511,40 @@ make install
|
||||
|
||||
</ul>
|
||||
|
||||
<a name="upgrading">
|
||||
** Upgrading
|
||||
|
||||
To upgrade your Mono installation from CVS, it is very
|
||||
important that you update your Mono and MCS modules from CVS
|
||||
at the same time. Failure to do so might result in a
|
||||
problematic installation as the runtime and the class
|
||||
libraries will be out of sync.
|
||||
|
||||
Run the following commands to update your CVS tree (more
|
||||
details in <a href="ccvs.html">Cvs and Mono</a> and the <A
|
||||
href="anoncvs.html">AnonCVS and Mono</a> pages).
|
||||
|
||||
<pre>
|
||||
(cd mono; cvs update -dP .)
|
||||
(cd mcs; cvs update -dP .)
|
||||
</pre>
|
||||
|
||||
Once you have updated your sources, remove any cached
|
||||
assemblies or old binaries from the Mono "runtime" directory,
|
||||
and then compile each component:
|
||||
|
||||
<pre>
|
||||
(cd mono/runtime; rm *exe *dll)
|
||||
(cd mono; make)
|
||||
(cd mcs; make)
|
||||
</pre>
|
||||
|
||||
Now you can install the result:
|
||||
|
||||
<pre>
|
||||
(cd mono; make install)
|
||||
</pre>
|
||||
|
||||
Notice that following the above procedure does not require you
|
||||
to manually install the software in the `mcs' directory, as
|
||||
the relevant files will be copied by the `mono' makefiles.
|
||||
@@ -3,6 +3,7 @@
|
||||
<a href="#gnome">Mono and GNOME</a><br>
|
||||
<a href="#gui">Building GUI applications with Mono</a><br>
|
||||
<a href="#msft">Mono and Microsoft</a><br>
|
||||
<a href="#platforms">Mono platforms</a><br>
|
||||
<a href="#pnpproject">Mono and the Portable.NET Project</a><br>
|
||||
<a href="#webservices">Web Services</a><br>
|
||||
<a href="#asp">Mono and ASP.NET</a><br>
|
||||
@@ -314,14 +315,16 @@ A: We do not know, volunteers are working on this, but there is no set
|
||||
|
||||
Q: Is Microsoft helping Ximian with this project?
|
||||
|
||||
A: No. Ximian CTO Miguel de Icaza had a friendly conversation with
|
||||
Microsoft software architect David Stutz, but that's about the
|
||||
extent of the contact. Microsoft is interested in other
|
||||
implementations of .NET and are willing to help make the ECMA spec
|
||||
more accurate for this purpose.
|
||||
A: There is no high level communication between Ximian and Microsoft
|
||||
at this point, but engineers who work on .NET or the ECMA groups
|
||||
have been very friendly, and very nice to answer our questions, or
|
||||
clarify part of the specification for us.
|
||||
|
||||
Ximian representatives have also spoken with Sam Ruby at the ECMA
|
||||
TG3 committee to discuss the same issues.
|
||||
Microsoft is interested in other implementations of .NET and are
|
||||
willing to help make the ECMA spec more accurate for this purpose.
|
||||
|
||||
Ximian was also invited to participate in the ECMA committee
|
||||
meetings for C# and the CLI.
|
||||
|
||||
Q: Is Microsoft or Corel paying Ximian to do this?
|
||||
|
||||
@@ -425,6 +428,44 @@ A: Not yet, but the client side API for authentication is not the problem.
|
||||
Alliance APIs. The problem is people on the web provider end that might use
|
||||
this for authentication.
|
||||
|
||||
<a name="platforms"></a>
|
||||
** Mono Platforms
|
||||
|
||||
Q: What operating systems does Mono run on?
|
||||
|
||||
A: Mono is known to run on Linux, Unix and Windows systems.
|
||||
|
||||
Q: What architectures does Mono support?
|
||||
|
||||
A: Mono today ships with a Just-in-Time compiler for x86-based
|
||||
systems. It is tested regularly on Linux, FreeBSD and Windows
|
||||
(with the XP/NT core).
|
||||
|
||||
There is also an interpreter, which is slower that runs on the
|
||||
s390, SPARC and PowerPC architectures.
|
||||
|
||||
Q: Can Mono run on Windows 9x, or ME editions?
|
||||
|
||||
A: Mono requires Unicode versions of Win32 APIs to run,
|
||||
and only a handful of *W functions is supported under Win9x.
|
||||
|
||||
There is Microsoft Layer for Unicode that provides implementation
|
||||
of these APIs on 9x systems.
|
||||
|
||||
Unfortunately it uses linker trick for delayed load that is not
|
||||
supported by ld, so some sort of adapter is necessary.
|
||||
|
||||
You will need MSLU and one of the following libs to link Mono to
|
||||
unicows.dll <a
|
||||
href="http://mono.eurosoft.od.ua/files/unimono.zip">http://mono.eurosoft.od.ua/files/unimono.zip</a>
|
||||
or alternatively search the net for "libunicows".
|
||||
|
||||
No changes to Mono source code required, the only thing is to make
|
||||
sure that linker will resolve imports to adapter library instead of
|
||||
Win32 libs. This is achieved by inserting -lunimono before
|
||||
-lkerner32/user32 in the linker's specs file.
|
||||
|
||||
|
||||
<a name="pnpproject"></a>
|
||||
** Mono and Portable.NET
|
||||
|
||||
@@ -436,13 +477,20 @@ A: Most of Mono is being written using C#, with only
|
||||
|
||||
It is easier to describe what is unique about Mono:
|
||||
<ul>
|
||||
<li> A Just-in-Time compiler engine. This is important for
|
||||
making your applications fast.
|
||||
|
||||
<li> A self-hosting C# compiler written in C#, which is clean, easy
|
||||
to maintain.
|
||||
|
||||
<li> Focus on the .NET Framework: we are tracking down the .NET
|
||||
Framework API definition, as we believe it is the API people
|
||||
will be most familiar with.
|
||||
|
||||
<li> A multi-platform runtime engine: both a JIT engine and an
|
||||
interpreter exist. The JIT engine runs currently on x86
|
||||
systems, while the interpreter works on SPARC, StrongARM and
|
||||
PowerPC systems.
|
||||
systems, while the interpreter works on SPARC, StrongARM,
|
||||
s390 and PowerPC systems.
|
||||
|
||||
<li> Supports Linux, Windows and Solaris at this point.
|
||||
|
||||
@@ -471,8 +519,9 @@ A: Most of Mono is being written using C#, with only
|
||||
<li> We have a great community of developers, without which Mono
|
||||
would not be possible.
|
||||
|
||||
<li> We will provide an ahead of time compilation mode in the
|
||||
future.
|
||||
<li> We are working on an ahead of time compilation mode to
|
||||
pre-compile code for the target architecture (this is part
|
||||
of our new code generation effort).
|
||||
</ul>
|
||||
|
||||
<a name="webservices"></a>
|
||||
@@ -659,6 +708,16 @@ Q: I'm wondering if there are any plans to start using nant to build the
|
||||
A: Maybe well be doing some sort of automated build process + testing when
|
||||
the summer finish.
|
||||
|
||||
Q: My C code uses the __stdcall which is not availble on Linux, how can I
|
||||
make the code portable Windows/Unix across platforms?
|
||||
|
||||
A: Replace the __stdcall attribute with the STDCALL macro, and include this
|
||||
in your C code for newer gcc versions:
|
||||
|
||||
#ifndef STDCALL
|
||||
#define STDCALL __attribute__((stdcall))
|
||||
#endif
|
||||
|
||||
<a name="asp">
|
||||
** Mono and ASP.NET
|
||||
|
||||
@@ -704,6 +763,12 @@ A: We are implementing all the classes in Microsoft .NET's System.Data, so
|
||||
you can be sure that things will work the same in Mono as with the Microsoft
|
||||
implementation.
|
||||
|
||||
Q: Does Mono can to connect to Sybase by using Mono.Data.*?
|
||||
|
||||
A: Yes. use Mono.Data.SybaseClient. First of all you have to create a
|
||||
SybaseConnection, and then, from it, use it as any other
|
||||
IDbConnection-based class.
|
||||
|
||||
<a name="java">
|
||||
** Mono and Java
|
||||
|
||||
@@ -773,6 +838,17 @@ A: Yes. Eto Demerzal has started a Rhino port to C#.
|
||||
After this is completed, we will begin developing
|
||||
the JavaScript compiler.
|
||||
|
||||
Q: Can Mono or .NET share system classes (loaded from mscore.dll and other
|
||||
libs) or will it behave like Sun's Java VM?
|
||||
|
||||
A: What you can do with mono is to load different applications in their own
|
||||
application domain: this is a feature of the CLR that allows sandboxing
|
||||
applications inside a single process space. This is usualy exploited to
|
||||
compartmentalize different parts of the same app, but it can also be
|
||||
effectively used to reduce the startup and memory overhead.
|
||||
Using different appdomains the runtime representation of types and
|
||||
methods is shared across applications.
|
||||
|
||||
<a name="extending"></a>
|
||||
** Extending Mono
|
||||
|
||||
@@ -1030,9 +1106,6 @@ A: We will have to evaluate the licenses for compatibility first,
|
||||
but as a general rule, we will accept the code under the same
|
||||
terms of the "container" module.
|
||||
|
||||
Q: Is the Mono
|
||||
|
||||
|
||||
<a name="patents"></a>
|
||||
** Patents
|
||||
|
||||
@@ -1140,6 +1213,15 @@ A: GtkHTML is just a lightweight HTML rendering engine that does not
|
||||
Linux when disconnected from the Web (and that has better
|
||||
interactions than a web page).
|
||||
|
||||
Q: Is there a command-line tool that allows me to access .NET interactively?
|
||||
|
||||
A: There are several but one that is free software and uses MCS is the one
|
||||
Dennis Lu from Rice University is working on; a REPL C# interpreter.
|
||||
|
||||
Q: Is it possible to use Visual C++ with Mono?.
|
||||
|
||||
A: Well, It's possible to run VC++ generated apps under Mono though.
|
||||
|
||||
<a name="problems"></a>
|
||||
** Mono Common Problems
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
* Gtk#
|
||||
|
||||
<a href="http://gtk-sharp.sourceforge.net">Gtk#</a> (Gtk
|
||||
sharp) is a set of C# language bindings for the
|
||||
<a href="http://www.gtk.org">Gtk+</a> toolkit and other
|
||||
libraries that are part of the <a
|
||||
href="http://www.gnome.org">GNOME</a> platform .
|
||||
|
||||
** API of Gtk#
|
||||
|
||||
The API is browsable
|
||||
<a
|
||||
href="http://primates.ximian.com/~tvgm/gtk-sharp-docs/">here</a>
|
||||
|
||||
** Where to learn more.
|
||||
|
||||
Visit the official site for the <a
|
||||
href="http://gtk-sharp.sourceforge.net">Gtk# Project</a>.
|
||||
The <a href="http://www.go-mono.org/faq">Mono FAQ</a> has some useful
|
||||
information too.
|
||||
|
||||
@@ -91,7 +91,86 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@item Dec 9th, 2002: VB.NET, Oracle Provider.
|
||||
@item Jan 10th, 2003: Mono Weekly News.
|
||||
|
||||
A new issue of the <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2003-January/004903.html">Mono
|
||||
Weekly News</a> has been published.
|
||||
|
||||
Check out the <a href="crypto.html">Crypto status</a> page
|
||||
that Sebastien has put together.
|
||||
|
||||
@item Jan 3rd, 2003: Glade#, Code Coverage, Apache, MBas, Debugger.
|
||||
|
||||
Rachel has made Glade# use attributes so binding C# widgets to
|
||||
the designed widgets is now easier than ever. Alp has
|
||||
improved this to use implicit names as well.
|
||||
|
||||
Martin's Mono debugger now has support for multi-thread
|
||||
debugging. Special feature: breakpoints can be defined in a
|
||||
per-thread basis now.
|
||||
|
||||
Daniel López has checked in his Apache module to integrate
|
||||
Mono and Mono's ASP.NET support as an Apache module. Gonzalo
|
||||
has folded his new Mono hosting classes into this module (they
|
||||
are now shared between XSP and mod_mono). You can get the
|
||||
mod_apache from CVS (module name: mod_mono).
|
||||
|
||||
Mono Basic improvements: Marco has added support for more
|
||||
statements on the grammar.
|
||||
|
||||
Zoltan has <a href="http://www.nexus.hu/vargaz2/">posted</a>
|
||||
his Code Coverage analysis tool for Mono.
|
||||
|
||||
@item Dec 17th, 2002: Mono: Commercial uses.
|
||||
|
||||
<a href="http://www.tipic.com">Tipic</a> today <a
|
||||
href="http://www.ximian.com/about_us/press_center/press_releases/index.html?pr=tipic_mono">announced</a>
|
||||
their work on porting their Instant Messaging Server platform
|
||||
to run on Mono.
|
||||
|
||||
<a href="http://www.winfessor.com">Winfessor</a> also <a
|
||||
href="http://www.winfessor.com/press.asp">announced</a> the
|
||||
availability of their Jabber SDK to run on Mono.
|
||||
|
||||
Also two weeks ago we mentioned <a
|
||||
href="http://www.openlinksw.com">OpenLink Software's</a> <a
|
||||
href="http://www.ximian.com/about_us/press_center/press_releases/index.html?pr=openlink_mono">announcement</a>
|
||||
of their product, also using Mono.
|
||||
|
||||
@item Dec 10th, 2002: Gtk# 0.6 released; Mono 0.17 packages for Windows and Debian.
|
||||
|
||||
Mike Kestner <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2002-December/003961.html">announced
|
||||
Gtk# 0.6</a>. This new release includes many new features and
|
||||
bug fixes, and is the perfect companion to the <a
|
||||
href="archive/mono-0.17">Mono 0.17</a> release.
|
||||
|
||||
Johannes has contributed a Windows-ready package of Mono 0.17,
|
||||
and its available from our <a
|
||||
href="download.html">download</a> page.
|
||||
|
||||
Alp Toker has <a href="http://www.atoker.com/mono/">Debian packages</a>
|
||||
|
||||
@item Dec 9th, 2002: Mono 0.17 has been released
|
||||
|
||||
Mono 0.17 has been released. Check out the <a
|
||||
href="archive/mono-0.17">release notes</a> for a more detailed
|
||||
list. You can get it <a href="download.html">here</a>.
|
||||
|
||||
Many new features as well as plenty of bug fixes. Many new
|
||||
System.Data providers and a more mature System.Web (ASP.NET)
|
||||
which can now be hosted in any web server. A simple <a
|
||||
href="archive/xsp-0.2.tar.gz">test web server</a> to host
|
||||
asp.net has been released as well.
|
||||
|
||||
This version also integrates Neale's s390 port.
|
||||
|
||||
This release also includes a new exception handling system
|
||||
that uses the gcc exception information that vastly improves
|
||||
our internalcall speed (15% faster mcs compilation times).
|
||||
|
||||
@item Dec 8th, 2002: VB.NET, Oracle Provider.
|
||||
|
||||
Marco has got the Mono Basic compiler up to speed (support for
|
||||
classes, modules, expressions, object creation, method
|
||||
@@ -493,6 +572,8 @@
|
||||
|
||||
@item Aug 20th, 2002: Remoting work, Resources, SPARC checkins, ADO.NET
|
||||
|
||||
<b>San Francisco</b>: August 14th. Linux World Expo.
|
||||
|
||||
Mark Crichton has checked in his patches to get the SPARC port
|
||||
on par with the PPC port.
|
||||
|
||||
|
||||
+19
-1
@@ -8,6 +8,14 @@
|
||||
* <a href="#MonoLogo">MonoLogo</a>
|
||||
* <a href="#Oberon">Oberon</a>
|
||||
* <a href="#Forth">Forth</a>
|
||||
* <a href="#mbas">Mono Basic</a> (Mono's VB.NET compiler)
|
||||
</ul>
|
||||
|
||||
Languages which are known to run, but we have not done a
|
||||
complete ran of all their regression tests to validate it:
|
||||
|
||||
<ul>
|
||||
* Kylix.NET.
|
||||
</ul>
|
||||
|
||||
Languages we would like to have supported, with links to resources:
|
||||
@@ -28,8 +36,11 @@
|
||||
** Java
|
||||
|
||||
There is a very interesting project to make a JavaVM for .NET
|
||||
<a href="http://radio.weblogs.com/0109845/">here</a>
|
||||
<a href="http://radio.weblogs.com/0109845/">here</a>.
|
||||
Currently this will not work with Mono, as they use some
|
||||
pieces of Managed C++ to implement the JNI interface.
|
||||
|
||||
A workaround has been discussed, contact the author if you want to contribute.
|
||||
|
||||
<a name="MonoLogo">
|
||||
** MonoLogo
|
||||
@@ -40,6 +51,13 @@
|
||||
hosted in the <a href="ccvs.html">Mono CVS</a> repository
|
||||
and also available on the <a href="anoncvs.html">AnonCVS</a> mirrors.
|
||||
|
||||
<a name="mbas">
|
||||
** Mono Basic (Mono's VB.NET compiler)
|
||||
|
||||
Work has resumed on the Mono Visual Basic compiler (currently
|
||||
called mbas). It is part of the standard Mono distribution,
|
||||
but its still an early compiler.
|
||||
|
||||
<a name="Oberon">
|
||||
** Oberon
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
* mbas: Mono's Basic.NET Compiler.
|
||||
|
||||
MBAS is a CIL compiler for the Visual Basic language, an extended
|
||||
version of VisualBasic.NET. It's based on the MCS compiler
|
||||
and still in heavy development, though many language features are
|
||||
already supported.
|
||||
|
||||
** What works
|
||||
|
||||
<ul>
|
||||
|
||||
* Classes, Fields and Methods. Properties are still
|
||||
being worked on.
|
||||
|
||||
* Module definition and Sub functionality (TODO: Function's)
|
||||
|
||||
* Namespace Import, so can you reference, instantiate
|
||||
and call external assemblies
|
||||
|
||||
* Parameter passing between Sub's. ByVal and ByRef
|
||||
parameters are being worked on.
|
||||
|
||||
* Delegates
|
||||
|
||||
* Object creation
|
||||
|
||||
* Events - to a limited extent. You can declare a
|
||||
Class-Field as 'WithEvents' and dynamic events (i.e
|
||||
AddHandler MyButton.Click, Button1_OnClick). Please
|
||||
beware: just after committing the code, I discovered
|
||||
that the handler field in the AddHandler call is
|
||||
case-sensitive, a remnant of mBas' mcs heritage)
|
||||
|
||||
* Statements supported are 'If..Then..Else' ,
|
||||
'While..End While' and assignment statements. Simple
|
||||
operators (+, -, *, /, >, <, =) should also
|
||||
work. Other statements (For..Next, etc.) should be
|
||||
quite trivial to implement.
|
||||
</ul>
|
||||
|
||||
A lot of this stuff is implemented rebuilding proper expressions and
|
||||
statements on top of the classes provided by mcs (look at the grammar -
|
||||
mb-parser.jay - and compare it with cs-parser.jay, if interested).
|
||||
|
||||
** TODO-list
|
||||
|
||||
At this stage almost every element of the language must be still checked for
|
||||
conformance to MS'implementation. Help is particularly needed for those areas
|
||||
I know little of (mcs internals are still quite obscure to me). I'd like to
|
||||
implement class properties, the missing statements, exception handling,
|
||||
structures and actual event support (not necessarily in this order). Once we
|
||||
have all this stuff set up and reasonably bug-free, more work could be done
|
||||
on helper functions and Object-vars handling.
|
||||
|
||||
+2
-5
@@ -11,22 +11,19 @@
|
||||
|
||||
For <a href="mono-beginning/t1.html">RPM Linux based systems</a>
|
||||
|
||||
For <a href="http://geneura.ugr.es/~jaime/mono-beginning-windows/t1.html">Microsoft Windows</a>
|
||||
For <a href="http://monoevo.sourceforge.net/mono-windows/mono-beginning-windows/t1.html">Microsoft Windows</a>
|
||||
|
||||
|
||||
PDF Format
|
||||
|
||||
For <a href="mono-beginning.pdf">RPM Linux based systems</a>
|
||||
|
||||
For <a href="http://geneura.ugr.es/~jaime/mono-beginning-windows/mono-beginning-windows.pdf">Microsoft Windows</a>
|
||||
|
||||
|
||||
|
||||
XML Source
|
||||
|
||||
For <a href="mono-beginning.xml">RPM Linux based systems</a>
|
||||
|
||||
For <a href="http://geneura.ugr.es/~jaime/mono-beginning-windows/mono-beginning-windows.xml">Microsoft Windows</a>
|
||||
For <a href="http://monoevo.sourceforge.net/mono-windows/mono-beginning-windows.xml">Microsoft Windows</a>
|
||||
|
||||
|
||||
Currently Hinne is working on a Mono Tools HOWTO. Which will be
|
||||
|
||||
Executable
+52
@@ -0,0 +1,52 @@
|
||||
* Oracle Data Provider
|
||||
<ul>
|
||||
<li>Exists in namespace System.Data.OracleClient and assembly System.Data.OracleClient</li>
|
||||
|
||||
<li>Works on Windows</li>
|
||||
|
||||
<li>Works with Oracle 8i</li>
|
||||
|
||||
<li>More information about Oracle can be found at <a href="http://www.oracle.com/"/>here</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
* Current Status
|
||||
|
||||
<ul>
|
||||
<li>OracleConnection can connect to an Oracle 8i database on
|
||||
Windows via oci.dll</li>
|
||||
|
||||
<li>The native glue library only has makefiles for Borland C++ and
|
||||
Microsoft Visual C++ command line compilers. Only the makefile for
|
||||
Microsoft Visual C++ command-line compiler has been tested.</li>
|
||||
|
||||
<li>Can execute simple DML SQL statements, such as,
|
||||
INSERT a row into the EMP table via the OracleCommand's ExecuteNonQuery method</li>
|
||||
|
||||
<li>The System.Data.OracleClient.dll assembly can be built with mcs/mono via
|
||||
the makefile.gnu for System.Data.OracleClient or csc/.net via the
|
||||
System.Data.OracleClient.build nant build file. There is also a Visual Studio.NET
|
||||
solution it too.
|
||||
|
||||
</ul>
|
||||
|
||||
* Action Plan
|
||||
|
||||
<ul>
|
||||
<li>Get the makefile for the Borland C++ compiler to work
|
||||
since the <a href="http://www.borland.com/">Borland</a> C++ compiler is
|
||||
a free download</li>
|
||||
<li>Get the native glue lib System.Data.OracleClient.ocigule.dll to be built
|
||||
using gcc on Linux. This would require that Oracle 8i client software be installed
|
||||
on Linux with the oci headers and shared libraries</li>
|
||||
<li>Be able to retrieve results via a data reader</li>
|
||||
<li>Parameters support</li>
|
||||
<li>Stored Procedures, Functions, and Packages support</li>
|
||||
<li>Be able to fill a DataTable in a DataSet via a data adapter</li>
|
||||
<li>Support for Oracle 9i</li>
|
||||
<li>Figure out how to move the unmanaged OCI handling code in
|
||||
the oci glue C library to the managed C# assembly. I have been unable
|
||||
to successfully connect to an Oracle 8i database by using Platform Invoke and
|
||||
Marshalling in C# to the oci shared library (oci.dll on Windows)</li>
|
||||
|
||||
</ul>
|
||||
+55
-27
@@ -11,9 +11,13 @@
|
||||
|
||||
The <a href="http://msdn.microsoft.com/net">Microsoft.NET site.</a>
|
||||
|
||||
The Microsoft .NET Framework 1.0 can be downloaded <a href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">here</a>
|
||||
The Microsoft .NET Framework 1.0 can be downloaded <a
|
||||
href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">here</a>
|
||||
|
||||
New methods that are not documented in 1.0, are documented <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/framewrkaddend.asp">here</a>
|
||||
New methods that are not documented in 1.0, are documented <a
|
||||
href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/framewrkaddend.asp">here</a>
|
||||
|
||||
The changes between .NET 1.0 and .NET 1.1 are available <a href="http://www.csharphelp.com/archives2/archive406.html">here</a>
|
||||
|
||||
** IRC
|
||||
|
||||
@@ -24,7 +28,7 @@
|
||||
|
||||
The Mono Tutorial:
|
||||
|
||||
<a href="http://mwh.sysrq.dk/the_mono_tutorial/">Mono Tutorial</a>
|
||||
<a href="http://http://go-mono.com/gnometutorial/">GNOME.NET Tutorial</a>
|
||||
|
||||
and other useful tutorials (Gtk#, Glade#, Embeded, etc) (in Spanish) at
|
||||
|
||||
@@ -53,6 +57,14 @@
|
||||
href="http://www.foundstone.com/pdf/dotnet-security-framework.pdf">.NET
|
||||
security architecture</a>.
|
||||
|
||||
** Development Tools
|
||||
|
||||
A tool to compare two assemblies:
|
||||
|
||||
<ul>
|
||||
<li><a href="http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=winchurn">http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=winchurn</a>
|
||||
</ul>
|
||||
|
||||
** Presentations
|
||||
|
||||
Currently the <a href="Presentations/O-Reilly">O'Reilly</a>
|
||||
@@ -111,31 +123,53 @@
|
||||
|
||||
There are a number of related projects to Mono:
|
||||
|
||||
<li><b>Development tools</b></li>
|
||||
<ul>
|
||||
|
||||
* <a
|
||||
href="http://qtcsharp.sourceforge.net">Qt#:</a>
|
||||
C# bindings for the Qt toolkit.
|
||||
|
||||
* <a
|
||||
href="http://www.icsharpcode.net/OpenSource/SD/default.asp">Sharp
|
||||
Develop:</a> an IDE for the C# language written in C#.
|
||||
|
||||
* <a
|
||||
href="http://www.improve-technologies.com/alpha/esharp/">Eclipse
|
||||
Plugin for C#</a>
|
||||
|
||||
* <a
|
||||
href="http://janet-js.sourceforge.net/">Janet:</a>
|
||||
an implemention of ECMAScript (the standarized
|
||||
version of JavaScript) in C#
|
||||
* <a href="http://nunit.sourceforge.net">NUnit:</a> A
|
||||
testing framework for .NET classes.
|
||||
|
||||
* <a
|
||||
href="http://xmarks.sourceforge.net/doc.html">XMarks DOC.NET:</a> For
|
||||
creating online documentation you can browse for your own classes.
|
||||
|
||||
* <a href="http://nunit.sourceforge.net">NUnit:</a> A
|
||||
testing framework for .NET classes.
|
||||
</ul>
|
||||
|
||||
<li><b>Class Libraries</b></li>
|
||||
<ul>
|
||||
* <a href="http://9mm.com/~ogl/sdldotnet/">SDL for
|
||||
.NET:</a> Bindings for the popular SDL graphics library.
|
||||
|
||||
|
||||
* C# bindings for OpenGL and SDL are available here: <a
|
||||
href="http://csgl.sourceforge.net">http://csgl.sourceforge.net</a>
|
||||
|
||||
* <a
|
||||
href="http://qtcsharp.sourceforge.net">Qt#:</a>
|
||||
C# bindings for the Qt toolkit.
|
||||
|
||||
* <a
|
||||
href="http://codigolivre.org.br/projects/monoqle">Project MonoQLE:</a> a C# Message Queue Server.
|
||||
Sorry only in portuguese, for now.
|
||||
|
||||
</ul>
|
||||
|
||||
<li><b>Programming languages:</b></li>
|
||||
<ul>
|
||||
* <a
|
||||
href="http://janet-js.sourceforge.net/">Janet:</a>
|
||||
an implemention of ECMAScript (the standarized
|
||||
version of JavaScript) in C#
|
||||
</ul>
|
||||
|
||||
<li><b>Other projects</b></li>
|
||||
<ul>
|
||||
* <a
|
||||
href="http://www.improve-technologies.com/alpha/esharp/">Eclipse
|
||||
Plugin for C#</a>
|
||||
|
||||
* <a href="http://www.kaffe.org">Kaffe:</a> A popular
|
||||
Free Software JIT engine for Java.
|
||||
@@ -143,19 +177,13 @@
|
||||
* <a href="http://www.intel.com/research/mrl/orp">ORP:</a> A research
|
||||
JIT/VM/GC system from Intel.
|
||||
|
||||
* C# bindings for OpenGL and SDL are available here: <a
|
||||
href="http://csgl.sourceforge.net">http://csgl.sourceforge.net</a>
|
||||
|
||||
* <a
|
||||
href="http://www.southern-storm.com.au/portable_net.html">Portable.NET:</a>
|
||||
Another implementation of the CLI and C# compiler.
|
||||
|
||||
* A Free (GFDL) tutorial on C# in Spanish with examples, slides, and extras (under development). Get it <a href="http://geneura.ugr.es/~jaime/csharp/">here</a>.
|
||||
|
||||
* <a
|
||||
href="http://codigolivre.org.br/projects/monoqle">Project MonoQLE:</a> a C# Message Queue Server.
|
||||
Sorry only in portuguese, for now.
|
||||
|
||||
* A Free (GFDL) tutorial on C# in Spanish with
|
||||
examples, slides, and extras (under development). Get it <a
|
||||
href="http://geneura.ugr.es/~jaime/csharp/">here</a>.
|
||||
</ul>
|
||||
|
||||
** GNOME Documentation
|
||||
|
||||
+30
-27
@@ -4,23 +4,11 @@
|
||||
1,Runtime,runtime.html,runtime.src
|
||||
2,Embedding,embedded-api.html,embedded-api.src
|
||||
1,Classes,class-library.html,class-library.src
|
||||
1,Gtk#,http://gtk-sharp.sourceforge.net
|
||||
1,Gtk#,gtk-sharp.html,gtk-sharp.src
|
||||
1,ASP.NET,asp-net.html,asp-net.src
|
||||
1,ADO.NET,ado-net.html,ado-net.src
|
||||
1,Class Status,class-status.html,class-status.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,corlib,class-status-corlib.html,class-status-corlib.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,System,class-status-System.html,class-status-System.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Xml,class-status-System.Xml.html,class-status-System.Xml.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Data,class-status-System.Data.html,class-status-System.Data.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Drawing,class-status-System.Drawing.html,class-status-System.Drawing.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Web,class-status-System.Web.html,class-status-System.Web.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Web.Services,class-status-System.Web.Services.html,class-status-System.Web.Services.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Microsoft.VisualBasic,class-status-Microsoft.VisualBasic.html,class-status-Microsoft.VisualBasic.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Windows.Forms,class-status-System.Windows.Forms.html,class-status-System.Windows.Forms.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,EnterpriseServices,class-status-System.EnterpriseServices.html,class-status-System.EnterpriseServices.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Formatters.Soap,class-status-System.Runtime.Serialization.Formatters.Soap.html,class-status-System.Runtime.Serialization.Formatters.Soap.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,C# Compiler,c-sharp.html,c-sharp.src
|
||||
1,Status,status.html,status.src
|
||||
1,VB Compiler,mbas.html,mbas.src
|
||||
0,Download,download.html,download.src
|
||||
1,CVS access,ccvs.html,ccvs.src
|
||||
1,AnonCVS access,anoncvs.html,anoncvs.src
|
||||
@@ -34,19 +22,6 @@
|
||||
1,Porting,porting.html,porting.src
|
||||
2,PowerPC,ppc.html,ppc.src
|
||||
1,HOWTO,mono-contribution-howto.html,mono-contribution-howto.src
|
||||
0,Plans,plans.html,plans.src
|
||||
1,ADO.NET,ado-net.html,ado-net.src
|
||||
2,Firebird Interbase,firebird.html,firebird.src
|
||||
2,Microsft SQL Server,sqlclient.html,sqlclient.src
|
||||
2,MySQL,mysql.html,mysql.src
|
||||
2,ODBC,odbc.html,odbc.src
|
||||
2,OLE DB,oledb.html,oledb.src
|
||||
2,PostgreSQL,postgresql.html,postgresql.src
|
||||
2,SQL Lite,sqlite.html,sqlite.src
|
||||
2,Sybase,sybase.html,sybase.src
|
||||
2,TDS Generic,tdsclient.html,tdsclient.src
|
||||
1,Java,java.html,java.src
|
||||
1,Windows.Forms,winforms.html,winforms.src
|
||||
0,Resources,resources.html,resources.src
|
||||
1,Beginning,mono-beginning.html,mono-beginning.src
|
||||
1,Mailing Lists,mailing-lists.html,mailing-lists.src
|
||||
@@ -56,4 +31,32 @@
|
||||
1,Papers,papers.html,papers.src
|
||||
1,Languages,languages.html,languages.src
|
||||
1,Debugging,jit-debug.html,jit-debug.src
|
||||
0,Plans,plans.html,plans.src
|
||||
1,ADO.NET,ado-net.html,ado-net.src
|
||||
1,Crypto,crypto.html,crypto.src
|
||||
2,Firebird Interbase,firebird.html,firebird.src
|
||||
2,Microsft SQL Server,sqlclient.html,sqlclient.src
|
||||
2,MySQL,mysql.html,mysql.src
|
||||
2,ODBC,odbc.html,odbc.src
|
||||
2,OLE DB,oledb.html,oledb.src
|
||||
2,Oracle,oracle.html,oracle.src
|
||||
2,PostgreSQL,postgresql.html,postgresql.src
|
||||
2,SQL Lite,sqlite.html,sqlite.src
|
||||
2,Sybase,sybase.html,sybase.src
|
||||
2,TDS Generic,tdsclient.html,tdsclient.src
|
||||
1,Java,java.html,java.src
|
||||
1,Windows.Forms,winforms.html,winforms.src
|
||||
0,Class Status,class-status.html,class-status.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,corlib,class-status-corlib.html,class-status-corlib.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,System,class-status-System.html,class-status-System.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Xml,class-status-System.Xml.html,class-status-System.Xml.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Data,class-status-System.Data.html,class-status-System.Data.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Drawing,class-status-System.Drawing.html,class-status-System.Drawing.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Web,class-status-System.Web.html,class-status-System.Web.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Web.Services,class-status-System.Web.Services.html,class-status-System.Web.Services.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Microsoft.VisualBasic,class-status-Microsoft.VisualBasic.html,class-status-Microsoft.VisualBasic.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Windows.Forms,class-status-System.Windows.Forms.html,class-status-System.Windows.Forms.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,EnterpriseServices,class-status-System.EnterpriseServices.html,class-status-System.EnterpriseServices.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Formatters.Soap,class-status-System.Runtime.Serialization.Formatters.Soap.html,class-status-System.Runtime.Serialization.Formatters.Soap.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,Cscompmgd,class-status-Cscompmgd.html,class-status-Cscompmgd.src,cm/cormissing.css,cm/cormissing.js
|
||||
0,Contact,contact.html,contact.src
|
||||
@@ -9,6 +9,7 @@ OBJECTS= \
|
||||
deploy/mysql.html \
|
||||
deploy/odbc.html \
|
||||
deploy/oledb.html \
|
||||
deploy/oracle.html \
|
||||
deploy/postgresql.html \
|
||||
deploy/sqlclient.html \
|
||||
deploy/sqlite.html \
|
||||
@@ -30,13 +31,16 @@ OBJECTS= \
|
||||
deploy/class-status-System.EnterpriseServices.html \
|
||||
deploy/class-status-System.Runtime.Serialization.Formatters.Soap.html \
|
||||
deploy/class-status-System.Windows.Forms.html \
|
||||
deploy/class-status-Cscompmgd.html \
|
||||
deploy/class-library.html \
|
||||
deploy/classlib-doc.html \
|
||||
deploy/contact.html \
|
||||
deploy/c-sharp.html \
|
||||
deploy/mbas.html \
|
||||
deploy/ccvs.html \
|
||||
deploy/documentation.html \
|
||||
deploy/download.html \
|
||||
deploy/crypto.html \
|
||||
deploy/embedded-api.html \
|
||||
deploy/faq.html \
|
||||
deploy/gcc-frontend.html \
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>#TITLE#</title>
|
||||
<link rel="icon" href="../MonoIcon.png" type="image/png">
|
||||
<!-- background-image: url("images/bgsquares.gif"); -->
|
||||
<style type="text/css">
|
||||
<!--
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
man_MANS = mcs.1 mono.1 monostyle.1 mono-config.5 sqlsharpcli.1
|
||||
man_MANS = mcs.1 mono.1 monostyle.1 mono-config.5 sqlsharp.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
.TH sqlsharpcli 1 "30 November 2002"
|
||||
.TH sqlsharp 1 "10 December 2002"
|
||||
.SH NAME
|
||||
sqlsharpcli \- Mono SQL# Command Line SQL Query tool
|
||||
sqlsharp \- Mono SQL# command-line SQL Query tool
|
||||
.SH SYNOPSIS
|
||||
.B sqlsharpcli
|
||||
[option] [source-files]
|
||||
.B sqlsharp
|
||||
[\-f filename] [\-o filename] [\-s]
|
||||
.SH DESCRIPTION
|
||||
sqlsharpcli is the Mono SQL# tool used for entering SQL queries
|
||||
sqlsharp is the Mono SQL# tool used for entering SQL queries
|
||||
to a database using Mono ADO.NET providers.
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
The following options are supported:
|
||||
.TP
|
||||
.I "-f filename"
|
||||
Output file to load SQL# commands from.
|
||||
.TP
|
||||
.I "-o filename"
|
||||
Output file to send results.
|
||||
.TP
|
||||
.I "-s"
|
||||
Silent mode.
|
||||
.PP
|
||||
.SH HOW TO USE
|
||||
The SQL# tool accepts commands via its command line interface. Commands
|
||||
begin with a backslash followed by the command name.
|
||||
.PP
|
||||
@@ -46,35 +59,6 @@ To connect to a database, you need to do the following:
|
||||
|
||||
.fi
|
||||
.PP
|
||||
.SH COMMANDS
|
||||
The following commands are supported:
|
||||
.PP
|
||||
.TP
|
||||
.I "Open"
|
||||
Opens connection to database.
|
||||
.nf
|
||||
|
||||
Example:
|
||||
SQL# \\open
|
||||
|
||||
.fi
|
||||
.TP
|
||||
.I "ConnectionString"
|
||||
Sets the Connection String.
|
||||
.nf
|
||||
|
||||
Example:
|
||||
SQL# \\connectionstring Database=test
|
||||
.fi
|
||||
.TP
|
||||
.I "Provider"
|
||||
Sets the data provider.
|
||||
.nf
|
||||
|
||||
Example:
|
||||
SQL# \\provider mysql
|
||||
|
||||
.fi
|
||||
.SH CONNECTION AND PROVIDER COMMANDS
|
||||
These commands are used to setup the provider,
|
||||
connection string, and open/close the database connnection
|
||||
@@ -427,30 +411,34 @@ which connects to a PostgreSQL database:
|
||||
.fi
|
||||
.SH DEBUGGING SUPPORT
|
||||
No debugging support.
|
||||
.SH NOTES
|
||||
No notes.
|
||||
.SH AUTHORS
|
||||
The Mono SQL# Tool was written
|
||||
.nf
|
||||
by Daniel Morgan <[email protected]>
|
||||
.fi
|
||||
.PP
|
||||
.SH LICENSE
|
||||
The Mono SQL# Tool is released under the terms of the GNU GPL.
|
||||
Please read the accompanying `COPYING' file for details. Alternative
|
||||
licenses are available from Ximian or Daniel Morgan.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
mono(1), mint(1), mcs(1)
|
||||
.PP
|
||||
.SH BUGS
|
||||
To report bugs in the compiler, you can use `bug-buddy', or you can
|
||||
file bug reports in our bug tracking system:
|
||||
.nf
|
||||
http://bugzilla.ximian.com.
|
||||
.SH MAILING LIST
|
||||
The Mono Mailing List is available at: [email protected]
|
||||
.SH MORE INFORMATION
|
||||
The Mono C# compiler is developed by Ximian, Inc
|
||||
(http://www.ximian.com) (http://www.ximian.com) and is based on the
|
||||
ECMA C# language standard available here:
|
||||
http://www.ecma.ch/ecma1/STAND/ecma-334.htm
|
||||
|
||||
.fi
|
||||
.PP
|
||||
.SH MAILING LISTS
|
||||
For details, visit:
|
||||
.nf
|
||||
http://mail.ximian.com/mailman/mono-list
|
||||
.fi
|
||||
.SH WEB SITE
|
||||
For details, visit:
|
||||
.nf
|
||||
http://www.go-mono.com
|
||||
.fi
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
mono(1), mint(1)
|
||||
|
||||
+2
-1
@@ -5,7 +5,7 @@ C# Compiler:
|
||||
|
||||
Class Libraries:
|
||||
Patrik Torstensson <[email protected]>
|
||||
Gaurav Vaish <gvaish@iitk.ac.in>
|
||||
Gaurav Vaish <gvaish[email protected]>
|
||||
Jeff Stedfast ([email protected])
|
||||
Joe Shaw ([email protected])
|
||||
Miguel de Icaza ([email protected])
|
||||
@@ -15,3 +15,4 @@ Class Libraries:
|
||||
Bob Smith ([email protected])
|
||||
John Barnette ([email protected])
|
||||
Daniel Morgan <[email protected]>
|
||||
Sebastien Pouliot <[email protected]>
|
||||
+47
-16
@@ -1,3 +1,34 @@
|
||||
2003-01-10 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* README.building: New file.
|
||||
* makefile.gnu: install README.building file.
|
||||
|
||||
2003-01-09 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* AUTHORS: add myself to class library list
|
||||
|
||||
2002-12-15 Alp Toker <[email protected]>
|
||||
|
||||
* makefile.gnu: make sure mcs is in PATH, otherwise tell user to read
|
||||
INSTALL.txt
|
||||
|
||||
2002-12-10 Daniel Morgan <[email protected]>
|
||||
|
||||
* makefile
|
||||
* tools/makefile
|
||||
* tools/makefile.gnu: change target
|
||||
from SqlSharpCli.exe
|
||||
to sqlsharp.exe
|
||||
|
||||
2002-12-10 Alp Toker <[email protected]>
|
||||
|
||||
* ilasm/makefile.gnu: Install ilasm executable with -m 755, not 644
|
||||
* ilasm/makefile: ditto
|
||||
|
||||
2002-12-10 Gaurav Vaish <[email protected]>
|
||||
|
||||
* AUTHORS: Corrected my email-ID.
|
||||
|
||||
2002-11-29 Daniel Morgan <[email protected]>
|
||||
|
||||
* INSTALL: renamed to INSTALL.txt because INSTALL
|
||||
@@ -165,20 +196,20 @@
|
||||
|
||||
* makefile (linux): Abandon the build if any of the subdir makes fail
|
||||
|
||||
2002-03-07 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile: Change order of build so corlib is built before nunit since
|
||||
Nunit needs corlib now.
|
||||
|
||||
2002-02-14 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile: Build mcs/doctools too when one does 'make'
|
||||
|
||||
2002-01-20 Nick Drochak <[email protected]>
|
||||
|
||||
* on the 'test' target, make sure NUnit is built first before building
|
||||
and running tests
|
||||
|
||||
2002-01-20 Nick Drochak <[email protected]>
|
||||
|
||||
2002-03-07 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile: Change order of build so corlib is built before nunit since
|
||||
Nunit needs corlib now.
|
||||
|
||||
2002-02-14 Nick Drochak <[email protected]>
|
||||
|
||||
* makefile: Build mcs/doctools too when one does 'make'
|
||||
|
||||
2002-01-20 Nick Drochak <[email protected]>
|
||||
|
||||
* on the 'test' target, make sure NUnit is built first before building
|
||||
and running tests
|
||||
|
||||
2002-01-20 Nick Drochak <[email protected]>
|
||||
|
||||
* add nunit directory to the list of dirs to build in
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
[1] Building mono + mcs from CVS on *NIX. The Easy Way (tm)
|
||||
-------------------------------------------------------------
|
||||
1. Get mono and mcs from CVS (http://www.go-mono.com/download.html)
|
||||
|
||||
2. Use the script to build mono (mono/doc/mono-build.sh).
|
||||
|
||||
3. Copy the dlls and mcs.exe from the latest monocharge tarball
|
||||
(http://www.gnome-db.org/~gonzalo/mono/) to /where/you/installed/mono/lib and
|
||||
..../bin respectively.
|
||||
|
||||
|
||||
|
||||
[2] Keeping the stuff up to date
|
||||
----------------------------------
|
||||
Once you have followed the above steps, do these ones to keep your installation
|
||||
up to date:
|
||||
|
||||
1. In mcs directory,
|
||||
|
||||
cvs -z3 update -Pd
|
||||
make -f makefile.gnu
|
||||
|
||||
2. Use the mono-build.sh script to update, rebuild and install mono from CVS.
|
||||
Doing a cvs update of mono/doc/mono-build.sh file is also a good idea.
|
||||
|
||||
3. In mcs directory:
|
||||
|
||||
make -f makefile.gnu install prefix=/prefix/of/your/installation/path
|
||||
|
||||
4. In case of troubles (ie, unable to compile mcs/* sources) go to [1].
|
||||
|
||||
-Gonzalo
|
||||
@@ -22,7 +22,9 @@
|
||||
</sources>
|
||||
</csc>
|
||||
<copy file="../lib/Accessibility.dll" tofile="Test/Accessibility.dll"/>
|
||||
<nant basedir="Test" target="build"/>
|
||||
<!-- TODO: missing tests & buildfile
|
||||
<nant basedir="Test" target="build"/>
|
||||
-->
|
||||
</target>
|
||||
|
||||
<target name="test" depends="build">
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
2002-12-10 Jeroen Janssen <[email protected]>
|
||||
|
||||
* updated .build file to correctly build with Nant
|
||||
@@ -1,3 +1,24 @@
|
||||
2003-01-08 Gaurav Vaish <gvaish_mono AT lycos.com>
|
||||
|
||||
* System.Web.Mobile : Added new directory
|
||||
|
||||
2002-12-11 Jeroen Janssen <[email protected]>
|
||||
|
||||
* enabled building Mono.Directory.LDAP and
|
||||
System.Design in .build file
|
||||
|
||||
2002-12-10 Jeroen Janssen <[email protected]>
|
||||
|
||||
* updated .build file(s) to correctly contain required buildfile
|
||||
attribute for nant
|
||||
|
||||
2002-12-09 Daniel Morgan <[email protected]>
|
||||
|
||||
* library.build: add Mono.GetOptions to windows build
|
||||
|
||||
* Mono.GetOptions/Mono.GetOptions.build: add file
|
||||
for windows build
|
||||
|
||||
2002-12-08 Radek Doulik <[email protected]>
|
||||
|
||||
* makefile.gnu (DIRS): place System.Data before Mono.GetOptions,
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
2002-13-07 Jackson Harper <[email protected]>
|
||||
2002-12-15 Jackson Harper <[email protected]>
|
||||
|
||||
* CompilerError.cs ErrorLevel.cs: Moved ErrorLevel enum into its own file
|
||||
|
||||
2002-12-12 Jackson Harper <[email protected]>
|
||||
|
||||
* Compiler.cs: Partially implemented bugreport option, also only allow valid options now
|
||||
|
||||
2002-12-07 Jackson Harper <[email protected]>
|
||||
|
||||
* Compiler.cs: Moved StreamWriter creation into a try block
|
||||
|
||||
2002-13-07 Jackson Harper <[email protected]>
|
||||
2002-12-07 Jackson Harper <[email protected]>
|
||||
|
||||
* Compiler.cs: Source text is now implemented so you can pass strings of C# code to be compiled
|
||||
|
||||
|
||||
@@ -30,11 +30,20 @@ namespace Microsoft.CSharp {
|
||||
|
||||
string[] temp_cs_files;
|
||||
CompilerError[] errors;
|
||||
|
||||
string bugreport_path = null;
|
||||
StreamWriter bug_report = null;
|
||||
|
||||
temp_cs_files = CreateCsFiles (sourceTexts, sourceTextNames);
|
||||
|
||||
if (options != null)
|
||||
bugreport_path = (string)options["bugreport"];
|
||||
|
||||
if (bugreport_path != null) {
|
||||
bug_report = CreateBugReport (sourceTexts, sourceTextNames, bugreport_path);
|
||||
}
|
||||
|
||||
try {
|
||||
errors = CompileFiles (temp_cs_files, target, imports, options);
|
||||
errors = CompileFiles (temp_cs_files, target, imports, options, bug_report);
|
||||
} catch {
|
||||
throw;
|
||||
} finally {
|
||||
@@ -42,6 +51,8 @@ namespace Microsoft.CSharp {
|
||||
FileInfo file = new FileInfo (temp_file);
|
||||
file.Delete ();
|
||||
}
|
||||
if (bug_report != null)
|
||||
bug_report.Close ();
|
||||
}
|
||||
|
||||
return errors;
|
||||
@@ -52,7 +63,7 @@ namespace Microsoft.CSharp {
|
||||
//
|
||||
|
||||
private static CompilerError[] CompileFiles (string[] cs_files,
|
||||
string target, string[] imports, IDictionary options)
|
||||
string target, string[] imports, IDictionary options, StreamWriter bug_report)
|
||||
{
|
||||
ArrayList error_list = new ArrayList ();
|
||||
Process mcs = new Process ();
|
||||
@@ -82,6 +93,11 @@ namespace Microsoft.CSharp {
|
||||
error_list.Add (error);
|
||||
}
|
||||
|
||||
if (bug_report != null) {
|
||||
bug_report.WriteLine ("### Compiler Output");
|
||||
bug_report.Write (mcs_output);
|
||||
}
|
||||
|
||||
return (CompilerError[])error_list.ToArray (typeof(CompilerError));
|
||||
}
|
||||
|
||||
@@ -152,6 +168,8 @@ namespace Microsoft.CSharp {
|
||||
if (null != options) {
|
||||
foreach (object option in options.Keys) {
|
||||
object value = options[option];
|
||||
if (!ValidOption ((string)option))
|
||||
continue;
|
||||
args.AppendFormat ("{0} ", OptionString (option,value));
|
||||
}
|
||||
}
|
||||
@@ -184,6 +202,64 @@ namespace Microsoft.CSharp {
|
||||
throw new IndexOutOfRangeException ();
|
||||
}
|
||||
|
||||
private static StreamWriter CreateBugReport (string[] source_texts,
|
||||
string[] source_names, string path)
|
||||
{
|
||||
StreamWriter bug_report = null;
|
||||
|
||||
try {
|
||||
bug_report = new StreamWriter (path);
|
||||
bug_report.WriteLine ("### C# Compiler Defect Report," +
|
||||
" created {0}", DateTime.Now);
|
||||
// Compiler Version
|
||||
// Runtime
|
||||
// Operating System
|
||||
// Username
|
||||
for (int i=0; i<source_texts.Length; i++) {
|
||||
bug_report.WriteLine ("### Source file: '{0}'",
|
||||
source_names[i]);
|
||||
bug_report.Write (source_texts[i]);
|
||||
}
|
||||
} catch {
|
||||
if (bug_report != null)
|
||||
bug_report.Close ();
|
||||
throw;
|
||||
}
|
||||
|
||||
return bug_report;
|
||||
}
|
||||
|
||||
|
||||
private static bool ValidOption (string option)
|
||||
{
|
||||
switch (option) {
|
||||
case "addmodule":
|
||||
case "baseaddress":
|
||||
case "checked":
|
||||
case "d":
|
||||
case "debug":
|
||||
case "doc":
|
||||
case "filealign":
|
||||
case "incr":
|
||||
case "lib":
|
||||
case "linkres":
|
||||
case "m":
|
||||
case "nostdlib":
|
||||
case "nowarn":
|
||||
case "o":
|
||||
case "r":
|
||||
case "res":
|
||||
case "target":
|
||||
case "unsafe":
|
||||
case "w":
|
||||
case "warnaserror":
|
||||
case "win32icon":
|
||||
case "win32res":
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,13 +11,6 @@ using System.Text;
|
||||
|
||||
namespace Microsoft.CSharp {
|
||||
|
||||
public enum ErrorLevel {
|
||||
None,
|
||||
Warning,
|
||||
Error,
|
||||
FatalError,
|
||||
}
|
||||
|
||||
public class CompilerError {
|
||||
|
||||
private ErrorLevel level = ErrorLevel.None;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Microsoft.CSharp.ErrorLevel
|
||||
//
|
||||
// Author(s):
|
||||
// Jackson Harper ([email protected])
|
||||
//
|
||||
// (C) 2002 Jackson Harper, All rights reserved.
|
||||
//
|
||||
|
||||
namespace Microsoft.CSharp {
|
||||
|
||||
public enum ErrorLevel {
|
||||
None,
|
||||
Warning,
|
||||
Error,
|
||||
FatalError,
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
Microsoft.CSharp/Compiler.cs
|
||||
Microsoft.CSharp/CompilerError.cs
|
||||
Microsoft.CSharp/ErrorLevel.cs
|
||||
Microsoft.CSharp/TODOAttribute.cs
|
||||
@@ -1,3 +1,14 @@
|
||||
2002-12-22 Tim Coleman <[email protected]>
|
||||
* Mono.Data.Tds.Protocol/TdsComm.cs:
|
||||
Change GetString to NOT explicitly add a NUL
|
||||
to the end of the string since Encoder.GetString ()
|
||||
will do that.
|
||||
|
||||
2002-12-14 Daniel Morgan <[email protected]>
|
||||
|
||||
* Mono.Data.Tds.Protocol/Tds70.cs: single quotes in SQL string
|
||||
need to be escaped as two single quotes
|
||||
|
||||
2002-12-01 Tim Coleman <[email protected]>
|
||||
* list:
|
||||
Remove more unnecessary files.
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
2002-12-10 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Tds.cs:
|
||||
(Disconnect): close the stream and set connected to false.
|
||||
(NextResult): check if after DoneProc we have a ColumnMetadata + Row,
|
||||
which holds the values for the output parameters and read them.
|
||||
(LoadRow): add the values to outputParameters if DoneProc.
|
||||
When executing a stored procedure, we execute the procedure and then
|
||||
select the parameter values.
|
||||
|
||||
* Tds70.cs:
|
||||
(BuildParameters): check Parameters.
|
||||
|
||||
* TdsComm.cs: added Close () to close the stream.
|
||||
|
||||
* TdsConnectionParameters.cs: initialize all the string to be empty.
|
||||
|
||||
2002-11-04 Tim Coleman ([email protected])
|
||||
* TdsBigDecimal.cs:
|
||||
New class added to handle (potentially) large
|
||||
|
||||
@@ -184,8 +184,8 @@ namespace Mono.Data.Tds.Protocol {
|
||||
comm.StartPacket (TdsPacketType.Logoff);
|
||||
comm.Append ((byte) 0);
|
||||
comm.SendPacket ();
|
||||
|
||||
SkipToEnd ();
|
||||
comm.Close ();
|
||||
connected = false;
|
||||
}
|
||||
|
||||
public void Execute (string sql)
|
||||
@@ -237,14 +237,26 @@ namespace Mono.Data.Tds.Protocol {
|
||||
TdsPacketSubType subType;
|
||||
|
||||
bool done = false;
|
||||
bool outputParams = false;
|
||||
|
||||
while (!done) {
|
||||
subType = ProcessSubPacket ();
|
||||
if (outputParams) {
|
||||
moreResults = false;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (subType) {
|
||||
case TdsPacketSubType.ColumnInfo:
|
||||
case TdsPacketSubType.ColumnMetadata:
|
||||
case TdsPacketSubType.RowFormat:
|
||||
done = (Comm.Peek () != (byte) TdsPacketSubType.TableName);
|
||||
byte peek = Comm.Peek ();
|
||||
done = (peek != (byte) TdsPacketSubType.TableName);
|
||||
if (done && doneProc && peek == (byte) TdsPacketSubType.Row) {
|
||||
outputParams = true;
|
||||
done = false;
|
||||
}
|
||||
|
||||
break;
|
||||
case TdsPacketSubType.TableName:
|
||||
done = true;
|
||||
@@ -763,6 +775,9 @@ namespace Mono.Data.Tds.Protocol {
|
||||
foreach (TdsDataColumn column in columns) {
|
||||
object o = GetColumnValue ((TdsColumnType) column["ColumnType"], false, i);
|
||||
currentRow.Add (o);
|
||||
if (doneProc)
|
||||
outputParameters.Add (o);
|
||||
|
||||
if (o is TdsBigDecimal && currentRow.BigDecimalIndex < 0)
|
||||
currentRow.BigDecimalIndex = i;
|
||||
i += 1;
|
||||
|
||||
@@ -37,14 +37,18 @@ namespace Mono.Data.Tds.Protocol {
|
||||
|
||||
private string BuildExec (string sql)
|
||||
{
|
||||
string esql = sql.Replace ("'", "''"); // escape single quote
|
||||
if (Parameters != null && Parameters.Count > 0)
|
||||
return BuildProcedureCall (String.Format ("sp_executesql N'{0}', N'{1}', ", sql, BuildPreparedParameters ()));
|
||||
return BuildProcedureCall (String.Format ("sp_executesql N'{0}', N'{1}', ", esql, BuildPreparedParameters ()));
|
||||
else
|
||||
return BuildProcedureCall (String.Format ("sp_executesql N'{0}'", sql));
|
||||
return BuildProcedureCall (String.Format ("sp_executesql N'{0}'", esql));
|
||||
}
|
||||
|
||||
private string BuildParameters ()
|
||||
{
|
||||
if (Parameters == null || Parameters.Count == 0)
|
||||
return String.Empty;
|
||||
|
||||
StringBuilder result = new StringBuilder ();
|
||||
foreach (TdsMetaParameter p in Parameters) {
|
||||
if (result.Length > 0)
|
||||
|
||||
@@ -215,6 +215,11 @@ namespace Mono.Data.Tds.Protocol {
|
||||
Append (BitConverter.GetBytes (l));
|
||||
}
|
||||
|
||||
public void Close ()
|
||||
{
|
||||
stream.Close ();
|
||||
}
|
||||
|
||||
private void ConnectCallback (IAsyncResult ar)
|
||||
{
|
||||
Socket s = (Socket) ar.AsyncState;
|
||||
@@ -291,7 +296,6 @@ namespace Mono.Data.Tds.Protocol {
|
||||
else {
|
||||
byte[] result = new byte[len + 1];
|
||||
Array.Copy (GetBytes (len, false), result, len);
|
||||
result[len] = (byte) 0;
|
||||
return (encoder.GetString (result));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,17 +7,18 @@
|
||||
// Copyright (C) 2002 Tim Coleman
|
||||
//
|
||||
|
||||
using System;
|
||||
namespace Mono.Data.Tds.Protocol {
|
||||
public class TdsConnectionParameters
|
||||
{
|
||||
public string ApplicationName = "Mono";
|
||||
public string Database;
|
||||
public string Charset;
|
||||
public string Database = String.Empty;
|
||||
public string Charset = String.Empty;
|
||||
public string Hostname = "localhost";
|
||||
public string Language;
|
||||
public string Language = String.Empty;
|
||||
public string LibraryName = "Mono";
|
||||
public string Password;
|
||||
public string Password = String.Empty;
|
||||
public string ProgName = "Mono";
|
||||
public string User;
|
||||
public string User = String.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
2002-12-11 Jeroen Janssen <[email protected]>
|
||||
|
||||
* add reference to corlib.dll in order to eliminate [MonoTODO] build error
|
||||
|
||||
2002-12-10 Jeroen Janssen <[email protected]>
|
||||
|
||||
* added Mono.Directory.LDAP.build file
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- NAnt build file for Mono.Directory.LDAP.dll -->
|
||||
|
||||
<project name="Mono.Directory.LDAP" default="build">
|
||||
<property name="debug" value="false"/>
|
||||
|
||||
<target name="build">
|
||||
<csc target="library" output="../lib/Mono.Directory.LDAP.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<arg value="/nowarn:0067"/>
|
||||
<arg value="/nowarn:0109"/>
|
||||
<arg value="/nowarn:0169"/>
|
||||
<arg value="/nowarn:0649"/>
|
||||
<arg value="/unsafe"/>
|
||||
<arg value="/noconfig"/>
|
||||
<arg value="/lib:../lib/"/>
|
||||
<arg value="/r:corlib.dll"/>
|
||||
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
<excludes name="Test/**"/>
|
||||
</sources>
|
||||
</csc>
|
||||
</target>
|
||||
<target name="test" depends="build">
|
||||
<nant basedir="Test" target="test"/>
|
||||
</target>
|
||||
<target name="clean">
|
||||
<delete file="../lib/Mono.Directory.LDAP.dll" failonerror="false"/>
|
||||
</target>
|
||||
</project>
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- NAnt build file for Mono.GetOptions.dll -->
|
||||
|
||||
<project name="Mono.GetOptions" default="build">
|
||||
<property name="debug" value="false"/>
|
||||
|
||||
<target name="build">
|
||||
<csc target="library" output="../lib/Mono.GetOptions.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<arg value="/nowarn:0067"/>
|
||||
<arg value="/nowarn:0109"/>
|
||||
<arg value="/nowarn:0169"/>
|
||||
<arg value="/nowarn:0649"/>
|
||||
<arg value="/unsafe"/>
|
||||
<arg value="/noconfig"/>
|
||||
<arg value="/r:System.dll"/>
|
||||
<arg value="/r:System.Xml.dll"/>
|
||||
<arg value="/r:System.Data.dll"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
<excludes name="GetOptTest/**"/>
|
||||
|
||||
</sources>
|
||||
<references>
|
||||
<includes name="../lib/corlib.dll"/>
|
||||
<includes name="../lib/System.dll"/>
|
||||
<includes name="../lib/System.Xml.dll"/>
|
||||
<includes name="../lib/System.Data.dll"/>
|
||||
</references>
|
||||
</csc>
|
||||
</target>
|
||||
<target name="test" depends="build">
|
||||
<nant basedir="Test" target="test"/>
|
||||
</target>
|
||||
<target name="clean">
|
||||
<delete file="../lib/Mono.GetOptions.dll" failonerror="false"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,3 +1,8 @@
|
||||
2002-12-10 Jeroen Janssen <[email protected]>
|
||||
|
||||
* updated .build file(s) to correctly contain required buildfile
|
||||
attribute for nant
|
||||
|
||||
2002-12-01 Alejandro Sánchez Acosta <[email protected]>
|
||||
|
||||
* list.unix: Changed
|
||||
|
||||
@@ -1,3 +1,39 @@
|
||||
2003-01-08 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* list: added System.Data/DataTablePropertyDescriptor.cs
|
||||
|
||||
2002-12-27 Ville Palo <[email protected]>
|
||||
|
||||
* list: Added System.Data/XmlDataLoader.cs
|
||||
|
||||
2002-12-16 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocument.cs: Now rollback works. It means all
|
||||
types of transactions works, i guess ;)
|
||||
|
||||
2002-12-14 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocument.cs: Adding row via XmlDataDocument to
|
||||
DataSet's datatable is now possible.
|
||||
|
||||
2002-12-11 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocument.cs: Implemented GetRowFromElement() and
|
||||
GetElementFromRowElement () -methods. Somefixed and little clean up.
|
||||
|
||||
2002-12-10 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* System.Data.SqlClient/SqlCommand.cs:
|
||||
(CloseReader): don't get the output parameters here.
|
||||
(GetOutputParameters): don't skip the stream. The parameters will be
|
||||
there.
|
||||
|
||||
* System.Data.SqlClient/SqlConnection.cs: don't try to execute
|
||||
'sp_reset_connection'.
|
||||
|
||||
* System.Data.SqlClient/SqlDataReader.cs: get the output parameters
|
||||
after the end of the results.
|
||||
|
||||
2002-12-04 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocument.cs: Now this works in both ways,
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2003-01-08 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* DbDataRecord.cs: return DbNull.Value in GetValue () if value is null.
|
||||
|
||||
2002-10-31 Daniel Morgan <[email protected]>
|
||||
|
||||
* SchemaInfo.cs: added missing properties to fix mcs build
|
||||
|
||||
@@ -154,7 +154,10 @@ namespace System.Data.Common {
|
||||
|
||||
public object GetValue (int i)
|
||||
{
|
||||
return values [i];
|
||||
object value = values [i];
|
||||
if (value == null)
|
||||
value = DBNull.Value;
|
||||
return value;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
|
||||
@@ -202,7 +202,6 @@ namespace System.Data.SqlClient {
|
||||
|
||||
internal void CloseDataReader (bool moreResults)
|
||||
{
|
||||
GetOutputParameters ();
|
||||
Connection.DataReader = null;
|
||||
|
||||
if ((behavior & CommandBehavior.CloseConnection) != 0)
|
||||
@@ -345,11 +344,9 @@ namespace System.Data.SqlClient {
|
||||
return xmlReader;
|
||||
}
|
||||
|
||||
private void GetOutputParameters ()
|
||||
internal void GetOutputParameters ()
|
||||
{
|
||||
Connection.Tds.SkipToEnd ();
|
||||
|
||||
IList list = Connection.Tds.ColumnValues;
|
||||
IList list = Connection.Tds.OutputParameters;
|
||||
|
||||
if (list != null && list.Count > 0) {
|
||||
int index = 0;
|
||||
|
||||
@@ -351,8 +351,13 @@ namespace System.Data.SqlClient {
|
||||
|
||||
if (!tds.IsConnected)
|
||||
tds.Connect (parms);
|
||||
/* Not sure ebout removing these 2 lines.
|
||||
* The command that gets to the sql server is just
|
||||
* 'sp_reset_connection' and it fails.
|
||||
* Either remove them definitely or fix it
|
||||
else if (connectionReset)
|
||||
tds.ExecProc ("sp_reset_connection");
|
||||
*/
|
||||
|
||||
ChangeState (ConnectionState.Open);
|
||||
}
|
||||
|
||||
@@ -732,12 +732,13 @@ namespace System.Data.SqlClient {
|
||||
{
|
||||
if ((command.CommandBehavior & CommandBehavior.SingleResult) != 0 && resultsRead > 0)
|
||||
return false;
|
||||
if (command.Tds.DoneProc)
|
||||
return false;
|
||||
|
||||
schemaTable.Rows.Clear ();
|
||||
|
||||
moreResults = command.Tds.NextResult ();
|
||||
if (!moreResults)
|
||||
command.GetOutputParameters ();
|
||||
|
||||
GetSchemaTable ();
|
||||
|
||||
rowsRead = 0;
|
||||
|
||||
@@ -1,3 +1,116 @@
|
||||
2003-01-08 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* DataColumnPropertyDescriptor.cs: store columnIndex in the .ctor.
|
||||
|
||||
2003-01-08 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* DataColumnPropertyDescriptor.cs: fixed typo.
|
||||
* DataViewManagerListItemTypeDescriptor.cs: added new internal property
|
||||
to get the DataViewManager and removed TablePD class.
|
||||
* DataTablePropertyDescriptor.cs: TablePD class is now this one as
|
||||
suggested by danmorg.
|
||||
|
||||
2003-01-06 Ville Palo <[email protected]>
|
||||
|
||||
* XmlDataLoader.cs: Moved diffgram stuff to new internal class
|
||||
XmlDiffLoader.
|
||||
* XmlDiffLoader.cs: new class for diffgrams. Added handling of
|
||||
diffgr:Errors and some fixes and changed XmlReader to XPathNavigator.
|
||||
|
||||
2003-01-06 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* DataView.cs: made dataViewManager internal.
|
||||
* DataViewManager.cs: use ICustomTypeDescriptor. We don't want the
|
||||
properties of the object, but the values of the columns present in a
|
||||
row.
|
||||
|
||||
* DataViewManagerListItemTypeDescriptor.cs: implemented GetProperties,
|
||||
which returns a PropertyDescriptorCollection. Created a new class
|
||||
derived from PropertyDescriptor that treats Table as an object whose
|
||||
properties are DataRowView.
|
||||
|
||||
2003-01-04 Ville Palo <[email protected]>
|
||||
|
||||
* XmlSchemaMapper.cs: Added handling for Constraints, Attributes.
|
||||
|
||||
2003-01-04 Ville Palo <[email protected]>
|
||||
|
||||
* DataColumn.cs: ExtendedProperties is by default !null-
|
||||
|
||||
2003-01-04 Ville Palo <[email protected]>
|
||||
|
||||
* DataColumnCollection.cs: Add (DataColumn Column) -method didn't
|
||||
set column's ordinal.
|
||||
|
||||
2003-01-02 Ville Palo <[email protected]>
|
||||
|
||||
* DataSet.cs:
|
||||
* XmlDataLoader.cs: XmlReader closing fixes.
|
||||
* XmlSchemaReader.cs: Added support for ref=
|
||||
|
||||
2003-01-01 Ville Palo <[email protected]>
|
||||
|
||||
* DataSet.cs:
|
||||
- Added XmlReader and XmlWriter Closing.
|
||||
- Moved ReadXmlSchema stuff to new internal class XmlSchemaMapper.
|
||||
* XmlSchemaMapper.cs
|
||||
- Much better way IMHO to map xmlschema than the old one in
|
||||
DataSet.cs. Its, more flexible, cleaner, ...
|
||||
|
||||
2002-12-29 Ville Palo <[email protected]>
|
||||
|
||||
* XmlDataLoader.cs: Reading diffgrams.
|
||||
|
||||
2002-12-29 Ville Palo <[email protected]>
|
||||
|
||||
* DataRow.cs: Little fix to indexer and DataColumnCang* trigger fixes.
|
||||
* DataTable.cs: Added ChanginDataColumn () for triggering
|
||||
DataColumnChanging event
|
||||
|
||||
2002-12-28 Ville Palo <[email protected]>
|
||||
|
||||
* DataSet.cs: Indentations to WriteXmlSchema () and one little fix
|
||||
|
||||
2002-12-28 Ville Palo <[email protected]>
|
||||
|
||||
* DataSet.cs: Indentations to WriteXml ()
|
||||
|
||||
2002-12-27 Ville Palo <[email protected]>
|
||||
|
||||
* DataSet.cs:
|
||||
* XmlDataLoader.cs: Moved ReadXml -stuff from DataSet.cs to new
|
||||
class XmlDataLoader.cs
|
||||
|
||||
2002-12-19 Ville Palo <[email protected]>
|
||||
|
||||
* DataSet.cs Implemented ReadXml with XmlReadMode.ReadSchema
|
||||
|
||||
2002-12-18 Ville Palo <[email protected]>
|
||||
|
||||
* DataSet.cs: Started to implement ReadXml-methods.
|
||||
|
||||
2002-12-17 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* DataSet.cs: implemented DefaultViewManager and GetList.
|
||||
|
||||
* DataViewManager.cs: a bit of work on IList and ITypedList needed by
|
||||
DataList in System.Web.
|
||||
|
||||
* DataViewManagerListItemTypeDescriptor.cs: custom type descriptor for
|
||||
DataViewManager.
|
||||
|
||||
2002-12-16 Ville Palo <[email protected]>
|
||||
|
||||
* DataRow.cs
|
||||
* DataTable.cs: Fixed NullException (rollback -event)
|
||||
* DataSet.cs: WriteXml -method does not anymore write <?xml... row.
|
||||
|
||||
2002-12-15 Ville Palo <[email protected]>
|
||||
|
||||
* DataRow.cs:
|
||||
* DataRowCollection.cs: Moved event triggering from DataRow to
|
||||
DataRowCollection.
|
||||
|
||||
2002-12-09 Ville Palo <[email protected]>
|
||||
|
||||
* DataSet.cs: Little fix to WriteTable () -method
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace System.Data {
|
||||
private Type _dataType = null;
|
||||
private object _defaultValue = null;
|
||||
private string expression = null;
|
||||
private PropertyCollection _extendedProperties = null;
|
||||
private PropertyCollection _extendedProperties = new PropertyCollection ();
|
||||
private int maxLength = -1; //-1 represents no length limit
|
||||
private string nameSpace = null;
|
||||
private int _ordinal = -1; //-1 represents not part of a collection
|
||||
|
||||
@@ -117,7 +117,8 @@ namespace System.Data {
|
||||
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
|
||||
|
||||
column.SetTable( parentTable);
|
||||
base.List.Add(column);
|
||||
int ordinal = base.List.Add(column);
|
||||
column.SetOrdinal (ordinal);
|
||||
|
||||
//add constraints if neccesary
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace System.Data
|
||||
public DataColumnPropertyDescriptor (string name, int columnIndex, Attribute [] attrs)
|
||||
: base (name, attrs)
|
||||
{
|
||||
this.columnIndex = columnIndex;
|
||||
}
|
||||
|
||||
public void SetReadOnly (bool value)
|
||||
@@ -72,7 +73,7 @@ namespace System.Data
|
||||
DataRowView drv = (DataRowView) component;
|
||||
return drv[base.Name];
|
||||
}
|
||||
else if(component == typeof(DbDataRecord) && component is DbDataRecord) {
|
||||
else if(componentType == typeof(DbDataRecord) && component is DbDataRecord) {
|
||||
DbDataRecord dr = (DbDataRecord) component;
|
||||
return dr[columnIndex];
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
// Rodrigo Moya <[email protected]>
|
||||
// Daniel Morgan <[email protected]>
|
||||
// Tim Coleman <[email protected]>
|
||||
// Ville Palo <[email protected]>
|
||||
//
|
||||
// (C) Ximian, Inc 2002
|
||||
// (C) Daniel Morgan 2002
|
||||
@@ -13,6 +14,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Data {
|
||||
/// <summary>
|
||||
@@ -97,10 +99,10 @@ namespace System.Data {
|
||||
|
||||
[MonoTODO]
|
||||
set {
|
||||
value = (value == null) ? DBNull.Value : value;
|
||||
value = (value == null) ? DBNull.Value : value;
|
||||
bool objIsDBNull = value.Equals(DBNull.Value);
|
||||
if (column == null)
|
||||
throw new ArgumentNullException ();
|
||||
throw new ArgumentNullException (Locale.GetText ("'column' argument cannot be null."));
|
||||
int columnIndex = _table.Columns.IndexOf (column);
|
||||
if (columnIndex == -1)
|
||||
throw new ArgumentException ();
|
||||
@@ -114,6 +116,8 @@ namespace System.Data {
|
||||
if (rowState == DataRowState.Deleted)
|
||||
throw new DeletedRowInaccessibleException ();
|
||||
|
||||
_table.ChangingDataColumn (this, column, value);
|
||||
|
||||
//MS Implementation doesn't seem to create the proposed or original
|
||||
//set of values when a datarow has just been created or added to the
|
||||
//DataTable and AcceptChanges() has not been called yet.
|
||||
@@ -128,20 +132,23 @@ namespace System.Data {
|
||||
else {
|
||||
BeginEdit (); // implicitly called
|
||||
|
||||
rowState = DataRowState.Modified;
|
||||
|
||||
if(objIsDBNull)
|
||||
proposed[columnIndex] = DBNull.Value;
|
||||
else
|
||||
proposed[columnIndex] = value;
|
||||
|
||||
_table.ChangedDataColumn (this, column, value);
|
||||
|
||||
rowState = DataRowState.Modified;
|
||||
current [columnIndex] = proposed[columnIndex];
|
||||
proposed[columnIndex] = null;
|
||||
}
|
||||
|
||||
//Don't know if this is the rigth thing to do,
|
||||
//but it fixes my test. I believe the MS docs only say this
|
||||
//method is implicitly called when calling AcceptChanges()
|
||||
|
||||
// EndEdit (); // is this the right thing to do?
|
||||
//EndEdit (); // is this the right thing to do?
|
||||
|
||||
}
|
||||
}
|
||||
@@ -191,14 +198,14 @@ namespace System.Data {
|
||||
return column.DefaultValue;
|
||||
|
||||
if (!HasVersion (version))
|
||||
throw new VersionNotFoundException ();
|
||||
throw new VersionNotFoundException (Locale.GetText ("There is no " + version.ToString () + " data to access."));
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case DataRowVersion.Proposed:
|
||||
return proposed[columnIndex];
|
||||
case DataRowVersion.Current:
|
||||
return current[columnIndex];
|
||||
return current[columnIndex];
|
||||
case DataRowVersion.Original:
|
||||
return original[columnIndex];
|
||||
default:
|
||||
@@ -397,7 +404,6 @@ namespace System.Data {
|
||||
switch (rowState) {
|
||||
case DataRowState.Added:
|
||||
Table.Rows.Remove (this);
|
||||
_table.DeletedDataRow (this, DataRowAction.Delete);
|
||||
break;
|
||||
case DataRowState.Deleted:
|
||||
throw new DeletedRowInaccessibleException ();
|
||||
@@ -656,6 +662,8 @@ namespace System.Data {
|
||||
if (original != null)
|
||||
{
|
||||
Array.Copy (original, current, _table.Columns.Count);
|
||||
|
||||
_table.ChangedDataRow (this, DataRowAction.Rollback);
|
||||
CancelEdit ();
|
||||
switch (rowState)
|
||||
{
|
||||
@@ -668,9 +676,17 @@ namespace System.Data {
|
||||
case DataRowState.Deleted:
|
||||
rowState = DataRowState.Unchanged;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_table.ChangedDataRow (this, DataRowAction.Rollback);
|
||||
}
|
||||
else {
|
||||
// If rows are just loaded via Xml the original values are null.
|
||||
// So in this case we have to remove all columns.
|
||||
// FIXME: I'm not realy sure, does this break something else, but
|
||||
// if so: FIXME ;)
|
||||
|
||||
if ((rowState & DataRowState.Added) > 0)
|
||||
_table.Rows.Remove (this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,14 +132,17 @@ namespace System.Data
|
||||
public void Remove (DataRow row)
|
||||
{
|
||||
list.Remove (row);
|
||||
table.DeletedDataRow (row, DataRowAction.Delete);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the row at the specified index from the collection.
|
||||
/// </summary>
|
||||
public void RemoveAt (int index)
|
||||
{
|
||||
list.RemoveAt (index);
|
||||
{
|
||||
DataRow row = (DataRow)list [index];
|
||||
list.RemoveAt (index);
|
||||
table.DeletedDataRow (row, DataRowAction.Delete);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
|
||||
@@ -32,13 +32,14 @@ namespace System.Data {
|
||||
ISupportInitialize, ISerializable {
|
||||
|
||||
private string dataSetName;
|
||||
private string _namespace;
|
||||
private string _namespace = "";
|
||||
private string prefix;
|
||||
private bool caseSensitive;
|
||||
private bool enforceConstraints;
|
||||
private bool enforceConstraints = true;
|
||||
private DataTableCollection tableCollection;
|
||||
// private DataTableRelationCollection relationCollection;
|
||||
private PropertyCollection properties;
|
||||
private DataViewManager defaultView;
|
||||
|
||||
#region Constructors
|
||||
|
||||
@@ -80,15 +81,11 @@ namespace System.Data {
|
||||
[DataSysDescription ("Indicates a custom \"view\" of the data contained by the DataSet. This view allows filtering, searching, and navigating through the custom data view.")]
|
||||
[Browsable (false)]
|
||||
public DataViewManager DefaultViewManager {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
if (defaultView == null)
|
||||
defaultView = new DataViewManager (this);
|
||||
return defaultView;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[DataSysDescription ("Indicates whether constraint rules are to be followed.")]
|
||||
@@ -272,6 +269,7 @@ namespace System.Data {
|
||||
public void WriteXml(XmlWriter writer)
|
||||
{
|
||||
WriteXml( writer, XmlWriteMode.IgnoreSchema );
|
||||
writer.Close ();
|
||||
}
|
||||
|
||||
public void WriteXml(Stream stream, XmlWriteMode mode)
|
||||
@@ -297,9 +295,7 @@ namespace System.Data {
|
||||
|
||||
public void WriteXml(XmlWriter writer, XmlWriteMode mode)
|
||||
{
|
||||
writer.WriteStartDocument();
|
||||
|
||||
|
||||
((XmlTextWriter)writer).Formatting = Formatting.Indented;
|
||||
WriteStartElement( writer, mode, Namespace, Prefix, DataSetName );
|
||||
|
||||
if( mode == XmlWriteMode.WriteSchema )
|
||||
@@ -333,7 +329,7 @@ namespace System.Data {
|
||||
writer.WriteEndElement();
|
||||
|
||||
writer.WriteEndDocument();
|
||||
|
||||
writer.Close ();
|
||||
}
|
||||
|
||||
public void WriteXmlSchema(Stream stream)
|
||||
@@ -359,6 +355,7 @@ namespace System.Data {
|
||||
|
||||
public void WriteXmlSchema(XmlWriter writer)
|
||||
{
|
||||
((XmlTextWriter)writer).Formatting = Formatting.Indented;
|
||||
//Create a skeleton doc and then write the schema
|
||||
//proper which is common to the WriteXml method in schema mode
|
||||
writer.WriteStartDocument();
|
||||
@@ -366,7 +363,7 @@ namespace System.Data {
|
||||
DoWriteXmlSchema( writer );
|
||||
|
||||
writer.WriteEndDocument();
|
||||
|
||||
writer.Close ();
|
||||
}
|
||||
|
||||
public void ReadXmlSchema(Stream stream)
|
||||
@@ -384,13 +381,59 @@ namespace System.Data {
|
||||
public void ReadXmlSchema(TextReader treader)
|
||||
{
|
||||
XmlReader reader = new XmlTextReader( treader );
|
||||
|
||||
ReadXmlSchema( reader );
|
||||
}
|
||||
|
||||
public void ReadXmlSchema(XmlReader reader)
|
||||
{
|
||||
DoReadXmlSchema( reader );
|
||||
XmlSchemaMapper SchemaMapper = new XmlSchemaMapper (this);
|
||||
SchemaMapper.Read (reader);
|
||||
reader.Close ();
|
||||
}
|
||||
|
||||
public XmlReadMode ReadXml (Stream stream)
|
||||
{
|
||||
return ReadXml (new XmlTextReader (stream));
|
||||
}
|
||||
|
||||
public XmlReadMode ReadXml (string str)
|
||||
{
|
||||
return ReadXml (new XmlTextReader (str));
|
||||
}
|
||||
|
||||
public XmlReadMode ReadXml (TextReader reader)
|
||||
{
|
||||
return ReadXml (new XmlTextReader (reader));
|
||||
}
|
||||
|
||||
public XmlReadMode ReadXml (XmlReader r)
|
||||
{
|
||||
XmlDataLoader Loader = new XmlDataLoader (this);
|
||||
XmlReadMode Result = Loader.LoadData (r);
|
||||
r.Close ();
|
||||
return Result;
|
||||
}
|
||||
|
||||
public XmlReadMode ReadXml (Stream stream, XmlReadMode mode)
|
||||
{
|
||||
return ReadXml (new XmlTextReader (stream), mode);
|
||||
}
|
||||
|
||||
public XmlReadMode ReadXml (string str, XmlReadMode mode)
|
||||
{
|
||||
return ReadXml (new XmlTextReader (str), mode);
|
||||
}
|
||||
|
||||
public XmlReadMode ReadXml (TextReader reader, XmlReadMode mode)
|
||||
{
|
||||
return ReadXml (new XmlTextReader (reader), mode);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public XmlReadMode ReadXml (XmlReader reader, XmlReadMode mode)
|
||||
{
|
||||
XmlDataLoader Loader = new XmlDataLoader (this);
|
||||
return Loader.LoadData (reader, mode);
|
||||
}
|
||||
|
||||
#endregion // Public Methods
|
||||
@@ -414,12 +457,12 @@ namespace System.Data {
|
||||
#region IListSource methods
|
||||
IList IListSource.GetList ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return DefaultViewManager;
|
||||
}
|
||||
|
||||
bool IListSource.ContainsListCollection {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endregion IListSource methods
|
||||
@@ -459,7 +502,7 @@ namespace System.Data {
|
||||
{
|
||||
//sort out the namespacing
|
||||
string nspc = table.Namespace.Length > 0 ? table.Namespace : Namespace;
|
||||
|
||||
|
||||
WriteStartElement( writer, mode, nspc, table.Prefix, table.TableName );
|
||||
|
||||
foreach( DataColumn col in atts )
|
||||
@@ -539,7 +582,7 @@ namespace System.Data {
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private void DoWriteXmlSchema( XmlWriter writer )
|
||||
{
|
||||
//Create the root element and declare all the namespaces etc
|
||||
@@ -704,135 +747,6 @@ namespace System.Data {
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void DoReadXmlSchema(XmlReader reader)
|
||||
{
|
||||
DataTable dt = new DataTable ();
|
||||
XmlSchema schema = XmlSchema.Read (reader, null);
|
||||
XmlSchemaObjectCollection SimpleTypes = new XmlSchemaObjectCollection ();
|
||||
XmlSchemaObjectCollection ComplexTypes = new XmlSchemaObjectCollection ();
|
||||
|
||||
// Get types
|
||||
for (int i = 0; i < schema.Items.Count; i++) {
|
||||
|
||||
XmlSchemaSimpleType simpleType = null;
|
||||
XmlSchemaComplexType complexType = null;
|
||||
if ((simpleType = schema.Items [i] as XmlSchemaSimpleType) != null) {
|
||||
SimpleTypes.Add (simpleType);
|
||||
}
|
||||
else if ((complexType = schema.Items [i] as XmlSchemaComplexType) != null) {
|
||||
ComplexTypes.Add (complexType);
|
||||
}
|
||||
}
|
||||
|
||||
// Get elements
|
||||
XmlSchemaObjectCollection Elements = new XmlSchemaObjectCollection ();
|
||||
for (int i = 0; i < schema.Items.Count; i++) {
|
||||
|
||||
XmlSchemaElement element = null;
|
||||
XmlSchemaComplexType complexType = null;
|
||||
if ((element = schema.Items [i] as XmlSchemaElement) != null) {
|
||||
|
||||
// does element have type defined
|
||||
if (!element.SchemaTypeName.IsEmpty)
|
||||
ReadTypeElement (element, ComplexTypes, ref dt);
|
||||
else if ((complexType = element.SchemaType as XmlSchemaComplexType) != null) {
|
||||
dataSetName = element.Name;
|
||||
ReadColumnsFromSchema (complexType, ComplexTypes, ref dt);
|
||||
}
|
||||
|
||||
Tables.Add (dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private bool ReadTypeElement (XmlSchemaElement el, XmlSchemaObjectCollection ComplexTypes,
|
||||
ref DataTable datatable)
|
||||
{
|
||||
/*
|
||||
* reads element's type
|
||||
*/
|
||||
|
||||
bool found = false;
|
||||
|
||||
if (ComplexTypes.Count <= 0)
|
||||
return found;
|
||||
|
||||
if (ComplexTypes[0] is XmlSchemaComplexType) {
|
||||
|
||||
foreach (XmlSchemaComplexType c in ComplexTypes) {
|
||||
|
||||
if (el.SchemaTypeName.ToString () == c.Name.ToString ()) {
|
||||
|
||||
found = true;
|
||||
ReadColumnsFromSchema (c, ComplexTypes, ref datatable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void ReadColumnsFromSchema (XmlSchemaComplexType c, XmlSchemaObjectCollection ComplexTypes,
|
||||
ref DataTable datatable)
|
||||
{
|
||||
// FIXME: There is so much work to do. And i dont event know is this right way but here it is
|
||||
XmlSchemaSequence seq = null;
|
||||
XmlSchemaChoice choice = null;
|
||||
ArrayList names = new ArrayList ();
|
||||
|
||||
if ((seq = c.Particle as XmlSchemaSequence) != null) {
|
||||
|
||||
for (int i = 0; i < seq.Items.Count; i++) {
|
||||
|
||||
XmlSchemaElement element = null;
|
||||
if ((element = seq.Items [i] as XmlSchemaElement) != null) {
|
||||
|
||||
// first is table name and after that comes column names
|
||||
if (datatable.TableName == string.Empty)
|
||||
datatable.TableName = element.Name;
|
||||
else if (i + 1 > datatable.Columns.Count)
|
||||
datatable.Columns.Add (element.Name);
|
||||
|
||||
ReadTypeElement (element, ComplexTypes, ref datatable);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((choice = c.Particle as XmlSchemaChoice) != null) {
|
||||
|
||||
foreach (XmlSchemaObject obj in choice.Items) {
|
||||
XmlSchemaElement e = null;
|
||||
|
||||
if ((e = obj as XmlSchemaElement) != null) {
|
||||
|
||||
|
||||
// if element has type we got to find out what is it
|
||||
if (e.SchemaType != null) {
|
||||
datatable.TableName = e.Name;
|
||||
ReadColumnsFromSchema (e.SchemaType as XmlSchemaComplexType, ComplexTypes,
|
||||
ref datatable);
|
||||
}
|
||||
else if (!e.RefName.IsEmpty) {
|
||||
|
||||
// FIXME: this is wrong way to do. We should find element which is
|
||||
// referenced by e. I do that later
|
||||
dataSetName = e.Name;
|
||||
datatable.TableName = e.RefName.ToString ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[MonoTODO]
|
||||
private void OnXmlSchemaValidation (object sender, ValidationEventArgs args)
|
||||
{
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// Helper function to split columns into attributes elements and simple
|
||||
/// content
|
||||
@@ -878,5 +792,7 @@ namespace System.Data {
|
||||
//TODO -
|
||||
return "xs:string";
|
||||
}
|
||||
|
||||
#endregion //Private Xml Serialisation
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
// Daniel Morgan <[email protected]>
|
||||
// Rodrigo Moya <[email protected]>
|
||||
// Tim Coleman ([email protected])
|
||||
// Ville Palo <[email protected]>
|
||||
//
|
||||
// (C) Chris Podurgiel
|
||||
// (C) Ximian, Inc 2002
|
||||
@@ -118,6 +119,12 @@ namespace System.Data {
|
||||
OnColumnChanged(e);
|
||||
}
|
||||
|
||||
internal void ChangingDataColumn (DataRow dr, DataColumn dc, object pv)
|
||||
{
|
||||
DataColumnChangeEventArgs e = new DataColumnChangeEventArgs (dr, dc, pv);
|
||||
OnColumnChanging (e);
|
||||
}
|
||||
|
||||
internal void DeletedDataRow (DataRow dr, DataRowAction action)
|
||||
{
|
||||
DataRowChangeEventArgs e = new DataRowChangeEventArgs (dr, action);
|
||||
@@ -602,10 +609,13 @@ namespace System.Data {
|
||||
[MonoTODO]
|
||||
public void RejectChanges()
|
||||
{
|
||||
foreach(DataRow myRow in _rows)
|
||||
{
|
||||
if (myRow.RowState != DataRowState.Unchanged)
|
||||
myRow.RejectChanges();
|
||||
|
||||
//foreach(DataRow myRow in _rows)
|
||||
//{
|
||||
for (int i = _rows.Count - 1; i >= 0; i--) {
|
||||
DataRow row = _rows [i];
|
||||
if (row.RowState != DataRowState.Unchanged)
|
||||
_rows [i].RejectChanges ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// System.Data.DataTablePropertyDescriptor
|
||||
//
|
||||
// Authors:
|
||||
// Gonzalo Paniagua Javier ([email protected])
|
||||
//
|
||||
// (C) 2003 Ximian, Inc (http://www.ximian.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
internal class DataTablePropertyDescriptor : PropertyDescriptor
|
||||
{
|
||||
DataTable table;
|
||||
|
||||
public DataTablePropertyDescriptor (DataTable table) : base (table.TableName, null)
|
||||
{
|
||||
this.table = table;
|
||||
}
|
||||
|
||||
public override object GetValue (object component)
|
||||
{
|
||||
DataViewManagerListItemTypeDescriptor desc = component as DataViewManagerListItemTypeDescriptor;
|
||||
if (desc == null)
|
||||
return null;
|
||||
|
||||
DataView dv = new DataView (table);
|
||||
dv.dataViewManager = desc.DataViewManager;
|
||||
return dv;
|
||||
}
|
||||
|
||||
public override bool CanResetValue (object component)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool Equals (object other)
|
||||
{
|
||||
return (other is DataTablePropertyDescriptor &&
|
||||
((DataTablePropertyDescriptor) other).table == table);
|
||||
}
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return table.GetHashCode ();
|
||||
}
|
||||
|
||||
public override bool ShouldSerializeValue (object component)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ResetValue (object component)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetValue (object component, object value)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool IsReadOnly
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override Type ComponentType
|
||||
{
|
||||
get { return typeof (DataRowView); }
|
||||
}
|
||||
|
||||
public override Type PropertyType
|
||||
{
|
||||
get { return typeof (IBindingList); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace System.Data {
|
||||
|
||||
bool isOpen = false;
|
||||
|
||||
DataViewManager dataViewManager = null;
|
||||
internal DataViewManager dataViewManager = null;
|
||||
|
||||
[MonoTODO]
|
||||
public DataView () {
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace System.Data
|
||||
#region Fields
|
||||
|
||||
DataSet dataSet;
|
||||
DataViewManagerListItemTypeDescriptor descriptor;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
@@ -78,20 +79,22 @@ namespace System.Data
|
||||
}
|
||||
|
||||
bool IList.IsFixedSize {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
bool IList.IsReadOnly {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
object IList.this [int index] {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
[MonoTODO]
|
||||
set { throw new NotImplementedException (); }
|
||||
get {
|
||||
if (descriptor == null)
|
||||
descriptor = new DataViewManagerListItemTypeDescriptor (this);
|
||||
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
set { throw new ArgumentException ("Not modifiable"); }
|
||||
}
|
||||
|
||||
bool IBindingList.AllowEdit {
|
||||
@@ -239,9 +242,16 @@ namespace System.Data
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
PropertyDescriptorCollection ITypedList.GetItemProperties (PropertyDescriptor[] listAccessors)
|
||||
{
|
||||
if (dataSet == null)
|
||||
throw new DataException ("dataset is null");
|
||||
|
||||
if (listAccessors == null || listAccessors.Length == 0) {
|
||||
ICustomTypeDescriptor desc = new DataViewManagerListItemTypeDescriptor (this);
|
||||
return desc.GetProperties ();
|
||||
}
|
||||
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
//
|
||||
// System.Data.DataViewManagerListItemTypeDscriptor
|
||||
//
|
||||
// Authors:
|
||||
// Gonzalo Paniagua Javier ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc (http://www.ximian.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
class DataViewManagerListItemTypeDescriptor : ICustomTypeDescriptor
|
||||
{
|
||||
DataViewManager dvm;
|
||||
PropertyDescriptorCollection propsCollection;
|
||||
|
||||
internal DataViewManagerListItemTypeDescriptor (DataViewManager dvm)
|
||||
{
|
||||
this.dvm = dvm;
|
||||
}
|
||||
|
||||
internal DataViewManager DataViewManager {
|
||||
get { return dvm; }
|
||||
}
|
||||
|
||||
AttributeCollection ICustomTypeDescriptor.GetAttributes ()
|
||||
{
|
||||
return new AttributeCollection (null);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
string ICustomTypeDescriptor.GetClassName ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
string ICustomTypeDescriptor.GetComponentName ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
TypeConverter ICustomTypeDescriptor.GetConverter ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
EventDescriptor ICustomTypeDescriptor.GetDefaultEvent ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
object ICustomTypeDescriptor.GetEditor (Type editorBaseType)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
EventDescriptorCollection ICustomTypeDescriptor.GetEvents ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
EventDescriptorCollection ICustomTypeDescriptor.GetEvents (System.Attribute[] attributes)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ()
|
||||
{
|
||||
DataSet ds = dvm.DataSet;
|
||||
if (ds == null)
|
||||
return null;
|
||||
|
||||
DataTableCollection tables = ds.Tables;
|
||||
int index = 0;
|
||||
PropertyDescriptor [] descriptors = new PropertyDescriptor [tables.Count];
|
||||
foreach (DataTable table in tables)
|
||||
descriptors [index++] = new DataTablePropertyDescriptor (table);
|
||||
|
||||
return new PropertyDescriptorCollection (descriptors);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (System.Attribute[] attributes)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
object ICustomTypeDescriptor.GetPropertyOwner (PropertyDescriptor pd)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
//
|
||||
// mcs/class/System.Data/System.Data/XmlDataLoader.cs
|
||||
//
|
||||
// Purpose: Loads XmlDocument to DataSet
|
||||
//
|
||||
// class: XmlDataLoader
|
||||
// assembly: System.Data.dll
|
||||
// namespace: System.Data
|
||||
//
|
||||
// Author:
|
||||
// Ville Palo <[email protected]>
|
||||
//
|
||||
// (c)copyright 2002 Ville Palo
|
||||
//
|
||||
// XmlDataLoader is included within the Mono Class Library.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Data {
|
||||
|
||||
internal class XmlDataLoader
|
||||
{
|
||||
|
||||
private DataSet DSet;
|
||||
Hashtable DiffGrRows = new Hashtable ();
|
||||
|
||||
public XmlDataLoader (DataSet set)
|
||||
{
|
||||
DSet = set;
|
||||
}
|
||||
|
||||
public XmlReadMode LoadData (XmlReader r)
|
||||
{
|
||||
// FIXME: somekinda exception?
|
||||
if (!r.Read ())
|
||||
return XmlReadMode.Auto; // FIXME
|
||||
|
||||
/*\
|
||||
* If document is diffgram we will use diffgram
|
||||
\*/
|
||||
if (r.LocalName == "diffgram")
|
||||
return LoadData (r, XmlReadMode.DiffGram);
|
||||
|
||||
/*\
|
||||
* If we already have a schema, or the document
|
||||
* contains an in-line schema, sets XmlReadMode to ReadSchema.
|
||||
\*/
|
||||
|
||||
// FIXME: is this always true: "if we have tables we have to have schema also"
|
||||
if (DSet.Tables.Count > 0)
|
||||
return LoadData (r, XmlReadMode.ReadSchema);
|
||||
|
||||
/*\
|
||||
* If we dont have a schema yet and document
|
||||
* contains no inline-schema mode is XmlReadMode.InferSchema
|
||||
\*/
|
||||
|
||||
return LoadData (r, XmlReadMode.InferSchema);
|
||||
}
|
||||
|
||||
public XmlReadMode LoadData (XmlReader reader, XmlReadMode mode)
|
||||
{
|
||||
XmlReadMode Result = XmlReadMode.Auto;
|
||||
|
||||
switch (mode) {
|
||||
|
||||
case XmlReadMode.DiffGram:
|
||||
Result = XmlReadMode.DiffGram;
|
||||
ReadModeDiffGram (reader);
|
||||
break;
|
||||
case XmlReadMode.Auto:
|
||||
LoadData (reader);
|
||||
break;
|
||||
case XmlReadMode.Fragment:
|
||||
break;
|
||||
case XmlReadMode.ReadSchema:
|
||||
Result = XmlReadMode.ReadSchema;
|
||||
ReadModeSchema (reader, false);
|
||||
break;
|
||||
case XmlReadMode.IgnoreSchema:
|
||||
Result = XmlReadMode.IgnoreSchema;
|
||||
ReadModeSchema (reader, true);
|
||||
break;
|
||||
case XmlReadMode.InferSchema:
|
||||
Result = XmlReadMode.InferSchema;
|
||||
ReadModeInferSchema (reader);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
// These methods should be in their own class for example XmlDiffLoader. But for now, let them be here
|
||||
#region diffgram-methods
|
||||
|
||||
// XmlReadMode.DiffGram
|
||||
private void ReadModeDiffGram (XmlReader reader)
|
||||
{
|
||||
XmlDiffLoader DiffLoader = new XmlDiffLoader (DSet);
|
||||
DiffLoader.Load (reader);
|
||||
}
|
||||
|
||||
#endregion // diffgram-methods
|
||||
|
||||
#region reading
|
||||
|
||||
// XmlReadMode.InferSchema
|
||||
[MonoTODO]
|
||||
private void ReadModeInferSchema (XmlReader reader)
|
||||
{
|
||||
// root element is DataSets name
|
||||
reader.MoveToContent ();
|
||||
|
||||
DSet.DataSetName = reader.LocalName;
|
||||
|
||||
// And now comes tables
|
||||
while (reader.Read ()) {
|
||||
|
||||
// skip possible inline-schema
|
||||
if (String.Compare (reader.LocalName, "schema", true) == 0 && reader.NodeType == XmlNodeType.Element) {
|
||||
while (reader.Read () && (reader.NodeType != XmlNodeType.EndElement
|
||||
|| String.Compare (reader.LocalName, "schema", true) != 0));
|
||||
}
|
||||
|
||||
|
||||
if (reader.NodeType == XmlNodeType.Element) {
|
||||
|
||||
string datatablename = reader.LocalName;
|
||||
bool addTable = true;
|
||||
DataTable table;
|
||||
|
||||
if (!DSet.Tables.Contains (datatablename)) {
|
||||
table = new DataTable (reader.LocalName);
|
||||
}
|
||||
else {
|
||||
table = DSet.Tables [datatablename];
|
||||
addTable = false;
|
||||
}
|
||||
|
||||
Hashtable rowValue = new Hashtable ();
|
||||
|
||||
while (reader.Read () && (reader.NodeType != XmlNodeType.EndElement
|
||||
|| reader.LocalName != datatablename))
|
||||
{
|
||||
if (reader.NodeType == XmlNodeType.Element) {
|
||||
|
||||
string dataColumnName = reader.LocalName;
|
||||
if (addTable)
|
||||
table.Columns.Add (dataColumnName);
|
||||
|
||||
// FIXME: exception?
|
||||
if (!reader.Read ())
|
||||
return;
|
||||
|
||||
rowValue.Add (dataColumnName, reader.Value);
|
||||
}
|
||||
}
|
||||
|
||||
DataRow row = table.NewRow ();
|
||||
|
||||
IDictionaryEnumerator enumerator = rowValue.GetEnumerator ();
|
||||
while (enumerator.MoveNext ()) {
|
||||
row [enumerator.Key.ToString ()] = enumerator.Value.ToString ();
|
||||
}
|
||||
|
||||
table.Rows.Add (row);
|
||||
|
||||
if (addTable)
|
||||
DSet.Tables.Add (table);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Read Xmldocument. XmlReadMode.ReadSchema and XmlReadMode.IgnoreSchema
|
||||
[MonoTODO]
|
||||
private void ReadModeSchema (XmlReader reader, bool IgnoreSchema)
|
||||
{
|
||||
/*\
|
||||
* Reads any inline schema, but an exception is thrown
|
||||
* if any tables in the inline schema already exist in the DataSet.
|
||||
\*/
|
||||
|
||||
reader.MoveToContent ();
|
||||
|
||||
while (reader.Read ()) {
|
||||
|
||||
// FIXME: possible inline-schema should be readed here
|
||||
if (String.Compare (reader.LocalName, "schema", true) == 0 && reader.NodeType == XmlNodeType.Element) {
|
||||
if (!IgnoreSchema)
|
||||
DSet.ReadXmlSchema (reader);
|
||||
}
|
||||
|
||||
// find table
|
||||
if (reader.NodeType == XmlNodeType.Element && DSet.Tables.Contains (reader.LocalName)) {
|
||||
|
||||
DataTable table = DSet.Tables [reader.LocalName];
|
||||
DataRow row = table.NewRow ();
|
||||
|
||||
ReadColumns (reader, row, table, reader.LocalName);
|
||||
|
||||
table.Rows.Add (row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // reading
|
||||
|
||||
#region Private helper methods
|
||||
|
||||
private void ReadColumns (XmlReader reader, DataRow row, DataTable table, string TableName)
|
||||
{
|
||||
do {
|
||||
if (reader.NodeType == XmlNodeType.Element &&
|
||||
table.Columns.Contains (reader.LocalName)) {
|
||||
string columName = reader.LocalName;
|
||||
reader.Read ();
|
||||
row [columName] = reader.Value;
|
||||
}
|
||||
else {
|
||||
reader.Read ();
|
||||
}
|
||||
|
||||
} while (table.TableName != reader.LocalName
|
||||
|| reader.NodeType != XmlNodeType.EndElement);
|
||||
}
|
||||
|
||||
#endregion // Private helper methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
//
|
||||
// mcs/class/System.Data/System.Data/XmlDiffLoader.cs
|
||||
//
|
||||
// Purpose: Loads XmlDiffGrams to DataSet
|
||||
//
|
||||
// class: XmlDiffLoader
|
||||
// assembly: System.Data.dll
|
||||
// namespace: System.Data
|
||||
//
|
||||
// Author:
|
||||
// Ville Palo <[email protected]>
|
||||
//
|
||||
// (c)copyright 2003 Ville Palo
|
||||
//
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Xml;
|
||||
using System.Xml.XPath;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Data {
|
||||
|
||||
internal class XmlDiffLoader
|
||||
{
|
||||
|
||||
#region Fields
|
||||
|
||||
private DataSet DSet;
|
||||
private Hashtable DiffGrRows = new Hashtable ();
|
||||
private Hashtable ErrorRows = new Hashtable ();
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region ctors
|
||||
|
||||
public XmlDiffLoader (DataSet DSet)
|
||||
{
|
||||
this.DSet = DSet;
|
||||
}
|
||||
|
||||
#endregion //ctors
|
||||
|
||||
#region Public methods
|
||||
|
||||
public void Load (XmlReader Reader)
|
||||
{
|
||||
XmlTextReader TextReader = new XmlTextReader (Reader.BaseURI);
|
||||
XmlDocument Document = new XmlDocument ();
|
||||
Document.Load (TextReader);
|
||||
TextReader.Close ();
|
||||
|
||||
XPathNavigator Navigator = Document.CreateNavigator ();
|
||||
LoadBefore (Navigator);
|
||||
LoadCurrent (Navigator);
|
||||
LoadErrors (Navigator);
|
||||
}
|
||||
|
||||
#endregion // Public methods
|
||||
|
||||
#region Private methods
|
||||
|
||||
private void LoadCurrent (XPathNavigator Navigator)
|
||||
{
|
||||
Navigator.MoveToRoot ();
|
||||
|
||||
if (Navigator.MoveToFirstChild ()) {
|
||||
|
||||
if (Navigator.Name == "diffgr:diffgram") {
|
||||
|
||||
if (Navigator.MoveToFirstChild ()) {
|
||||
|
||||
if (Navigator.MoveToFirstChild ()) {
|
||||
|
||||
if (DSet.Tables.Contains (Navigator.LocalName)) {
|
||||
|
||||
DataTable Table = DSet.Tables [Navigator.LocalName];
|
||||
DataRow Row = null;
|
||||
bool NewRow = false;
|
||||
bool HasErrors = false;
|
||||
string id = "";
|
||||
|
||||
if (Navigator.MoveToFirstAttribute ()) {
|
||||
|
||||
do {
|
||||
// Find out was there same row in 'before' section
|
||||
if (Navigator.LocalName == "id") {
|
||||
id = Navigator.Value;
|
||||
if (DiffGrRows.Contains (id))
|
||||
Row = (DataRow)DiffGrRows [id];
|
||||
|
||||
}
|
||||
else if (Navigator.LocalName == "hasErrors" && String.Compare (Navigator.Value, "true", true) == 0)
|
||||
HasErrors = true;
|
||||
} while (Navigator.MoveToNextAttribute ());
|
||||
|
||||
// back to business
|
||||
Navigator.MoveToParent ();
|
||||
}
|
||||
|
||||
if (Row == null) {
|
||||
|
||||
Row = Table.NewRow ();
|
||||
NewRow = true;
|
||||
}
|
||||
|
||||
LoadColumns (Table, Row, Navigator, NewRow);
|
||||
|
||||
if (HasErrors) // If row had errors add row to hashtable for later use
|
||||
ErrorRows.Add (id, Row);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadBefore (XPathNavigator Navigator)
|
||||
{
|
||||
Navigator.MoveToRoot ();
|
||||
|
||||
if (!Navigator.MoveToFirstChild ())
|
||||
return; // FIXME: exception
|
||||
|
||||
if (Navigator.Name != "diffgr:diffgram")
|
||||
return; // FIXME: exception
|
||||
|
||||
if (Navigator.MoveToFirstChild ()) {
|
||||
|
||||
while (Navigator.Name != "diffgr:before") {
|
||||
|
||||
if (!Navigator.MoveToNext ()) // there is no before
|
||||
return;
|
||||
}
|
||||
|
||||
if (Navigator.MoveToFirstChild ()) {
|
||||
|
||||
do {
|
||||
if (DSet.Tables.Contains (Navigator.LocalName)) {
|
||||
|
||||
String id = null;
|
||||
DataTable Table = DSet.Tables [Navigator.LocalName];
|
||||
DataRow Row = Table.NewRow ();
|
||||
|
||||
if (Navigator.MoveToFirstAttribute ()) {
|
||||
|
||||
do {
|
||||
if (Navigator.Name == "diffgr:id")
|
||||
id = Navigator.Value;
|
||||
|
||||
} while (Navigator.MoveToNextAttribute ());
|
||||
|
||||
Navigator.MoveToParent ();
|
||||
}
|
||||
|
||||
LoadColumns (Table, Row, Navigator, true);
|
||||
DiffGrRows.Add (id, Row); // for later use
|
||||
Row.AcceptChanges ();
|
||||
}
|
||||
else {
|
||||
throw new DataException (Locale.GetText ("Cannot load diffGram. Table '" + Navigator.LocalName + "' is missing in the destination dataset"));
|
||||
}
|
||||
} while (Navigator.MoveToNext ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void LoadErrors (XPathNavigator Navigator)
|
||||
{
|
||||
Navigator.MoveToRoot ();
|
||||
|
||||
if (!Navigator.MoveToFirstChild ())
|
||||
return; // FIXME: exception
|
||||
|
||||
if (Navigator.Name != "diffgr:diffgram")
|
||||
return; // FIXME: exception
|
||||
|
||||
if (Navigator.MoveToFirstChild ()) {
|
||||
|
||||
while (Navigator.Name != "diffgr:errors") {
|
||||
if (!Navigator.MoveToNext ())
|
||||
return;
|
||||
}
|
||||
|
||||
if (Navigator.MoveToFirstChild ()) {
|
||||
|
||||
DataRow Row = null;
|
||||
|
||||
// find the row in 'current' section
|
||||
if (Navigator.MoveToFirstAttribute ()) {
|
||||
|
||||
do {
|
||||
if (Navigator.Name == "diffgr:id") {
|
||||
|
||||
if (ErrorRows.Contains (Navigator.Value))
|
||||
Row = (DataRow)ErrorRows [Navigator.Value];
|
||||
}
|
||||
|
||||
} while (Navigator.MoveToNextAttribute ());
|
||||
|
||||
Navigator.MoveToParent ();
|
||||
}
|
||||
|
||||
if (Navigator.MoveToFirstChild ()) {
|
||||
|
||||
string Error = "";
|
||||
|
||||
do {
|
||||
if (Navigator.MoveToFirstAttribute ()) {
|
||||
do {
|
||||
if (Navigator.Name == "diffgr:Error")
|
||||
Error = Navigator.Value;
|
||||
|
||||
} while (Navigator.MoveToNextAttribute ());
|
||||
|
||||
Navigator.MoveToParent ();
|
||||
}
|
||||
|
||||
Row.SetColumnError (Navigator.LocalName, Error);
|
||||
|
||||
} while (Navigator.MoveToNext ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadColumns (DataTable Table, DataRow Row, XPathNavigator Navigator, bool NewRow)
|
||||
{
|
||||
if (Navigator.MoveToFirstChild ()) {
|
||||
|
||||
do {
|
||||
if (Table.Columns.Contains (Navigator.LocalName))
|
||||
Row [Navigator.LocalName] = Navigator.Value;
|
||||
|
||||
} while (Navigator.MoveToNext ());
|
||||
|
||||
if (NewRow)
|
||||
Table.Rows.Add (Row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion // Private methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,380 @@
|
||||
//
|
||||
// mcs/class/System.Data/System.Data/XmlSchemaMapper.cs
|
||||
//
|
||||
// Purpose: Maps XmlSchema to DataSet
|
||||
//
|
||||
// class: XmlSchemaMapper
|
||||
// assembly: System.Data.dll
|
||||
// namespace: System.Data
|
||||
//
|
||||
// Author:
|
||||
// Ville Palo <[email protected]>
|
||||
//
|
||||
// (C) 2002 Ville Palo
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Data {
|
||||
|
||||
/*\
|
||||
* There is so much TODO here that i dont bother to list them.
|
||||
\*/
|
||||
|
||||
internal class XmlSchemaMapper
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private DataSet DSet;
|
||||
enum ElementType {ELEMENT_UNDEFINED, ELEMENT_TABLE, ELEMENT_COLUMN};
|
||||
private Hashtable TypeCollection = new Hashtable ();
|
||||
private Hashtable ElementCollection = new Hashtable ();
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public XmlSchemaMapper (DataSet dataset)
|
||||
{
|
||||
DSet = dataset;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Public methods
|
||||
|
||||
public void Read (XmlReader Reader)
|
||||
{
|
||||
XmlSchema Schema = XmlSchema.Read (Reader, new ValidationEventHandler (OnXmlSchemaValidation));
|
||||
|
||||
// read items
|
||||
foreach (XmlSchemaObject Item in Schema.Items) {
|
||||
ReadXmlSchemaItem (Item);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Public methods
|
||||
|
||||
#region Private methods
|
||||
|
||||
private void ReadXmlSchemaItem (XmlSchemaObject Item)
|
||||
{
|
||||
XmlSchemaObject SchemaObject;
|
||||
|
||||
if (Item is XmlSchemaType)
|
||||
ReadXmlSchemaType ((XmlSchemaType)Item);
|
||||
else if ((SchemaObject = Item as XmlSchemaElement) != null)
|
||||
ReadXmlSchemaElement (SchemaObject as XmlSchemaElement, ElementType.ELEMENT_UNDEFINED);
|
||||
}
|
||||
|
||||
private void ReadXmlSchemaSequence (XmlSchemaSequence Sequence)
|
||||
{
|
||||
ReadXmlSchemaSequence (Sequence, null);
|
||||
}
|
||||
|
||||
private void ReadXmlSchemaSequence (XmlSchemaSequence Sequence, DataTable Table)
|
||||
{
|
||||
foreach (XmlSchemaObject TempObj in Sequence.Items) {
|
||||
|
||||
XmlSchemaObject SchemaObject;
|
||||
if ((SchemaObject = TempObj as XmlSchemaElement) != null)
|
||||
ReadXmlSchemaElement ((XmlSchemaElement)SchemaObject, ElementType.ELEMENT_COLUMN, Table);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadXmlSchemaChoice (XmlSchemaChoice Choice)
|
||||
{
|
||||
//MaxOccurs
|
||||
|
||||
XmlSchemaObject SchemaObject;
|
||||
foreach (XmlSchemaObject TempObject in Choice.Items) {
|
||||
|
||||
if ((SchemaObject = TempObject as XmlSchemaElement) != null)
|
||||
ReadXmlSchemaElement ((XmlSchemaElement)SchemaObject, ElementType.ELEMENT_TABLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadXmlSchemaElement (XmlSchemaElement Element)
|
||||
{
|
||||
ReadXmlSchemaElement (Element, ElementType.ELEMENT_UNDEFINED);
|
||||
}
|
||||
|
||||
private void ReadXmlSchemaElement (XmlSchemaElement Element, ElementType ElType)
|
||||
{
|
||||
ReadXmlSchemaElement (Element, ElType, null);
|
||||
}
|
||||
|
||||
private void ReadXmlSchemaElement (XmlSchemaElement Element, ElementType ElType, DataTable Table)
|
||||
{
|
||||
Hashtable Attributes = ReadUnhandledAttributes (Element.UnhandledAttributes);
|
||||
DataTable Table2 = null;
|
||||
|
||||
if (Attributes.Contains ("IsDataSet")) { // DataSet -elemt
|
||||
|
||||
if (String.Compare (Attributes ["IsDataSet"].ToString (), "true", true) == 0)
|
||||
DSet.DataSetName = Element.Name;
|
||||
}
|
||||
else if (Element.SchemaTypeName != null && Element.SchemaTypeName.Namespace != XmlConstants.SchemaNamespace
|
||||
&& Element.SchemaTypeName.Name != String.Empty) {
|
||||
|
||||
//
|
||||
// If type is not standard type
|
||||
//
|
||||
|
||||
DataTable TempTable = new DataTable (Element.Name);
|
||||
DSet.Tables.Add (TempTable);
|
||||
|
||||
// FIXME: if this element comes before types
|
||||
if (TypeCollection.Contains (Element.SchemaTypeName.ToString ()))
|
||||
ReadXmlSchemaType ((XmlSchemaType)TypeCollection [Element.SchemaTypeName.ToString ()], TempTable);
|
||||
|
||||
}
|
||||
else if (Element.RefName != null && Element.RefName.Name != string.Empty) { // if there is a ref=
|
||||
|
||||
if (ElementCollection.Contains (Element.RefName.Name))
|
||||
ReadXmlSchemaElement ((XmlSchemaElement)ElementCollection [Element.RefName.Name], ElementType.ELEMENT_TABLE);
|
||||
}
|
||||
else if (ElementType.ELEMENT_UNDEFINED != ElType) {
|
||||
|
||||
if (ElType == ElementType.ELEMENT_TABLE)
|
||||
ReadTable (Element);
|
||||
else if (ElType == ElementType.ELEMENT_COLUMN && Table != null)
|
||||
ReadColumn (Element, Table);
|
||||
}
|
||||
else {
|
||||
// this element is undefined, for now
|
||||
ElementCollection.Add (Element.Name, Element);
|
||||
}
|
||||
|
||||
// Read Element type
|
||||
if (Element.SchemaType != null)
|
||||
ReadXmlSchemaType (Element.SchemaType);
|
||||
|
||||
// Read possible constraints
|
||||
if (Element.Constraints != null && Element.Constraints.Count > 0)
|
||||
ReadXmlSchemaConstraints (Element.Constraints);
|
||||
}
|
||||
|
||||
private void ReadTable (XmlSchemaElement Element)
|
||||
{
|
||||
DataTable TempTable = new DataTable (Element.Name);
|
||||
DSet.Tables.Add (TempTable);
|
||||
ReadXmlSchemaType (Element.SchemaType, TempTable);
|
||||
}
|
||||
|
||||
private void ReadColumn (XmlSchemaElement Element, DataTable Table)
|
||||
{
|
||||
DataColumn Column = new DataColumn (Element.Name);
|
||||
Table.Columns.Add (Column);
|
||||
|
||||
if (Element.UnhandledAttributes == null)
|
||||
return;
|
||||
|
||||
foreach (XmlAttribute Attr in Element.UnhandledAttributes) {
|
||||
|
||||
switch (Attr.LocalName) {
|
||||
|
||||
case "Caption":
|
||||
Column.Caption = Attr.Value;
|
||||
break;
|
||||
case "DataType":
|
||||
Column.DataType = Type.GetType (Attr.Value);
|
||||
break;
|
||||
case "type":
|
||||
// FIXME:
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Handel rest of the parameters
|
||||
//
|
||||
|
||||
// FIXME: Default columntype is string???
|
||||
if (Column.DataType == null)
|
||||
Column.DataType = Type.GetType ("System.String");
|
||||
|
||||
if (Element.DefaultValue != null)
|
||||
Column.DefaultValue = Element.DefaultValue;
|
||||
|
||||
// If Element have type
|
||||
if (Element.SchemaType != null)
|
||||
ReadXmlSchemaType (Element.SchemaType, Column);
|
||||
}
|
||||
|
||||
// Makes new Hashtable of the attributes.
|
||||
private Hashtable ReadUnhandledAttributes (XmlAttribute [] Attributes)
|
||||
{
|
||||
Hashtable Result = new Hashtable ();
|
||||
|
||||
if (Attributes == null)
|
||||
return Result;
|
||||
|
||||
foreach (XmlAttribute attribute in Attributes) {
|
||||
Result.Add (attribute.LocalName, attribute.Value);
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
private void ReadXmlSchemaConstraints (XmlSchemaObjectCollection Constraints)
|
||||
{
|
||||
foreach (XmlSchemaObject Constraint in Constraints) {
|
||||
|
||||
if (Constraint is XmlSchemaUnique)
|
||||
ReadXmlSchemaUnique ((XmlSchemaUnique)Constraint);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO()]
|
||||
private void ReadXmlSchemaUnique (XmlSchemaUnique Unique)
|
||||
{
|
||||
// FIXME: Parsing XPath
|
||||
|
||||
string TableName = Unique.Selector.XPath;
|
||||
if (TableName.StartsWith (".//"))
|
||||
TableName = TableName.Substring (3);
|
||||
|
||||
DataColumn [] Columns;
|
||||
if (DSet.Tables.Contains (TableName)) {
|
||||
|
||||
DataTable Table = DSet.Tables [TableName];
|
||||
Columns = new DataColumn [Unique.Fields.Count];
|
||||
int i = 0;
|
||||
foreach (XmlSchemaXPath Field in Unique.Fields) {
|
||||
|
||||
if (Table.Columns.Contains (Field.XPath)) {
|
||||
Table.Columns [Field.XPath].Unique = true;
|
||||
Columns [i] = Table.Columns [Field.XPath];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
UniqueConstraint Constraint = new UniqueConstraint (Unique.Name, Columns);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Private methods
|
||||
|
||||
#region Private listeners
|
||||
|
||||
private void OnXmlSchemaValidation (object sender, ValidationEventArgs args)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
#endregion // Private listeners
|
||||
|
||||
#region Private TypeReaders
|
||||
|
||||
// Reads XmlSchemaType
|
||||
private void ReadXmlSchemaType (XmlSchemaType SchemaType)
|
||||
{
|
||||
ReadXmlSchemaType (SchemaType, (DataTable)null);
|
||||
}
|
||||
|
||||
// Reads XmlSchemaType and decides is it Complex or Simple and continue reading those types
|
||||
private void ReadXmlSchemaType (XmlSchemaType SchemaType, DataTable Table)
|
||||
{
|
||||
if (SchemaType is XmlSchemaComplexType)
|
||||
ReadXmlSchemaComplexType ((XmlSchemaComplexType)SchemaType, Table);
|
||||
else if (SchemaType is XmlSchemaSimpleType)
|
||||
ReadXmlSchemaSimpleType ((XmlSchemaSimpleType)SchemaType, Table);
|
||||
}
|
||||
|
||||
// Same as above but with DataColumn
|
||||
private void ReadXmlSchemaType (XmlSchemaType SchemaType, DataColumn Column)
|
||||
{
|
||||
if (SchemaType is XmlSchemaComplexType)
|
||||
ReadXmlSchemaComplexType ((XmlSchemaComplexType)SchemaType, Column);
|
||||
else if (SchemaType is XmlSchemaSimpleType)
|
||||
ReadXmlSchemaSimpleType ((XmlSchemaSimpleType)SchemaType, Column);
|
||||
}
|
||||
|
||||
#endregion // PrivateTypeReader
|
||||
|
||||
#region TypeReaderHelppers
|
||||
|
||||
private void ReadXmlSchemaSimpleType (XmlSchemaSimpleType SimpleType, DataColumn Column)
|
||||
{
|
||||
// Read Contents
|
||||
if (SimpleType.Content is XmlSchemaSimpleTypeRestriction)
|
||||
ReadXmlSchemaSimpleTypeRestriction ((XmlSchemaSimpleTypeRestriction)SimpleType.Content, Column);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void ReadXmlSchemaSimpleType (XmlSchemaSimpleType SimpleType, DataTable Table)
|
||||
{
|
||||
// TODO: Is it possible that Table-element have simpletype???
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void ReadXmlSchemaSimpleTypeRestriction (XmlSchemaSimpleTypeRestriction Restriction, DataColumn Column)
|
||||
{
|
||||
foreach (XmlSchemaObject Facet in Restriction.Facets) {
|
||||
|
||||
// FIXME: I dont know are everyone of these needed but, let them be here for now
|
||||
if (Facet is XmlSchemaMaxLengthFacet)
|
||||
Column.MaxLength = Int32.Parse(((XmlSchemaFacet)Facet).Value);
|
||||
//else if (Facet is XmlSchemaMinLengthFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaLengthFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaPatternFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaEnumerationFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaMaxInclusiveFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaMaxExclusiveFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaMinInclusiveFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaMinExclusiveFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaFractionDigitsFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaTotalDigitsFacet)
|
||||
// ;
|
||||
//else if (Facet is XmlSchemaWhiteSpaceFacet)
|
||||
// ;
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void ReadXmlSchemaComplexType (XmlSchemaComplexType Type, DataColumn Column)
|
||||
{
|
||||
// TODO: is it possible that column-element have complextype
|
||||
}
|
||||
|
||||
// Reads XmlSchemaComplexType with DataTable
|
||||
private void ReadXmlSchemaComplexType (XmlSchemaComplexType Type, DataTable Table)
|
||||
{
|
||||
XmlSchemaComplexType ComplexType = Type as XmlSchemaComplexType;
|
||||
|
||||
if (ComplexType.Name != null && !TypeCollection.Contains (ComplexType.Name)) {
|
||||
TypeCollection.Add (ComplexType.Name, ComplexType);
|
||||
}
|
||||
else {
|
||||
XmlSchemaParticle Particle;
|
||||
if ((Particle = ComplexType.Particle as XmlSchemaChoice) != null) {
|
||||
ReadXmlSchemaChoice (Particle as XmlSchemaChoice);
|
||||
}
|
||||
else if ((Particle = ComplexType.Particle as XmlSchemaSequence) != null) {
|
||||
ReadXmlSchemaSequence (Particle as XmlSchemaSequence, Table);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // TypeReaderHelppers
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml.XPath;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Xml {
|
||||
|
||||
@@ -36,21 +37,31 @@ namespace System.Xml {
|
||||
private int dataRowID = 1;
|
||||
private ArrayList dataRowIDList = new ArrayList ();
|
||||
|
||||
// this is needed for inserting new row to datatable via xml
|
||||
private Hashtable TempTable = new Hashtable ();
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public XmlDataDocument() {
|
||||
|
||||
dataSet = new DataSet();
|
||||
this.NodeChanged += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
|
||||
this.NodeChanged += new XmlNodeChangedEventHandler (OnNodeChanged);
|
||||
//this.NodeChanging += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
|
||||
//this.NodeInserted += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
|
||||
//this.NodeRemoved += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
|
||||
this.NodeInserting += new XmlNodeChangedEventHandler (OnNodeInserting);
|
||||
this.NodeRemoved += new XmlNodeChangedEventHandler (OnNodeRemoved);
|
||||
this.NodeInserted += new XmlNodeChangedEventHandler (OnNodeInserted);
|
||||
}
|
||||
|
||||
public XmlDataDocument(DataSet dataset) {
|
||||
|
||||
this.dataSet = dataset;
|
||||
this.NodeChanged += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
|
||||
this.NodeChanged += new XmlNodeChangedEventHandler (OnNodeChanged);
|
||||
//this.NodeChanging += new XmlNodeChangedEventHandler (OnXmlDataColumnChanged);
|
||||
this.NodeInserting += new XmlNodeChangedEventHandler (OnNodeInserting);
|
||||
this.NodeRemoved += new XmlNodeChangedEventHandler (OnNodeRemoved);
|
||||
this.NodeInserted += new XmlNodeChangedEventHandler (OnNodeInserted);
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
@@ -119,7 +130,7 @@ namespace System.Xml {
|
||||
public override string Name {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException();
|
||||
return base.Name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +153,7 @@ namespace System.Xml {
|
||||
|
||||
#region overloaded CreateElement methods
|
||||
|
||||
[MonoTODO]
|
||||
[MonoTODO ("why this is override?")]
|
||||
public override XmlElement CreateElement(string prefix,
|
||||
string localName, string namespaceURI)
|
||||
{
|
||||
@@ -151,7 +162,6 @@ namespace System.Xml {
|
||||
"or an empty string.");
|
||||
string pref = prefix != null ? prefix : String.Empty;
|
||||
return base.CreateElement (pref, localName, namespaceURI != null ? namespaceURI : String.Empty);
|
||||
|
||||
}
|
||||
|
||||
#endregion // overloaded CreateElement Methods
|
||||
@@ -169,16 +179,72 @@ namespace System.Xml {
|
||||
}
|
||||
|
||||
// get the XmlElement associated with the DataRow
|
||||
[MonoTODO ("Exceptions")]
|
||||
public XmlElement GetElementFromRow(DataRow r)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (r.XmlRowID == 0) // datarow was not in xmldatadocument
|
||||
throw new Exception ();
|
||||
|
||||
int elementRow = dataRowIDList.IndexOf (r.XmlRowID);
|
||||
|
||||
return (XmlElement)GetElementsByTagName (r.Table.TableName) [elementRow];
|
||||
}
|
||||
|
||||
// get the DataRow associated with the XmlElement
|
||||
[MonoTODO]
|
||||
[MonoTODO ("Exceptions")]
|
||||
public DataRow GetRowFromElement(XmlElement e)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
XmlElement node = e;
|
||||
if (node == null)
|
||||
return null;
|
||||
|
||||
XPathNavigator nodeNavigator = node.CreateNavigator ();
|
||||
int c = GetElementsByTagName (node.Name).Count;
|
||||
|
||||
if (c == 0)
|
||||
return null;
|
||||
|
||||
// FIXME: I dont know which way it should be but this work on linux.
|
||||
// could be also GetElementsByTagName (args.OldParent.Name) []
|
||||
XmlNodeList nodeList = GetElementsByTagName (node.Name);
|
||||
|
||||
int i = 0;
|
||||
bool isSame = false;
|
||||
|
||||
while (i < c && !isSame) {
|
||||
|
||||
XPathNavigator docNavigator = nodeList [i].CreateNavigator ();
|
||||
isSame = docNavigator.IsSamePosition (nodeNavigator);
|
||||
docNavigator = nodeList [i].CreateNavigator ();
|
||||
if (!isSame)
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!isSame)
|
||||
return null;
|
||||
|
||||
if (i >= dataRowIDList.Count)
|
||||
return null;
|
||||
|
||||
// now we know rownum
|
||||
int xmlrowid = (int)dataRowIDList [i];
|
||||
if (xmlrowid <= 0)
|
||||
return null;
|
||||
|
||||
DataTable dt = DataSet.Tables [node.Name];
|
||||
DataRow row = null;
|
||||
|
||||
if (dt == null)
|
||||
return null;
|
||||
|
||||
foreach (DataRow r in dt.Rows) {
|
||||
if (xmlrowid == r.XmlRowID) {
|
||||
row = r;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
#region overload Load methods
|
||||
@@ -196,7 +262,10 @@ namespace System.Xml {
|
||||
}
|
||||
|
||||
public override void Load(XmlReader reader) {
|
||||
|
||||
|
||||
// dont listen these events
|
||||
RemoveXmlDocumentListeners ();
|
||||
|
||||
DataTable dt = null;
|
||||
|
||||
// For reading xml to XmlDocument
|
||||
@@ -207,18 +276,18 @@ namespace System.Xml {
|
||||
reader.MoveToContent ();
|
||||
|
||||
// TODO: Findout which exception should be throwen
|
||||
if (reader.NodeType != XmlNodeType.Element)
|
||||
if (reader.NodeType != XmlNodeType.Element) {
|
||||
throw new Exception ();
|
||||
}
|
||||
|
||||
if (dataSet.DataSetName != reader.Name)
|
||||
if (dataSet.DataSetName != reader.Name) {
|
||||
throw new Exception ();
|
||||
}
|
||||
|
||||
// read to next element
|
||||
while (reader.Read () && reader.NodeType != XmlNodeType.Element);
|
||||
|
||||
do {
|
||||
|
||||
|
||||
// Find right table from tablecollection
|
||||
for (int i = 0; i < DataSet.Tables.Count && dt == null; i++) {
|
||||
|
||||
@@ -261,6 +330,8 @@ namespace System.Xml {
|
||||
} while (reader.Read ());
|
||||
|
||||
base.Load (textReader);
|
||||
|
||||
AddXmlDocumentListeners ();
|
||||
}
|
||||
|
||||
#endregion // overloaded Load methods
|
||||
@@ -293,76 +364,149 @@ namespace System.Xml {
|
||||
#endregion // Protected Methods
|
||||
|
||||
#region DataSet event handlers
|
||||
|
||||
// this changed datatable values when some of xmldocument elements is changed
|
||||
private void OnXmlDataColumnChanged (object sender, XmlNodeChangedEventArgs args)
|
||||
|
||||
// Invoked when XmlNode is changed colum is changed
|
||||
[MonoTODO]
|
||||
private void OnNodeChanged (object sender, XmlNodeChangedEventArgs args)
|
||||
{
|
||||
int i = 0;
|
||||
XPathNavigator nodeNavigator = args.Node.CreateNavigator ();
|
||||
int c = GetElementsByTagName (args.Node.Name).Count;
|
||||
|
||||
// FIXME: I dont know which way it should be but this work on linux.
|
||||
// could be also GetElementsByTagName (args.OldParent.Name) []
|
||||
XmlNodeList nodeList = GetElementsByTagName (args.Node.Name);
|
||||
if (args.Node == null)
|
||||
return;
|
||||
|
||||
DataRow row = GetRowFromElement ((XmlElement)args.Node);
|
||||
|
||||
bool isSame = false;
|
||||
if (row == null)
|
||||
return;
|
||||
|
||||
// Find right row
|
||||
while ((i < c) && !isSame ) {
|
||||
if (row [args.Node.Name].ToString () != args.Node.InnerText)
|
||||
row [args.Node.Name] = args.Node.InnerText;
|
||||
}
|
||||
|
||||
XPathNavigator docNavigator = nodeList [i].CreateNavigator ();
|
||||
isSame = docNavigator.IsSamePosition (nodeNavigator);
|
||||
docNavigator = nodeList [i].CreateNavigator ();
|
||||
i++;
|
||||
}
|
||||
|
||||
// if there wasnt such row it is just added and we dont need to care about it
|
||||
if (!isSame)
|
||||
// Invoked when XmlNode is removed
|
||||
[MonoTODO]
|
||||
private void OnNodeRemoved (object sender, XmlNodeChangedEventArgs args)
|
||||
{
|
||||
if (args.OldParent == null)
|
||||
return;
|
||||
|
||||
// now we know rownum
|
||||
int xmlrowid = (int)dataRowIDList [i];
|
||||
|
||||
DataTable dt = DataSet.Tables [args.OldParent.Name];
|
||||
foreach (DataRow r in dt.Rows) {
|
||||
if (xmlrowid == r.XmlRowID) {
|
||||
|
||||
// change value only when have to.
|
||||
if ((string)r [args.Node.Name] != (string)args.Node.InnerText)
|
||||
r [args.Node.Name] = args.Node.InnerText;
|
||||
DataRow row = GetRowFromElement ((XmlElement)args.OldParent);
|
||||
|
||||
if (row == null) {
|
||||
return ;
|
||||
}
|
||||
|
||||
// Dont trig event again
|
||||
row.Table.ColumnChanged -= new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
row [args.Node.Name] = null;
|
||||
|
||||
// if all columns are "nulled" we can remove the row.
|
||||
// FIXME: This is rather slow, try to find faster way
|
||||
bool allNulls = true;
|
||||
foreach (DataColumn dc in row.Table.Columns) {
|
||||
|
||||
if (row [dc.ColumnName] != DBNull.Value) {
|
||||
allNulls = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (allNulls) {
|
||||
dataRowIDList.Remove (row.XmlRowID);
|
||||
row.Delete ();
|
||||
}
|
||||
|
||||
row.Table.ColumnChanged += new DataColumnChangeEventHandler (OnDataTableColumnChanged);
|
||||
}
|
||||
|
||||
private void OnNodeInserting (object sender, XmlNodeChangedEventArgs args) {
|
||||
|
||||
if (DataSet.EnforceConstraints)
|
||||
throw new InvalidOperationException (Locale.GetText ("Please set DataSet.EnforceConstraints == false " +
|
||||
"before trying to edit XmlDataDocument using " +
|
||||
"XML operations."));
|
||||
|
||||
}
|
||||
|
||||
private void OnNodeInserted (object sender, XmlNodeChangedEventArgs args)
|
||||
{
|
||||
|
||||
// this is table element
|
||||
if (DataSet.Tables.Contains (args.NewParent.Name)) {
|
||||
|
||||
Hashtable ht = null;
|
||||
if (TempTable.ContainsKey (args.NewParent.Name)) {
|
||||
|
||||
// if TempTable contains table name, get it and remove it from hashtable
|
||||
// so we can later add it :)
|
||||
ht = TempTable [args.NewParent.Name] as Hashtable;
|
||||
TempTable.Remove (args.NewParent.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
ht = new Hashtable ();
|
||||
|
||||
ht.Add (args.Node.Name, args.Node.InnerText);
|
||||
TempTable.Add (args.NewParent.Name, ht);
|
||||
}
|
||||
else if (DataSet.Tables.Contains (args.Node.Name)) {
|
||||
|
||||
// if nodes name is same as some table in the list is is time to
|
||||
// add row to datatable
|
||||
|
||||
DataTable dt = DataSet.Tables [args.Node.Name];
|
||||
DataRow row = dt.NewRow ();
|
||||
|
||||
Hashtable ht = TempTable [args.Node.Name] as Hashtable;
|
||||
|
||||
IDictionaryEnumerator enumerator = ht.GetEnumerator ();
|
||||
while (enumerator.MoveNext ()) {
|
||||
row [enumerator.Key.ToString ()] = enumerator.Value.ToString ();
|
||||
}
|
||||
|
||||
dt.RowChanged -= new DataRowChangeEventHandler (OnDataTableRowChanged);
|
||||
DataSet.Tables [args.Node.Name].Rows.Add (row);
|
||||
dt.RowChanged += new DataRowChangeEventHandler (OnDataTableRowChanged);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void OnDataTableColumnChanged(object sender,
|
||||
DataColumnChangeEventArgs eventArgs)
|
||||
{
|
||||
RemoveXmlDocumentListeners ();
|
||||
|
||||
// row is not yet in datatable
|
||||
if (eventArgs.Row.XmlRowID == 0)
|
||||
return;
|
||||
|
||||
// TODO: Here should be some kind of error checking.
|
||||
GetElementsByTagName (eventArgs.Column.ToString ()) [dataRowIDList.IndexOf (
|
||||
eventArgs.Row.XmlRowID)].InnerText = (string)eventArgs.ProposedValue;
|
||||
eventArgs.Row.XmlRowID)].InnerText = eventArgs.ProposedValue.ToString ();
|
||||
|
||||
AddXmlDocumentListeners ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void OnDataTableRowDeleted(object sender,
|
||||
DataRowChangeEventArgs eventArgs)
|
||||
{
|
||||
|
||||
DataRow deletedRow = null;
|
||||
deletedRow = eventArgs.Row;
|
||||
|
||||
if (eventArgs.Row.XmlRowID == 0)
|
||||
return;
|
||||
|
||||
|
||||
int rowIndex = dataRowIDList.IndexOf (eventArgs.Row.XmlRowID);
|
||||
|
||||
if (rowIndex == -1 || eventArgs.Row.XmlRowID == 0 ||
|
||||
rowIndex > GetElementsByTagName (deletedRow.Table.TableName).Count - 1)
|
||||
return;
|
||||
|
||||
// Remove element from xmldocument and row indexlist
|
||||
GetElementsByTagName (deletedRow.Table.TableName) [rowIndex].RemoveAll ();
|
||||
dataRowIDList.RemoveAt (rowIndex);
|
||||
// FIXME: this is one way to do this, but i hope someday i find out much better way.
|
||||
XmlNode p = GetElementsByTagName (deletedRow.Table.TableName) [rowIndex].ParentNode;
|
||||
if (p != null) {
|
||||
p.RemoveChild (GetElementsByTagName (deletedRow.Table.TableName) [rowIndex]);
|
||||
dataRowIDList.RemoveAt (rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -390,6 +534,8 @@ namespace System.Xml {
|
||||
[MonoTODO]
|
||||
private void OnDataTableRowAdded (DataRowChangeEventArgs args)
|
||||
{
|
||||
RemoveXmlDocumentListeners ();
|
||||
|
||||
// If XmlRowID is != 0 then it is already added
|
||||
if (args.Row.XmlRowID != 0)
|
||||
return;
|
||||
@@ -401,34 +547,44 @@ namespace System.Xml {
|
||||
XmlElement element = CreateElement (args.Row.Table.TableName);
|
||||
DocumentElement.AppendChild (element);
|
||||
|
||||
XmlElement rowElement = null;
|
||||
for (int i = 0; i < row.Table.Columns.Count; i++) {
|
||||
XmlElement rowElement = null;
|
||||
|
||||
for (int i = 0; i < row.Table.Columns.Count; i++) {
|
||||
|
||||
rowElement = CreateElement (row.Table.Columns [i].ToString ());
|
||||
rowElement.InnerText = (string)row [i];
|
||||
element.AppendChild (rowElement);
|
||||
|
||||
}
|
||||
|
||||
AddXmlDocumentListeners ();
|
||||
}
|
||||
|
||||
// Rollback
|
||||
[MonoTODO]
|
||||
private void OnDataTableRowRollback (DataRowChangeEventArgs args)
|
||||
{
|
||||
DataRow row = args.Row;
|
||||
|
||||
int rowid = dataRowIDList.IndexOf (row.XmlRowID);
|
||||
|
||||
// find right element in xmldocument
|
||||
XmlNode node = GetElementsByTagName (row.Table.TableName) [rowid];
|
||||
RemoveXmlDocumentListeners ();
|
||||
|
||||
DataRow row = args.Row;
|
||||
int rowid = dataRowIDList.IndexOf (row.XmlRowID);
|
||||
|
||||
// find right element in xmldocument
|
||||
if (rowid == 0 || rowid >= GetElementsByTagName (row.Table.TableName).Count)
|
||||
return;
|
||||
|
||||
XmlNode node = GetElementsByTagName (row.Table.TableName) [rowid];
|
||||
|
||||
int rowValue = 0;
|
||||
for (int i = 0; i < node.ChildNodes.Count; i++) {
|
||||
|
||||
XmlNode child = node.ChildNodes [i];
|
||||
if (child.NodeType != XmlNodeType.Whitespace)
|
||||
child.InnerText = (string)row [rowValue++];
|
||||
|
||||
XmlNode child = node.ChildNodes [i];
|
||||
if (child.NodeType != XmlNodeType.Whitespace) {
|
||||
child.InnerText = (string)row [rowValue++];
|
||||
}
|
||||
}
|
||||
|
||||
AddXmlDocumentListeners ();
|
||||
}
|
||||
|
||||
#endregion // DataSet event handlers
|
||||
@@ -457,6 +613,17 @@ namespace System.Xml {
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveXmlDocumentListeners ()
|
||||
{
|
||||
this.NodeInserting -= new XmlNodeChangedEventHandler (OnNodeInserting);
|
||||
this.NodeInserted -= new XmlNodeChangedEventHandler (OnNodeInserted);
|
||||
}
|
||||
|
||||
private void AddXmlDocumentListeners ()
|
||||
{
|
||||
this.NodeInserting += new XmlNodeChangedEventHandler (OnNodeInserting);
|
||||
this.NodeInserted += new XmlNodeChangedEventHandler (OnNodeInserted);
|
||||
}
|
||||
#endregion // Private methods
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
2002-12-16 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocumentTest.cs: some fixes.
|
||||
|
||||
2002-12-14 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocumentTest.cs: Added three new tests
|
||||
|
||||
2002-12-10 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocumentTest.cs: Added new tests
|
||||
* System.Xml/region.xml: Changed XmlDocument.
|
||||
|
||||
2002-11-24 Ville Palo <[email protected]>
|
||||
|
||||
* System.Xml/XmlDataDocumentTest.cs: Added new test suite for
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
2002/11/08 Nick Drochak <[email protected]>
|
||||
|
||||
* SqlSingleTest.cs : Remove debug statement that was breaking the build
|
||||
@@ -30,6 +30,7 @@ namespace MonoTests.System.Data
|
||||
suite.AddTest (new TestSuite (typeof (DataRowCollectionTest)));
|
||||
suite.AddTest (new TestSuite (typeof (DataRowTest)));
|
||||
suite.AddTest (new TestSuite (typeof (DataColumnCollectionTest)));
|
||||
suite.AddTest (new TestSuite (typeof (DataSetTest)));
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
2002-12-26 Ville Palo <[email protected]>
|
||||
|
||||
* own_schema.xsd: XmlSchema for testing ReadXmlSchema() -method
|
||||
* DataSetTest.cs: Added more Xml-tests.
|
||||
|
||||
2002-12-17 Ville Palo <[email protected]>
|
||||
|
||||
* region.xml:
|
||||
* store.xsd: new xmldoment and xmlschema for testing DataSet
|
||||
* DataSetTest.cs: Added some Xml-tests.
|
||||
* AllTests.cs: Added DataSetTest
|
||||
|
||||
2002-10-23 Nick Drochak <[email protected]>
|
||||
|
||||
* ConstraintCollectionTest.cs (SetUp): Clear the constraints before
|
||||
@@ -9,4 +21,4 @@
|
||||
2002-10-22 Nick Drochak <[email protected]>
|
||||
|
||||
* DataColumnTest.cs: Remove compiler warnings and use caught exception
|
||||
to report useful info.
|
||||
to report useful info.
|
||||
@@ -0,0 +1,832 @@
|
||||
// MonoTests.System.Data.DataSetTest.cs
|
||||
//
|
||||
// Author:
|
||||
// Ville Palo <[email protected]>
|
||||
//
|
||||
// (C) Copyright 2002 Ville Palo
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Data;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
|
||||
namespace MonoTests.System.Data
|
||||
{
|
||||
|
||||
public class DataSetTest : TestCase
|
||||
{
|
||||
|
||||
public DataSetTest() : base ("MonoTests.System.Data.DataSetTest") {}
|
||||
public DataSetTest(string name) : base(name) {}
|
||||
|
||||
protected override void SetUp()
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo ("fi-FI");
|
||||
}
|
||||
|
||||
protected override void TearDown() {}
|
||||
|
||||
public static ITest Suite
|
||||
{
|
||||
get
|
||||
{
|
||||
return new TestSuite(typeof(DataSetTest));
|
||||
}
|
||||
}
|
||||
|
||||
public void TestReadXmlSchema ()
|
||||
{
|
||||
DataSet ds = new DataSet ();
|
||||
ds.ReadXmlSchema ("System.Data/own_schema.xsd");
|
||||
|
||||
AssertEquals ("test#01", 2, ds.Tables.Count);
|
||||
DataTable Table = ds.Tables [0];
|
||||
AssertEquals ("test#02", "test_table", Table.TableName);
|
||||
AssertEquals ("test#03", "", Table.Namespace);
|
||||
AssertEquals ("test#04", 2, Table.Columns.Count);
|
||||
AssertEquals ("test#05", 0, Table.Rows.Count);
|
||||
AssertEquals ("test#06", false, Table.CaseSensitive);
|
||||
AssertEquals ("test#07", 1, Table.Constraints.Count);
|
||||
AssertEquals ("test#08", "", Table.Prefix);
|
||||
|
||||
Constraint cons = Table.Constraints [0];
|
||||
AssertEquals ("test#09", "Constraint1", cons.ConstraintName.ToString ());
|
||||
AssertEquals ("test#10", "Constraint1", cons.ToString ());
|
||||
|
||||
DataColumn column = Table.Columns [0];
|
||||
AssertEquals ("test#11", true, column.AllowDBNull);
|
||||
AssertEquals ("test#12", false, column.AutoIncrement);
|
||||
AssertEquals ("test#13", 0L, column.AutoIncrementSeed);
|
||||
AssertEquals ("test#14", 1L, column.AutoIncrementStep);
|
||||
AssertEquals ("test#15", "test", column.Caption);
|
||||
AssertEquals ("test#16", "Element", column.ColumnMapping.ToString ());
|
||||
AssertEquals ("test#17", "first", column.ColumnName);
|
||||
AssertEquals ("test#18", "System.String", column.DataType.ToString ());
|
||||
AssertEquals ("test#19", "test_default_value", column.DefaultValue.ToString ());
|
||||
AssertEquals ("test#20", false, column.DesignMode);
|
||||
AssertEquals ("test#21", "", column.Expression);
|
||||
AssertEquals ("test#22", 100, column.MaxLength);
|
||||
AssertEquals ("test#23", "", column.Namespace);
|
||||
AssertEquals ("test#24", 0, column.Ordinal);
|
||||
AssertEquals ("test#25", "", column.Prefix);
|
||||
AssertEquals ("test#26", false, column.ReadOnly);
|
||||
AssertEquals ("test#27", true, column.Unique);
|
||||
|
||||
DataColumn column2 = Table.Columns [1];
|
||||
AssertEquals ("test#28", true, column2.AllowDBNull);
|
||||
AssertEquals ("test#29", false, column2.AutoIncrement);
|
||||
AssertEquals ("test#30", 0L, column2.AutoIncrementSeed);
|
||||
AssertEquals ("test#31", 1L, column2.AutoIncrementStep);
|
||||
AssertEquals ("test#32", "second", column2.Caption);
|
||||
AssertEquals ("test#33", "Element", column2.ColumnMapping.ToString ());
|
||||
AssertEquals ("test#34", "second", column2.ColumnName);
|
||||
AssertEquals ("test#35", "System.Data.SqlTypes.SqlGuid", column2.DataType.ToString ());
|
||||
AssertEquals ("test#36", "", column2.DefaultValue.ToString ());
|
||||
AssertEquals ("test#37", false, column2.DesignMode);
|
||||
AssertEquals ("test#38", "", column2.Expression);
|
||||
AssertEquals ("test#39", -1, column2.MaxLength);
|
||||
AssertEquals ("test#40", "", column2.Namespace);
|
||||
AssertEquals ("test#41", 1, column2.Ordinal);
|
||||
AssertEquals ("test#42", "", column2.Prefix);
|
||||
AssertEquals ("test#43", false, column2.ReadOnly);
|
||||
AssertEquals ("test#44", false, column2.Unique);
|
||||
|
||||
DataTable Table2 = ds.Tables [1];
|
||||
AssertEquals ("test#45", "second_test_table", Table2.TableName);
|
||||
AssertEquals ("test#46", "", Table2.Namespace);
|
||||
AssertEquals ("test#47", 1, Table2.Columns.Count);
|
||||
AssertEquals ("test#48", 0, Table2.Rows.Count);
|
||||
AssertEquals ("test#49", false, Table2.CaseSensitive);
|
||||
AssertEquals ("test#50", 1, Table2.Constraints.Count);
|
||||
AssertEquals ("test#51", "", Table2.Prefix);
|
||||
|
||||
DataColumn column3 = Table2.Columns [0];
|
||||
AssertEquals ("test#52", true, column3.AllowDBNull);
|
||||
AssertEquals ("test#53", false, column3.AutoIncrement);
|
||||
AssertEquals ("test#54", 0L, column3.AutoIncrementSeed);
|
||||
AssertEquals ("test#55", 1L, column3.AutoIncrementStep);
|
||||
AssertEquals ("test#56", "second_first", column3.Caption);
|
||||
AssertEquals ("test#57", "Element", column3.ColumnMapping.ToString ());
|
||||
AssertEquals ("test#58", "second_first", column3.ColumnName);
|
||||
AssertEquals ("test#59", "System.String", column3.DataType.ToString ());
|
||||
AssertEquals ("test#60", "default_value", column3.DefaultValue.ToString ());
|
||||
AssertEquals ("test#61", false, column3.DesignMode);
|
||||
AssertEquals ("test#62", "", column3.Expression);
|
||||
AssertEquals ("test#63", 100, column3.MaxLength);
|
||||
AssertEquals ("test#64", "", column3.Namespace);
|
||||
AssertEquals ("test#65", 0, column3.Ordinal);
|
||||
AssertEquals ("test#66", "", column3.Prefix);
|
||||
AssertEquals ("test#67", false, column3.ReadOnly);
|
||||
AssertEquals ("test#68", true, column3.Unique);
|
||||
}
|
||||
|
||||
public void TestOwnWriteXmlSchema ()
|
||||
{
|
||||
DataSet ds = new DataSet ("test_dataset");
|
||||
DataTable table = new DataTable ("test_table");
|
||||
DataColumn column = new DataColumn ("first", typeof (string));
|
||||
column.AllowDBNull = true;
|
||||
column.DefaultValue = "test_default_value";
|
||||
column.MaxLength = 100;
|
||||
column.Caption = "test";
|
||||
column.Unique = true;
|
||||
table.Columns.Add (column);
|
||||
|
||||
DataColumn column2 = new DataColumn ("second", typeof (SqlGuid));
|
||||
column2.ColumnMapping = MappingType.Element;
|
||||
table.Columns.Add (column2);
|
||||
ds.Tables.Add (table);
|
||||
|
||||
DataTable table2 = new DataTable ("second_test_table");
|
||||
DataColumn column3 = new DataColumn ("second_first", typeof (string));
|
||||
column3.AllowDBNull = true;
|
||||
column3.DefaultValue = "default_value";
|
||||
column3.MaxLength = 100;
|
||||
column3.Unique = true;
|
||||
table2.Columns.Add (column3);
|
||||
ds.Tables.Add (table2);
|
||||
|
||||
TextWriter writer = new StringWriter ();
|
||||
ds.WriteXmlSchema (writer);
|
||||
|
||||
string TextString = writer.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#01", "<?xml version=\"1.0\" encoding=\"utf-16\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#02", "<xs:schema id=\"test_dataset\" xmlns=\"\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#03", " <xs:element name=\"test_dataset\" msdata:IsDataSet=\"true\" msdata:Locale=\"fi-FI\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#04", " <xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#05", " <xs:choice maxOccurs=\"unbounded\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#06", " <xs:element name=\"test_table\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#07", " <xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#08", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#09", " <xs:element name=\"first\" msdata:Caption=\"test\" default=\"test_default_value\" minOccurs=\"0\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#10", " <xs:simpleType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#11", " <xs:restriction base=\"xs:string\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#12", " <xs:maxLength value=\"100\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#13", " </xs:restriction>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#14", " </xs:simpleType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#15", " </xs:element>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#16", " <xs:element name=\"second\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" type=\"xs:string\" minOccurs=\"0\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#17", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#18", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#19", " </xs:element>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#20", " <xs:element name=\"second_test_table\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#21", " <xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#22", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#23", " <xs:element name=\"second_first\" default=\"default_value\" minOccurs=\"0\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#24", " <xs:simpleType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#25", " <xs:restriction base=\"xs:string\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#26", " <xs:maxLength value=\"100\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#27", " </xs:restriction>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#28", " </xs:simpleType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#29", " </xs:element>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#30", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#31", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#32", " </xs:element>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#33", " </xs:choice>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#34", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#36", " <xs:unique name=\"Constraint1\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#37", " <xs:selector xpath=\".//test_table\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#38", " <xs:field xpath=\"first\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#39", " </xs:unique>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#40", " <xs:unique name=\"second_test_table_Constraint1\" msdata:ConstraintName=\"Constraint1\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#41", " <xs:selector xpath=\".//second_test_table\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#42", " <xs:field xpath=\"second_first\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#43", " </xs:unique>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#44", " </xs:element>", substring);
|
||||
AssertEquals ("test#45", "</xs:schema>", TextString);
|
||||
}
|
||||
|
||||
public void TestReadWriteXml ()
|
||||
{
|
||||
DataSet ds = new DataSet ();
|
||||
ds.ReadXml ("System.Data/region.xml");
|
||||
TextWriter writer = new StringWriter ();
|
||||
ds.WriteXml (writer);
|
||||
|
||||
string TextString = writer.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#01", "<Root>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#02", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#03", " <RegionID>1</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#04", " <RegionDescription>Eastern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#05", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#06", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#07", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#08", " <RegionID>2</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#09", " <RegionDescription>Western", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#10", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#11", " </Region>", substring);
|
||||
|
||||
AssertEquals ("test#11", "</Root>", TextString);
|
||||
}
|
||||
|
||||
public void TestReadWriteXmlDiffGram ()
|
||||
{
|
||||
DataSet ds = new DataSet ();
|
||||
ds.ReadXml ("System.Data/region.xml", XmlReadMode.DiffGram);
|
||||
TextWriter writer = new StringWriter ();
|
||||
ds.WriteXml (writer);
|
||||
|
||||
string TextString = writer.ToString ();
|
||||
AssertEquals ("test#01", "<NewDataSet />", TextString);
|
||||
|
||||
ds.WriteXml (writer, XmlWriteMode.DiffGram);
|
||||
TextString = writer.ToString ();
|
||||
|
||||
AssertEquals ("test#02", "<NewDataSet /><diffgr:diffgram xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\" xmlns:diffgr=\"urn:schemas-microsoft-com:xml-diffgram-v1\" />", TextString);
|
||||
|
||||
|
||||
ds = new DataSet ();
|
||||
ds.ReadXml ("System.Data/region.xml");
|
||||
DataTable table = ds.Tables ["Region"];
|
||||
table.Rows [0] [0] = "64";
|
||||
ds.ReadXml ("System.Data/region.xml", XmlReadMode.DiffGram);
|
||||
ds.WriteXml (writer, XmlWriteMode.DiffGram);
|
||||
|
||||
TextString = writer.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#03", "<NewDataSet /><diffgr:diffgram xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\" xmlns:diffgr=\"urn:schemas-microsoft-com:xml-diffgram-v1\" /><diffgr:diffgram xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\" xmlns:diffgr=\"urn:schemas-microsoft-com:xml-diffgram-v1\">",substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#04", " <Root>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#05", " <Region diffgr:id=\"Region1\" msdata:rowOrder=\"0\" diffgr:hasChanges=\"inserted\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#06", " <RegionID>64</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#07", " <RegionDescription>Eastern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#07", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#08", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#09", " <Region diffgr:id=\"Region2\" msdata:rowOrder=\"1\" diffgr:hasChanges=\"inserted\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#10", " <RegionID>2</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#11", " <RegionDescription>Western", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#12", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#13", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#14", " </Root>", substring);
|
||||
|
||||
AssertEquals ("test#15", "</diffgr:diffgram>", TextString);
|
||||
}
|
||||
|
||||
public void TestWriteXmlSchema ()
|
||||
{
|
||||
DataSet ds = new DataSet ();
|
||||
ds.ReadXml ("System.Data/region.xml");
|
||||
TextWriter writer = new StringWriter ();
|
||||
ds.WriteXmlSchema (writer);
|
||||
|
||||
string TextString = writer.ToString ();
|
||||
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#01", "<?xml version=\"1.0\" encoding=\"utf-16\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#02", "<xs:schema id=\"Root\" xmlns=\"\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#03", " <xs:element name=\"Root\" msdata:IsDataSet=\"true\" msdata:Locale=\"fi-FI\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#04", " <xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#05", " <xs:choice maxOccurs=\"unbounded\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#06", " <xs:element name=\"Region\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#07", " <xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#08", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#09", " <xs:element name=\"RegionID\" type=\"xs:string\" minOccurs=\"0\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#10", " <xs:element name=\"RegionDescription\" type=\"xs:string\" minOccurs=\"0\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#11", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#12", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#13", " </xs:element>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#14", " </xs:choice>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#15", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#16", " </xs:element>", substring);
|
||||
|
||||
AssertEquals ("test#17", "</xs:schema>", TextString);
|
||||
}
|
||||
|
||||
public void TestReadWriteXmlSchemaIgnoreSchema ()
|
||||
{
|
||||
DataSet ds = new DataSet ();
|
||||
ds.ReadXmlSchema ("System.Data/store.xsd");
|
||||
ds.ReadXml ("System.Data/region.xml", XmlReadMode.IgnoreSchema);
|
||||
TextWriter writer = new StringWriter ();
|
||||
|
||||
ds.WriteXmlSchema (writer);
|
||||
string TextString = writer.ToString ();
|
||||
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#01", "<?xml version=\"1.0\" encoding=\"utf-16\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#02", "<xs:schema id=\"NewDataSet\" xmlns=\"\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#03", " <xs:complexType name=\"bookstoreType\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#04", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#05", " <xs:element name=\"book\" type=\"bookType\" minOccurs=\"0\" maxOccurs=\"unbounded\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#06", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#07", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#08", " <xs:complexType name=\"bookType\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#09", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#10", " <xs:element name=\"title\" type=\"xs:string\" msdata:Ordinal=\"1\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#11", " <xs:element name=\"price\" type=\"xs:decimal\" msdata:Ordinal=\"2\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#12", " <xs:element name=\"author\" type=\"authorName\" minOccurs=\"0\" maxOccurs=\"unbounded\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#13", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#14", " <xs:attribute name=\"genre\" type=\"xs:string\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#15", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#16", " <xs:complexType name=\"authorName\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#17", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#18", " <xs:element name=\"first-name\" type=\"xs:string\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#19", " <xs:element name=\"last-name\" type=\"xs:string\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#20", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#21", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#22", " <xs:element name=\"bookstore\" type=\"bookstoreType\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#23", " <xs:element name=\"NewDataSet\" msdata:IsDataSet=\"true\" msdata:Locale=\"fi-FI\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#24", " <xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#25", " <xs:choice maxOccurs=\"unbounded\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#26", " <xs:element ref=\"bookstore\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#27", " </xs:choice>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#28", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#29", " </xs:element>", substring);
|
||||
|
||||
AssertEquals ("test#30", "</xs:schema>", TextString);
|
||||
}
|
||||
|
||||
public void TestReadWriteXmlSchema ()
|
||||
{
|
||||
DataSet ds = new DataSet ();
|
||||
ds.ReadXmlSchema ("System.Data/store.xsd");
|
||||
ds.ReadXml ("System.Data/region.xml", XmlReadMode.InferSchema);
|
||||
TextWriter writer = new StringWriter ();
|
||||
ds.WriteXmlSchema (writer);
|
||||
|
||||
string TextString = writer.ToString ();
|
||||
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#01", "<?xml version=\"1.0\" encoding=\"utf-16\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#02", "<xs:schema id=\"Root\" xmlns=\"\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#03", " <xs:complexType name=\"bookstoreType\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#04", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#05", " <xs:element name=\"book\" type=\"bookType\" minOccurs=\"0\" maxOccurs=\"unbounded\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#06", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#07", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#08", " <xs:complexType name=\"bookType\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#09", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#10", " <xs:element name=\"title\" type=\"xs:string\" msdata:Ordinal=\"1\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#11", " <xs:element name=\"price\" type=\"xs:decimal\" msdata:Ordinal=\"2\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#12", " <xs:element name=\"author\" type=\"authorName\" minOccurs=\"0\" maxOccurs=\"unbounded\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#13", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#14", " <xs:attribute name=\"genre\" type=\"xs:string\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#15", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#16", " <xs:complexType name=\"authorName\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#17", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#18", " <xs:element name=\"first-name\" type=\"xs:string\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#19", " <xs:element name=\"last-name\" type=\"xs:string\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#20", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#21", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#22", " <xs:element name=\"bookstore\" type=\"bookstoreType\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#23", " <xs:element name=\"Root\" msdata:IsDataSet=\"true\" msdata:Locale=\"fi-FI\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#24", " <xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#25", " <xs:choice maxOccurs=\"unbounded\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#26", " <xs:element ref=\"bookstore\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#27", " <xs:element name=\"Region\">", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#28", " <xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#29", " <xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#30", " <xs:element name=\"RegionID\" type=\"xs:string\" minOccurs=\"0\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#31", " <xs:element name=\"RegionDescription\" type=\"xs:string\" minOccurs=\"0\" />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#32", " </xs:sequence>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#33", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#34", " </xs:element>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#35", " </xs:choice>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#36", " </xs:complexType>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("test#37", " </xs:element>", substring);
|
||||
|
||||
AssertEquals ("test#38", "</xs:schema>", TextString);
|
||||
}
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0"?>
|
||||
<xs:schema id="test_dataset" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xs:element name="test_dataset" msdata:IsDataSet="true" msdata:Locale="fi-FI">
|
||||
<xs:complexType>
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="test_table">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="first" msdata:Caption="test" default="test_default_value" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="second" msdata:DataType="System.Data.SqlTypes.SqlGuid, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="second_test_table">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="second_first" default="default_value" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:unique name="Constraint1">
|
||||
<xs:selector xpath=".//test_table" />
|
||||
<xs:field xpath="first" />
|
||||
</xs:unique>
|
||||
<xs:unique name="second_test_table_Constraint1" msdata:ConstraintName="Constraint1">
|
||||
<xs:selector xpath=".//second_test_table" />
|
||||
<xs:field xpath="second_first" />
|
||||
</xs:unique>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<Root>
|
||||
<Region>
|
||||
<RegionID>1</RegionID>
|
||||
<RegionDescription>Eastern
|
||||
</RegionDescription>
|
||||
</Region>
|
||||
<Region>
|
||||
<RegionID>2</RegionID>
|
||||
<RegionDescription>Western
|
||||
</RegionDescription>
|
||||
</Region>
|
||||
</Root>
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<xsd:element name="bookstore" type="bookstoreType"/>
|
||||
|
||||
<xsd:complexType name="bookstoreType">
|
||||
<xsd:sequence maxOccurs="unbounded">
|
||||
<xsd:element name="book" type="bookType"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="bookType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="title" type="xsd:string"/>
|
||||
<xsd:element name="author" type="authorName"/>
|
||||
<xsd:element name="price" type="xsd:decimal"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="genre" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="authorName">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="first-name" type="xsd:string"/>
|
||||
<xsd:element name="last-name" type="xsd:string"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
</xsd:schema>
|
||||
@@ -1,239 +1,629 @@
|
||||
//
|
||||
// XmlDataDocumentTestTest.cs - NUnit Test Cases for XmlDataDocument
|
||||
//
|
||||
// Ville Palo ([email protected])
|
||||
//
|
||||
// (C) Ville Palo 2002
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
|
||||
namespace MonoTests.System.Data.Xml
|
||||
{
|
||||
public class XmlDataDocumentTest : TestCase {
|
||||
|
||||
|
||||
public XmlDataDocumentTest() : base ("System.Xml.XmlDataDocument") {}
|
||||
public XmlDataDocumentTest(string name) : base(name) {}
|
||||
|
||||
protected override void TearDown() {}
|
||||
|
||||
protected override void SetUp()
|
||||
{
|
||||
}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
return new TestSuite(typeof(XmlDataDocumentTest));
|
||||
}
|
||||
}
|
||||
|
||||
// Test constructor
|
||||
public void Test1()
|
||||
{
|
||||
|
||||
//Create an XmlDataDocument.
|
||||
XmlDataDocument doc = new XmlDataDocument();
|
||||
|
||||
//Load the schema file.
|
||||
doc.DataSet.ReadXmlSchema("System.Xml/store.xsd");
|
||||
|
||||
//Load the XML data.
|
||||
doc.Load("System.Data/2books.xml");
|
||||
|
||||
//Update the price on the first book using the DataSet methods.
|
||||
DataTable books = doc.DataSet.Tables["book"];
|
||||
books.Rows[0]["price"] = "12,95";
|
||||
|
||||
//string outstring = "";
|
||||
TextWriter text = new StringWriter ();
|
||||
doc.Save(text);
|
||||
|
||||
//str.Read (bytes, 0, (int)str.Length);
|
||||
//String OutString = new String (bytes);
|
||||
|
||||
string TextString = text.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A01", "<?xml version=\"1.0\" encoding=\"utf-16\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A02", "<!--sample XML fragment-->", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A03", "<bookstore>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A04", " <book genre=\"novel\" ISBN=\"10-861003-324\">", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A05", " <title>The Handmaid's Tale</title>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A06", " <price>12.95</price>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A07", " </book>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A08", " <book genre=\"novel\" ISBN=\"1-861001-57-5\">", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A09", " <title>Pride And Prejudice</title>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A10", " <price>24.95</price>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A11", " </book>", substring);
|
||||
substring = TextString;
|
||||
AssertEquals ("#A12", "</bookstore>", substring);
|
||||
|
||||
}
|
||||
|
||||
// Test public fields
|
||||
public void Test2()
|
||||
{
|
||||
DataSet RegionDS = new DataSet ();
|
||||
DataRow RegionRow;
|
||||
RegionDS.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
XmlDataDocument DataDoc = new XmlDataDocument (RegionDS);
|
||||
DataDoc.Load("System.Data/region.xml" );
|
||||
|
||||
|
||||
RegionRow = RegionDS.Tables[0].Rows[0];
|
||||
|
||||
RegionDS.AcceptChanges ();
|
||||
RegionRow["RegionDescription"] = "Reeeeeaalllly Far East!";
|
||||
RegionDS.AcceptChanges ();
|
||||
|
||||
TextWriter text = new StringWriter ();
|
||||
|
||||
DataDoc.Save (text);
|
||||
string TextString = text.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
|
||||
AssertEquals ("#B01", "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B02", "<Root>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B03", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B04", " <RegionID>1</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B05", " <RegionDescription>Reeeeeaalllly Far East!</RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B06", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B07", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B08", " <RegionID>2</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B09", " <RegionDescription>Western", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B10", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B11", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B12", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B13", " <RegionID>3</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B14", " <RegionDescription>Northern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B15", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B16", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B17", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B18", " <RegionID>4</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B19", " <RegionDescription>Southern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B20", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B21", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B22", " <MoreData>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B23", " <Column1>12</Column1>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B24", " <Column2>Hi There</Column2>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B25", " </MoreData>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B26", " <MoreData>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B27", " <Column1>12</Column1>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B28", " <Column2>Hi There</Column2>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B29", " </MoreData>", substring);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// XmlDataDocumentTestTest.cs - NUnit Test Cases for XmlDataDocument
|
||||
//
|
||||
// Ville Palo ([email protected])
|
||||
//
|
||||
// (C) Ville Palo 2002
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
|
||||
namespace MonoTests.System.Data.Xml
|
||||
{
|
||||
public class XmlDataDocumentTest : TestCase {
|
||||
|
||||
|
||||
public XmlDataDocumentTest() : base ("System.Xml.XmlDataDocument") {}
|
||||
public XmlDataDocumentTest(string name) : base(name) {}
|
||||
|
||||
protected override void TearDown() {}
|
||||
|
||||
protected override void SetUp()
|
||||
{
|
||||
}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
return new TestSuite(typeof(XmlDataDocumentTest));
|
||||
}
|
||||
}
|
||||
|
||||
// Test constructor
|
||||
public void Test1()
|
||||
{
|
||||
|
||||
//Create an XmlDataDocument.
|
||||
XmlDataDocument doc = new XmlDataDocument();
|
||||
|
||||
//Load the schema file.
|
||||
doc.DataSet.ReadXmlSchema("System.Xml/store.xsd");
|
||||
|
||||
//Load the XML data.
|
||||
doc.Load("System.Xml/2books.xml");
|
||||
|
||||
//Update the price on the first book using the DataSet methods.
|
||||
DataTable books = doc.DataSet.Tables["book"];
|
||||
books.Rows[0]["price"] = "12,95";
|
||||
|
||||
//string outstring = "";
|
||||
TextWriter text = new StringWriter ();
|
||||
doc.Save(text);
|
||||
|
||||
//str.Read (bytes, 0, (int)str.Length);
|
||||
//String OutString = new String (bytes);
|
||||
|
||||
string TextString = text.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A01", "<?xml version=\"1.0\" encoding=\"utf-16\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A02", "<!--sample XML fragment-->", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A03", "<bookstore>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A04", " <book genre=\"novel\" ISBN=\"10-861003-324\">", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A05", " <title>The Handmaid's Tale</title>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A06", " <price>12.95</price>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A07", " </book>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A08", " <book genre=\"novel\" ISBN=\"1-861001-57-5\">", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A09", " <title>Pride And Prejudice</title>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A10", " <price>24.95</price>", substring);
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#A11", " </book>", substring);
|
||||
substring = TextString;
|
||||
AssertEquals ("#A12", "</bookstore>", substring);
|
||||
|
||||
}
|
||||
|
||||
// Test public fields
|
||||
public void Test2()
|
||||
{
|
||||
DataSet RegionDS = new DataSet ();
|
||||
DataRow RegionRow;
|
||||
RegionDS.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
XmlDataDocument DataDoc = new XmlDataDocument (RegionDS);
|
||||
DataDoc.Load("System.Xml/region.xml" );
|
||||
|
||||
|
||||
RegionRow = RegionDS.Tables[0].Rows[0];
|
||||
|
||||
RegionDS.AcceptChanges ();
|
||||
RegionRow["RegionDescription"] = "Reeeeeaalllly Far East!";
|
||||
RegionDS.AcceptChanges ();
|
||||
|
||||
TextWriter text = new StringWriter ();
|
||||
|
||||
DataDoc.Save (text);
|
||||
string TextString = text.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
|
||||
AssertEquals ("#B01", "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B02", "<Root>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B03", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B04", " <RegionID>1</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B05", " <RegionDescription>Reeeeeaalllly Far East!</RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B06", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B07", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B08", " <RegionID>2</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B09", " <RegionDescription>Western", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B10", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B11", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B12", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B13", " <RegionID>3</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B14", " <RegionDescription>Northern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B15", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B16", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B17", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B18", " <RegionID>4</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B19", " <RegionDescription>Southern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B20", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B21", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B22", " <MoreData>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B23", " <Column1>12</Column1>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B24", " <Column2>Hi There</Column2>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B25", " </MoreData>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B26", " <MoreData>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B27", " <Column1>12</Column1>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B28", " <Column2>Hi There</Column2>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#B29", " </MoreData>", substring);
|
||||
}
|
||||
|
||||
public void Test3()
|
||||
{
|
||||
XmlDataDocument DataDoc = new XmlDataDocument ();
|
||||
DataSet dataset = DataDoc.DataSet;
|
||||
dataset.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
DataDoc.Load("System.Xml/region.xml" );
|
||||
|
||||
DataDoc.GetElementsByTagName ("Region") [0].RemoveAll ();
|
||||
|
||||
TextWriter text = new StringWriter ();
|
||||
dataset.WriteXml (text);
|
||||
//DataDoc.Save (text);
|
||||
string TextString = text.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
|
||||
AssertEquals ("#C01", "<Root>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C02", " <Region />", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C03", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C04", " <RegionID>2</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C05", " <RegionDescription>Western", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C06", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C07", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C08", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C09", " <RegionID>3</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C10", " <RegionDescription>Northern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C11", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C12", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C13", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C14", " <RegionID>4</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C15", " <RegionDescription>Southern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C16", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C17", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.Length);
|
||||
//TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#C18", "</Root>", substring);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void Test4 ()
|
||||
{
|
||||
DataSet RegionDS = new DataSet ();
|
||||
|
||||
RegionDS.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
XmlDataDocument DataDoc = new XmlDataDocument (RegionDS);
|
||||
DataDoc.Load("System.Xml/region.xml" );
|
||||
DataTable table = DataDoc.DataSet.Tables ["Region"];
|
||||
DataRow newRow = table.NewRow ();
|
||||
newRow [0] = "new row";
|
||||
newRow [1] = "new description";
|
||||
table.Rows.Add (newRow);
|
||||
|
||||
TextWriter text = new StringWriter ();
|
||||
|
||||
DataDoc.Save (text);
|
||||
string TextString = text.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
|
||||
AssertEquals ("#F01", "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F02", "<Root>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F03", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F04", " <RegionID>1</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F05", " <RegionDescription>Eastern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F06", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F07", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F08", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F09", " <RegionID>2</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F10", " <RegionDescription>Western", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F11", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F12", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F13", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F14", " <RegionID>3</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F15", " <RegionDescription>Northern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F16", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F17", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F18", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F19", " <RegionID>4</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F20", " <RegionDescription>Southern", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F21", " </RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F22", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F23", " <MoreData>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F24", " <Column1>12</Column1>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F25", " <Column2>Hi There</Column2>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F26", " </MoreData>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F27", " <MoreData>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F28", " <Column1>12</Column1>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F29", " <Column2>Hi There</Column2>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F30", " </MoreData>", substring);
|
||||
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F31", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F32", " <RegionID>new row</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F33", " <RegionDescription>new description</RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#F34", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.Length);
|
||||
AssertEquals ("#F35", "</Root>", substring);
|
||||
|
||||
}
|
||||
|
||||
public void Test5 ()
|
||||
{
|
||||
DataSet RegionDS = new DataSet ();
|
||||
|
||||
RegionDS.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
XmlDataDocument DataDoc = new XmlDataDocument (RegionDS);
|
||||
DataDoc.Load("System.Xml/region.xml" );
|
||||
try {
|
||||
DataDoc.DocumentElement.AppendChild (DataDoc.DocumentElement.FirstChild);
|
||||
Fail ("#G01");
|
||||
} catch (Exception e) {
|
||||
AssertEquals ("#G02", typeof (InvalidOperationException), e.GetType ());
|
||||
AssertEquals ("#G03", "Please set DataSet.EnforceConstraints == false before trying to edit " +
|
||||
"XmlDataDocument using XML operations.", e.Message);
|
||||
DataDoc.DataSet.EnforceConstraints = false;
|
||||
}
|
||||
XmlElement newNode = DataDoc.CreateElement ("Region");
|
||||
XmlElement newChildNode = DataDoc.CreateElement ("RegionID");
|
||||
newChildNode.InnerText = "64";
|
||||
XmlElement newChildNode2 = DataDoc.CreateElement ("RegionDescription");
|
||||
newChildNode2.InnerText = "test node";
|
||||
newNode.AppendChild (newChildNode);
|
||||
newNode.AppendChild (newChildNode2);
|
||||
DataDoc.DocumentElement.AppendChild (newNode);
|
||||
TextWriter text = new StringWriter ();
|
||||
|
||||
//DataDoc.Save (text);
|
||||
DataDoc.DataSet.WriteXml(text);
|
||||
string TextString = text.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
|
||||
for (int i = 0; i < 21; i++) {
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
}
|
||||
AssertEquals ("#G04", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#G05", " <RegionID>64</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#G06", " <RegionDescription>test node</RegionDescription>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#G07", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.Length);
|
||||
AssertEquals ("#G08", "</Root>", substring);
|
||||
|
||||
}
|
||||
|
||||
public void Test6 ()
|
||||
{
|
||||
DataSet RegionDS = new DataSet ();
|
||||
|
||||
RegionDS.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
XmlDataDocument DataDoc = new XmlDataDocument (RegionDS);
|
||||
DataDoc.Load("System.Xml/region.xml" );
|
||||
DataDoc.DataSet.EnforceConstraints = false;
|
||||
|
||||
XmlElement newNode = DataDoc.CreateElement ("Region");
|
||||
XmlElement newChildNode = DataDoc.CreateElement ("RegionID");
|
||||
newChildNode.InnerText = "64";
|
||||
XmlElement newChildNode2 = null;
|
||||
try {
|
||||
newChildNode2 = DataDoc.CreateElement ("something else");
|
||||
Fail ("#H01");
|
||||
} catch (Exception e) {
|
||||
AssertEquals ("#H02", typeof (XmlException), e.GetType ());
|
||||
newChildNode2 = DataDoc.CreateElement ("something_else");
|
||||
}
|
||||
newChildNode2.InnerText = "test node";
|
||||
newNode.AppendChild (newChildNode);
|
||||
newNode.AppendChild (newChildNode2);
|
||||
DataDoc.DocumentElement.AppendChild (newNode);
|
||||
TextWriter text = new StringWriter ();
|
||||
|
||||
//DataDoc.Save (text);
|
||||
DataDoc.DataSet.WriteXml(text);
|
||||
string TextString = text.ToString ();
|
||||
string substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
|
||||
for (int i = 0; i < 21; i++) {
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
}
|
||||
|
||||
AssertEquals ("#H03", " <Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#H04", " <RegionID>64</RegionID>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.IndexOf("\n") - 1);
|
||||
TextString = TextString.Substring (TextString.IndexOf("\n") + 1);
|
||||
AssertEquals ("#H05", " </Region>", substring);
|
||||
|
||||
substring = TextString.Substring (0, TextString.Length);
|
||||
AssertEquals ("#H06", "</Root>", substring);
|
||||
}
|
||||
|
||||
public void TestGetElementFromRow ()
|
||||
{
|
||||
XmlDataDocument doc = new XmlDataDocument ();
|
||||
doc.DataSet.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
doc.Load ("System.Xml/region.xml");
|
||||
DataTable table = doc.DataSet.Tables ["Region"];
|
||||
|
||||
XmlElement element = doc.GetElementFromRow (table.Rows [2]);
|
||||
AssertEquals ("#D01", "Region", element.Name);
|
||||
AssertEquals ("#D02", "3", element ["RegionID"].InnerText);
|
||||
|
||||
try {
|
||||
element = doc.GetElementFromRow (table.Rows [4]);
|
||||
Fail ("#D03");
|
||||
} catch (Exception e) {
|
||||
AssertEquals ("#D04", typeof (IndexOutOfRangeException), e.GetType ());
|
||||
AssertEquals ("#D05", "There is no row at position 4.", e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void TestGetRowFromElement ()
|
||||
{
|
||||
XmlDataDocument doc = new XmlDataDocument ();
|
||||
doc.DataSet.ReadXmlSchema ("System.Xml/region.xsd");
|
||||
doc.Load ("System.Xml/region.xml");
|
||||
XmlElement root = doc.DocumentElement;
|
||||
|
||||
DataRow row = doc.GetRowFromElement((XmlElement)root.FirstChild);
|
||||
|
||||
AssertEquals ("#E01", "1", row [0]);
|
||||
|
||||
row = doc.GetRowFromElement((XmlElement)root.ChildNodes [2]);
|
||||
AssertEquals ("#E02", "3", row [0]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,31 @@
|
||||
<!--sample XML fragment-->
|
||||
<bookstore>
|
||||
<book genre='novel' ISBN='10-861003-324'>
|
||||
<title>The Handmaid's Tale</title>
|
||||
<price>19.95</price>
|
||||
</book>
|
||||
<book genre='novel' ISBN='1-861001-57-5'>
|
||||
<title>Pride And Prejudice</title>
|
||||
<price>24.95</price>
|
||||
</book>
|
||||
</bookstore>
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<Root>
|
||||
<Region>
|
||||
<RegionID>1</RegionID>
|
||||
<RegionDescription>Eastern
|
||||
</RegionDescription>
|
||||
</Region>
|
||||
<Region>
|
||||
<RegionID>2</RegionID>
|
||||
<RegionDescription>Western
|
||||
</RegionDescription>
|
||||
</Region>
|
||||
<Region>
|
||||
<RegionID>3</RegionID>
|
||||
<RegionDescription>Northern
|
||||
</RegionDescription>
|
||||
</Region>
|
||||
<Region>
|
||||
<RegionID>4</RegionID>
|
||||
<RegionDescription>Southern
|
||||
</RegionDescription>
|
||||
</Region>
|
||||
<MoreData>
|
||||
<Column1>12</Column1>
|
||||
<Column2>Hi There</Column2>
|
||||
</MoreData>
|
||||
<MoreData>
|
||||
<Column1>12</Column1>
|
||||
<Column2>Hi There</Column2>
|
||||
</MoreData>
|
||||
</Root>
|
||||
@@ -1,118 +0,0 @@
|
||||
//
|
||||
// TestPgSqlInsert.cs
|
||||
//
|
||||
// To Test PgSqlConnection and PgSqlCommand by connecting
|
||||
// to a PostgreSQL database
|
||||
// and then executing an INSERT SQL statement
|
||||
//
|
||||
// To use:
|
||||
// change strings to your database, userid, tables, etc...:
|
||||
// connectionString
|
||||
// insertStatement
|
||||
//
|
||||
// To test:
|
||||
// mcs TestPgSqlInsert.cs -r System.Data
|
||||
// mint TestPgSqlInsert.exe
|
||||
//
|
||||
// Author:
|
||||
// Rodrigo Moya ([email protected])
|
||||
// Daniel Morgan ([email protected])
|
||||
//
|
||||
// (C) Ximian, Inc 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using Mono.Data.PostgreSqlClient;
|
||||
|
||||
namespace TestSystemDataPgSqlClient
|
||||
{
|
||||
class TestPgSqlInsert
|
||||
{
|
||||
[STAThread]
|
||||
static void Main(string[] args) {
|
||||
PgSqlConnection conn = null;
|
||||
PgSqlCommand cmd = null;
|
||||
PgSqlTransaction trans = null;
|
||||
|
||||
int rowsAffected = -1;
|
||||
|
||||
String connectionString = "";
|
||||
String insertStatement = "";
|
||||
String deleteStatement = "";
|
||||
|
||||
connectionString =
|
||||
"host=localhost;" +
|
||||
"dbname=test;" +
|
||||
"user=postgres";
|
||||
|
||||
insertStatement =
|
||||
"insert into NoSuchTable " +
|
||||
"(tid, tdesc) " +
|
||||
"values ('beer', 'Beer for All!') ";
|
||||
|
||||
deleteStatement =
|
||||
"delete from sometable " +
|
||||
"where tid = 'beer' ";
|
||||
|
||||
try {
|
||||
// Connect to a PostgreSQL database
|
||||
Console.WriteLine ("Connect to database...");
|
||||
conn = new PgSqlConnection(connectionString);
|
||||
conn.Open();
|
||||
|
||||
// begin transaction
|
||||
Console.WriteLine ("Begin Transaction...");
|
||||
trans = conn.BeginTransaction();
|
||||
|
||||
// create SQL DELETE command
|
||||
Console.WriteLine ("Create Command initializing " +
|
||||
"with an DELETE statement...");
|
||||
cmd = new PgSqlCommand (deleteStatement, conn);
|
||||
|
||||
// execute the DELETE SQL command
|
||||
Console.WriteLine ("Execute DELETE SQL Command...");
|
||||
rowsAffected = cmd.ExecuteNonQuery();
|
||||
Console.WriteLine ("Rows Affected: " + rowsAffected);
|
||||
|
||||
// change the SQL command to an SQL INSERT Command
|
||||
Console.WriteLine ("Now use INSERT SQL Command...");
|
||||
cmd.CommandText = insertStatement;
|
||||
|
||||
// execute the INSERT SQL command
|
||||
Console.WriteLine ("Execute INSERT SQL Command...");
|
||||
rowsAffected = cmd.ExecuteNonQuery();
|
||||
Console.WriteLine ("Rows Affected: " + rowsAffected);
|
||||
|
||||
// if successfull at INSERT, commit the transaction,
|
||||
// otherwise, do a rollback the transaction using
|
||||
// trans.Rollback();
|
||||
Console.WriteLine ("Commit transaction...");
|
||||
trans.Commit();
|
||||
|
||||
// Close connection to database
|
||||
Console.WriteLine ("Close database connection...");
|
||||
conn.Close();
|
||||
|
||||
Console.WriteLine ("Assuming everything " +
|
||||
"was successful.");
|
||||
Console.WriteLine ("Verify data in database to " +
|
||||
"see if row is there.");
|
||||
}
|
||||
catch(PgSqlException e) {
|
||||
// Display the SQL Errors and Rollback the database
|
||||
Console.WriteLine("PgSqlException caught: " +
|
||||
e.ToString());
|
||||
if(trans != null) {
|
||||
trans.Rollback();
|
||||
Console.WriteLine("Database has been Rolled back!");
|
||||
}
|
||||
}
|
||||
finally {
|
||||
if(conn != null)
|
||||
if(conn.State == ConnectionState.Open)
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
//
|
||||
// TestSqlInsert.cs
|
||||
//
|
||||
// To Test SqlConnection and SqlCommand by connecting
|
||||
// to a PostgreSQL database
|
||||
// and then executing an INSERT SQL statement
|
||||
//
|
||||
// To use:
|
||||
// change strings to your database, userid, tables, etc...:
|
||||
// connectionString
|
||||
// insertStatement
|
||||
//
|
||||
// To test:
|
||||
// mcs TestSqlInsert.cs -r System.Data
|
||||
// mint TestSqlInsert.exe
|
||||
//
|
||||
// Author:
|
||||
// Rodrigo Moya ([email protected])
|
||||
// Daniel Morgan ([email protected])
|
||||
//
|
||||
// (C) Ximian, Inc 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace TestSystemDataSqlClient
|
||||
{
|
||||
class TestSqlInsert
|
||||
{
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
SqlConnection conn;
|
||||
SqlCommand cmd;
|
||||
SqlTransaction trans;
|
||||
|
||||
int rowsAffected;
|
||||
|
||||
String connectionString;
|
||||
String insertStatement;
|
||||
String deleteStatement;
|
||||
|
||||
connectionString =
|
||||
"host=localhost;" +
|
||||
"dbname=test;" +
|
||||
"user=postgres";
|
||||
|
||||
insertStatement =
|
||||
"insert into sometable " +
|
||||
"(tid, tdesc) " +
|
||||
"values ('beer', 'Beer for All!') ";
|
||||
|
||||
deleteStatement =
|
||||
"delete from sometable " +
|
||||
"where tid = 'beer' ";
|
||||
|
||||
// Connect to a PostgreSQL database
|
||||
Console.WriteLine ("Connect to database...");
|
||||
conn = new SqlConnection(connectionString);
|
||||
conn.Open();
|
||||
|
||||
// begin transaction
|
||||
Console.WriteLine ("Begin Transaction...");
|
||||
trans = conn.BeginTransaction();
|
||||
|
||||
// create SQL DELETE command
|
||||
Console.WriteLine ("Create Command initializing " +
|
||||
"with an DELETE statement...");
|
||||
cmd = new SqlCommand (deleteStatement, conn);
|
||||
|
||||
// execute the DELETE SQL command
|
||||
Console.WriteLine ("Execute DELETE SQL Command...");
|
||||
rowsAffected = cmd.ExecuteNonQuery();
|
||||
Console.WriteLine ("Rows Affected: " + rowsAffected);
|
||||
|
||||
// change the SQL command to an SQL INSERT Command
|
||||
Console.WriteLine ("Now use INSERT SQL Command...");
|
||||
cmd.CommandText = insertStatement;
|
||||
|
||||
// execute the INSERT SQL command
|
||||
Console.WriteLine ("Execute INSERT SQL Command...");
|
||||
rowsAffected = cmd.ExecuteNonQuery();
|
||||
Console.WriteLine ("Rows Affected: " + rowsAffected);
|
||||
|
||||
// if successfull at INSERT, commit the transaction,
|
||||
// otherwise, do a rollback the transaction using
|
||||
// trans.Rollback();
|
||||
// FIXME: need to have exceptions working in
|
||||
// SqlClient classes before you can do rollback
|
||||
Console.WriteLine ("Commit transaction...");
|
||||
trans.Commit();
|
||||
|
||||
// Close connection to database
|
||||
Console.WriteLine ("Close database connection...");
|
||||
conn.Close();
|
||||
|
||||
Console.WriteLine ("Assuming everything " +
|
||||
"was successful.");
|
||||
Console.WriteLine ("Verify data in database to " +
|
||||
"see if row is there.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
//
|
||||
// TestSqlIsolationLevel.
|
||||
//
|
||||
// To Test Setting Isolation Level of SqlTransaction
|
||||
// to a PostgreSQL database
|
||||
//
|
||||
// To use:
|
||||
// change strings to your database, userid, tables, etc...:
|
||||
// connectionString
|
||||
// insertStatement
|
||||
//
|
||||
// To test:
|
||||
// mcs TestSqlIsolationLevel.cs -r System.Data
|
||||
// mint TestSqlIsolationLevel.exe
|
||||
//
|
||||
// Author:
|
||||
// Rodrigo Moya ([email protected])
|
||||
// Daniel Morgan ([email protected])
|
||||
//
|
||||
// (C) Ximian, Inc 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace TestSystemDataSqlClient
|
||||
{
|
||||
class TestSqlInsert
|
||||
{
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
SqlConnection conn;
|
||||
SqlCommand cmd;
|
||||
SqlTransaction trans;
|
||||
|
||||
int rowsAffected;
|
||||
|
||||
String connectionString;
|
||||
String insertStatement;
|
||||
String deleteStatement;
|
||||
|
||||
connectionString =
|
||||
"host=localhost;" +
|
||||
"dbname=test;" +
|
||||
"user=postgres";
|
||||
|
||||
insertStatement =
|
||||
"insert into sometable " +
|
||||
"(tid, tdesc) " +
|
||||
"values ('beer', 'Beer for All!') ";
|
||||
|
||||
deleteStatement =
|
||||
"delete from sometable " +
|
||||
"where tid = 'beer' ";
|
||||
|
||||
// Connect to a PostgreSQL database
|
||||
Console.WriteLine ("Connect to database...");
|
||||
conn = new SqlConnection(connectionString);
|
||||
conn.Open();
|
||||
|
||||
// begin transaction
|
||||
Console.WriteLine ("Begin Transaction...");
|
||||
trans = conn.BeginTransaction(IsolationLevel.Serializable);
|
||||
|
||||
// create SQL DELETE command
|
||||
Console.WriteLine ("Create Command initializing " +
|
||||
"with an DELETE statement...");
|
||||
cmd = new SqlCommand (deleteStatement, conn);
|
||||
|
||||
// execute the DELETE SQL command
|
||||
Console.WriteLine ("Execute DELETE SQL Command...");
|
||||
rowsAffected = cmd.ExecuteNonQuery();
|
||||
Console.WriteLine ("Rows Affected: " + rowsAffected);
|
||||
|
||||
// change the SQL command to an SQL INSERT Command
|
||||
Console.WriteLine ("Now use INSERT SQL Command...");
|
||||
cmd.CommandText = insertStatement;
|
||||
|
||||
// execute the INSERT SQL command
|
||||
Console.WriteLine ("Execute INSERT SQL Command...");
|
||||
rowsAffected = cmd.ExecuteNonQuery();
|
||||
Console.WriteLine ("Rows Affected: " + rowsAffected);
|
||||
|
||||
// if successfull at INSERT, commit the transaction,
|
||||
// otherwise, do a rollback the transaction using
|
||||
// trans.Rollback();
|
||||
// FIXME: need to have exceptions working in
|
||||
// SqlClient classes before you can do rollback
|
||||
Console.WriteLine ("Commit transaction...");
|
||||
trans.Commit();
|
||||
|
||||
// Close connection to database
|
||||
Console.WriteLine ("Close database connection...");
|
||||
conn.Close();
|
||||
|
||||
Console.WriteLine ("Assuming everything " +
|
||||
"was successful.");
|
||||
Console.WriteLine ("Verify data in database to " +
|
||||
"see if row is there.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ LIB_LIST = data_linux_test.args
|
||||
LIB_FLAGS = \
|
||||
-r $(topdir)/class/lib/corlib.dll \
|
||||
-r $(topdir)/class/lib/System.Data.dll \
|
||||
-r $(topdir)/class/lib/System.Xml.dll \
|
||||
-r $(topdir)/class/lib/System.dll \
|
||||
-r $(topdir)/class/lib/NUnitCore_mono.dll
|
||||
|
||||
|
||||
@@ -27,8 +27,10 @@ System.Data/DataSet.cs
|
||||
System.Data/DataSysDescriptionAttribute.cs
|
||||
System.Data/DataTable.cs
|
||||
System.Data/DataTableCollection.cs
|
||||
System.Data/DataTablePropertyDescriptor.cs
|
||||
System.Data/DataView.cs
|
||||
System.Data/DataViewManager.cs
|
||||
System.Data/DataViewManagerListItemTypeDescriptor.cs
|
||||
System.Data/DataViewRowState.cs
|
||||
System.Data/DataViewSetting.cs
|
||||
System.Data/DataViewSettingCollection.cs
|
||||
@@ -90,6 +92,7 @@ System.Data/VersionNotFoundException.cs
|
||||
System.Data/XmlReadMode.cs
|
||||
System.Data/XmlWriteMode.cs
|
||||
System.Data/XmlConstants.cs
|
||||
System.Data/XmlDiffLoader.cs
|
||||
System.Data.Common/DataAdapter.cs
|
||||
System.Data.Common/DataColumnMapping.cs
|
||||
System.Data.Common/DataColumnMappingCollection.cs
|
||||
@@ -184,4 +187,6 @@ System.Data.SqlClient/SqlRowUpdatingEventArgs.cs
|
||||
System.Data.SqlClient/SqlRowUpdatingEventHandler.cs
|
||||
System.Data.SqlClient/SqlTransaction.cs
|
||||
System.Data.SqlClient/SqlXmlTextReader.cs
|
||||
System.Data/XmlDataLoader.cs
|
||||
System.Data/XmlSchemaMapper.cs
|
||||
System.Xml/XmlDataDocument.cs
|
||||
@@ -1,4 +1,13 @@
|
||||
2002-10-07 Gaurav Vaish <[email protected]>
|
||||
2002-12-11 Jeroen Janssen <[email protected]>
|
||||
|
||||
* removed set for RootDesignerSerializerAttribute.TypeId
|
||||
* fixed .build file to include reference to System.dll
|
||||
|
||||
2002-09-16 Gaurav Vaish <[email protected]>
|
||||
|
||||
* System.Web.UI.Design : Added directory.
|
||||
|
||||
2002-12-09 Gaurav Vaish <[email protected]>
|
||||
|
||||
* System.Design : Added directory.
|
||||
|
||||
|
||||
-2
@@ -70,8 +70,6 @@ namespace System.ComponentModel.Design.Serialization
|
||||
[MonoTODO]
|
||||
public override object TypeId {
|
||||
get { throw new NotImplementedException ();}
|
||||
|
||||
set { throw new NotImplementedException ();}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
<arg value="/noconfig"/>
|
||||
<arg value="/debug"/>
|
||||
<arg value="/r:System.Web.dll"/>
|
||||
<arg value="/r:System.dll"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
<excludes name="Test/**"/>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
2003-01-07 Gaurav Vaish <gvaish_mono AT lycos.com>
|
||||
|
||||
* DataBindingHandler.cs : Implemented.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Namespace: System.Web.UI.Design
|
||||
* Class: DataBindingHandler
|
||||
*
|
||||
* Author: Gaurav Vaish
|
||||
* Maintainer: [email protected]
|
||||
*
|
||||
* (C) Gaurav Vaish (2002)
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace System.Web.UI.Design
|
||||
{
|
||||
public abstract class DataBindingHandler
|
||||
{
|
||||
protected DataBindingHandler()
|
||||
{
|
||||
}
|
||||
|
||||
public abstract void DataBindControl(IDesignerHost designerHost,
|
||||
Control control);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
//
|
||||
// (C) Alejandro Sánchez Acosta
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.EnterpriseServices.Internal
|
||||
|
||||
+1
@@ -5,6 +5,7 @@
|
||||
//
|
||||
// (C) Alejandro Sánchez Acosta
|
||||
//
|
||||
using System;
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
+1
@@ -5,6 +5,7 @@
|
||||
//
|
||||
// (C) Alejandro Sánchez Acosta
|
||||
//
|
||||
using System;
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
2002-12-29 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* CommonTransportKeys.cs: Implemented and added to CVS
|
||||
* TcpChannel.cs: Added. It is a more ore less complete implementation
|
||||
of the tcp channel, although not yet compatible with MS TcpChannel.
|
||||
* TcpClientChannel.cs: Added
|
||||
* TcpClientTransportSink.cs: Added
|
||||
* TcpClientTransportSinkProvider.cs: Added
|
||||
* TcpConnectionPool.cs: Added
|
||||
* TcpMessageIO.cs: Added
|
||||
* TcpServerChannel.cs: Added
|
||||
* TcpServerTransportSink.cs: Added
|
||||
* SimpleWireFormat.cs: Corrected a bug in method SerializeObject
|
||||
* SimpleServerFormatterSink.cs: Some small corrections
|
||||
* SimpleClientFormatterSink.cs: Some small corrections
|
||||
|
||||
2002-09-03 Dietmar Maurer <[email protected]>
|
||||
|
||||
* System.Runtime.Remoting.Channels.CORBA/CORBAChannel.cs:
|
||||
|
||||
+1
@@ -96,6 +96,7 @@ namespace System.Runtime.Remoting.Channels.Simple
|
||||
try {
|
||||
// create a new header
|
||||
TransportHeaders req_headers = new TransportHeaders ();
|
||||
req_headers[CommonTransportKeys.RequestUri] = call.Uri;
|
||||
|
||||
//fixme: set some header values
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ namespace System.Runtime.Remoting.Channels.Simple {
|
||||
{
|
||||
IMessage call;
|
||||
|
||||
string uri = (string)requestHeaders ["_requestUri"];
|
||||
string uri = (string)requestHeaders [CommonTransportKeys.RequestUri];
|
||||
|
||||
if (requestMsg == null) {
|
||||
call = (IMessage)format.DeserializeRequest (requestStream, uri);
|
||||
|
||||
+5
-3
@@ -40,14 +40,15 @@ namespace System.Runtime.Remoting.Channels.Simple {
|
||||
|
||||
void SerializeObject (BinaryWriter writer, object obj)
|
||||
{
|
||||
Type type = obj.GetType ();
|
||||
|
||||
if (obj == null) {
|
||||
writer.Write ((byte)TypeId.NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == typeof (String)) {
|
||||
Type type = obj.GetType ();
|
||||
|
||||
if (type == typeof (String))
|
||||
{
|
||||
writer.Write ((byte)TypeId.String);
|
||||
writer.Write ((String)obj);
|
||||
return;
|
||||
@@ -225,6 +226,7 @@ namespace System.Runtime.Remoting.Channels.Simple {
|
||||
}
|
||||
|
||||
MonoMethodMessage msg = new MonoMethodMessage (svr_type, method_name, args);
|
||||
msg.Uri = uri;
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
+75
-62
@@ -2,6 +2,7 @@
|
||||
// System.Runtime.Remoting.Channels.Tcp.TcpChannel.cs
|
||||
//
|
||||
// Author: Rodrigo Moya ([email protected])
|
||||
// Lluis Sanchez Gual ([email protected])
|
||||
//
|
||||
// 2002 (C) Copyright, Ximian, Inc.
|
||||
//
|
||||
@@ -12,86 +13,98 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace System.Runtime.Remoting.Channels.Tcp
|
||||
{
|
||||
public class TcpChannel : IChannelReceiver, IChannel,
|
||||
IChannelSender
|
||||
public class TcpChannel : IChannelReceiver, IChannel, IChannelSender
|
||||
{
|
||||
private int tcp_port;
|
||||
|
||||
public TcpChannel ()
|
||||
{
|
||||
tcp_port = 0;
|
||||
private TcpClientChannel _clientChannel;
|
||||
private TcpServerChannel _serverChannel = null;
|
||||
private string _name;
|
||||
|
||||
public TcpChannel (): this (0)
|
||||
{
|
||||
}
|
||||
|
||||
public TcpChannel (int port)
|
||||
{
|
||||
tcp_port = port;
|
||||
Hashtable ht = new Hashtable();
|
||||
ht["port"] = port.ToString();
|
||||
Init(ht, null, null);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void Init(IDictionary properties, IClientChannelSinkProvider clientSink, IServerChannelSinkProvider serverSink)
|
||||
{
|
||||
_clientChannel = new TcpClientChannel(properties,clientSink);
|
||||
|
||||
string port = properties["port"] as string;
|
||||
if (port != null && port != string.Empty)
|
||||
{
|
||||
_serverChannel = new TcpServerChannel(properties, serverSink);
|
||||
}
|
||||
|
||||
_name = properties["name"] as string;
|
||||
}
|
||||
|
||||
|
||||
public TcpChannel (IDictionary properties,
|
||||
IClientChannelSinkProvider clientSinkProvider,
|
||||
IServerChannelSinkProvider serverSinkProvider)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
Init (properties, clientSinkProvider, serverSinkProvider);
|
||||
}
|
||||
|
||||
public object ChannelData
|
||||
{
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public string ChannelName
|
||||
{
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public int ChannelPriority
|
||||
{
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public IMessageSink CreateMessageSink (string url,
|
||||
object remoteChannelData,
|
||||
out string objectURI)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public string[] GetUrlsForUri (string objectURI)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
public IMessageSink CreateMessageSink(string url, object remoteChannelData, out string objectURI)
|
||||
{
|
||||
return _clientChannel.CreateMessageSink(url, remoteChannelData, out objectURI);
|
||||
}
|
||||
|
||||
public string ChannelName
|
||||
{
|
||||
get { return _name; }
|
||||
}
|
||||
|
||||
public int ChannelPriority
|
||||
{
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
public void StartListening (object data)
|
||||
{
|
||||
if (_serverChannel != null) _serverChannel.StartListening(data);
|
||||
}
|
||||
|
||||
public void StopListening (object data)
|
||||
{
|
||||
if (_serverChannel != null) _serverChannel.StopListening(data);
|
||||
}
|
||||
|
||||
public string[] GetUrlsForUri (string uri)
|
||||
{
|
||||
if (_serverChannel != null) return _serverChannel.GetUrlsForUri(uri);
|
||||
else return null;
|
||||
}
|
||||
|
||||
public object ChannelData
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_serverChannel != null) return _serverChannel.ChannelData;
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string Parse (string url, out string objectURI)
|
||||
{
|
||||
return TcpChannel.ParseChannelUrl (url, out objectURI);
|
||||
}
|
||||
|
||||
internal static string ParseChannelUrl (string url, out string objectURI)
|
||||
{
|
||||
int port;
|
||||
|
||||
string host = ParseTcpURL (url, out objectURI, out port);
|
||||
|
||||
return "tcp://" + host + ":" + port;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void StartListening (object data)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void StopListening (object data)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
if (host != null)
|
||||
return "tcp://" + host + ":" + port;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
internal static string ParseTcpURL (string url, out string objectURI, out int port)
|
||||
@@ -101,7 +114,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
objectURI = null;
|
||||
port = 0;
|
||||
|
||||
Match m = Regex.Match (url, "tcp://([^:]+):([0-9]+)(/.*)");
|
||||
Match m = Regex.Match (url, "tcp://([^:]+):([0-9]+)[/](.*)");
|
||||
|
||||
if (!m.Success)
|
||||
return null;
|
||||
|
||||
+28
-112
@@ -2,6 +2,7 @@
|
||||
// System.Runtime.Remoting.Channels.Tcp.TcpClientChannel.cs
|
||||
//
|
||||
// Author: Dietmar Maurer ([email protected])
|
||||
// Lluis Sanchez Gual ([email protected])
|
||||
//
|
||||
// 2002 (C) Copyright, Ximian, Inc.
|
||||
//
|
||||
@@ -11,132 +12,51 @@ using System.IO;
|
||||
using System.Net.Sockets;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Runtime.Remoting.Channels;
|
||||
using System.Runtime.Remoting.Channels.Simple;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Runtime.Remoting.Channels.Tcp
|
||||
{
|
||||
|
||||
public class TcpClientTransportSink : IClientChannelSink
|
||||
{
|
||||
string host;
|
||||
string object_uri;
|
||||
int port;
|
||||
|
||||
TcpClient tcpclient;
|
||||
Stream stream = null;
|
||||
|
||||
public TcpClientTransportSink (string url)
|
||||
{
|
||||
host = TcpChannel.ParseTcpURL (url, out object_uri, out port);
|
||||
tcpclient = new TcpClient ();
|
||||
}
|
||||
|
||||
public IDictionary Properties
|
||||
{
|
||||
get {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public IClientChannelSink NextChannelSink
|
||||
{
|
||||
get {
|
||||
// we are the last one
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void AsyncProcessRequest (IClientChannelSinkStack sinkStack, IMessage msg,
|
||||
ITransportHeaders headers, Stream stream)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void AsyncProcessResponse (IClientResponseChannelSinkStack sinkStack,
|
||||
object state, ITransportHeaders headers,
|
||||
Stream stream)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public Stream GetRequestStream (IMessage msg, ITransportHeaders headers)
|
||||
{
|
||||
// no acces to stream?
|
||||
return null;
|
||||
}
|
||||
|
||||
public void ProcessMessage (IMessage msg,
|
||||
ITransportHeaders requestHeaders,
|
||||
Stream requestStream,
|
||||
out ITransportHeaders responseHeaders,
|
||||
out Stream responseStream)
|
||||
{
|
||||
if (stream == null) {
|
||||
tcpclient.Connect (host, port);
|
||||
stream = tcpclient.GetStream ();
|
||||
}
|
||||
|
||||
Console.WriteLine ("Client ProcessMessage");
|
||||
|
||||
responseHeaders = null;
|
||||
responseStream = null;
|
||||
//throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class TcpClientTransportSinkProvider : IClientChannelSinkProvider
|
||||
{
|
||||
public TcpClientTransportSinkProvider ()
|
||||
{
|
||||
// what should we do here ?
|
||||
}
|
||||
|
||||
public IClientChannelSinkProvider Next
|
||||
{
|
||||
get {
|
||||
return null;
|
||||
}
|
||||
|
||||
set {
|
||||
// ignore, we are always the last in the chain
|
||||
}
|
||||
}
|
||||
|
||||
public IClientChannelSink CreateSink (IChannelSender channel, string url,
|
||||
object remoteChannelData)
|
||||
{
|
||||
return new TcpClientTransportSink (url);
|
||||
}
|
||||
}
|
||||
|
||||
public class TcpClientChannel : IChannelSender, IChannel
|
||||
{
|
||||
int priority = 1;
|
||||
string name = "tcp";
|
||||
IClientChannelSinkProvider sink_provider;
|
||||
IClientChannelSinkProvider _sinkProvider;
|
||||
|
||||
public TcpClientChannel ()
|
||||
{
|
||||
sink_provider = new BinaryClientFormatterSinkProvider ();
|
||||
sink_provider.Next = new TcpClientTransportSinkProvider ();
|
||||
{
|
||||
}
|
||||
|
||||
public TcpClientChannel (IDictionary properties, IClientChannelSinkProvider sinkProvider)
|
||||
{
|
||||
priority = 1;
|
||||
sink_provider = sinkProvider;
|
||||
|
||||
// add the tcp provider at the end of the chain
|
||||
IClientChannelSinkProvider prov = sinkProvider;
|
||||
while (prov.Next != null) prov = prov.Next;
|
||||
prov.Next = new TcpClientTransportSinkProvider ();
|
||||
if (_sinkProvider != null)
|
||||
{
|
||||
_sinkProvider = sinkProvider;
|
||||
|
||||
// add the tcp provider at the end of the chain
|
||||
IClientChannelSinkProvider prov = sinkProvider;
|
||||
while (prov.Next != null) prov = prov.Next;
|
||||
prov.Next = new TcpClientTransportSinkProvider ();
|
||||
|
||||
// Note: a default formatter is added only when
|
||||
// no sink providers are specified in the config file.
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: change soap to binary
|
||||
_sinkProvider = new SimpleClientFormatterSinkProvider ();
|
||||
_sinkProvider.Next = new TcpClientTransportSinkProvider ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public TcpClientChannel (string name, IClientChannelSinkProvider sinkProvider)
|
||||
{
|
||||
priority = 1;
|
||||
this.name = name;
|
||||
sink_provider = sinkProvider;
|
||||
_sinkProvider = sinkProvider;
|
||||
|
||||
// add the tcp provider at the end of the chain
|
||||
IClientChannelSinkProvider prov = sinkProvider;
|
||||
@@ -161,7 +81,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
public IMessageSink CreateMessageSink (string url,
|
||||
object remoteChannelData,
|
||||
out string objectURI)
|
||||
{
|
||||
{
|
||||
if (url == null && remoteChannelData != null) {
|
||||
IChannelDataStore ds = remoteChannelData as IChannelDataStore;
|
||||
if (ds != null)
|
||||
@@ -171,16 +91,12 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
if (Parse (url, out objectURI) == null)
|
||||
return null;
|
||||
|
||||
return (IMessageSink) sink_provider.CreateSink (this, url, remoteChannelData);
|
||||
return (IMessageSink) _sinkProvider.CreateSink (this, url, remoteChannelData);
|
||||
}
|
||||
|
||||
public string Parse (string url, out string objectURI)
|
||||
{
|
||||
int port;
|
||||
|
||||
string host = TcpChannel.ParseTcpURL (url, out objectURI, out port);
|
||||
|
||||
return "tcp://" + host + ":" + port;
|
||||
return TcpChannel.ParseChannelUrl (url, out objectURI);
|
||||
}
|
||||
}
|
||||
}
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
//
|
||||
// System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.cs
|
||||
//
|
||||
// Author: Dietmar Maurer ([email protected])
|
||||
// Lluis Sanchez ([email protected])
|
||||
//
|
||||
// 2002 (C) Copyright, Ximian, Inc.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.Remoting.Channels;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Runtime.Remoting.Channels.Tcp
|
||||
{
|
||||
public class TcpClientTransportSink : IClientChannelSink
|
||||
{
|
||||
string _host;
|
||||
string _objectUri;
|
||||
int _port;
|
||||
|
||||
public TcpClientTransportSink (string url)
|
||||
{
|
||||
_host = TcpChannel.ParseTcpURL (url, out _objectUri, out _port);
|
||||
}
|
||||
|
||||
public IDictionary Properties
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public IClientChannelSink NextChannelSink
|
||||
{
|
||||
get
|
||||
{
|
||||
// we are the last one
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void AsyncProcessRequest (IClientChannelSinkStack sinkStack, IMessage msg,
|
||||
ITransportHeaders headers, Stream requestStream)
|
||||
{
|
||||
TcpConnection connection = null;
|
||||
try
|
||||
{
|
||||
// Sends the stream using a connection from the pool
|
||||
// and creates a WorkItem that will wait for the
|
||||
// response of the server
|
||||
|
||||
connection = TcpConnectionPool.GetConnection (_host, _port);
|
||||
TcpMessageIO.SendMessageStream (connection.Stream, requestStream, headers, connection.Buffer);
|
||||
sinkStack.Push (this, connection);
|
||||
ThreadPool.QueueUserWorkItem (new WaitCallback(ReadAsyncTcpMessage), sinkStack);
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (connection != null) connection.Release();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadAsyncTcpMessage(object data)
|
||||
{
|
||||
// This method is called by a new thread to asynchronously
|
||||
// read the response to a request
|
||||
|
||||
// The stack was provided as state data in QueueUserWorkItem
|
||||
IClientChannelSinkStack stack = (IClientChannelSinkStack)data;
|
||||
|
||||
// The first sink in the stack is this sink. Pop it and
|
||||
// get the status data, which is the TcpConnection used to send
|
||||
// the request
|
||||
TcpConnection connection = (TcpConnection)stack.Pop(this);
|
||||
|
||||
try
|
||||
{
|
||||
ITransportHeaders responseHeaders;
|
||||
|
||||
// Read the response, blocking if necessary
|
||||
MessageType type = TcpMessageIO.ReceiveMessageType (connection.Stream);
|
||||
|
||||
if (type != MessageType.MethodMessage)
|
||||
throw new RemotingException ("Unknown response message from server");
|
||||
|
||||
Stream responseStream = TcpMessageIO.ReceiveMessageStream (connection.Stream, out responseHeaders, connection.Buffer);
|
||||
|
||||
// Free the connection, so it can be reused
|
||||
connection.Release();
|
||||
connection = null;
|
||||
|
||||
// Ok, proceed with the other sinks
|
||||
stack.AsyncProcessResponse (responseHeaders, responseStream);
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (connection != null) connection.Release();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void AsyncProcessResponse (IClientResponseChannelSinkStack sinkStack,
|
||||
object state, ITransportHeaders headers,
|
||||
Stream stream)
|
||||
{
|
||||
// Should never be called
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public Stream GetRequestStream (IMessage msg, ITransportHeaders headers)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void ProcessMessage (IMessage msg,
|
||||
ITransportHeaders requestHeaders,
|
||||
Stream requestStream,
|
||||
out ITransportHeaders responseHeaders,
|
||||
out Stream responseStream)
|
||||
{
|
||||
TcpConnection connection = null;
|
||||
try
|
||||
{
|
||||
// Sends the message
|
||||
connection = TcpConnectionPool.GetConnection (_host, _port);
|
||||
TcpMessageIO.SendMessageStream (connection.Stream, requestStream, requestHeaders, connection.Buffer);
|
||||
|
||||
// Reads the response
|
||||
MessageType type = TcpMessageIO.ReceiveMessageType (connection.Stream);
|
||||
|
||||
if (type != MessageType.MethodMessage)
|
||||
throw new RemotingException ("Unknown response message from server");
|
||||
|
||||
responseStream = TcpMessageIO.ReceiveMessageStream (connection.Stream, out responseHeaders, connection.Buffer);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (connection != null)
|
||||
connection.Release();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSinkProvider.cs
|
||||
//
|
||||
// Author: Dietmar Maurer ([email protected])
|
||||
// Lluis Sanchez ([email protected])
|
||||
//
|
||||
// 2002 (C) Copyright, Ximian, Inc.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.Remoting.Channels;
|
||||
|
||||
namespace System.Runtime.Remoting.Channels.Tcp
|
||||
{
|
||||
public class TcpClientTransportSinkProvider : IClientChannelSinkProvider
|
||||
{
|
||||
public TcpClientTransportSinkProvider ()
|
||||
{
|
||||
// what should we do here ?
|
||||
}
|
||||
|
||||
public IClientChannelSinkProvider Next
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
// ignore, we are always the last in the chain
|
||||
}
|
||||
}
|
||||
|
||||
public IClientChannelSink CreateSink (IChannelSender channel, string url,
|
||||
object remoteChannelData)
|
||||
{
|
||||
return new TcpClientTransportSink (url);
|
||||
}
|
||||
}
|
||||
}
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
//
|
||||
// System.Runtime.Remoting.Channels.Tcp.TcpConnectionPool.cs
|
||||
//
|
||||
// Author: Lluis Sanchez ([email protected])
|
||||
//
|
||||
// 2002 (C) Lluis Sanchez Gual
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
using System.IO;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace System.Runtime.Remoting.Channels.Tcp
|
||||
{
|
||||
// This is a pool of Tcp connections. Connections requested
|
||||
// by the TCP channel are pooled after their use, and can
|
||||
// be reused later. Connections are automaticaly closed
|
||||
// if not used after some time, specified in KeepAliveSeconds.
|
||||
// The number of allowed open connections can also be specified
|
||||
// in MaxOpenConnections. The limit is per host.
|
||||
// If a thread requests a connection and the limit has been
|
||||
// reached, the thread is suspended until one is released.
|
||||
|
||||
internal class TcpConnectionPool
|
||||
{
|
||||
// Table of pools. There is a HostConnectionPool
|
||||
// instance for each host
|
||||
static Hashtable _pools = new Hashtable();
|
||||
|
||||
static int _maxOpenConnections = 2;
|
||||
static int _keepAliveSeconds = 15;
|
||||
|
||||
static TcpConnectionPool()
|
||||
{
|
||||
// This thread will close unused connections
|
||||
Thread t = new Thread (new ThreadStart (ConnectionCollector));
|
||||
t.Start();
|
||||
t.IsBackground = true;
|
||||
}
|
||||
|
||||
public static int MaxOpenConnections
|
||||
{
|
||||
get { return _maxOpenConnections; }
|
||||
set
|
||||
{
|
||||
if (value < 1) throw new RemotingException ("MaxOpenConnections must be greater than zero");
|
||||
_maxOpenConnections = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static int KeepAliveSeconds
|
||||
{
|
||||
get { return _keepAliveSeconds; }
|
||||
set { _keepAliveSeconds = value; }
|
||||
}
|
||||
|
||||
public static TcpConnection GetConnection (string host, int port)
|
||||
{
|
||||
HostConnectionPool hostPool;
|
||||
|
||||
lock (_pools)
|
||||
{
|
||||
string key = host + ":" + port;
|
||||
hostPool = (HostConnectionPool) _pools[key];
|
||||
if (hostPool == null)
|
||||
{
|
||||
hostPool = new HostConnectionPool(host, port);
|
||||
_pools[key] = hostPool;
|
||||
}
|
||||
}
|
||||
|
||||
return hostPool.GetConnection();
|
||||
}
|
||||
|
||||
private static void ConnectionCollector ()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(3000);
|
||||
lock (_pools)
|
||||
{
|
||||
ICollection values = _pools.Values;
|
||||
foreach (HostConnectionPool pool in values)
|
||||
pool.PurgeConnections();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class TcpConnection
|
||||
{
|
||||
DateTime _controlTime;
|
||||
Stream _stream;
|
||||
TcpClient _client;
|
||||
HostConnectionPool _pool;
|
||||
byte[] _buffer;
|
||||
|
||||
public TcpConnection (HostConnectionPool pool, TcpClient client)
|
||||
{
|
||||
_pool = pool;
|
||||
_client = client;
|
||||
_stream = client.GetStream();
|
||||
_controlTime = DateTime.Now;
|
||||
_buffer = new byte[TcpMessageIO.DefaultStreamBufferSize];
|
||||
}
|
||||
|
||||
public Stream Stream
|
||||
{
|
||||
get { return _stream; }
|
||||
}
|
||||
|
||||
public DateTime ControlTime
|
||||
{
|
||||
get { return _controlTime; }
|
||||
set { _controlTime = value; }
|
||||
}
|
||||
|
||||
// This is a "thread safe" buffer that can be used by
|
||||
// TcpClientTransportSink to read or send data to the stream.
|
||||
// The buffer is "thread safe" since only one thread can
|
||||
// use a connection at a given time.
|
||||
public byte[] Buffer
|
||||
{
|
||||
get { return _buffer; }
|
||||
}
|
||||
|
||||
// Returns the connection to the pool
|
||||
public void Release()
|
||||
{
|
||||
_pool.ReleaseConnection (this);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
_client.Close();
|
||||
}
|
||||
}
|
||||
|
||||
internal class HostConnectionPool
|
||||
{
|
||||
ArrayList _pool = new ArrayList();
|
||||
int _activeConnections = 0;
|
||||
|
||||
string _host;
|
||||
int _port;
|
||||
|
||||
public HostConnectionPool (string host, int port)
|
||||
{
|
||||
_host = host;
|
||||
_port = port;
|
||||
}
|
||||
|
||||
public TcpConnection GetConnection ()
|
||||
{
|
||||
lock (_pool)
|
||||
{
|
||||
TcpConnection connection = null;
|
||||
|
||||
do
|
||||
{
|
||||
if (_pool.Count > 0)
|
||||
{
|
||||
// There are available connections
|
||||
connection = (TcpConnection)_pool[_pool.Count - 1];
|
||||
_pool.RemoveAt(_pool.Count - 1);
|
||||
}
|
||||
|
||||
if (connection == null && _activeConnections < TcpConnectionPool.MaxOpenConnections)
|
||||
{
|
||||
// No connections available, but the max connections
|
||||
// has not been reached yet, so a new one can be created
|
||||
connection = CreateConnection();
|
||||
}
|
||||
|
||||
// No available connections in the pool
|
||||
// Wait for somewone to release one.
|
||||
|
||||
if (connection == null)
|
||||
Monitor.Wait(_pool);
|
||||
}
|
||||
while (connection == null);
|
||||
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
|
||||
private TcpConnection CreateConnection()
|
||||
{
|
||||
try
|
||||
{
|
||||
TcpClient client = new TcpClient(_host, _port);
|
||||
TcpConnection entry = new TcpConnection(this, client);
|
||||
_activeConnections++;
|
||||
return entry;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new RemotingException (ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void ReleaseConnection (TcpConnection entry)
|
||||
{
|
||||
lock (_pool)
|
||||
{
|
||||
entry.ControlTime = DateTime.Now; // Initialize timeout
|
||||
_pool.Add (entry);
|
||||
Monitor.Pulse (_pool);
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelConnection(TcpConnection entry)
|
||||
{
|
||||
try
|
||||
{
|
||||
entry.Stream.Close();
|
||||
_activeConnections--;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void PurgeConnections()
|
||||
{
|
||||
lock (_pool)
|
||||
{
|
||||
for (int n=0; n < _pool.Count; n++)
|
||||
{
|
||||
TcpConnection entry = (TcpConnection)_pool[n];
|
||||
if ( (DateTime.Now - entry.ControlTime).TotalSeconds > TcpConnectionPool.KeepAliveSeconds)
|
||||
{
|
||||
CancelConnection (entry);
|
||||
_pool.RemoveAt(n);
|
||||
n--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+205
@@ -0,0 +1,205 @@
|
||||
// System.Runtime.Remoting.Channels.Tcp.TcpMessageIO.cs
|
||||
//
|
||||
// Author: Lluis Sanchez ([email protected])
|
||||
//
|
||||
// (C) 2002 Lluis Sanchez Gual
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace System.Runtime.Remoting.Channels.Tcp
|
||||
{
|
||||
enum MessageType { MethodMessage = 0, CancelSignal = 1, Unknown = 10}
|
||||
|
||||
internal class TcpMessageIO
|
||||
{
|
||||
static byte[][] _msgHeaders =
|
||||
{
|
||||
new byte[] { (byte)'.', (byte)'N', (byte)'E', (byte)'T', 0 },
|
||||
new byte[] { 255, 255, 255, 255, 255 }
|
||||
};
|
||||
|
||||
public static int DefaultStreamBufferSize = 1000;
|
||||
|
||||
// Identifies an incoming message
|
||||
public static MessageType ReceiveMessageType (Stream networkStream)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool[] isOnTrack = new bool[_msgHeaders.Length];
|
||||
bool atLeastOneOnTrack = true;
|
||||
int i = 0;
|
||||
|
||||
while (atLeastOneOnTrack)
|
||||
{
|
||||
atLeastOneOnTrack = false;
|
||||
byte c = (byte)networkStream.ReadByte();
|
||||
for (int n = 0; n<_msgHeaders.Length; n++)
|
||||
{
|
||||
if (i > 0 && !isOnTrack[n]) continue;
|
||||
|
||||
isOnTrack[n] = (c == _msgHeaders[n][i]);
|
||||
if (isOnTrack[n] && (i == _msgHeaders[n].Length-1)) return (MessageType)n;
|
||||
atLeastOneOnTrack = atLeastOneOnTrack || isOnTrack[n];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return MessageType.Unknown;
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
// Stream closed
|
||||
return MessageType.CancelSignal;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SendMessageStream (Stream networkStream, Stream data, ITransportHeaders requestHeaders, byte[] buffer)
|
||||
{
|
||||
if (buffer == null) buffer = new byte[DefaultStreamBufferSize];
|
||||
|
||||
// Writes the message start header
|
||||
byte[] dotnetHeader = _msgHeaders[(int)MessageType.MethodMessage];
|
||||
networkStream.Write(dotnetHeader, 0, dotnetHeader.Length);
|
||||
|
||||
// Writes the length of the stream being sent (not including the headers)
|
||||
int num = (int)data.Length;
|
||||
buffer [0] = (byte) num;
|
||||
buffer [1] = (byte) (num >> 8);
|
||||
buffer [2] = (byte) (num >> 16);
|
||||
buffer [3] = (byte) (num >> 24);
|
||||
networkStream.Write(buffer, 0, 4);
|
||||
|
||||
// Writes the message headers
|
||||
SendHeaders (networkStream, requestHeaders, buffer);
|
||||
|
||||
// Writes the stream
|
||||
if (data is MemoryStream)
|
||||
{
|
||||
// The copy of the stream can be optimized. The internal
|
||||
// buffer of MemoryStream can be used.
|
||||
MemoryStream memStream = (MemoryStream)data;
|
||||
networkStream.Write (memStream.GetBuffer(), 0, (int)memStream.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
int nread = data.Read (buffer, 0, buffer.Length);
|
||||
while (nread > 0)
|
||||
{
|
||||
networkStream.Write (buffer, 0, nread);
|
||||
nread = data.Read (buffer, 0, buffer.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void SendHeaders(Stream networkStream, ITransportHeaders requestHeaders, byte[] buffer)
|
||||
{
|
||||
if (requestHeaders == null)
|
||||
SendString (networkStream, "", buffer);
|
||||
else
|
||||
{
|
||||
// Writes the headers as a sequence of strings
|
||||
IEnumerator e = requestHeaders.GetEnumerator();
|
||||
while (e.MoveNext())
|
||||
{
|
||||
DictionaryEntry hdr = (DictionaryEntry)e.Current;
|
||||
SendString (networkStream, hdr.Key.ToString(), buffer);
|
||||
SendString (networkStream, hdr.Value.ToString(), buffer);
|
||||
}
|
||||
SendString (networkStream, "", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public static ITransportHeaders ReceiveHeaders (Stream networkStream, byte[] buffer)
|
||||
{
|
||||
TransportHeaders headers = new TransportHeaders();
|
||||
|
||||
string key = ReceiveString (networkStream, buffer);
|
||||
while (key != string.Empty)
|
||||
{
|
||||
headers[key] = ReceiveString (networkStream, buffer);
|
||||
key = ReceiveString (networkStream, buffer);
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
public static Stream ReceiveMessageStream (Stream networkStream, out ITransportHeaders headers, byte[] buffer)
|
||||
{
|
||||
if (buffer == null) buffer = new byte[DefaultStreamBufferSize];
|
||||
|
||||
// Gets the length of the data stream
|
||||
int nr = 0;
|
||||
while (nr < 4)
|
||||
nr += networkStream.Read (buffer, nr, 4 - nr);
|
||||
|
||||
int byteCount = (buffer [0] | (buffer [1] << 8) |
|
||||
(buffer [2] << 16) | (buffer [3] << 24));
|
||||
|
||||
// Reads the headers
|
||||
|
||||
headers = ReceiveHeaders (networkStream, buffer);
|
||||
|
||||
byte[] resultBuffer = new byte[byteCount];
|
||||
|
||||
nr = 0;
|
||||
while (nr < byteCount)
|
||||
nr += networkStream.Read (resultBuffer, nr, byteCount - nr);
|
||||
|
||||
return new MemoryStream(resultBuffer);
|
||||
}
|
||||
|
||||
private static void SendString (Stream networkStream, string str, byte[] buffer)
|
||||
{
|
||||
// Allocates a buffer. Use the internal buffer if it is
|
||||
// big enough. If not, create a new one.
|
||||
|
||||
int maxBytes = Encoding.UTF8.GetMaxByteCount(str.Length)+4; //+4 bytes for storing the string length
|
||||
if (maxBytes > buffer.Length)
|
||||
buffer = new byte[maxBytes];
|
||||
|
||||
int num = Encoding.UTF8.GetBytes (str, 0, str.Length, buffer, 4);
|
||||
|
||||
// store number of bytes (not number of chars!)
|
||||
|
||||
buffer [0] = (byte) num;
|
||||
buffer [1] = (byte) (num >> 8);
|
||||
buffer [2] = (byte) (num >> 16);
|
||||
buffer [3] = (byte) (num >> 24);
|
||||
|
||||
// Write the string bytes
|
||||
networkStream.Write (buffer, 0, num + 4);
|
||||
}
|
||||
|
||||
private static string ReceiveString (Stream networkStream, byte[] buffer)
|
||||
{
|
||||
int nr = 0;
|
||||
while (nr < 4)
|
||||
nr += networkStream.Read (buffer, nr, 4 - nr);
|
||||
|
||||
// Reads the number of bytes (not chars!)
|
||||
|
||||
int byteCount = (buffer [0] | (buffer [1] << 8) |
|
||||
(buffer [2] << 16) | (buffer [3] << 24));
|
||||
|
||||
if (byteCount == 0) return string.Empty;
|
||||
|
||||
// Allocates a buffer of the correct size. Use the
|
||||
// internal buffer if it is big enough
|
||||
|
||||
if (byteCount > buffer.Length)
|
||||
buffer = new byte[byteCount];
|
||||
|
||||
// Reads the string
|
||||
|
||||
nr = 0;
|
||||
while (nr < byteCount)
|
||||
nr += networkStream.Read (buffer, nr, byteCount - nr);
|
||||
|
||||
char[] chars = Encoding.UTF8.GetChars(buffer, 0, byteCount);
|
||||
return new string(chars);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+90
-83
@@ -2,6 +2,7 @@
|
||||
// System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.cs
|
||||
//
|
||||
// Author: Rodrigo Moya ([email protected])
|
||||
// Lluis Sanchez Gual ([email protected])
|
||||
//
|
||||
// 2002 (C) Copyright, Ximian, Inc.
|
||||
//
|
||||
@@ -13,63 +14,10 @@ using System.Net.Sockets;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.IO;
|
||||
using System.Runtime.Remoting.Channels.Simple;
|
||||
|
||||
namespace System.Runtime.Remoting.Channels.Tcp
|
||||
{
|
||||
public class TcpServerTransportSink : IServerChannelSink, IChannelSinkBase
|
||||
{
|
||||
IServerChannelSink next_sink;
|
||||
|
||||
public TcpServerTransportSink (IServerChannelSink next)
|
||||
{
|
||||
next_sink = next;
|
||||
}
|
||||
|
||||
public IServerChannelSink NextChannelSink {
|
||||
get {
|
||||
return next_sink;
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public IDictionary Properties {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state,
|
||||
IMessage msg, ITransportHeaders headers, Stream stream)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public Stream GetResponseStream (IServerResponseChannelSinkStack sinkStack, object state,
|
||||
IMessage msg, ITransportHeaders headers)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public ServerProcessing ProcessMessage (IServerChannelSinkStack sinkStack,
|
||||
IMessage requestMsg,
|
||||
ITransportHeaders requestHeaders,
|
||||
Stream requestStream,
|
||||
out IMessage responseMsg,
|
||||
out ITransportHeaders responseHeaders,
|
||||
out Stream responseStream)
|
||||
{
|
||||
// this is the first sink, and TcpServerChannel does not call it.
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
internal void InternalProcessMessage (Stream requestStream)
|
||||
{
|
||||
Console.WriteLine ("ProcessMessageInternal");
|
||||
}
|
||||
}
|
||||
|
||||
public class TcpServerChannel : IChannelReceiver, IChannel
|
||||
{
|
||||
int port = 0;
|
||||
@@ -81,11 +29,12 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
TcpServerTransportSink sink;
|
||||
ChannelDataStore channel_data;
|
||||
|
||||
void Init (IServerChannelSinkProvider provider) {
|
||||
if (provider == null) {
|
||||
provider = new BinaryServerFormatterSinkProvider ();
|
||||
void Init (IServerChannelSinkProvider serverSinkProvider)
|
||||
{
|
||||
if (serverSinkProvider == null) {
|
||||
// FIXME: change soap for binary
|
||||
serverSinkProvider = new SimpleServerFormatterSinkProvider ();
|
||||
}
|
||||
IServerChannelSink next_sink = provider.CreateSink (this);
|
||||
|
||||
host = Dns.GetHostByName(Dns.GetHostName()).HostName;
|
||||
|
||||
@@ -95,9 +44,20 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
uris = new String [1];
|
||||
uris [0] = GetChannelUri ();
|
||||
}
|
||||
|
||||
channel_data = new ChannelDataStore (uris);;
|
||||
|
||||
// Gets channel data from the chain of channel providers
|
||||
|
||||
channel_data = new ChannelDataStore (uris);
|
||||
IServerChannelSinkProvider provider = serverSinkProvider;
|
||||
while (provider != null)
|
||||
{
|
||||
provider.GetChannelData(channel_data);
|
||||
provider = provider.Next;
|
||||
}
|
||||
|
||||
// Creates the sink chain that will process all incoming messages
|
||||
|
||||
IServerChannelSink next_sink = ChannelServices.CreateServerChannelSinkChain (serverSinkProvider, this);
|
||||
sink = new TcpServerTransportSink (next_sink);
|
||||
|
||||
listener = new TcpListener (port);
|
||||
@@ -113,21 +73,21 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
public TcpServerChannel (IDictionary properties,
|
||||
IServerChannelSinkProvider serverSinkProvider)
|
||||
{
|
||||
port = (int)properties ["port"];
|
||||
port = Int32.Parse ((string)properties ["port"]);
|
||||
Init (serverSinkProvider);
|
||||
}
|
||||
|
||||
public TcpServerChannel (string name, int port,
|
||||
IServerChannelSinkProvider serverSinkProvider)
|
||||
{
|
||||
name = name;
|
||||
this.name = name;
|
||||
this.port = port;
|
||||
Init (serverSinkProvider);
|
||||
}
|
||||
|
||||
public TcpServerChannel (string name, int port)
|
||||
{
|
||||
name = name;
|
||||
this.name = name;
|
||||
this.port = port;
|
||||
Init (null);
|
||||
}
|
||||
@@ -158,35 +118,32 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
return "tcp://" + host + ":" + port;
|
||||
}
|
||||
|
||||
public string[] GetUrlsForUri (string uri)
|
||||
{
|
||||
string [] result = new String [1];
|
||||
|
||||
if (uri.IndexOf ('/') != 0)
|
||||
result [0] = GetChannelUri () + "/" + uri;
|
||||
else
|
||||
result [0] = GetChannelUri () + uri;
|
||||
|
||||
return result;
|
||||
}
|
||||
public string[] GetUrlsForUri (string uri)
|
||||
{
|
||||
if (!uri.StartsWith ("/")) uri = "/" + uri;
|
||||
|
||||
string [] chnl_uris = channel_data.ChannelUris;
|
||||
string [] result = new String [chnl_uris.Length];
|
||||
|
||||
for (int i = 0; i < chnl_uris.Length; i++)
|
||||
result [i] = chnl_uris [i] + uri;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public string Parse (string url, out string objectURI)
|
||||
{
|
||||
int port;
|
||||
|
||||
string host = TcpChannel.ParseTcpURL (url, out objectURI, out port);
|
||||
|
||||
return "tcp://" + host + ":" + port;
|
||||
return TcpChannel.ParseChannelUrl (url, out objectURI);
|
||||
}
|
||||
|
||||
void WaitForConnections ()
|
||||
{
|
||||
while (true) {
|
||||
while (true)
|
||||
{
|
||||
TcpClient client = listener.AcceptTcpClient ();
|
||||
|
||||
sink.InternalProcessMessage (client.GetStream ());
|
||||
|
||||
client.Close ();
|
||||
ClientConnection reader = new ClientConnection (client, sink);
|
||||
ThreadPool.QueueUserWorkItem ( new WaitCallback( reader.ProcessMessages));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,6 +158,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
}
|
||||
|
||||
server_thread = new Thread (new ThreadStart (WaitForConnections));
|
||||
server_thread.IsBackground = true;
|
||||
server_thread.Start ();
|
||||
}
|
||||
}
|
||||
@@ -214,4 +172,53 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ClientConnection
|
||||
{
|
||||
TcpClient _client;
|
||||
TcpServerTransportSink _sink;
|
||||
Stream _stream;
|
||||
|
||||
byte[] _buffer = new byte[TcpMessageIO.DefaultStreamBufferSize];
|
||||
|
||||
public ClientConnection (TcpClient client, TcpServerTransportSink sink)
|
||||
{
|
||||
_client = client;
|
||||
_sink = sink;
|
||||
}
|
||||
|
||||
public Stream Stream
|
||||
{
|
||||
get { return _stream; }
|
||||
}
|
||||
|
||||
public byte[] Buffer
|
||||
{
|
||||
get { return _buffer; }
|
||||
}
|
||||
|
||||
public void ProcessMessages(object data)
|
||||
{
|
||||
_stream = _client.GetStream();
|
||||
|
||||
bool end = false;
|
||||
while (!end)
|
||||
{
|
||||
MessageType type = TcpMessageIO.ReceiveMessageType (_stream);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case MessageType.MethodMessage:
|
||||
_sink.InternalProcessMessage (this);
|
||||
break;
|
||||
|
||||
case MessageType.CancelSignal:
|
||||
end = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_stream.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 811 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user