mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 11:21:08 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af150fc45b | ||
|
|
074dd116b5 | ||
|
|
39bf505fc8 | ||
|
|
7fa479a7be | ||
|
|
0e72616dce | ||
|
|
62fe7b089e | ||
|
|
8e26f9cfaa | ||
|
|
50cf0a1d10 | ||
|
|
633d211e5f | ||
|
|
39fe36ae8c | ||
|
|
567c035fb3 | ||
|
|
922dfc4b3d | ||
|
|
467d6874aa | ||
|
|
ed65e24aa2 | ||
|
|
a0b63a3a2b | ||
|
|
2a71fad59b | ||
|
|
533db1f6d6 | ||
|
|
9a9a2552ee | ||
|
|
6a793a7e4c | ||
|
|
58da214495 | ||
|
|
8a9d0d3a6f | ||
|
|
27429d34b2 | ||
|
|
8a8571b55a | ||
|
|
1665b5b5f9 | ||
|
|
3ad554ae46 | ||
|
|
8b400082cd | ||
|
|
05d0acdf9c | ||
|
|
d051a5f14c | ||
|
|
1c829a1da6 | ||
|
|
38486c66a7 | ||
|
|
f6974a69f0 | ||
|
|
054a55eb8a | ||
|
|
64ccedaae1 | ||
|
|
f30a45aa81 | ||
|
|
f87fdfe28b | ||
|
|
991dcf3052 | ||
|
|
7fe8800db6 | ||
|
|
c524434bdd | ||
|
|
9499c0c0c8 | ||
|
|
61653dcf07 | ||
|
|
2692004c15 | ||
|
|
c63be4a417 | ||
|
|
cee7cd6432 | ||
|
|
389d8b96eb | ||
|
|
d8e2cf5a68 | ||
|
|
22b8e0ef8f | ||
|
|
c72c36abd3 | ||
|
|
faa9aa885a | ||
|
|
d5365829c9 | ||
|
|
9de46ebb4b | ||
|
|
b08ba63e3b | ||
|
|
c3ef3b2ace | ||
|
|
ce0b941981 | ||
|
|
06ef625369 | ||
|
|
e34de2a008 | ||
|
|
d2ab69888d | ||
|
|
b5443be6ef | ||
|
|
9d3742f8a4 | ||
|
|
e17a1613a0 | ||
|
|
93c137f414 | ||
|
|
a12f24d3c0 | ||
|
|
e0c104ea39 | ||
|
|
759613b0ac | ||
|
|
5c890a25c4 | ||
|
|
b23e7d5908 | ||
|
|
424c67c8bb | ||
|
|
63e87414b7 | ||
|
|
f44e10dcd8 | ||
|
|
320677a3a6 | ||
|
|
dce63b64e2 | ||
|
|
6869e30046 | ||
|
|
5bc5019876 | ||
|
|
ed209759fd | ||
|
|
934b45908c | ||
|
|
f3e6fb6faa | ||
|
|
cbf795e489 | ||
|
|
609e0fd746 | ||
|
|
791551a1fd | ||
|
|
30919f6c89 | ||
|
|
e78fe12a71 | ||
|
|
405da0cfc5 | ||
|
|
35993fc816 | ||
|
|
7fb9b61d1c | ||
|
|
82569adb9a | ||
|
|
c8aa8adc77 | ||
|
|
2c8ed7e761 | ||
|
|
cf3230844f | ||
|
|
625275d351 | ||
|
|
f7c08d45f1 | ||
|
|
400a0fa7f4 | ||
|
|
019038fb65 | ||
|
|
9e4b82f521 | ||
|
|
29b4a0ff4a | ||
|
|
b1ead8f0f2 | ||
|
|
d15008ab68 | ||
|
|
5db8a0e001 | ||
|
|
c47eee4306 | ||
|
|
d12ea80ba6 | ||
|
|
ea278b331e | ||
|
|
eccbfed148 | ||
|
|
63a3913c54 | ||
|
|
b519ef7ce6 | ||
|
|
519c2ff9d8 | ||
|
|
cabda218a6 | ||
|
|
461571d604 | ||
|
|
2f08aa2447 | ||
|
|
c00e025c5f | ||
|
|
70861f6802 | ||
|
|
a43c7989ec | ||
|
|
9b3b238e80 | ||
|
|
eb1f7e44e4 | ||
|
|
b3729fc348 | ||
|
|
bf80ac2e15 | ||
|
|
63a1712c15 | ||
|
|
b30142248e | ||
|
|
71edd83a6b | ||
|
|
7199ee1b4d | ||
|
|
d1e2aa5fdc | ||
|
|
8bc60e48ee | ||
|
|
f48935593a | ||
|
|
8e2f430fc2 | ||
|
|
6a93351136 | ||
|
|
cbb727d8dc | ||
|
|
9a5092bbee | ||
|
|
038e5f96d8 | ||
|
|
d4be0148c3 | ||
|
|
e52326b762 | ||
|
|
be4664bfd0 | ||
|
|
f319403eeb | ||
|
|
afc3976ea8 | ||
|
|
458fefebb6 | ||
|
|
3c16ab8283 | ||
|
|
9d016aac59 | ||
|
|
f84db0ed75 | ||
|
|
4c2f952e2a | ||
|
|
14f7406846 | ||
|
|
08f452120b | ||
|
|
195b057940 | ||
|
|
b38a5247f3 | ||
|
|
802e7403cf | ||
|
|
468247ced6 | ||
|
|
274cd4eda7 | ||
|
|
5d695895ac | ||
|
|
6cb20fa399 | ||
|
|
f19df41f5e | ||
|
|
367b81aaf4 | ||
|
|
15a3e9c890 | ||
|
|
7d92c99513 | ||
|
|
c594f230cf | ||
|
|
ca4f4a397b | ||
|
|
b432805a27 | ||
|
|
018693ef40 | ||
|
|
b6894a1307 | ||
|
|
9aeafd95af | ||
|
|
ee06e135c8 | ||
|
|
a04c232b3e | ||
|
|
5d9b5d08bd | ||
|
|
c5f312e69f | ||
|
|
e8f766b2d0 | ||
|
|
339c974710 | ||
|
|
9acaf39177 | ||
|
|
db46d9bb48 | ||
|
|
caff4ab4f8 | ||
|
|
d61d2446a4 | ||
|
|
27666e78b5 | ||
|
|
9a4aae931c | ||
|
|
0c3d101ecd | ||
|
|
7bce180acd | ||
|
|
54ef5d26ba | ||
|
|
5bfe0eb17a | ||
|
|
12333d1f7f | ||
|
|
c9bf6fa840 | ||
|
|
9bbc6450fc | ||
|
|
23febb4ea2 | ||
|
|
bdbe31026b | ||
|
|
c39d86416b | ||
|
|
5b2bf58553 | ||
|
|
fd80f4cdfc | ||
|
|
36eaf686cb | ||
|
|
a5cba8a3e3 | ||
|
|
c9bc4f563d | ||
|
|
4ca77be3da | ||
|
|
5ef1e904fb | ||
|
|
b5e6a5d22e | ||
|
|
a36d71f207 | ||
|
|
61c1751f80 | ||
|
|
4de507decf | ||
|
|
1369850277 | ||
|
|
e7f4a77902 | ||
|
|
625ea56d71 | ||
|
|
4e816d153a | ||
|
|
29bf951a72 | ||
|
|
0910896799 | ||
|
|
168b76ca33 | ||
|
|
b5ccf16341 | ||
|
|
3b01111157 | ||
|
|
13fb783d5b | ||
|
|
c266c087a4 | ||
|
|
ea109a812e | ||
|
|
00f5a2eba0 | ||
|
|
cdd7bc786f | ||
|
|
3149727e48 | ||
|
|
c33530bc3b | ||
|
|
6e78aacf25 | ||
|
|
f9b6b80ab6 | ||
|
|
ef2bd985e5 | ||
|
|
7696d1e767 | ||
|
|
81b702e529 | ||
|
|
6b4b5ae9a5 | ||
|
|
4120192ea8 | ||
|
|
8f0e2b6836 | ||
|
|
04c71cf0d5 | ||
|
|
abbbbc7d11 | ||
|
|
6b4ae03b74 | ||
|
|
62bc89081e | ||
|
|
3eaa5c2d63 | ||
|
|
1f157cb4ad | ||
|
|
f75a384f70 | ||
|
|
46d6dfb034 | ||
|
|
1c2178293d | ||
|
|
cb4a85bc52 | ||
|
|
cf9da09578 | ||
|
|
700a35e242 | ||
|
|
db7b2aedae | ||
|
|
3cd14aa403 | ||
|
|
ec9fff9c16 | ||
|
|
e0c265bf13 | ||
|
|
6066a833df | ||
|
|
a45fb7d0dd | ||
|
|
1c42fd434a | ||
|
|
4859527992 | ||
|
|
b1de14e921 | ||
|
|
40ecc595bd | ||
|
|
8812a5324c | ||
|
|
1ebf09aa60 | ||
|
|
0286ebabeb | ||
|
|
bf83c44486 | ||
|
|
4b65909094 | ||
|
|
eef3063430 | ||
|
|
df076b425e | ||
|
|
38acb564e2 | ||
|
|
dd293f9286 | ||
|
|
5183d6ce46 | ||
|
|
38a5aa982d | ||
|
|
1fba2759ab | ||
|
|
701e5820f5 | ||
|
|
b7b157b35f | ||
|
|
413ae473a2 | ||
|
|
4952c2784e | ||
|
|
d3eb53af10 | ||
|
|
0b75ca2f34 | ||
|
|
fc29499600 | ||
|
|
46ba39cb3d | ||
|
|
8608fd450b | ||
|
|
12c30fc7d0 | ||
|
|
d40bf981ff | ||
|
|
a5a71e6825 | ||
|
|
ef3498561e | ||
|
|
438589918c | ||
|
|
f28bc624e2 | ||
|
|
ade5563df2 | ||
|
|
713a3e3504 | ||
|
|
73cb06b006 | ||
|
|
cd51bc0dcb | ||
|
|
f41c8f9902 | ||
|
|
cd2202a560 | ||
|
|
a895772503 | ||
|
|
1c5ba012dc | ||
|
|
fade38c871 | ||
|
|
04ea508bdc | ||
|
|
28cb278275 | ||
|
|
7b58b1b3bb | ||
|
|
a44b234d20 | ||
|
|
8b0f7ee219 | ||
|
|
9fee09ffac | ||
|
|
ee9154981d | ||
|
|
3a33b3ba56 | ||
|
|
1c3dd3b6df | ||
|
|
b765c01c73 | ||
|
|
55d373bf50 | ||
|
|
0634bc55a0 | ||
|
|
f32be9e2a8 | ||
|
|
2333913863 | ||
|
|
095999edf6 | ||
|
|
fcb53f7590 | ||
|
|
c5c6a46391 | ||
|
|
4cd802dd52 | ||
|
|
3cb83f1d3d | ||
|
|
b5f7580177 | ||
|
|
ac452caaf9 | ||
|
|
26d07ded90 | ||
|
|
6fffa82897 | ||
|
|
11e86809aa | ||
|
|
d2956e133a | ||
|
|
8e1db7b828 | ||
|
|
1a378c36c1 | ||
|
|
3679c2cccd | ||
|
|
32fb04e4db | ||
|
|
882d73d1ef | ||
|
|
3c7955a400 | ||
|
|
c985d1e78c | ||
|
|
414efd30f5 | ||
|
|
f156f9d2ea | ||
|
|
72352ee097 | ||
|
|
164b21a807 | ||
|
|
765fac406a | ||
|
|
7c32d23891 | ||
|
|
91bec20178 | ||
|
|
dbf56967d4 | ||
|
|
9a98ae9f60 | ||
|
|
1df5bfa6af | ||
|
|
dc0069d613 | ||
|
|
d4230a9e74 | ||
|
|
8a345b1116 | ||
|
|
f1b1f7e4ba | ||
|
|
8caa7b8d52 | ||
|
|
cbb8889e88 | ||
|
|
5b63c14e0b | ||
|
|
d5f372534b | ||
|
|
1d4958553c | ||
|
|
b70d2281fe | ||
|
|
bb6d29529d | ||
|
|
10173bda94 | ||
|
|
f9f59ce84d | ||
|
|
58ddb1b9ba | ||
|
|
847ee2e84e | ||
|
|
5425d7f449 | ||
|
|
b3635f858f | ||
|
|
92c42d3786 | ||
|
|
bdbbb0be53 | ||
|
|
01f32373b8 | ||
|
|
9480735bae | ||
|
|
fd287fd437 | ||
|
|
7d9e544016 | ||
|
|
cf4a4ffef3 | ||
|
|
ba240dad7a | ||
|
|
c8f29d7894 | ||
|
|
460a3e16d5 | ||
|
|
fca8d10a1b | ||
|
|
87748c062d | ||
|
|
5285cef890 | ||
|
|
3165e9439e | ||
|
|
acf0ef2491 | ||
|
|
bc76f237ce | ||
|
|
03ae846ed8 | ||
|
|
a84ce70f07 | ||
|
|
3dcdffa3d3 | ||
|
|
0f13b99cc8 | ||
|
|
6b456c265a | ||
|
|
9d55c814e2 | ||
|
|
f1e7aca3bd | ||
|
|
842d08d4cd | ||
|
|
1cb4839fba | ||
|
|
55cf73a721 | ||
|
|
fda2c0b177 | ||
|
|
7d0dc9454e | ||
|
|
3d5d039e2b | ||
|
|
b1b2f7650f | ||
|
|
17e4f87593 | ||
|
|
6fc94963a6 | ||
|
|
d60339354e | ||
|
|
625ea07825 | ||
|
|
eef9493170 | ||
|
|
ea20055173 | ||
|
|
daa29c8628 | ||
|
|
69feb0bc36 | ||
|
|
3b35810755 | ||
|
|
377111edf3 | ||
|
|
8a0143f98d | ||
|
|
8fff972898 | ||
|
|
dbee5b2084 | ||
|
|
49c28c4b9d | ||
|
|
d0ff840f18 | ||
|
|
832b700015 | ||
|
|
8deab983f8 | ||
|
|
0557631ec0 | ||
|
|
cf61fe51ac | ||
|
|
c8ada60ec8 | ||
|
|
8ee5e23537 | ||
|
|
8e4f5881fe | ||
|
|
ccc79b094e | ||
|
|
cff7fa205b | ||
|
|
769a3265d6 | ||
|
|
eb94ad4da8 | ||
|
|
4e47010b48 | ||
|
|
0254c244a8 | ||
|
|
11d169f36a | ||
|
|
0b26f57d40 | ||
|
|
8bec3c50f3 | ||
|
|
ab2b985693 | ||
|
|
9e3aae2189 | ||
|
|
6d68675285 | ||
|
|
709cc26e5a | ||
|
|
7a05b14771 | ||
|
|
99db2d8223 | ||
|
|
50f4a53efb | ||
|
|
a57a294aa8 | ||
|
|
46efd171be | ||
|
|
8830ff436a | ||
|
|
3f0bdeb968 | ||
|
|
949cd9ebff | ||
|
|
2c58bb85f8 | ||
|
|
717d7681b2 | ||
|
|
5ab25f7d43 | ||
|
|
4c19878420 | ||
|
|
36bc87e690 | ||
|
|
1720d4fdce | ||
|
|
ba723ab1b1 | ||
|
|
7dee91aaf0 | ||
|
|
c5cb8b0cf2 | ||
|
|
eade2d863f | ||
|
|
c1f7631e75 | ||
|
|
0a86ce3801 | ||
|
|
6a3a172fa9 | ||
|
|
89b84291ca | ||
|
|
2bae10d749 | ||
|
|
7f0542b133 | ||
|
|
9f187b5dd0 |
No files matched your search
@@ -1,3 +1,6 @@
|
||||
2002-08-12 Dick Porter <[email protected]>
|
||||
|
||||
* mono.pc.in: Add $includedir to Cflags
|
||||
|
||||
Fri Jul 19 18:38:38 CEST 2002 Paolo Molaro <[email protected]>
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
AC_INIT(README)
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono, 0.12)
|
||||
AM_INIT_AUTOMAKE(mono, 0.13)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl ****************************************
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
|
||||
** Summary
|
||||
|
||||
<em>
|
||||
[This documentation is in progress. Comments to
|
||||
<a href="mailto:[email protected]">[email protected]</a>.]
|
||||
</em>
|
||||
|
||||
While using inline XML tags to document classes is certainly
|
||||
convenient, properly verbose documentation quickly overwhelms
|
||||
the code, making the source quite difficult to read. Furthermore,
|
||||
|
||||
+5
-5
@@ -30,18 +30,18 @@
|
||||
be browsed <a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?cvsroot=Mono#dirlist">here</a>
|
||||
|
||||
<a name="jun-7">
|
||||
<b>Mono 0.12</b>
|
||||
<b>Mono 0.13</b>
|
||||
|
||||
New packaged versions of the Mono C# compiler and Mono runtime
|
||||
are now available. The latest version is 0.12.
|
||||
are now available. The latest version is 0.13.
|
||||
|
||||
<ul>
|
||||
* <a href="archive/mono-0.12">Mono 0.12 release notes</a>
|
||||
* <a href="archive/mono-0.13">Mono 0.13 release notes</a>
|
||||
|
||||
* <a href="archive/mcs-0.12.tar.gz">mcs-0.12.tar.gz</a>
|
||||
* <a href="archive/mcs-0.13.tar.gz">mcs-0.13.tar.gz</a>
|
||||
Mono C# compiler with class library source code.
|
||||
|
||||
* <a href="archive/mono-0.12.tar.gz">mono-0.12.tar.gz</a>
|
||||
* <a href="archive/mono-0.13.tar.gz">mono-0.13.tar.gz</a>
|
||||
Mono runtime.
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<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>
|
||||
<a href="#ado">Mono and ADO.NET</a><br>
|
||||
<a href="#devel">Development Tools and Issues</a><br>
|
||||
<a href="#java">Mono and Java</a><br>
|
||||
<a href="#extending">Extending Mono</a><br>
|
||||
@@ -66,7 +67,7 @@ A: Mono contains a number of components useful for building new
|
||||
Windows has compilers that target the virtual machine from <a
|
||||
href="http://msdn.microsoft.com/net/thirdparty/default.asp#lang">a
|
||||
number of languages:</a> Managed C++, Java Script, Eiffel,
|
||||
Component Pascal, APL, Cobol, Oberon, Perl, Python, Scheme,
|
||||
Component Pascal, APL, Cobol, Perl, Python, Scheme,
|
||||
Smalltalk, Standard ML, Haskell, Mercury and Oberon.
|
||||
|
||||
The CLR and the Common Type System (CTS) enables applications and
|
||||
@@ -119,13 +120,13 @@ A: Different parts of Mono will achieve usability at different stages,
|
||||
which contains everything needed to develop applications with the base
|
||||
class libraries. This should be available at some point during 2002.
|
||||
|
||||
Other higher level class libraries (ASP.NET, ADO.NET, Windows.Forms) will
|
||||
Other higher level class libraries (ASP.NET, ADO.NET) will
|
||||
be released when they become stable.
|
||||
|
||||
Q: What major components will you include in Mono?
|
||||
|
||||
A: Hopefully everything that Microsoft ships on their Framework
|
||||
(ADO.NET, ASP.NET, Windows.Forms), and
|
||||
(ADO.NET, ASP.NET), and
|
||||
we encourage third party developers to create reusable components that
|
||||
work on both Mono and Windows.
|
||||
|
||||
@@ -242,6 +243,15 @@ Q: But will I be able to build GNOME applications?
|
||||
|
||||
A: Yes, we will enable people to write GNOME applications using Mono.
|
||||
|
||||
Q: Do you have C# bindings for GNOME?.
|
||||
|
||||
A: Yes, we currently bind libgnome, libgnomecanvas, and libgnomeui --
|
||||
although I dare say I have no idea how functional the bindings are
|
||||
outside of what I tested in the sample app. I imagine other libraries
|
||||
under the GNOME framework will be added on an as-needed (and as-requested)
|
||||
basis...although a truly good bonobo binding will have to wait on the CORBA
|
||||
remoting support which has been started recently.
|
||||
|
||||
<a name="gui"></a>
|
||||
** GUI applications
|
||||
|
||||
@@ -278,6 +288,17 @@ A: Try: mcs --unsafe -o HelloWorld.exe -r glib-sharp -r pango-sharp -r
|
||||
atk-sharp -r gdk-sharp -r gtk-sharp -r gdk-imaging-sharp
|
||||
HelloWorld.cs
|
||||
|
||||
Q: Is there any way how to connect DataAdapter to some GTK# controls?
|
||||
|
||||
A: There is a sample file called `DbClient' in gtk-sharp/samples that you
|
||||
might to look at. It is a sample program in Gtk# that adds/updates/deletes
|
||||
information on a Postgress database. When we have the new table/tree widgets,
|
||||
I am sure someone would write an adapter for System.Data (in Gtk2 the
|
||||
tree/list widgets are written using a view/model, so you only need to write
|
||||
a model that maps to the database). You can have a look at
|
||||
gtk-sharp/sample/DbClient, where there is a GTK# application that uses
|
||||
System.Data. It does not use DataAdapter, but DataReader though.
|
||||
|
||||
<a name="winforms"></a>
|
||||
** Mono and WinForms
|
||||
|
||||
@@ -417,6 +438,25 @@ A: No, it will not. Microsoft Office is a Windows application. To
|
||||
learn more about running Windows applications on Intel Unix systems
|
||||
refer to <a href="http://www.winehq.com">the Wine Project</a>.
|
||||
|
||||
Q: Will I be able to compile a Microsoft VB.NET application and execute
|
||||
the resultant MSIL file under MONO on Linux without converting to C#
|
||||
and recompiling?
|
||||
|
||||
A: Once we have a complete VisualBasic runtime, yes.
|
||||
|
||||
Q: Can mono run the WebMatrix ?
|
||||
|
||||
A: No. That requires winforms (we don't have).
|
||||
|
||||
Q: Does mono have something like Passport ? (ie PassportIdentity class,somewhere
|
||||
in System.Web ?) . Will mono have a server side Passport/Similar framework
|
||||
for XSP as well as client classes ?
|
||||
|
||||
A: Not yet, but the client side API for authentication is not the problem.
|
||||
We will likely have a lot of other authentication APIs, like the Liberty
|
||||
Aliance APIs. The problem is people on the web provider end that might use
|
||||
this for authentication.
|
||||
|
||||
<a name="pnpproject"></a>
|
||||
** Mono and Portable.NET
|
||||
|
||||
@@ -598,6 +638,81 @@ Q: Is there any way I can install a known working copy of mono in /usr,
|
||||
|
||||
A: Yes. Just use two installation prefixes.
|
||||
|
||||
Q: How should I write tests or a tests suite?
|
||||
|
||||
A: If you do a test suite for C#, you might want to keep it
|
||||
independent of the Mono C# compiler, so that other compiler
|
||||
implementations can later use it.
|
||||
|
||||
Q: Is the current stage the implementation of mono_create_trampoline
|
||||
function? Hence the sparc-codegen.h is reasonably complete? Is
|
||||
mono/arch/x86/* the best reference material for this stuff?
|
||||
|
||||
A: sparc-codegen.h is basically complete. We may want to add some
|
||||
convenience macros along the way, but it has all the stuff you need.
|
||||
And yes, or, the ppc/ dir, since the ppc call convention is more similar
|
||||
to the sparc one than the x86 one. The current issues with the sparc
|
||||
code are. roughly:
|
||||
1) it needs to handle overflowing the out registers (the additional
|
||||
arguments need to be put on the stack)
|
||||
2) it needs to flush the icache where the generated code is stored
|
||||
3) it needs to implement mono_create_method_pointer to get delegates
|
||||
working
|
||||
4) it needs a couple of updates (mono_method_pointer_get is no longer
|
||||
needed, for example)
|
||||
|
||||
Q: Would it be too terrible to have another corlib signed as mscorlib?
|
||||
|
||||
A: We rename corlib to mscorlib also when saving the PE files, in fact,
|
||||
the runtime can execute program created by mono just fine.
|
||||
|
||||
Q: How do I build corlib under Linux?
|
||||
|
||||
A: You can build your own (see the web site on how to get the mcs
|
||||
project from cvs), but in order to build them using mcs you need a
|
||||
set of working class libraries. After building the runtime (using
|
||||
mono-build.sh) get them from the nightly build and put them (and
|
||||
mcs.exe) in your mono/install/lib directory. Then you should be able
|
||||
to do: cd mcs, then: make -f makefile.gnu, then: cp mcs/mcs.exe
|
||||
class/lib/*.dll ../install/lib Also, you should know that you can
|
||||
either get your dose of DLLs from MonoCharge, or from
|
||||
http://primates.ximian.com/~miguel/runtime. MonoCharge is updated
|
||||
automatically, while the later is only updated when Miguel is around
|
||||
Once you have the DLLs, you can use `make -f makefile.gnu' as described
|
||||
before to self-host.
|
||||
|
||||
Q: Is there a relatively straightforward way to repeat the steps taken
|
||||
by Paolo to get Mono completely self-hosted on linux?
|
||||
|
||||
A: To build the compiler and class libraries in Linux, run:
|
||||
<ul><li>make -f makefile.gnu. To install them, run: </li>
|
||||
<li>make -f makefile.gnu install</li>
|
||||
<li>You can also specify a prefix:</li>
|
||||
<li>make -f makefile.gnu install prefix=/opt</li>
|
||||
</ul>
|
||||
If you want to produce and distribute a monocharge tarball, run:
|
||||
make -f makefile.gnu dist
|
||||
Of course you have to run these in the top level mcs directory.
|
||||
|
||||
Q: Is it possible to build a C# file to some sort of intermediate format which
|
||||
can linked into a final module, like the traditional .c -> .o -> .so path?
|
||||
|
||||
A: You could do: mcs /target:module file1.cs, mcs /target:module file2.cs,
|
||||
mcs /target:exe file1.dll file2.dll /out:mybin.exe
|
||||
|
||||
Q: Is there any plans for implementing remoting in the near future?, When will
|
||||
work in System.Runtime.Remoting.dll start?
|
||||
|
||||
A: The remoting infrastructure is in place. Some of the channels and
|
||||
formatters are not.
|
||||
|
||||
Q: I'm wondering if there are any plans to start using nant to build the
|
||||
class lib + test lib. i think that every project neeed/should use an
|
||||
automated build process and nant + a couple of tools enables this. is
|
||||
the problem that the compiler can't run nant yet?
|
||||
|
||||
A: Maybe well be doing some sort of automated build process + testing when
|
||||
the summer finish.
|
||||
|
||||
<a name="asp">
|
||||
** Mono and ASP.NET
|
||||
@@ -612,6 +727,41 @@ A: Yes. The development of the support for ASP.NET comes in various stages,
|
||||
our sample code with our classes with our runtime. This is the process
|
||||
we are following. Currently Gonzalo has reached point 5.
|
||||
|
||||
Q: Do I need install cygwin to work on ASP.NET in mono or Linux is enough since
|
||||
it is self host right now.
|
||||
|
||||
A: Linux is enough.
|
||||
|
||||
Q: Any plan to make ASP.NET in mono works with Apache in linux?.
|
||||
|
||||
A: Yes, we have plans to do so, but we need to wait for Patrik's patches to
|
||||
HttpRuntime. Once that is there, writing a mod_mono should be trivial
|
||||
(look at mono/samples/embed for a sample embedded application).
|
||||
|
||||
<a name="ado">
|
||||
** Mono and ADO.NET
|
||||
|
||||
Q: What is the status of ADO.NET support?. Could I start migrating
|
||||
applications from MS.NET to Mono?.
|
||||
|
||||
A: You could start right now using the ADO.NET support in mono, of course,
|
||||
if you want to help filling the missing gaps while you develop your app
|
||||
:-) Well, what I mean is that we're not that far to having full ADO.NET
|
||||
support in Mono, and we've got a lot of working things, so if we could
|
||||
get more help, we'd finish it really soon :-)
|
||||
|
||||
Q: In developing the data architecture for the application are there and
|
||||
objects I should stay away from in order to insure the smoothest possible
|
||||
transition (minimum code rewrite) to Mono's ADO.NET implementation? (For
|
||||
example, strongly typed datasets versus untyped datasets, etc...)
|
||||
|
||||
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 MS's
|
||||
implementation. We'll maybe provide extra classes to fix some things
|
||||
we've found missing while developing ADO.NET in Mono, but if you keep
|
||||
using the MS's System.Data classes, things will work out of the box with
|
||||
no changes (or at least that's the plan :-)
|
||||
|
||||
<a name="java">
|
||||
** Mono and Java
|
||||
|
||||
@@ -675,6 +825,12 @@ A: No. It is quite far from the philosophy of the project. The idea of Mono
|
||||
all prefer Suns original. But for Unix there don't exist a .NET-Framework.
|
||||
So it is possible, that in the future Mono is the standard .NET for unixes.
|
||||
|
||||
Q: Do you plan to implement a Javascript compiler?
|
||||
|
||||
A: Yes. Eto Demerzal has started a Rhino port to C#.
|
||||
After this is completed, we will begin developing
|
||||
the Javascript compiler.
|
||||
|
||||
<a name="extending"></a>
|
||||
** Extending Mono
|
||||
|
||||
@@ -774,6 +930,17 @@ Q: If I were about to start a Mono port to IA-64,would the same lburg code
|
||||
A: The lburg approach can be use for any processor architecture. But you might
|
||||
think in another better approach.
|
||||
|
||||
Q: Do you plan to port Rhino to C#?.
|
||||
|
||||
A: Eto Demerzal has started a Rhino port to C#.
|
||||
|
||||
Q: Has anyone succeeded in building a Mac version of the C# environment.
|
||||
If so can you explain how?
|
||||
|
||||
A: You could try to check with the Darwin people, or the Fink people.
|
||||
Mono/C# is self hosting on Linux/PPC which is the hard part, so it
|
||||
should be relatively simple to get it to work on macos
|
||||
|
||||
<a name="reuse"></a>
|
||||
** Reusing Existing Code
|
||||
|
||||
@@ -989,3 +1156,26 @@ Q: Does mcs support the same command line options as the MS C#
|
||||
|
||||
A: The Mono C# compiler on CVS now supports the same command line
|
||||
arguments as the Microsoft C# compiler does.
|
||||
|
||||
Q: I am thinking about making a VS.NET solution and include as
|
||||
projects both the library and the System.Xml.dll project
|
||||
file: is that the best way (sure at the beginning, when the
|
||||
compiler was not self hosting, you made something similar...)?
|
||||
|
||||
A: Jason and Krall did check in VS.NET files that you can use
|
||||
to compile our System.XML and even to run the System.XML tests
|
||||
(which is way cool, and way simple).
|
||||
|
||||
Q: How about getting searchable archives on lists.ximian.com?
|
||||
|
||||
A: You mean like http://www.go-mono.com/mailing-lists.html?
|
||||
|
||||
Q: I downloaded the lastest snapshot and did a make and make install on
|
||||
mono which ran normal but when I tried to do the same with mcs it
|
||||
errored out with a message saying Mono and Runtime out of sync.
|
||||
|
||||
A: You need to compile first the class libraries and install them with your
|
||||
existing compiler and then the runtime.
|
||||
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
* Mono Hackers Hall Of Fame
|
||||
|
||||
Without the help, the skills and the time of many passionate developers outside of
|
||||
the Ximian Mono team, Mono would not be where it is today.
|
||||
|
||||
Many of them do it for fun, some do it because they really want a nice CLR they
|
||||
can hack on, some do it because they need a working solution to some development
|
||||
issues and mono is the ideal tool for the job.
|
||||
|
||||
Some of them may start contributing because they want a mention in the
|
||||
<b>Mono Hackers Hall Of Fame</b>! Whatever the cause, join us in a big<br>
|
||||
<h1 align="center">Thank you!</h1>
|
||||
|
||||
* Mono Hackers
|
||||
|
||||
** Nick Drochak
|
||||
|
||||
The first, deserved, entry in the <b>Mono Hackers Hall Of Fame</b> is for
|
||||
Nick Drochak, who joined us in the first days of Mono and built the testing
|
||||
infrastructure for the C# assemblies, fixed tons of bugs and even adventured
|
||||
himself in the lands of the C runtime. His work is invaluable for keeping
|
||||
Mono on the right track through the daily changes in the codebase.
|
||||
|
||||
@@ -80,12 +80,135 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<b>Mono at the O'Reilly Open Source Conference (<a
|
||||
href="http://conferences.oreillynet.com/cs/os2002/view/e_sess/2994">here</a>
|
||||
and <a
|
||||
href="http://conferences.oreillynet.com/cs/os2002/view/e_sess/2996">here</a>)</b>
|
||||
<b>Mono Talks:</b>
|
||||
|
||||
@item Jul 23rd, 2002
|
||||
<b>Valencia</b>: August 8th.
|
||||
|
||||
<b>Hong Kong:</b> August 10th. If you live in Hong
|
||||
Kong, come see Duncan Mak talk about the Mono project.
|
||||
Details are <a
|
||||
href="http://linux.org.hk/org/event/200208-talk/">here</a>
|
||||
|
||||
<b>San Francisco</b>: August 14th. Linux World Expo.
|
||||
|
||||
@item Aug 13th, 2002: MCS news, Gtk# progress, Windows.Forms, ADO.NET
|
||||
|
||||
Martin Baulig has been fixing all the known bugs in the C#
|
||||
compiler and now has moved into improving the compilation
|
||||
speed and the generated code quality of MCS. Today we got a
|
||||
50% speedup in the bootstrap of MCS going from 24 seconds to 12 seconds.
|
||||
|
||||
Gtk# has been making a lot of progress, some interesting
|
||||
corner cases are now supported:, you can now create canvas items as
|
||||
well as using the tree widget. Here is a shot of <a
|
||||
href="images/mocil.png">MonoCIL</a>.
|
||||
|
||||
On the runtime front, focus has been on improving remoting
|
||||
support, exception handling, as well as completing the support
|
||||
for structure marshaling.
|
||||
|
||||
Patrik is also back in action: the HttpRuntime infrastructure
|
||||
is rapidly improving, and Gonzalo is working into moving XSP
|
||||
into our main class library and providing the missing pieces
|
||||
to integrate with Patrik's code.
|
||||
|
||||
Dennis and his team are working on a WineLib-based
|
||||
implementation of Windows Forms to guarantee that the corner
|
||||
cases of Windows.Forms can be handled, and we are back on track again.
|
||||
|
||||
A lot more work on the ADO.NET and WebServices has also been
|
||||
checked into CVS.
|
||||
|
||||
@item Aug 1st, 2002: Mono Hackers Hall of Fame
|
||||
|
||||
The <a href="hackers.html">Mono Hackers Hall Of Fame</a> has been started
|
||||
to show our appreciation to the excellent contributors that made <b>mono::</b>
|
||||
a successful free software project.
|
||||
|
||||
The first, deserved, entry goes to
|
||||
Nick Drochak, who joined us in the first days of Mono and built the testing
|
||||
infrastructure for the C# assemblies, fixed tons of bugs and even adventured
|
||||
himself in the lands of the C runtime. His work is invaluable for keeping
|
||||
Mono on the right track through the daily changes in the codebase.
|
||||
|
||||
@item Looking for volunteers
|
||||
|
||||
We are looking for volunteers to help complete various pieces
|
||||
of Mono and help move the project forward, we need
|
||||
contributions to:
|
||||
|
||||
<ul>
|
||||
* More tests to the existing class libraries.
|
||||
|
||||
* Finish existing class libraries, check our <a
|
||||
href="class-status.html">class status</a> pages to see
|
||||
all the missing things. There are open tasks all over
|
||||
the place: XML, Database access, enterprise services,
|
||||
configuration, ASP.NET, Drawing APIs, and more.
|
||||
|
||||
* Since we have now ASP.NET running, we would like to
|
||||
create an ASP.NET application to maintain our class
|
||||
library documentation.
|
||||
|
||||
We have some special needs (read them <a
|
||||
href="classlib-doc.html">here</a>). There is a
|
||||
prototype written using Windows.Forms, but we believe
|
||||
it will be faster to have this done using ASP.NET (and
|
||||
it is also a nice way of stress testing it).
|
||||
|
||||
* Support for the VB runtime: we need contributions
|
||||
to make our VB runtime mature enough to host
|
||||
applications compiled with the VB.NET to run with
|
||||
Mono.
|
||||
|
||||
* We need people to help write the documentation: you
|
||||
can start editing our XML files by hand, and once we
|
||||
have the ASP.NET tool, upgrade to that.
|
||||
</ul>
|
||||
|
||||
@item July 31st, 2002: Flow Analysis
|
||||
|
||||
Martin has checked into CVS the data flow analysis patch for
|
||||
MCS, this means that we now correctly implement definite
|
||||
assignment in the C# language.
|
||||
|
||||
@item Jul 31st, 2002: Most ASP.NET controls render, Gtk# structs.
|
||||
|
||||
Gonzalo <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2002-August/001234.html">posted
|
||||
an update</a> on the ASP.NET widgets that are still pending. Patrik is back, and he is
|
||||
working with Gonzalo to streamline the pipeline
|
||||
|
||||
Rachel quietly commited to Gtk-Sharp support for marshaling
|
||||
structures (very important for Gtk#). This uses extensively
|
||||
the new marshaling code that Dietmar added to the runtime.
|
||||
|
||||
Dietmar is also now sharing more code for P/Invoke using his
|
||||
intermediate representation. Another step to share more code, and
|
||||
simplify the porting and maintenance process.
|
||||
|
||||
@item Jul 27th, 2002: NGEN tool for Mono.
|
||||
|
||||
Zoltan <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2002-July/001117.html">announced</a>
|
||||
the availability of his CIL to C compiler. This allows your Mono assemblies to be pre-compiled
|
||||
and optimized by GCC in your platform, increasing the speed significantly of your code.
|
||||
|
||||
@item Jul 26th, 2002: Mono 0.13 has been released.
|
||||
|
||||
<b>Mono 0.13 has been released!</b> (details <a
|
||||
href="archive/mono-0.13">here</a>). Get
|
||||
your sources for the <a
|
||||
href="archive/mono-0.13.tar.gz">runtime</a> and
|
||||
<a href="archive/mcs-0.13.tar.gz">compiler and class libraries</a>.
|
||||
<p>
|
||||
Alp made Debian packages and they are <a
|
||||
href="http://www.atoker.com/mono/">here</a>. Cristophe made
|
||||
packages for Red Hat and they are <a
|
||||
href="http://mono.baselabs.org/software">here</a>.
|
||||
And Windows packages have been <a href="http://www.superin.formativ.net/mono/mono.htm">contributed</a>
|
||||
|
||||
@item Jul 23rd, 2002: Mono Verifier, System.Web.Services, ASP.NET samples.
|
||||
|
||||
Mono now has a verifier. It is used by the runtime, or you can invoke it manually to
|
||||
verify an image by using the `pedump' tool.
|
||||
@@ -97,15 +220,15 @@
|
||||
|
||||
Various samples for ASP.NET have landed in CVS.
|
||||
|
||||
@item Jul 20th, 2002
|
||||
@item Jul 20th, 2002: Spanish Mono Tutorial.
|
||||
|
||||
A spanish tutorial on using Mono is <a
|
||||
href="http://www.es.gnome.org/documentacion/articulos/mono-linux/mono-linux/t1.html">here</a>.
|
||||
href="http://mono.es.gnome.org/tutoriales/mono-linux/">here</a>.
|
||||
Also the <a
|
||||
href="http://www.es.gnome.org/documentacion/articulos/MONO-PUF/MONO-PUF/">FAQ</a>
|
||||
href="http://mono.es.gnome.org/tutoriales/mono-puf/">FAQ</a>
|
||||
has been translated as well.
|
||||
|
||||
@item Jul 19th, 2002
|
||||
@item Jul 19th, 2002: File handle redirection, Embeddable Mono and Mono Linux compilation.
|
||||
|
||||
Dick's code for file handle redirection is complete and has
|
||||
now landed on the CVS repository.
|
||||
@@ -192,41 +315,6 @@
|
||||
port the JITer to new architectures, and that our trampoline
|
||||
code is cross platform.
|
||||
|
||||
@item Looking for volunteers
|
||||
|
||||
We are looking for volunteers to help complete various pieces
|
||||
of Mono and help move the project forward, we need
|
||||
contributions to:
|
||||
|
||||
<ul>
|
||||
* More tests to the existing class libraries.
|
||||
|
||||
* Finish existing class libraries, check our <a
|
||||
href="class-status.html">class status</a> pages to see
|
||||
all the missing things. There are open tasks all over
|
||||
the place: XML, Database access, enterprise services,
|
||||
configuration, ASP.NET, Drawing APIs, and more.
|
||||
|
||||
* Since we have now ASP.NET running, we would like to
|
||||
create an ASP.NET application to maintain our class
|
||||
library documentation.
|
||||
|
||||
We have some special needs (read them <a
|
||||
href="classlib-doc.html">here</a>). There is a
|
||||
prototype written using Windows.Forms, but we believe
|
||||
it will be faster to have this done using ASP.NET (and
|
||||
it is also a nice way of stress testing it).
|
||||
|
||||
* Support for the VB runtime: we need contributions
|
||||
to make our VB runtime mature enough to host
|
||||
applications compiled with the VB.NET to run with
|
||||
Mono.
|
||||
|
||||
* We need people to help write the documentation: you
|
||||
can start editing our XML files by hand, and once we
|
||||
have the ASP.NET tool, upgrade to that.
|
||||
</ul>
|
||||
|
||||
@item Jul 9th, 2002
|
||||
|
||||
Ajay was the first to notice <a
|
||||
@@ -355,10 +443,63 @@
|
||||
A big thanks goes to Dennis Hayes for getting the
|
||||
Windows.Forms work together, and commiting so many stubs for Windows.Forms.
|
||||
|
||||
@item Jun 25, 2002
|
||||
|
||||
I am updating the Mono site from the Unesco offices in
|
||||
Uruguay, the <a href="http://www.gnome.org/resources/calendar/roadshow/GNOMEenelSur.html">South-America trip</a>
|
||||
to promote free software is going very well.
|
||||
|
||||
Many news in Mono-land this week so far:
|
||||
|
||||
Mike Kestner got bindings for GtkHTML last night for Gtk#,
|
||||
this is using GtkHTML 2.0.
|
||||
|
||||
On Monday Piers Haken <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2002-June/000380.html">contributed</a>
|
||||
the core to support XPath in Mono: most of the w3c spec is
|
||||
implemented (modulo a few pending bits).
|
||||
|
||||
Dick checked in his implementation of the Process classes:
|
||||
process forking and waiting support committed, with some functions to
|
||||
query status. This was complex as we had to emulate the Win32
|
||||
environment, but this is another step to be fully compatible.
|
||||
This means for example that any process can check on the
|
||||
status of any other process (without the parent/child relationship)
|
||||
|
||||
Of course, those interested
|
||||
in only the Unix semantics can always P/Invoke the Unix calls.
|
||||
|
||||
@item Jun 24, 2002
|
||||
|
||||
|
||||
Duncan has written a few sample <a
|
||||
href="http://primates.ximian.com/~duncan/Mono">gtk# demo apps</a>..
|
||||
href="http://primates.ximian.com/~duncan/Mono">Gtk# demo
|
||||
applications</a> (<a
|
||||
href="http://primates.ximian.com/~duncan/Mono/img/ImageViewer.png">screen
|
||||
shot</a>, <a
|
||||
href="http://primates.ximian.com/~duncan/Mono/img/ImageBrowser.png">another</a>)
|
||||
|
||||
Rachel also got the beginning of Gnome bindings (<a
|
||||
href="http://primates.ximian.com/~tvgm/gnome-hello.png">screenshot</a>).
|
||||
She also got some <a
|
||||
href="http://primates.ximian.com/~tvgm/gtk-sharp-docs/">documentation</a>
|
||||
up now.
|
||||
|
||||
@item Jun 22, 2002
|
||||
|
||||
Mono's ASP.NET has rendered its first page on Linxu for the
|
||||
first time (Gonzalo and Paolo).
|
||||
|
||||
Also, we are getting close to
|
||||
self hosting. Paolo posted a <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2002-June/000345.html">list
|
||||
of pending issues</a> which are now very small.
|
||||
|
||||
Steam is picking up in <a
|
||||
href="http://gtk-sharp.sf.net">Gtk#</a> as the bindings become more
|
||||
complete and small applications are starting to emerge. Gtk#
|
||||
now compiles completely on Linux. This uses a lot of the XML
|
||||
libraries, which is nice to see.
|
||||
|
||||
@item Jun 20, 2002
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@
|
||||
** Delta Forth
|
||||
|
||||
The Delta Forth.NET project: <a
|
||||
href="http://www.codeproject.com/dotnet/dforthnet.asp">Home
|
||||
href="www.dataman.ro/dforth">Home
|
||||
Page</a> and <a href="http://www.dataman.ro/dforth/index.html">more
|
||||
details here</a>.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Most of the mailing lists are in english, but there is also
|
||||
Mono Hispano that has lists in Spanish. <a
|
||||
href="http://www.es.gnome.org/mailman/listinfo/mono-hispano">Mono Hispano list</a>
|
||||
href="http://mono.es.gnome.org/mailman/listinfo/mono-hispano">Mono Hispano list</a>
|
||||
|
||||
There are a number of mailing lists for Mono in English:
|
||||
|
||||
|
||||
+33
-6
@@ -1,9 +1,36 @@
|
||||
* Mono for beginners
|
||||
|
||||
Hinne Hettema has provided us a beautiful and complete
|
||||
document on how to obtain, install and test Mono on
|
||||
a Linux system.
|
||||
Hinne Hettema and Jaime Anguiano Olarra are providing us with
|
||||
nice and complete set of documents (HOWTOs) about how to install,
|
||||
configure, run and test the software developed by the Mono Project.
|
||||
|
||||
You can read them online, get PDF versions or get the XML sources.
|
||||
|
||||
|
||||
HTML Format (read it online)
|
||||
|
||||
For <a href="mono-beginning/t1.html">RPM Linux based systems</a>
|
||||
|
||||
For <a href="mono-beginning-windows/t1.html">Microsoft Windows</a>
|
||||
|
||||
|
||||
PDF Format
|
||||
|
||||
For <a href="mono-beginning.pdf">RPM Linux based systems</a>
|
||||
|
||||
For <a href="mono-beginning-windows.pdf">Microsoft Windows</a>
|
||||
|
||||
|
||||
XML Source
|
||||
|
||||
For <a href="mono-beginning.xml">RPM Linux based systems</a>
|
||||
|
||||
For <a href="mono-beginning-windows.xml">Microsoft Windows</a>
|
||||
|
||||
|
||||
Currently Hinne is working on a Mono Tools HOWTO. Which will be
|
||||
very useful for the hackers that would like to get in touch with
|
||||
Mono and Jaime is working out a Mono Beginning HOWTO for Debian
|
||||
users.
|
||||
|
||||
|
||||
You can <a href="mono-beginning/t1.html">Read it online</a>,
|
||||
download a <a href="mono-beginning.pdf">PDF</a> version, or get the
|
||||
<a href="mono-beginning.xml">source code</a> for it.
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,28 +3,31 @@
|
||||
|
||||
** Status
|
||||
|
||||
It passes and compiles the same amount of mono tests as on the x86 architecture.
|
||||
It passes and compiles the same amount of mono tests as on the x86 architecture.
|
||||
|
||||
mcs is self hosting on Linux/PPC.
|
||||
|
||||
** To do
|
||||
mcs is self hosting on Linux/PPC.
|
||||
|
||||
*** Interpreter
|
||||
|
||||
Up to date.
|
||||
Up to date.
|
||||
|
||||
*** Jitter
|
||||
|
||||
Start the port
|
||||
Start the port
|
||||
|
||||
** Documentation
|
||||
|
||||
<B>PowerPC architecture:</B>
|
||||
*** PowerPC architecture:
|
||||
|
||||
<A HREF="http://e-www.motorola.com/brdata/PDFDB/docs/MPCFPE32B.pdf">PowerPC Programming environments manual</A><BR>
|
||||
<A HREF="http://e-www.motorola.com/brdata/PDFDB/docs/MPC7410UM.pdf">G4 (7410) User's manual</A>
|
||||
|
||||
<B>Calling conventions:</B>
|
||||
There's a very nice introduction to PowerPC assembly language
|
||||
at <a
|
||||
href="http://www-106.ibm.com/developerworks/library/l-ppc/">http://www-106.ibm.com/developerworks/library/l-ppc/</a>.
|
||||
|
||||
*** Calling conventions:
|
||||
|
||||
<a href="http://www.esofta.com/softspecs.html">The PowerPC SystemV ABI specification</a>
|
||||
|
||||
<add me>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
1,CVS access,ccvs.html,ccvs.src
|
||||
1,AnonCVS access,anoncvs.html,anoncvs.src
|
||||
0,Contributing,contributing.html,contributing.src
|
||||
1,Hackers,hackers.html,hackers.src
|
||||
1,Documentation,documentation.html,documentation.src
|
||||
1,Class Docs,classlib-doc.html,classlib-doc.src
|
||||
1,Doc format,monodoc-xml.html,monodoc-xml.src
|
||||
|
||||
+15
-2
@@ -26,6 +26,7 @@ OBJECTS= \
|
||||
deploy/download.html \
|
||||
deploy/faq.html \
|
||||
deploy/gcc-frontend.html \
|
||||
deploy/hackers.html \
|
||||
deploy/index.html \
|
||||
deploy/ideas.html \
|
||||
deploy/java.html \
|
||||
@@ -35,7 +36,6 @@ OBJECTS= \
|
||||
deploy/languages.html \
|
||||
deploy/mailing-lists.html \
|
||||
deploy/mono-beginning.html \
|
||||
deploy/mono-beginning-xml.html \
|
||||
deploy/mono-contribution-howto.html \
|
||||
deploy/monodoc-xml.html \
|
||||
deploy/papers.html \
|
||||
@@ -62,9 +62,12 @@ NON_HTML_SOURCES= \
|
||||
all: $(OBJECTS) deploy/index.rss
|
||||
perl process.pl commands template.html.in deploy
|
||||
|
||||
tutorial: mono-beginning.html.stamp mono-beginning.pdf
|
||||
tutorial: mono-beginning.html.stamp mono-beginning.pdf
|
||||
cp -a mono-beginning mono-beginning.xml mono-beginning.pdf deploy
|
||||
|
||||
tutorial-windows: mono-beginning-windows.html.stamp mono-beginning-windows.pdf
|
||||
cp -a mono-beginning-windows.xml mono-beginning-windows.pdf deploy
|
||||
|
||||
mono-beginning.html.stamp: mono-beginning.xml
|
||||
db2html mono-beginning.xml
|
||||
touch mono-beginning.html.stamp
|
||||
@@ -75,6 +78,16 @@ mono-beginning.pdf: mono-beginning.xml
|
||||
mono-beginning.xml: ../mono-beginning.xml
|
||||
cp ../mono-beginning.xml .
|
||||
|
||||
mono-beginning-windows.html.stamp: mono-beginning-windows.xml
|
||||
db2html mono-beginning-windows.xml
|
||||
touch mono-beginning-windows.html.stamp
|
||||
|
||||
mono-beginning-windows.pdf: mono-beginning-windows.xml
|
||||
db2pdf mono-beginning-windows.xml
|
||||
|
||||
mono-beginning-windows.xml: ../mono-beginning-windows.xml
|
||||
cp ../mono-beginning-windows.xml .
|
||||
|
||||
deploy/index.rss: mono-rss.exe ../index
|
||||
./mono-rss.exe ../index deploy/index.rss
|
||||
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
EXTRA_DIST = gc-issues jit-thoughts object-layout unmanaged-calls \
|
||||
exceptions jit-trampolines stack-alignment
|
||||
exceptions jit-trampolines stack-alignment embedded-api
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
|
||||
Embedding the Mono runtime, preliminary version
|
||||
|
||||
Miguel de Icaza, Paolo Molaro.
|
||||
|
||||
This document describes how to embed the Mono runtime in your
|
||||
application, and how to invoke CIL methods from C, and how to
|
||||
invoke C code from CIL.
|
||||
|
||||
* Embedding the runtime.
|
||||
|
||||
Embedding the runtime consists of various steps:
|
||||
|
||||
* Compiling and linking the Mono runtime
|
||||
|
||||
* Initializing the Mono runtime
|
||||
|
||||
* Optionally expose C code to the C#/CIL universe.
|
||||
|
||||
These are discussed in detail next.
|
||||
|
||||
** Compiling and Linking
|
||||
|
||||
To embed the runtime, you have to link your code against the
|
||||
Mono runtime libraries. To do this, you want to pass the
|
||||
flags returned by pkg-config to your compiler:
|
||||
|
||||
pkg-config --cflags --libs mono
|
||||
|
||||
Like this:
|
||||
|
||||
gcc sample.c `pkg-config --cflags --libs mono`
|
||||
|
||||
You can separate the compilation flags from the linking flags, for
|
||||
instance, you can use the following macros in your makefile:
|
||||
|
||||
CFLAGS=`pkg-config --cflags mono`
|
||||
LDFLAGS=`pkg-config --libs mono`
|
||||
|
||||
** Initializing the Mono runtime
|
||||
|
||||
To initialize the runtime, call mono_jit_init, like this:
|
||||
|
||||
MonoDomain *domain;
|
||||
|
||||
domain = mono_jit_init ("domain-name");
|
||||
|
||||
That will return a MonoDomain where your code will be
|
||||
executed. You can create multiple domains. Each domain is
|
||||
isolated from the other domains and code in one domain will
|
||||
not interfere with code in other domains. This is useful if
|
||||
you want to host different applications in your program.
|
||||
|
||||
Then you can load an assembly containing code into the domain:
|
||||
|
||||
MonoAssembly *assembly;
|
||||
|
||||
assembly = mono_domain_assembly_open ("file.dll");
|
||||
if (!assembly)
|
||||
error ();
|
||||
|
||||
In the above example, the contents of `file.dll' will be
|
||||
loaded into the domain. This only loads the code, but it will
|
||||
not execute anything yet. You can replace `file.dll' with
|
||||
another transport file, like `file.exe'
|
||||
|
||||
To start executing code, you must invoke a method in the
|
||||
assembly, or if you have provided a static Main method (an
|
||||
entry point), you can use the convenience function:
|
||||
|
||||
retval = mono_jit_exec (domain, assembly, argc - 1, argv + 1);
|
||||
|
||||
If you want to invoke a different method, look at the
|
||||
`Invoking Methods in the CIL universe' section later on.
|
||||
|
||||
** Shutting down the runtime
|
||||
|
||||
To shutdown the Mono runtime, you have to clean up all the
|
||||
domains that were created, use this function:
|
||||
|
||||
mono_jit_cleanup (domain);
|
||||
|
||||
* Exposing C code to the CIL universe
|
||||
|
||||
The Mono runtime provides two mechanisms to expose C code to
|
||||
the CIL universe: internal calls and native C code. Internal
|
||||
calls are tightly integrated with the runtime, and have the
|
||||
least overhead, as they use the same data types that the
|
||||
runtime uses.
|
||||
|
||||
The other option is to use the Platform Invoke (P/Invoke) to
|
||||
call C code from the CIL universe, using the standard P/Invoke
|
||||
mechanisms.
|
||||
|
||||
To register an internal call, use this call in the C code:
|
||||
|
||||
mono_add_internal_call ("Hello::Sample", sample);
|
||||
|
||||
Now, you need to declare this on the C# side:
|
||||
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
class Hello {
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern static string Sample ();
|
||||
}
|
||||
|
||||
Since this routine returns a string, here is the C definition:
|
||||
|
||||
static MonoString*
|
||||
Sample ()
|
||||
{
|
||||
return mono_string_new (mono_domain_get (), "Hello!");
|
||||
}
|
||||
|
||||
Notice that we have to return a `MonoString', and we use the
|
||||
`mono_string_new' API call to obtain this from a string.
|
||||
|
||||
* Invoking Methods in the CIL universe
|
||||
|
||||
Calling a method in the CIL universe from C requires a number of steps:
|
||||
|
||||
* Obtaining the MonoMethod handle to the method.
|
||||
|
||||
* The method invocation.
|
||||
|
||||
** Obtaining a MonoMethod
|
||||
|
||||
To get a MonoMethod there are several ways.
|
||||
|
||||
You can get a MonoClass (the structure representing a type)
|
||||
using:
|
||||
|
||||
MonoClass *
|
||||
mono_class_from_name (MonoImage *image, const char* name_space, const char *name);
|
||||
|
||||
and then loop in the returned class method array until you get
|
||||
the one you're looking for. There are examples of such
|
||||
searches as static functions in several C files in
|
||||
metadata/*.c: we need to expose one through the API and remove
|
||||
the duplicates.
|
||||
|
||||
The other, simpler, way is to use the functions in
|
||||
debug-helpers.h: there are examples of their use in monograph,
|
||||
mint and the jit as well. You basically use a string
|
||||
description of the method, like:
|
||||
|
||||
"System.Object:GetHashCode()"
|
||||
|
||||
and create a MonoMethodDesc out of it with:
|
||||
|
||||
MonoMethodDesc* mono_method_desc_new (const char *name, gboolean include_namespace);
|
||||
|
||||
You can then use:
|
||||
|
||||
MonoMethod* mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass);
|
||||
MonoMethod* mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image);
|
||||
|
||||
to search for the method in a class or in an image. You would
|
||||
tipically do this just once at the start of the program and
|
||||
store the result for reuse somewhere.
|
||||
|
||||
** Invoking a Method
|
||||
|
||||
There are two functions to call a managed method:
|
||||
|
||||
MonoObject*
|
||||
mono_runtime_invoke (MonoMethod *method, void *obj, void **params,
|
||||
MonoObject **exc);
|
||||
and
|
||||
MonoObject*
|
||||
mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
|
||||
MonoObject **exc);
|
||||
|
||||
obj is the 'this' pointer, it should be NULL for static
|
||||
methods, a MonoObject* for object instances and a pointer to
|
||||
the value type for value types.
|
||||
|
||||
The params array contains the arguments to the method with the
|
||||
same convention: MonoObject* pointers for object instances and
|
||||
pointers to the value type otherwise. The _invoke_array
|
||||
variant takes a C# object[] as the params argument (MonoArray
|
||||
*params): in this case the value types are boxed inside the
|
||||
respective reference representation.
|
||||
|
||||
From unmanaged code you'll usually use the
|
||||
mono_runtime_invoke() variant.
|
||||
|
||||
Note that this function doesn't handle virtual methods for
|
||||
you, it will exec the exact method you pass: we still need to
|
||||
expose a function to lookup the derived class implementation
|
||||
of a virtual method (there are examples of this in the code,
|
||||
though).
|
||||
|
||||
You can pass NULL as the exc argument if you don't want to
|
||||
catch exceptions, otherwise, *exc will be set to the exception
|
||||
thrown, if any. if an exception is thrown, you can't use the
|
||||
MonoObject* result from the function.
|
||||
|
||||
If the method returns a value type, it is boxed in an object
|
||||
reference.
|
||||
|
||||
We have plans for providing an additional method that returns
|
||||
an unmanaged->managed thunk like this:
|
||||
|
||||
void* mono_method_get_unmanaged_thunk (MonoMethod *method);
|
||||
|
||||
You'll be able to store the returned pointer in a function
|
||||
pointer with the proper signature and call that directly from
|
||||
C:
|
||||
|
||||
typedef gint32 (*GetHashCode) (MonoObject *obj);
|
||||
|
||||
GetHashCode func = mono_method_get_unmanaged_thunk (System_Object_GetHashCode_method);
|
||||
|
||||
gint32 hashvalue = func (myobject);
|
||||
|
||||
It may not be possible to manage exceptions in that case,
|
||||
though. I need to think more about it.
|
||||
|
||||
* Samples
|
||||
|
||||
See the sample programs inmono/sample/embed for examples of
|
||||
embedding the Mono runtime in your application.
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
Runtime support for Remoting
|
||||
============================
|
||||
|
||||
The runtime supports a special objects called "TransparentProxy". You can
|
||||
create objects of this type by calling GetTransparentProxy() on a "RealProxy"
|
||||
object.
|
||||
|
||||
LDFLD/STFLD for transparent proxies
|
||||
===================================
|
||||
|
||||
Access to fields must be redirected to the remote object. System.Object has
|
||||
some special methods for that:
|
||||
|
||||
void FieldGetter (string typeName, string fieldName, ref object val);
|
||||
|
||||
void FieldSetter (string typeName, string fieldName, object val);
|
||||
|
||||
This methods are never called on actual object. The are only used to pack
|
||||
LDFLD/STFLD operations into method call messages, which are then passed to the
|
||||
RealProxy::Invoke() method.
|
||||
|
||||
There are two helper methods which can be used by the JIT and the interpreter
|
||||
to convert LDFLD/STFLD operations into messages and then call
|
||||
RealProxy::Invoke(): mono_store_remote_field() and mono_load_remote_field().
|
||||
|
||||
|
||||
@@ -11,6 +11,13 @@ compiler, and a set of source files. Extra options or arguments can
|
||||
be provided in a response file. Response files are referenced by
|
||||
prepending the @ symbol to the response file name.
|
||||
.PP
|
||||
The Mono C# compiler accepts the same options than the Microsoft C#
|
||||
compiler does. Those options can start with a slash or a dash
|
||||
(/checked is the same as -checked). Additionally to this, the
|
||||
GNU-like options are supported, those begin with "--". All
|
||||
MCS-specific flags which are not available in the Microsoft C#
|
||||
compiler are available only with the GNU-style options.
|
||||
.PP
|
||||
C# source files must end with a ".cs" extension. Compilation of C#
|
||||
source code requires all the files that make up a library, module or
|
||||
executable to be provided on the command line. There is no support
|
||||
@@ -29,17 +36,26 @@ Executables are not bound to a specific CPU or operating system.
|
||||
.I \-\-about
|
||||
Displays information about the Mono C# compiler
|
||||
.TP
|
||||
.I \-\-checked
|
||||
.I -checked, -checked+
|
||||
Sets the default compilation mode to `checked'. This makes all
|
||||
the math operations checked (the default is unchecked).
|
||||
.TP
|
||||
.I \-\-define SYMBOL
|
||||
Defines a symbol named SYMBOL. This can be tested in the source code
|
||||
by the pre-processor.
|
||||
.I -checked-
|
||||
Sets the default compilation mode to `unchecked'. This makes all
|
||||
the math operations unchecked (this is the default).
|
||||
.TP
|
||||
.I \-\-debug or \-g
|
||||
.I \-define:SYMLIST, -d:SYMLIST
|
||||
Defines the symbol listed by the semi-colon separeted list SYMLIST
|
||||
SYMBOL. This can be tested in the source code by the pre-processor,
|
||||
or can be used by methods that have been tagged with the Conditional
|
||||
attribute.
|
||||
.TP
|
||||
.I \-debug, \-debug+, \-g
|
||||
Generate debugging information.
|
||||
.TP
|
||||
.I \-debug-
|
||||
Do not generate debugging information.
|
||||
.TP
|
||||
.I \-\-fatal
|
||||
This is used for debugging the compiler. This makes the error emission
|
||||
generate an exception that can be caught by a debugger.
|
||||
@@ -48,27 +64,29 @@ generate an exception that can be caught by a debugger.
|
||||
Generates a stack trace at the time the error is reported, useful for
|
||||
debugging the compiler.
|
||||
.TP
|
||||
.I -lib:PATHLIST
|
||||
Each path specified in the comma-separated list will direct the
|
||||
compiler to look for libraries in that specified path.
|
||||
.TP
|
||||
.I \-L PATH
|
||||
Directs the compiler to look for libraries in the specified path.
|
||||
Multiple paths can be provided.
|
||||
Multiple paths can be provided by using the option multiple times.
|
||||
.TP
|
||||
.I \-\-nostdlib
|
||||
.I \-nostdlib, -nostdlib+
|
||||
Use this flag if you want to compile the core library. This makes the
|
||||
compiler load its internal types from the assembly being compiled.
|
||||
.TP
|
||||
.I \-\-noconfig
|
||||
.I \-noconfig, \-noconfig+
|
||||
Disables the default compiler configuration to be loaded. The
|
||||
compiler by default has references to the system assemblies.
|
||||
.TP
|
||||
.I \-\-nowarn XXX
|
||||
Makes the compiler ignore warning XXX.
|
||||
.I \-nowarn:WARNLIST
|
||||
Makes the compiler ignore warnings specified in the comma-separeted
|
||||
list WARNLIST>
|
||||
.TP
|
||||
.I \-o FNAME
|
||||
.I -out:FNAME, -o FNAME
|
||||
Names the output file to be generated.
|
||||
.TP
|
||||
.I \-\-optimize
|
||||
Turns on optimizations in the compiler.
|
||||
.TP
|
||||
.I \-\-parse
|
||||
Used for benchmarking. The compiler will only parse its input files.
|
||||
.TP
|
||||
@@ -76,21 +94,21 @@ Used for benchmarking. The compiler will only parse its input files.
|
||||
Probes for the code to generate an error named `X' in line `L'. This
|
||||
is only used by the test suite.
|
||||
.TP
|
||||
.I /linkres:RESOURCE
|
||||
Links to the given resources
|
||||
.I /resource:RESOURCE
|
||||
Embeds to the given resource file.
|
||||
.TP
|
||||
.I \-\-recurse PATTERN
|
||||
.I /linkresource:RESOURCE
|
||||
Links to the given resource file.
|
||||
.TP
|
||||
.I \-recurse:PATTERN, --recurse PATTERN
|
||||
Does recursive compilation using the specified pattern. In Unix the
|
||||
shell will perform globbing, so you migth want to use it like this:
|
||||
.PP
|
||||
.nf
|
||||
bash$ mcs --recurse '*.cs'
|
||||
bash$ mcs -recurse:'*.cs'
|
||||
.fi
|
||||
.TP
|
||||
.I \-\-linkres FILE
|
||||
Links FILE as a resource of the resulting assembly.
|
||||
.TP
|
||||
.I \-\-target KIND
|
||||
.I \-target:KIND, \-t:KIND
|
||||
Used to specify the desired target. The possible values are: exe,
|
||||
winexe, library and module.
|
||||
.TP
|
||||
@@ -98,17 +116,17 @@ winexe, library and module.
|
||||
Another debugging flag. Used to display the times at various points
|
||||
in the compilation process.
|
||||
.TP
|
||||
.I \-\-unsafe
|
||||
.I \-unsafe, -unsafe+
|
||||
Enables compilation of unsafe code.
|
||||
.TP
|
||||
.I \-\-werror
|
||||
.I \-warnaserror, \-warnaserror+
|
||||
Treat warnings as errors.
|
||||
.TP
|
||||
.I \-\-wlevel LEVEL
|
||||
.I \-warn:LEVEL
|
||||
Sets the warning level. 0 is the lowest warning level, and 4 is the
|
||||
highest. The default is 2.
|
||||
.TP
|
||||
.I \-r ASSEMBLY
|
||||
.I -r:ASSEMBLY, \-r ASSEMBLY
|
||||
Reference the named assembly. Use this to use classes from the named
|
||||
assembly in your program. The assembly will be loaded from either the
|
||||
system directory where all the assemblies live, or from the path
|
||||
@@ -156,8 +174,8 @@ During compilation the MCS compiler defines the __MonoCS__ symbol,
|
||||
this can be used by pre-processor instructions to compile Mono C#
|
||||
compiler specific code.
|
||||
.SH AUTHORS
|
||||
The Mono C# Compiler was written by Miguel de Icaza and Ravi Pratap at
|
||||
Ximian.
|
||||
The Mono C# Compiler was written by Miguel de Icaza, Ravi Pratap and
|
||||
Martin Baulig at Ximian.
|
||||
.PP
|
||||
.SH LICENSE
|
||||
The Mono Compiler Suite is released under the terms of the GNU GPL.
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
2002-08-12 Piers Haken <[email protected]>
|
||||
|
||||
* class/library.make: use 'find' to specify source files, instead of static files
|
||||
* */makefile.gnu: specify include/exclude patterns for source files
|
||||
|
||||
2002-08-07 Peter Williams <[email protected]>
|
||||
|
||||
* class/library.make (.makefrag): Fix this rule a bit; was using
|
||||
$^ instead of $<
|
||||
|
||||
2002-07-29 Peter Williams <[email protected]>
|
||||
|
||||
* makefile.gnu: 'make install' wasn't actually working due to $@,
|
||||
fix it.
|
||||
|
||||
2002-07-29 Martin Baulig <[email protected]>
|
||||
|
||||
* makefile.gnu: Don't force people to install. The default must also
|
||||
be `all' and not `install'.
|
||||
|
||||
2002-07-26 Alp Toker <[email protected]>
|
||||
|
||||
* INSTALL: Wrote a guide to mcs installation.
|
||||
|
||||
+6
-9
@@ -27,13 +27,10 @@ To build the compiler and class libraries, run:
|
||||
The libraries will be placed in the directory class/lib/ and the mcs
|
||||
compiler executable in mcs/.
|
||||
|
||||
To install them, run:
|
||||
To install them, run the following, where prefix identifies where you
|
||||
want the files installed:
|
||||
|
||||
make -f makefile.gnu install
|
||||
|
||||
You can also specify a prefix into which the files will be installed:
|
||||
|
||||
make -f makefile.gnu install prefix=/opt
|
||||
make -f makefile.gnu install prefix=/usr/local
|
||||
|
||||
If you are tracking Mono's development, you may sometimes need to share
|
||||
the compiled libraries with others. If you want to produce an easily
|
||||
@@ -50,7 +47,7 @@ mcs setup. To build the compiler and class libraries, run:
|
||||
|
||||
make
|
||||
|
||||
The libraries will be placed in the directory class/lib/ and the mcs compiler
|
||||
executable in mcs/. They can then be copied to /usr/lib and /usr/bin or
|
||||
wherever desired on the target system.
|
||||
The libraries will be placed in the directory class/lib/ and the mcs
|
||||
compiler executable in mcs/. They can then be copied to /usr/lib and
|
||||
/usr/bin or wherever desired on the target system.
|
||||
|
||||
+6
-9
@@ -27,13 +27,10 @@ To build the compiler and class libraries, run:
|
||||
The libraries will be placed in the directory class/lib/ and the mcs
|
||||
compiler executable in mcs/.
|
||||
|
||||
To install them, run:
|
||||
To install them, run the following, where prefix identifies where you
|
||||
want the files installed:
|
||||
|
||||
make -f makefile.gnu install
|
||||
|
||||
You can also specify a prefix into which the files will be installed:
|
||||
|
||||
make -f makefile.gnu install prefix=/opt
|
||||
make -f makefile.gnu install prefix=/usr/local
|
||||
|
||||
If you are tracking Mono's development, you may sometimes need to share
|
||||
the compiled libraries with others. If you want to produce an easily
|
||||
@@ -50,7 +47,7 @@ mcs setup. To build the compiler and class libraries, run:
|
||||
|
||||
make
|
||||
|
||||
The libraries will be placed in the directory class/lib/ and the mcs compiler
|
||||
executable in mcs/. They can then be copied to /usr/lib and /usr/bin or
|
||||
wherever desired on the target system.
|
||||
The libraries will be placed in the directory class/lib/ and the mcs
|
||||
compiler executable in mcs/. They can then be copied to /usr/lib and
|
||||
/usr/bin or wherever desired on the target system.
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
2002-08-13 Daniel Morgan <[email protected]>
|
||||
|
||||
* Mono.Data.MySql/MySqlCommand.cs: modified
|
||||
rowsRetrieved should be rowsAffected in ExecuteNonQuery
|
||||
because the number is only to show the rows affected
|
||||
by an INSERT, UPDATE, or DELETE; anything else, the
|
||||
number is -1
|
||||
|
||||
* Mono.Data.MySql/Test.cs: modified
|
||||
enable retrieving the results from a query. even though
|
||||
this still does not work for some reason, i thought
|
||||
i would enable it so others could see the problem.
|
||||
|
||||
2002-05-30 Daniel Morgan <[email protected]>
|
||||
|
||||
* Mono.Data.MySql.build: modified
|
||||
|
||||
@@ -248,10 +248,10 @@ namespace Mono.Data.MySql {
|
||||
/// library!
|
||||
///</para>
|
||||
///</summary>
|
||||
//[DllImport("libmySQL",
|
||||
// CharSet=System.Runtime.InteropServices.CharSet.Ansi,
|
||||
// EntryPoint="mysql_thread_end", ExactSpelling=true)]
|
||||
//public static extern void ThreadEnd();
|
||||
[DllImport("libmySQL",
|
||||
CharSet=System.Runtime.InteropServices.CharSet.Ansi,
|
||||
EntryPoint="mysql_thread_end", ExactSpelling=true)]
|
||||
public static extern void ThreadEnd();
|
||||
|
||||
///<summary>
|
||||
///<para>
|
||||
@@ -262,9 +262,9 @@ namespace Mono.Data.MySql {
|
||||
/// This is automatically called by <see cref="Init"/>.
|
||||
///</para>
|
||||
///</summary>
|
||||
//[DllImport("libmySQL",
|
||||
// CharSet=System.Runtime.InteropServices.CharSet.Ansi,
|
||||
// EntryPoint="mysql_thread_init", ExactSpelling=true)]
|
||||
//public static extern void ThreadInit();
|
||||
[DllImport("libmySQL",
|
||||
CharSet=System.Runtime.InteropServices.CharSet.Ansi,
|
||||
EntryPoint="mysql_thread_init", ExactSpelling=true)]
|
||||
public static extern void ThreadInit();
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ namespace Mono.Data.MySql {
|
||||
|
||||
[MonoTODO]
|
||||
public int ExecuteNonQuery () {
|
||||
int rowsRetrieved = -1;
|
||||
int rowsAffected = -1;
|
||||
//TODO: need to do this correctly
|
||||
// this is just something quick
|
||||
// thrown together to see if we can
|
||||
@@ -110,13 +110,18 @@ namespace Mono.Data.MySql {
|
||||
Console.Out.Flush();
|
||||
return 0;
|
||||
}
|
||||
return rowsRetrieved;
|
||||
// TODO: need to return the number of rows affected for an INSERT, UPDATE, or DELETE
|
||||
// otherwise, it is -1
|
||||
return rowsAffected;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
IDataReader IDbCommand.ExecuteReader () {
|
||||
//return ExecuteReader ();
|
||||
// FIXME: just a quick hack
|
||||
ExecuteNonQuery();
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -142,7 +147,9 @@ namespace Mono.Data.MySql {
|
||||
|
||||
[MonoTODO]
|
||||
public object ExecuteScalar () {
|
||||
throw new NotImplementedException();
|
||||
// FIXME: just a quick hack
|
||||
ExecuteNonQuery();
|
||||
return null;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
// at http://www.opensource.org/licenses/mit-license.html
|
||||
//
|
||||
|
||||
// define MYSQL_CANDO_QUERY if the runtime can do a query
|
||||
// #define MYSQL_CANDO_QUERY if the runtime can do a query
|
||||
// define MYSQL_CANDO_THREADS if the runtime can use mysql_thread_* functions
|
||||
//#define MYSQL_CANDO_QUERY
|
||||
//#define MYSQL_CANDO_THREADS
|
||||
#define MYSQL_CANDO_QUERY
|
||||
#define MYSQL_CANDO_THREADS
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -60,9 +60,10 @@ public class Test {
|
||||
public static int Main() {
|
||||
Console.WriteLine("Test for MySQL C# Bindings started...");
|
||||
Console.Out.Flush();
|
||||
int rcq;
|
||||
|
||||
string myDb = "test";
|
||||
string myStmt = "SELECT * FROM db";
|
||||
string myStmt = "SELECT * FROM sometable";
|
||||
string insertStmt = "INSERT INTO SOMETABLE (TID,TDESC,AINT) VALUES ('MySQL','Mono.Data',12)";
|
||||
|
||||
Console.WriteLine("MySql Init...");
|
||||
@@ -101,7 +102,7 @@ public class Test {
|
||||
|
||||
Console.WriteLine("Insert SQL: "+insertStmt);
|
||||
Console.Out.Flush();
|
||||
int rcq = MySql.Query(db, insertStmt);
|
||||
rcq = MySql.Query(db, insertStmt);
|
||||
if (rcq != 0) {
|
||||
Console.WriteLine("Couldn't execute ["+insertStmt+"] on server.");
|
||||
Console.Out.Flush();
|
||||
@@ -113,7 +114,7 @@ public class Test {
|
||||
#if MYSQL_CANDO_QUERY
|
||||
Console.WriteLine("Query: "+myStmt);
|
||||
Console.Out.Flush();
|
||||
int rcq = MySql.Query(db, myStmt);
|
||||
rcq = MySql.Query(db, myStmt);
|
||||
if (rcq != 0) {
|
||||
Console.WriteLine("?Couldn't execute ["+myStmt+"] on server.");
|
||||
Console.Out.Flush();
|
||||
@@ -175,7 +176,14 @@ public class Test {
|
||||
while ((row = MySql.FetchRow(res)) != IntPtr.Zero) {
|
||||
Console.WriteLine("Record #" + recCnt + ":");
|
||||
for (int i = 0, j = 1; i < numFields; i++, j++) {
|
||||
Console.WriteLine(" Going to WriteLine Fld...\n");
|
||||
Console.Out.Flush();
|
||||
Console.WriteLine(" theField[[[" + fields[i] + "]]]\n");
|
||||
Console.Out.Flush();
|
||||
Console.WriteLine(" after theField... \n");
|
||||
Console.Out.Flush();
|
||||
Console.WriteLine(" Fld #"+j+" ("+fields[i]+"): "+rowVal(row, i));
|
||||
Console.Out.Flush();
|
||||
}
|
||||
Console.WriteLine("==============================");
|
||||
}
|
||||
@@ -183,10 +191,18 @@ public class Test {
|
||||
}
|
||||
|
||||
static string rowVal(IntPtr res, int index) {
|
||||
Console.WriteLine("...Marshal.ReadIntPtr() BEFORE...\n");
|
||||
Console.Out.Flush();
|
||||
IntPtr str = Marshal.ReadIntPtr(res, index*IntPtr.Size);
|
||||
Console.WriteLine("...Marshal.ReadIntPtr() AFTER...\n");
|
||||
Console.Out.Flush();
|
||||
if (str == IntPtr.Zero)
|
||||
return "NULL";
|
||||
Console.WriteLine("...Marshal.PtrToStringAnsi() BEFORE...");
|
||||
Console.Out.Flush();
|
||||
string s = Marshal.PtrToStringAnsi(str);
|
||||
Console.WriteLine("...Marshal.PtrToStringAnsi() AFTER...");
|
||||
Console.Out.Flush();
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
+28
-12
@@ -65,24 +65,40 @@ namespace System.Data.SqlClient
|
||||
|
||||
#region Properties
|
||||
|
||||
public new SqlCommand DeleteCommand {
|
||||
get { return deleteCommand; }
|
||||
set { deleteCommand = value; }
|
||||
public SqlCommand DeleteCommand {
|
||||
get {
|
||||
return deleteCommand;
|
||||
}
|
||||
set {
|
||||
deleteCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new SqlCommand InsertCommand {
|
||||
get { return insertCommand; }
|
||||
set { insertCommand = value; }
|
||||
public SqlCommand InsertCommand {
|
||||
get {
|
||||
return insertCommand;
|
||||
}
|
||||
set {
|
||||
insertCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new SqlCommand SelectCommand {
|
||||
get { return selectCommand; }
|
||||
set { selectCommand = value; }
|
||||
public SqlCommand SelectCommand {
|
||||
get {
|
||||
return selectCommand;
|
||||
}
|
||||
set {
|
||||
selectCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new SqlCommand UpdateCommand {
|
||||
get { return updateCommand; }
|
||||
set { updateCommand = value; }
|
||||
public SqlCommand UpdateCommand {
|
||||
get {
|
||||
return updateCommand;
|
||||
}
|
||||
set {
|
||||
updateCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
IDbCommand IDbDataAdapter.DeleteCommand {
|
||||
|
||||
@@ -65,24 +65,40 @@ namespace System.Data.SqlClient
|
||||
|
||||
#region Properties
|
||||
|
||||
public new SqlCommand DeleteCommand {
|
||||
get { return deleteCommand; }
|
||||
set { deleteCommand = value; }
|
||||
public SqlCommand DeleteCommand {
|
||||
get {
|
||||
return deleteCommand;
|
||||
}
|
||||
set {
|
||||
deleteCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new SqlCommand InsertCommand {
|
||||
get { return insertCommand; }
|
||||
set { insertCommand = value; }
|
||||
public SqlCommand InsertCommand {
|
||||
get {
|
||||
return insertCommand;
|
||||
}
|
||||
set {
|
||||
insertCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new SqlCommand SelectCommand {
|
||||
get { return selectCommand; }
|
||||
set { selectCommand = value; }
|
||||
public SqlCommand SelectCommand {
|
||||
get {
|
||||
return selectCommand;
|
||||
}
|
||||
set {
|
||||
selectCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new SqlCommand UpdateCommand {
|
||||
get { return updateCommand; }
|
||||
set { updateCommand = value; }
|
||||
public SqlCommand UpdateCommand {
|
||||
get {
|
||||
return updateCommand;
|
||||
}
|
||||
set {
|
||||
updateCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
IDbCommand IDbDataAdapter.DeleteCommand {
|
||||
|
||||
@@ -2,9 +2,12 @@ topdir = ../..
|
||||
|
||||
LIBRARY = ../lib/System.Configuration.Install.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = -r corlib
|
||||
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=\
|
||||
./Test*
|
||||
|
||||
export MONO_PATH_PREFIX = ../lib:
|
||||
|
||||
include ../library.make
|
||||
@@ -1,2 +1,4 @@
|
||||
.makefrag
|
||||
.response
|
||||
System.Data.dll
|
||||
library-deps.stamp
|
||||
+230
-19
@@ -1,45 +1,256 @@
|
||||
2002-08-16 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.OleDb/libgda.cs: added new needed libgda functions.
|
||||
|
||||
* System.Data.OleDb/OleDbDataReader.cs (GetBoolean): throw exceptions
|
||||
when there are errors.
|
||||
(GetByte, GetChar, GetDataTypeName, GetValue, Read): implemented.
|
||||
|
||||
* System.Data.OleDb/TestOleDb.cs: added more testing code for data
|
||||
readers.
|
||||
|
||||
2002-08-15 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.OleDb/libgda.cs: added new needed libgda functions.
|
||||
|
||||
* System.Data.OleDb/OleDbParameterCollection.cs (GdaParameterList):
|
||||
create an empty GdaParameterList.
|
||||
|
||||
* System.Data.OleDb/OleDbCommand.cs (ExecuteReader): check values
|
||||
for NULL before passing them to Marshal.PtrToStructure, which issues
|
||||
an exception if the value is NULL.
|
||||
|
||||
2002-08-15 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data/UniqueConstraint.cs (UniqueConstraint): commented
|
||||
unreachable code to avoid compiler warning.
|
||||
|
||||
* System.Data.OleDb/libgda.cs (GdaList): added new internal class.
|
||||
|
||||
* System.Data.OleDb/OleDbConnection.cs (DataSource): implemented.
|
||||
(OpenReader): removed internal method.
|
||||
|
||||
* System.Data.OleDb/OleDbCommand.cs (ExecuteReader): split correctly
|
||||
the list of returned data models.
|
||||
|
||||
2002-08-15 Franklin Wise <[email protected]>
|
||||
|
||||
* System.Data/Constraint.cs: Added helper virtual functions
|
||||
|
||||
* System.Data/ConstraintCollection.cs: Improved constraint removal,
|
||||
validation. Removed specific knowledge of subclasses of
|
||||
Constraint.
|
||||
|
||||
* System.Data/DataColumn.cs: Added static helper function to compare
|
||||
if two DataColumn arrays are the same.
|
||||
|
||||
* System.Data/ForeignKeyConstraint.cs: Continued to flush out.
|
||||
|
||||
* System.Data/UniqueConstraint.cs: Implemented. Still some constraint
|
||||
validation to do.
|
||||
|
||||
2002-08-13 Franklin Wise <[email protected]>
|
||||
|
||||
* System.Data/DataRow.cs: Added several fixme tags.
|
||||
|
||||
2002-08-13 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.SqlClient/SqlDataAdapter.cs (DeleteCommand,
|
||||
InsertCommand, SelectCommand, UpdateCommand): removed 'new' keyword
|
||||
to avoid compiler warnings.
|
||||
|
||||
2002-08-12 Franklin Wise <[email protected]>
|
||||
|
||||
* System.Data/Constraint.cs: Implemented
|
||||
|
||||
* System.Data/UniqueConstraint.cs: GetHashCode() &
|
||||
special case Ctor. Still need to be implemented. LAMESPEC tags
|
||||
added.
|
||||
|
||||
* System.Data/ConstraintCollection.cs: Clear() &
|
||||
AddRange() need to be finished. Several LAMESPEC tags.
|
||||
|
||||
* Allow Constraint collection to be created in DataTable.
|
||||
|
||||
* System.Data/ForeignKeyConstraint: Added a couple of
|
||||
helper functions.
|
||||
|
||||
* System.Data/DataColumnCollection New/Added DataColumns now have
|
||||
Table property set.
|
||||
|
||||
2002-08-11 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.OleDb/libgda.cs: added some GdaValue functions.
|
||||
|
||||
* System.Data.OleDb/OleDbCommand.cs (OpenReader): removed this
|
||||
internal method, since we don't need it.
|
||||
(ExecuteReader): call SetupGdaCommand before executing the command
|
||||
via libgda functions.
|
||||
(ExecuteScalar): implemented.
|
||||
|
||||
* System.Data.OleDb/OleDbDateReader.cs (OleDbDataReader): removed call
|
||||
to OleDbCommand.OpenReader.
|
||||
(GetBoolean): implemented.
|
||||
|
||||
2002-08-08 Franklin Wise <[email protected]>
|
||||
|
||||
* System.Data/IDbComand.cs: IDbCommand now inherits IDisposable
|
||||
|
||||
* System.Data/IDbConnection.cs: IDbConnection now inherits IDisposable
|
||||
|
||||
* System.Data.SqlTypes/SqlCompareOptions.cs: Enum now set to correct
|
||||
values.
|
||||
|
||||
2002-08-06 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* System.Data.OleDb/OleDbConnection.cs: little fixes to make it work
|
||||
and don't show a warning in Open.
|
||||
|
||||
* System.Data.OleDb/TestOleDb.cs: added Close.
|
||||
|
||||
2002-08-05 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.OleDb/OleDbConnection.cs (ConnectionString,
|
||||
ConnectionTimeout, ServerVersion, GdaConnection):
|
||||
corrected style.
|
||||
(OleDbConnection): call libgda.gda_init on constructor.
|
||||
|
||||
* System.Data.OleDb/libgda.cs (libgda): removed static constructor,
|
||||
which wasn't been called.
|
||||
|
||||
* System.Data.OleDb/TestOleDb.cs (TestOleDb): updated to really
|
||||
make some tests.
|
||||
|
||||
2002-08-04 Rodrigo Moya <[email protected]>
|
||||
|
||||
* list: added missing System.Data.OleDb and
|
||||
System.Data.Common files.
|
||||
|
||||
* System.Data.OleDb/ChangeLog: removed and merged with
|
||||
System.Data's ChangeLog.
|
||||
|
||||
* System.Data.OleDb/OleDbDataAdapter.cs:
|
||||
* System.Data.OleDb/OleDbPermission.cs: compilation fixes.
|
||||
|
||||
2002-07-30 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.OleDb/OleDbDataReader.cs (FieldCount): implemented.
|
||||
(IsClosed, Item, RecordsAffected): implemented some properties.
|
||||
|
||||
* libgda.cs: added GdaDataModel methods.
|
||||
|
||||
2002-07-29 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.OleDb/OleDbDataReader.cs (OleDbDataReader constructor): changed to receive
|
||||
a second argument (ArrayList results).
|
||||
(NextResult): implemented.
|
||||
|
||||
* System.Data.OleDb/OleDbCommand.cs: don't store the ArrayList of results, since we'll
|
||||
pass that to the OleDbDataReader.
|
||||
(OleDbCommand constructor): don't create the ArrayList of results.
|
||||
(GdaResults): removed property.
|
||||
(ExecuteReader): create a temporary ArrayList and pass that to the
|
||||
OleDbDataReader constructor.
|
||||
|
||||
2002-07-28 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.OleDb/OleDbCommand.cs (ExecuteReader):
|
||||
(CreateParameter): implemented IDbCommand methods.
|
||||
(CommandText): don't create many GdaCommand's, only one is needed.
|
||||
(ExecuteNonQuery): set up the internal GDA command object.
|
||||
(ExecuteReader): use correctly the unique GDA command object.
|
||||
|
||||
* System.Data.OleDb/libgda.cs: added new libgda calls.
|
||||
|
||||
2002-07-27 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.OleDb/OleDbConnection.cs (CreateCommand):
|
||||
(BeginTransaction): implemented IDbConnection methods.
|
||||
|
||||
2002-07-12 Rodrigo Moya <[email protected]>
|
||||
|
||||
* list: added System.Data.OleDb files to file list.
|
||||
|
||||
2002-07-11 Rodrigo Moya <[email protected]>
|
||||
|
||||
* System.Data.OleDb/libgda.cs: added new libgda functions and some enumerations.
|
||||
|
||||
* System.Data.OleDb/OleDbParameter.cs (IsNullable): removed explicit implementation
|
||||
of the set method for this property.
|
||||
|
||||
* System.Data.OleDb/OleDbDataAdapter.cs (MissingMappingAction): implemented.
|
||||
(MissingSchemaAction): implemented.
|
||||
|
||||
2002-07-10 Tim Coleman <[email protected]>
|
||||
|
||||
* System.Data.OleDb/OleDbCommandBuilder.cs: Added new methods, properties
|
||||
* System.Data.OleDb/OleDbConnection.cs: Modified constructor
|
||||
* System.Data.OleDb/OleDbError.cs: Added stubbs
|
||||
* System.Data.OleDb/OleDbException.cs: Added stubbs
|
||||
* System.Data.OleDb/OleDbInfoMessageEventArgs.cs: Added stubbs
|
||||
* System.Data.OleDb/OleDbInfoMessageEventHandler.cs: style change
|
||||
* System.Data.OleDb/OleDbParameter.cs: Added conversion from type to OleDbType
|
||||
* System.Data.OleDb/OleDbPermission.cs: Added stubbs
|
||||
* System.Data.OleDb/OleDbSchemaGuid.cs: Added stubbs
|
||||
* System.Data.OleDb/OleDbTransaction.cs: New constructors, changes to methods to
|
||||
support transaction nesting
|
||||
* System.Data.OleDb/libgda.cs: Added my name to this file
|
||||
|
||||
2002-07-09 Tim Coleman <[email protected]>
|
||||
|
||||
* System.Data.OleDb/OleDbCommand.cs: Style changes, added new methods
|
||||
* System.Data.OleDb/OleDbConnection.cs: Style changes, added new methods
|
||||
* System.Data.OleDb/OleDbDataAdapter.cs: Implementation
|
||||
* System.Data.OleDb/OleDbDataReader.cs: Added stubbs
|
||||
* System.Data.OleDb/OleDbErrorCollection.cs: Added stubbs, some implementation
|
||||
* System.Data.OleDb/OleDbParameter.cs: Style changes, added new methods
|
||||
* System.Data.OleDb/OleDbParameterCollection.cs: Style changes, added new methods
|
||||
* System.Data.OleDb/OleDbPermissionAttribute.cs: Style changes, added new methods
|
||||
* System.Data.OleDb/OleDbRowUpdatedEventArgs.cs: Added stubbs
|
||||
* System.Data.OleDb/OleDbRowUpdatingEventArgs.cs: Added stubbs
|
||||
* System.Data.OleDb/OleDbTransaction.cs: Style changes, added new methods
|
||||
* System.Data.OleDb/OleDbType.cs: Fixed two typos
|
||||
* System.Data.OleDb/libgda.cs: Style changes, added new methods
|
||||
|
||||
2002-07-09 Tim Coleman <[email protected]>
|
||||
|
||||
* System.Data.build: remove restriction on System.Data.OleDb build
|
||||
|
||||
2002-06-03 Rodrigo Moya <[email protected]>
|
||||
|
||||
* OleDbParameterCollection.cs (GetEnumerator, SyncRoot,
|
||||
* System.Data.OleDb/OleDbParameterCollection.cs (GetEnumerator, SyncRoot,
|
||||
IsSynchronized): implemented.
|
||||
|
||||
2002-06-02 Rodrigo Moya <[email protected]>
|
||||
|
||||
* OleDbTransaction.cs (Dispose): added missing method.
|
||||
* System.Data.OleDb/OleDbTransaction.cs (Dispose): added missing method.
|
||||
|
||||
* OleDbCommand.cs (Clone): added missing methods.
|
||||
* System.Data.OleDb/OleDbCommand.cs (Clone): added missing methods.
|
||||
(Parameters, Transaction, Connection): made these overload
|
||||
IDbCommand's ones.
|
||||
|
||||
* OleDbParameterCollection.cs (IndexOf, Remove, RemoveAt):
|
||||
* System.Data.OleDb/OleDbParameterCollection.cs (IndexOf, Remove, RemoveAt):
|
||||
call m_list methods, not own ones.
|
||||
|
||||
* OleDbParameter.cs: more implementation.
|
||||
* System.Data.OleDb/OleDbParameter.cs: more implementation.
|
||||
|
||||
2002-06-02 Rodrigo Moya <[email protected]>
|
||||
|
||||
* OleDbTransaction.cs (Connection, IsolationLevel, Begin,
|
||||
* System.Data.OleDb/OleDbTransaction.cs (Connection, IsolationLevel, Begin,
|
||||
Commit, Rollback): implemented.
|
||||
(GdaConnection): added new internal property.
|
||||
|
||||
* OleDbParameter.cs:
|
||||
* OleDbParameterCollection.cs: implemented some methods and
|
||||
* System.Data.OleDb/OleDbParameter.cs:
|
||||
* System.Data.OleDb/OleDbParameterCollection.cs: implemented some methods and
|
||||
properties.
|
||||
|
||||
* libgda.cs: added yet more libgda API functions.
|
||||
* System.Data.OleDb/libgda.cs: added yet more libgda API functions.
|
||||
|
||||
2002-06-01 Rodrigo Moya <[email protected]>
|
||||
|
||||
* libgda.cs: added new libgda API functions.
|
||||
* System.Data.OleDb/libgda.cs: added new libgda API functions.
|
||||
|
||||
* OleDbConnection.cs (Provider): implemented.
|
||||
* System.Data.OleDb/OleDbConnection.cs (Provider): implemented.
|
||||
(BeginTransaction): made it overload IDbConnection methods.
|
||||
(ChangeDatabase): new stub, needs some work on libgda for being
|
||||
implemented.
|
||||
@@ -51,33 +262,33 @@
|
||||
strings that represent a GDA data source name. More to come.
|
||||
(InfoMessage, StateChange): added events.
|
||||
|
||||
* TestOleDb.cs: test program for System.Data.OleDb.
|
||||
* System.Data.OleDb/TestOleDb.cs: test program for System.Data.OleDb.
|
||||
|
||||
2002-05-29 Rodrigo Moya <[email protected]>
|
||||
|
||||
* libgda.cs: added static constructor.
|
||||
* System.Data.OleDb/libgda.cs: added static constructor.
|
||||
(GdaClient): new static property to get the underlying GdaClient
|
||||
object.
|
||||
|
||||
* OleDbConnection.cs: removed GDA initialization, which belongs to
|
||||
* System.Data.OleDb/OleDbConnection.cs: removed GDA initialization, which belongs to
|
||||
the static 'libgda' class.
|
||||
|
||||
2002-05-29 Rodrigo Moya <[email protected]>
|
||||
|
||||
* libgda.cs: static class for libgda API calls.
|
||||
* System.Data.OleDb/libgda.cs: static class for libgda API calls.
|
||||
|
||||
* OleDbConnection.cs: implemented constructors.
|
||||
* System.Data.OleDb/OleDbConnection.cs: implemented constructors.
|
||||
(ConnectionString, Connectiontimeout, Database, State):
|
||||
implemented class properties.
|
||||
(BeginTransaction): implemented.
|
||||
|
||||
* OleDbTransaction.cs: implemented protected constructors.
|
||||
* System.Data.OleDb/OleDbTransaction.cs: implemented protected constructors.
|
||||
|
||||
* TestGDA.cs: simple test for libgda API.
|
||||
* System.Data.OleDb/TestGDA.cs: simple test for libgda API.
|
||||
|
||||
2002-05-27 Rodrigo Moya <[email protected]>
|
||||
|
||||
Started System.Data.OleDb provider, based on libgda.
|
||||
* System.Data.OleDb/*: started System.Data.OleDb provider, based on libgda.
|
||||
|
||||
2002-06-06 Rodrigo Moya <[email protected]>
|
||||
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
2002-07-11 Rodrigo Moya <[email protected]>
|
||||
|
||||
* libgda.cs: added new libgda functions and some enumerations.
|
||||
|
||||
* OleDbParameter.cs (IsNullable): removed explicit implementation
|
||||
of the set method for this property.
|
||||
|
||||
* OleDbDataAdapter.cs (MissingMappingAction): implemented.
|
||||
(MissingSchemaAction): implemented.
|
||||
|
||||
2002-07-10 Tim Coleman <[email protected]>
|
||||
* OleDbCommandBuilder.cs: Added new methods, properties
|
||||
* OleDbConnection.cs: Modified constructor
|
||||
* OleDbError.cs: Added stubbs
|
||||
* OleDbException.cs: Added stubbs
|
||||
* OleDbInfoMessageEventArgs.cs: Added stubbs
|
||||
* OleDbInfoMessageEventHandler.cs: style change
|
||||
* OleDbParameter.cs: Added conversion from type to OleDbType
|
||||
* OleDbPermission.cs: Added stubbs
|
||||
* OleDbSchemaGuid.cs: Added stubbs
|
||||
* OleDbTransaction.cs: New constructors, changes to methods to
|
||||
support transaction nesting
|
||||
* libgda.cs: Added my name to this file
|
||||
|
||||
2002-07-09 Tim Coleman <[email protected]>
|
||||
* OleDbCommand.cs: Style changes, added new methods
|
||||
* OleDbConnection.cs: Style changes, added new methods
|
||||
* OleDbDataAdapter.cs: Implementation
|
||||
* OleDbDataReader.cs: Added stubbs
|
||||
* OleDbErrorCollection.cs: Added stubbs, some implementation
|
||||
* OleDbParameter.cs: Style changes, added new methods
|
||||
* OleDbParameterCollection.cs: Style changes, added new methods
|
||||
* OleDbPermissionAttribute.cs: Style changes, added new methods
|
||||
* OleDbRowUpdatedEventArgs.cs: Added stubbs
|
||||
* OleDbRowUpdatingEventArgs.cs: Added stubbs
|
||||
* OleDbTransaction.cs: Style changes, added new methods
|
||||
* OleDbType.cs: Fixed two typos
|
||||
* libgda.cs: Style changes, added new methods
|
||||
|
||||
2002-06-03 Rodrigo Moya <[email protected]>
|
||||
|
||||
* OleDbParameterCollection.cs (GetEnumerator, SyncRoot,
|
||||
IsSynchronized): implemented.
|
||||
|
||||
2002-06-02 Rodrigo Moya <[email protected]>
|
||||
|
||||
* OleDbTransaction.cs (Dispose): added missing method.
|
||||
|
||||
* OleDbCommand.cs (Clone): added missing methods.
|
||||
(Parameters, Transaction, Connection): made these overload
|
||||
IDbCommand's ones.
|
||||
|
||||
* OleDbParameterCollection.cs (IndexOf, Remove, RemoveAt):
|
||||
call m_list methods, not own ones.
|
||||
|
||||
* OleDbParameter.cs: more implementation.
|
||||
|
||||
2002-06-02 Rodrigo Moya <[email protected]>
|
||||
|
||||
* OleDbTransaction.cs (Connection, IsolationLevel, Begin,
|
||||
Commit, Rollback): implemented.
|
||||
(GdaConnection): added new internal property.
|
||||
|
||||
* OleDbParameter.cs:
|
||||
* OleDbParameterCollection.cs: implemented some methods and
|
||||
properties.
|
||||
|
||||
* libgda.cs: added yet more libgda API functions.
|
||||
|
||||
2002-06-01 Rodrigo Moya <[email protected]>
|
||||
|
||||
* libgda.cs: added new libgda API functions.
|
||||
|
||||
* OleDbConnection.cs (Provider): implemented.
|
||||
(BeginTransaction): made it overload IDbConnection methods.
|
||||
(ChangeDatabase): new stub, needs some work on libgda for being
|
||||
implemented.
|
||||
(Clone): new stub.
|
||||
(Close): implemented.
|
||||
(CreateCommand): implemented.
|
||||
(GetOleDbSchemaTable): new stub, until I understand what to do here.
|
||||
(Open): implemented basic stuff, which is just supporting connection
|
||||
strings that represent a GDA data source name. More to come.
|
||||
(InfoMessage, StateChange): added events.
|
||||
|
||||
* TestOleDb.cs: test program for System.Data.OleDb.
|
||||
|
||||
2002-05-29 Rodrigo Moya <[email protected]>
|
||||
|
||||
* libgda.cs: added static constructor.
|
||||
(GdaClient): new static property to get the underlying GdaClient
|
||||
object.
|
||||
|
||||
* OleDbConnection.cs: removed GDA initialization, which belongs to
|
||||
the static 'libgda' class.
|
||||
|
||||
2002-05-29 Rodrigo Moya <[email protected]>
|
||||
|
||||
* libgda.cs: static class for libgda API calls.
|
||||
|
||||
* OleDbConnection.cs: implemented constructors.
|
||||
(ConnectionString, Connectiontimeout, Database, State):
|
||||
implemented class properties.
|
||||
(BeginTransaction): implemented.
|
||||
|
||||
* OleDbTransaction.cs: implemented protected constructors.
|
||||
|
||||
* TestGDA.cs: simple test for libgda API.
|
||||
|
||||
2002-05-27 Rodrigo Moya <[email protected]>
|
||||
|
||||
Started System.Data.OleDb provider, based on libgda.
|
||||
@@ -13,6 +13,7 @@ using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Data.OleDb
|
||||
{
|
||||
@@ -32,8 +33,7 @@ namespace System.Data.OleDb
|
||||
bool designTimeVisible;
|
||||
OleDbDataReader dataReader;
|
||||
CommandBehavior behavior;
|
||||
ArrayList gdaCommands;
|
||||
ArrayList gdaResults;
|
||||
IntPtr gdaCommand;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
@@ -50,12 +50,10 @@ namespace System.Data.OleDb
|
||||
designTimeVisible = false;
|
||||
dataReader = null;
|
||||
behavior = CommandBehavior.Default;
|
||||
gdaCommands = new ArrayList ();
|
||||
gdaResults = new ArrayList ();
|
||||
gdaCommand = IntPtr.Zero;
|
||||
}
|
||||
|
||||
public OleDbCommand (string cmdText)
|
||||
: this ()
|
||||
public OleDbCommand (string cmdText) : this ()
|
||||
{
|
||||
CommandText = cmdText;
|
||||
}
|
||||
@@ -66,8 +64,9 @@ namespace System.Data.OleDb
|
||||
Connection = connection;
|
||||
}
|
||||
|
||||
public OleDbCommand (string cmdText, OleDbConnection connection, OleDbTransaction transaction)
|
||||
: this (cmdText, connection)
|
||||
public OleDbCommand (string cmdText,
|
||||
OleDbConnection connection,
|
||||
OleDbTransaction transaction) : this (cmdText, connection)
|
||||
{
|
||||
this.transaction = transaction;
|
||||
}
|
||||
@@ -78,71 +77,101 @@ namespace System.Data.OleDb
|
||||
|
||||
public string CommandText
|
||||
{
|
||||
get { return commandText; }
|
||||
get {
|
||||
return commandText;
|
||||
}
|
||||
set {
|
||||
string[] queries = value.Split (new Char[] {';'});
|
||||
gdaCommands.Clear ();
|
||||
|
||||
foreach (string query in queries)
|
||||
gdaCommands.Add (libgda.gda_command_new (query, 0, 0));
|
||||
|
||||
commandText = value;
|
||||
commandText = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int CommandTimeout {
|
||||
get { return timeout; }
|
||||
set { timeout = value; }
|
||||
get {
|
||||
return timeout;
|
||||
}
|
||||
set {
|
||||
timeout = value;
|
||||
}
|
||||
}
|
||||
|
||||
public CommandType CommandType {
|
||||
get { return commandType; }
|
||||
set { commandType = value; }
|
||||
get {
|
||||
return commandType;
|
||||
}
|
||||
set {
|
||||
commandType = value;
|
||||
}
|
||||
}
|
||||
|
||||
public OleDbConnection Connection {
|
||||
get { return connection; }
|
||||
set { connection = value; }
|
||||
get {
|
||||
return connection;
|
||||
}
|
||||
set {
|
||||
connection = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool DesignTimeVisible {
|
||||
get { return designTimeVisible; }
|
||||
set { designTimeVisible = value; }
|
||||
get {
|
||||
return designTimeVisible;
|
||||
}
|
||||
set {
|
||||
designTimeVisible = value;
|
||||
}
|
||||
}
|
||||
|
||||
public OleDbParameterCollection Parameters {
|
||||
get { return parameters; }
|
||||
set { parameters = value; }
|
||||
get {
|
||||
return parameters;
|
||||
}
|
||||
set {
|
||||
parameters = value;
|
||||
}
|
||||
}
|
||||
|
||||
public OleDbTransaction Transaction {
|
||||
get { return transaction; }
|
||||
set { transaction = value; }
|
||||
get {
|
||||
return transaction;
|
||||
}
|
||||
set {
|
||||
transaction = value;
|
||||
}
|
||||
}
|
||||
|
||||
public UpdateRowSource UpdatedRowSource {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
[MonoTODO]
|
||||
set { throw new NotImplementedException (); }
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
IDbConnection IDbCommand.Connection {
|
||||
get { return Connection; }
|
||||
set { Connection = (OleDbConnection) value; }
|
||||
get {
|
||||
return Connection;
|
||||
}
|
||||
set {
|
||||
Connection = (OleDbConnection) value;
|
||||
}
|
||||
}
|
||||
|
||||
IDataParameterCollection IDbCommand.Parameters {
|
||||
get { return Parameters; }
|
||||
get {
|
||||
return Parameters;
|
||||
}
|
||||
}
|
||||
|
||||
IDbTransaction IDbCommand.Transaction {
|
||||
get { return Transaction; }
|
||||
set { Transaction = (OleDbTransaction) value; }
|
||||
}
|
||||
|
||||
internal ArrayList GdaResults {
|
||||
get { return gdaResults; }
|
||||
get {
|
||||
return Transaction;
|
||||
}
|
||||
set {
|
||||
Transaction = (OleDbTransaction) value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
@@ -160,12 +189,44 @@ namespace System.Data.OleDb
|
||||
return new OleDbParameter ();
|
||||
}
|
||||
|
||||
IDbDataParameter IDbCommand.CreateParameter ()
|
||||
{
|
||||
return CreateParameter ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
private void SetupGdaCommand ()
|
||||
{
|
||||
GdaCommandType type;
|
||||
|
||||
switch (commandType) {
|
||||
case CommandType.TableDirect :
|
||||
type = GdaCommandType.Table;
|
||||
break;
|
||||
case CommandType.StoredProcedure :
|
||||
type = GdaCommandType.Procedure;
|
||||
break;
|
||||
case CommandType.Text :
|
||||
default :
|
||||
type = GdaCommandType.Sql;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gdaCommand != IntPtr.Zero) {
|
||||
libgda.gda_command_set_text (gdaCommand, commandText);
|
||||
libgda.gda_command_set_command_type (gdaCommand, type);
|
||||
} else {
|
||||
gdaCommand = libgda.gda_command_new (commandText, type, 0);
|
||||
}
|
||||
|
||||
//libgda.gda_command_set_transaction
|
||||
}
|
||||
|
||||
public int ExecuteNonQuery ()
|
||||
{
|
||||
if (connection == null)
|
||||
@@ -177,7 +238,10 @@ namespace System.Data.OleDb
|
||||
IntPtr gdaConnection = connection.GdaConnection;
|
||||
IntPtr gdaParameterList = parameters.GdaParameterList;
|
||||
|
||||
return libgda.gda_connection_execute_non_query (gdaConnection, (IntPtr) gdaCommands[0], gdaParameterList);
|
||||
SetupGdaCommand ();
|
||||
return libgda.gda_connection_execute_non_query (gdaConnection,
|
||||
(IntPtr) gdaCommand,
|
||||
gdaParameterList);
|
||||
}
|
||||
|
||||
public OleDbDataReader ExecuteReader ()
|
||||
@@ -185,8 +249,17 @@ namespace System.Data.OleDb
|
||||
return ExecuteReader (CommandBehavior.Default);
|
||||
}
|
||||
|
||||
IDataReader IDbCommand.ExecuteReader ()
|
||||
{
|
||||
return ExecuteReader ();
|
||||
}
|
||||
|
||||
public OleDbDataReader ExecuteReader (CommandBehavior behavior)
|
||||
{
|
||||
ArrayList results = new ArrayList ();
|
||||
IntPtr rs_list;
|
||||
GdaList glist_node;
|
||||
|
||||
if (connection.State != ConnectionState.Open)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
@@ -195,20 +268,40 @@ namespace System.Data.OleDb
|
||||
IntPtr gdaConnection = connection.GdaConnection;
|
||||
IntPtr gdaParameterList = parameters.GdaParameterList;
|
||||
|
||||
foreach (IntPtr gdaCommand in gdaCommands)
|
||||
GdaResults.Add (libgda.gda_connection_execute_single_command (gdaConnection, gdaCommand, gdaParameterList));
|
||||
/* execute the command */
|
||||
SetupGdaCommand ();
|
||||
rs_list = libgda.gda_connection_execute_command (
|
||||
gdaConnection,
|
||||
gdaCommand,
|
||||
gdaParameterList);
|
||||
if (rs_list != IntPtr.Zero) {
|
||||
glist_node = (GdaList) Marshal.PtrToStructure (rs_list, typeof (GdaList));
|
||||
|
||||
dataReader = new OleDbDataReader (this);
|
||||
while (glist_node != null) {
|
||||
results.Add (glist_node.data);
|
||||
if (glist_node.next == IntPtr.Zero)
|
||||
break;
|
||||
|
||||
dataReader.NextResult ();
|
||||
glist_node = (GdaList) Marshal.PtrToStructure (glist_node.next,
|
||||
typeof (GdaList));
|
||||
}
|
||||
dataReader = new OleDbDataReader (this, results);
|
||||
dataReader.NextResult ();
|
||||
}
|
||||
|
||||
return dataReader;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
IDataReader IDbCommand.ExecuteReader (CommandBehavior behavior)
|
||||
{
|
||||
return ExecuteReader (behavior);
|
||||
}
|
||||
|
||||
public object ExecuteScalar ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
SetupGdaCommand ();
|
||||
OleDbDataReader reader = ExecuteReader ();
|
||||
return reader.GetValue (0);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -217,24 +310,6 @@ namespace System.Data.OleDb
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
IDbDataParameter IDbCommand.CreateParameter ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
IDataReader IDbCommand.ExecuteReader ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
IDataReader IDbCommand.ExecuteReader (CommandBehavior behavior)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void Prepare ()
|
||||
{
|
||||
@@ -247,17 +322,5 @@ namespace System.Data.OleDb
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
// only meant to be used between OleDbConnectioin,
|
||||
// OleDbCommand, and OleDbDataReader
|
||||
internal void OpenReader (OleDbDataReader reader)
|
||||
{
|
||||
connection.OpenReader (reader);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -31,12 +31,13 @@ namespace System.Data.OleDb
|
||||
|
||||
public OleDbConnection ()
|
||||
{
|
||||
libgda.gda_init ("System.Data.OleDb", "1.0", 0, new string [0]);
|
||||
gdaConnection = IntPtr.Zero;
|
||||
connectionTimeout = 15;
|
||||
connectionString = null;
|
||||
}
|
||||
|
||||
public OleDbConnection (string connectionString)
|
||||
: this ()
|
||||
public OleDbConnection (string connectionString) : this ()
|
||||
{
|
||||
this.connectionString = connectionString;
|
||||
}
|
||||
@@ -46,17 +47,24 @@ namespace System.Data.OleDb
|
||||
#region Properties
|
||||
|
||||
public string ConnectionString {
|
||||
get { return connectionString; }
|
||||
set { connectionString = value; }
|
||||
get {
|
||||
return connectionString;
|
||||
}
|
||||
set {
|
||||
connectionString = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int ConnectionTimeout {
|
||||
get { return connectionTimeout; }
|
||||
get {
|
||||
return connectionTimeout;
|
||||
}
|
||||
}
|
||||
|
||||
public string Database {
|
||||
get {
|
||||
if (gdaConnection != IntPtr.Zero && libgda.gda_connection_is_open (gdaConnection)) {
|
||||
if (gdaConnection != IntPtr.Zero
|
||||
&& libgda.gda_connection_is_open (gdaConnection)) {
|
||||
return libgda.gda_connection_get_database (gdaConnection);
|
||||
}
|
||||
|
||||
@@ -65,15 +73,20 @@ namespace System.Data.OleDb
|
||||
}
|
||||
|
||||
public string DataSource {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
if (gdaConnection != IntPtr.Zero
|
||||
&& libgda.gda_connection_is_open (gdaConnection)) {
|
||||
return libgda.gda_connection_get_dsn (gdaConnection);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string Provider {
|
||||
get {
|
||||
if (gdaConnection != IntPtr.Zero && libgda.gda_connection_is_open (gdaConnection)) {
|
||||
if (gdaConnection != IntPtr.Zero
|
||||
&& libgda.gda_connection_is_open (gdaConnection)) {
|
||||
return libgda.gda_connection_get_provider (gdaConnection);
|
||||
}
|
||||
|
||||
@@ -83,7 +96,9 @@ namespace System.Data.OleDb
|
||||
|
||||
public string ServerVersion {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public ConnectionState State
|
||||
@@ -100,7 +115,9 @@ namespace System.Data.OleDb
|
||||
|
||||
internal IntPtr GdaConnection
|
||||
{
|
||||
get { return gdaConnection; }
|
||||
get {
|
||||
return gdaConnection;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
@@ -115,6 +132,11 @@ namespace System.Data.OleDb
|
||||
return null;
|
||||
}
|
||||
|
||||
IDbTransaction IDbConnection.BeginTransaction ()
|
||||
{
|
||||
return BeginTransaction ();
|
||||
}
|
||||
|
||||
public OleDbTransaction BeginTransaction (IsolationLevel level)
|
||||
{
|
||||
if (gdaConnection != IntPtr.Zero)
|
||||
@@ -123,6 +145,11 @@ namespace System.Data.OleDb
|
||||
return null;
|
||||
}
|
||||
|
||||
IDbTransaction IDbConnection.BeginTransaction (IsolationLevel level)
|
||||
{
|
||||
return BeginTransaction (level);
|
||||
}
|
||||
|
||||
public void ChangeDatabase (string name)
|
||||
{
|
||||
// FIXME: see http://bugzilla.gnome.org/show_bug.cgi?id=83315
|
||||
@@ -138,8 +165,9 @@ namespace System.Data.OleDb
|
||||
|
||||
public OleDbCommand CreateCommand ()
|
||||
{
|
||||
if (gdaConnection != IntPtr.Zero && libgda.gda_connection_is_open (gdaConnection))
|
||||
return new OleDbCommand ();
|
||||
if (gdaConnection != IntPtr.Zero
|
||||
&& libgda.gda_connection_is_open (gdaConnection))
|
||||
return new OleDbCommand (null, this);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -162,30 +190,19 @@ namespace System.Data.OleDb
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
IDbTransaction IDbConnection.BeginTransaction ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
IDbTransaction IDbConnection.BeginTransaction (IsolationLevel level)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
IDbCommand IDbConnection.CreateCommand ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return CreateCommand ();
|
||||
}
|
||||
|
||||
public void Open ()
|
||||
{
|
||||
if (gdaConnection != IntPtr.Zero || libgda.gda_connection_is_open (gdaConnection))
|
||||
if (State == ConnectionState.Open)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
gdaConnection = libgda.gda_client_open_connection (libgda.GdaClient, connectionString, "", "");
|
||||
gdaConnection = libgda.gda_client_open_connection (libgda.GdaClient,
|
||||
connectionString,
|
||||
"", "");
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -194,28 +211,6 @@ namespace System.Data.OleDb
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
// Used to prevent OleDbConnection
|
||||
// from doing anything while
|
||||
// OleDbDataReader is open.
|
||||
// Open the Reader. (called from OleDbCommand)
|
||||
internal void OpenReader(OleDbDataReader reader)
|
||||
{
|
||||
if(dataReaderOpen == true) {
|
||||
// TODO: throw exception here?
|
||||
// because a reader
|
||||
// is already open
|
||||
}
|
||||
else {
|
||||
dataReader = reader;
|
||||
dataReaderOpen = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events and Delegates
|
||||
|
||||
@@ -61,22 +61,22 @@ namespace System.Data.OleDb
|
||||
|
||||
#region Properties
|
||||
|
||||
public new OleDbCommand DeleteCommand {
|
||||
public OleDbCommand DeleteCommand {
|
||||
get { return deleteCommand; }
|
||||
set { deleteCommand = value; }
|
||||
}
|
||||
|
||||
public new OleDbCommand InsertCommand {
|
||||
public OleDbCommand InsertCommand {
|
||||
get { return insertCommand; }
|
||||
set { insertCommand = value; }
|
||||
}
|
||||
|
||||
public new OleDbCommand SelectCommand {
|
||||
public OleDbCommand SelectCommand {
|
||||
get { return selectCommand; }
|
||||
set { selectCommand = value; }
|
||||
}
|
||||
|
||||
public new OleDbCommand UpdateCommand {
|
||||
public OleDbCommand UpdateCommand {
|
||||
get { return updateCommand; }
|
||||
set { updateCommand = value; }
|
||||
}
|
||||
|
||||
@@ -20,18 +20,26 @@ namespace System.Data.OleDb
|
||||
{
|
||||
#region Fields
|
||||
|
||||
OleDbCommand command;
|
||||
bool open;
|
||||
private OleDbCommand command;
|
||||
private bool open;
|
||||
private ArrayList gdaResults;
|
||||
private int currentResult;
|
||||
private int currentRow;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal OleDbDataReader (OleDbCommand command)
|
||||
internal OleDbDataReader (OleDbCommand command, ArrayList results)
|
||||
{
|
||||
this.command = command;
|
||||
open = true;
|
||||
command.OpenReader(this);
|
||||
if (results != null)
|
||||
gdaResults = results;
|
||||
else
|
||||
gdaResults = new ArrayList ();
|
||||
currentResult = -1;
|
||||
currentRow = -1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -40,32 +48,67 @@ namespace System.Data.OleDb
|
||||
|
||||
public int Depth {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public int FieldCount {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
if (currentResult < 0 ||
|
||||
currentResult >= gdaResults.Count)
|
||||
return 0;
|
||||
|
||||
return libgda.gda_data_model_get_n_columns (
|
||||
(IntPtr) gdaResults[currentResult]);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsClosed {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
return !open;
|
||||
}
|
||||
}
|
||||
|
||||
public object this[string name] {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public object this[int index] {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
if (currentResult < 0 ||
|
||||
currentResult >= gdaResults.Count)
|
||||
return null;
|
||||
|
||||
return libgda.gda_data_model_get_value_at (
|
||||
(IntPtr) gdaResults[currentResult],
|
||||
index,
|
||||
currentRow);
|
||||
}
|
||||
}
|
||||
|
||||
public int RecordsAffected {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
int total_rows;
|
||||
|
||||
if (currentResult < 0 ||
|
||||
currentResult >= gdaResults.Count)
|
||||
return 0;
|
||||
|
||||
total_rows = libgda.gda_data_model_get_n_rows (
|
||||
(IntPtr) gdaResults[currentResult]);
|
||||
if (total_rows > 0) {
|
||||
if (FieldCount > 0) {
|
||||
// It's a SELECT statement
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return FieldCount > 0 ? -1 : total_rows;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -84,16 +127,38 @@ namespace System.Data.OleDb
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public bool GetBoolean (int ordinal)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
IntPtr value;
|
||||
|
||||
if (currentResult == -1)
|
||||
throw new InvalidCastException ();
|
||||
|
||||
value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
|
||||
ordinal, currentRow);
|
||||
if (value == IntPtr.Zero)
|
||||
throw new InvalidCastException ();
|
||||
|
||||
if (libgda.gda_value_get_vtype (value) != GdaValueType.Boolean)
|
||||
throw new InvalidCastException ();
|
||||
return libgda.gda_value_get_boolean (value);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public byte GetByte (int ordinal)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
IntPtr value;
|
||||
|
||||
if (currentResult == -1)
|
||||
throw new InvalidCastException ();
|
||||
|
||||
value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
|
||||
ordinal, currentRow);
|
||||
if (value == IntPtr.Zero)
|
||||
throw new InvalidCastException ();
|
||||
|
||||
if (libgda.gda_value_get_vtype (value) != GdaValueType.Tinyint)
|
||||
throw new InvalidCastException ();
|
||||
return libgda.gda_value_get_tinyint (value);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -101,11 +166,22 @@ namespace System.Data.OleDb
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
|
||||
public char GetChar (int ordinal)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
IntPtr value;
|
||||
|
||||
if (currentResult == -1)
|
||||
throw new InvalidCastException ();
|
||||
|
||||
value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
|
||||
ordinal, currentRow);
|
||||
if (value == IntPtr.Zero)
|
||||
throw new InvalidCastException ();
|
||||
|
||||
if (libgda.gda_value_get_vtype (value) != GdaValueType.Tinyint)
|
||||
throw new InvalidCastException ();
|
||||
return (char) libgda.gda_value_get_tinyint (value);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -120,10 +196,19 @@ namespace System.Data.OleDb
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public string GetDataTypeName (int index)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
IntPtr value;
|
||||
|
||||
if (currentResult == -1)
|
||||
return "unknown";
|
||||
|
||||
value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
|
||||
index, currentRow);
|
||||
if (value == IntPtr.Zero)
|
||||
return "unknown";
|
||||
|
||||
return libgda.gda_type_to_string (libgda.gda_value_get_vtype (value));
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -210,10 +295,23 @@ namespace System.Data.OleDb
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public object GetValue (int ordinal)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
IntPtr value;
|
||||
GdaValueType type;
|
||||
|
||||
if (currentResult == -1)
|
||||
throw new IndexOutOfRangeException ();
|
||||
|
||||
value = libgda.gda_data_model_get_value_at ((IntPtr) gdaResults[currentResult],
|
||||
ordinal, currentRow);
|
||||
if (value == IntPtr.Zero)
|
||||
throw new IndexOutOfRangeException ();
|
||||
|
||||
type = libgda.gda_value_get_vtype (value);
|
||||
// FIXME: return correct type
|
||||
|
||||
return (object) libgda.gda_value_stringify (value);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -246,16 +344,29 @@ namespace System.Data.OleDb
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public bool NextResult ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
int i = currentResult + 1;
|
||||
if (i >= 0 && i < gdaResults.Count) {
|
||||
currentResult++;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public bool Read ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
if (currentResult < 0 ||
|
||||
currentResult >= gdaResults.Count)
|
||||
return false;
|
||||
|
||||
currentRow++;
|
||||
if (currentRow <
|
||||
libgda.gda_data_model_get_n_rows ((IntPtr) gdaResults[currentResult]))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -67,16 +67,28 @@ namespace System.Data.OleDb
|
||||
set { list[index] = value; }
|
||||
}
|
||||
|
||||
object IDataParameterCollection.this[string name] {
|
||||
object IDataParameterCollection.this[string name]
|
||||
{
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
[MonoTODO]
|
||||
set { throw new NotImplementedException (); }
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
internal IntPtr GdaParameterList {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
IntPtr param_list;
|
||||
|
||||
param_list = libgda.gda_parameter_list_new ();
|
||||
// FIXME: add parameters to list
|
||||
|
||||
return param_list;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
@@ -61,13 +61,13 @@ namespace System.Data.OleDb
|
||||
get { return connection; }
|
||||
}
|
||||
|
||||
public IsolationLevel IsolationLevel {
|
||||
get { return isolationLevel; }
|
||||
}
|
||||
|
||||
IDbConnection IDbTransaction.Connection {
|
||||
get { return connection; }
|
||||
}
|
||||
|
||||
public IsolationLevel IsolationLevel {
|
||||
get { return isolationLevel; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
|
||||
@@ -10,11 +10,54 @@ namespace System.Data.OleDb.Test
|
||||
private TestOleDb ()
|
||||
{
|
||||
m_cnc = new OleDbConnection ("PostgreSQL");
|
||||
m_cnc.Open ();
|
||||
}
|
||||
|
||||
void DisplayRow (IDataReader reader)
|
||||
{
|
||||
for (int i = 0; i < reader.FieldCount; i++) {
|
||||
Console.WriteLine (" " + reader.GetDataTypeName (i) + ": " +
|
||||
reader.GetValue (i).ToString ());
|
||||
}
|
||||
}
|
||||
|
||||
void TestDataReader ()
|
||||
{
|
||||
int i = 0;
|
||||
string sql = "SELECT * FROM pg_tables";
|
||||
|
||||
Console.WriteLine ("Executing command...");
|
||||
OleDbCommand cmd = new OleDbCommand (sql, m_cnc);
|
||||
IDataReader reader = cmd.ExecuteReader ();
|
||||
|
||||
Console.WriteLine (" Recordset description:");
|
||||
for (i = 0; i < reader.FieldCount; i++) {
|
||||
Console.WriteLine (" Field " + i + ": " + reader.GetDataTypeName (i));
|
||||
}
|
||||
|
||||
Console.WriteLine ("Reading data...");
|
||||
i = 0;
|
||||
while (reader.Read ()) {
|
||||
Console.WriteLine ("Row " + i + ":");
|
||||
DisplayRow (reader);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
void Close ()
|
||||
{
|
||||
m_cnc.Close ();
|
||||
}
|
||||
|
||||
static void Main (string[] args)
|
||||
{
|
||||
TestOleDb test = new TestOleDb ();
|
||||
try {
|
||||
TestOleDb test = new TestOleDb ();
|
||||
test.TestDataReader ();
|
||||
test.Close ();
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine ("An error has occured: {0}", e.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,29 +29,83 @@ namespace System.Data.OleDb
|
||||
Schema = 4,
|
||||
Invalid = 5
|
||||
};
|
||||
|
||||
internal enum GdaValueType {
|
||||
Null = 0,
|
||||
Bigint = 1,
|
||||
Binary = 2,
|
||||
Boolean = 3,
|
||||
Date = 4,
|
||||
Double = 5,
|
||||
GeometricPoint = 6,
|
||||
Integer = 7,
|
||||
List = 8,
|
||||
Numeric = 9,
|
||||
Single = 10,
|
||||
Smallint = 11,
|
||||
String = 12,
|
||||
Time = 13,
|
||||
Timestamp = 14,
|
||||
Tinyint = 15,
|
||||
Type = 16,
|
||||
Unknown = 17
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal class GdaList
|
||||
{
|
||||
public IntPtr data;
|
||||
public IntPtr next;
|
||||
public IntPtr prev;
|
||||
}
|
||||
|
||||
sealed internal class libgda
|
||||
{
|
||||
private static IntPtr m_gdaClient = IntPtr.Zero;
|
||||
|
||||
static libgda ()
|
||||
{
|
||||
gda_init ("System.Data.OleDb", "0.1", 0, null);
|
||||
}
|
||||
private static IntPtr gdaClient = IntPtr.Zero;
|
||||
|
||||
public static IntPtr GdaClient
|
||||
{
|
||||
get {
|
||||
if (m_gdaClient == IntPtr.Zero)
|
||||
m_gdaClient = gda_client_new ();
|
||||
if (gdaClient == IntPtr.Zero)
|
||||
gdaClient = gda_client_new ();
|
||||
|
||||
return m_gdaClient;
|
||||
return gdaClient;
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern void gda_init (string app_id, string version, int nargs, string[] args);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern GdaValueType gda_value_get_vtype (IntPtr value);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern bool gda_value_get_boolean (IntPtr value);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern int gda_value_get_smallint (IntPtr value);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern byte gda_value_get_tinyint (IntPtr value);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern string gda_value_stringify (IntPtr value);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern IntPtr gda_parameter_list_new ();
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern string gda_type_to_string (GdaValueType type);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern int gda_data_model_get_n_rows (IntPtr model);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern int gda_data_model_get_n_columns (IntPtr model);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern IntPtr gda_data_model_get_value_at (IntPtr model, int col, int row);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern IntPtr gda_client_new ();
|
||||
|
||||
@@ -100,6 +154,9 @@ namespace System.Data.OleDb
|
||||
[DllImport("gda-2")]
|
||||
public static extern bool gda_connection_rollback_transaction (IntPtr cnc, IntPtr xaction);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern IntPtr gda_connection_execute_command (IntPtr cnc, IntPtr cmd, IntPtr parameterList);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern int gda_connection_execute_non_query (IntPtr cnc, IntPtr command, IntPtr parameterList);
|
||||
|
||||
@@ -107,6 +164,12 @@ namespace System.Data.OleDb
|
||||
public static extern IntPtr gda_connection_execute_single_command (IntPtr cnc, IntPtr command, IntPtr parameterList);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern IntPtr gda_command_new (string text, int type, int options);
|
||||
public static extern IntPtr gda_command_new (string text, GdaCommandType type, GdaCommandOptions options);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern void gda_command_set_text (IntPtr cmd, string text);
|
||||
|
||||
[DllImport("gda-2")]
|
||||
public static extern void gda_command_set_command_type (IntPtr cmd, GdaCommandType type);
|
||||
}
|
||||
}
|
||||
@@ -65,24 +65,40 @@ namespace System.Data.SqlClient
|
||||
|
||||
#region Properties
|
||||
|
||||
public new SqlCommand DeleteCommand {
|
||||
get { return deleteCommand; }
|
||||
set { deleteCommand = value; }
|
||||
public SqlCommand DeleteCommand {
|
||||
get {
|
||||
return deleteCommand;
|
||||
}
|
||||
set {
|
||||
deleteCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new SqlCommand InsertCommand {
|
||||
get { return insertCommand; }
|
||||
set { insertCommand = value; }
|
||||
public SqlCommand InsertCommand {
|
||||
get {
|
||||
return insertCommand;
|
||||
}
|
||||
set {
|
||||
insertCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new SqlCommand SelectCommand {
|
||||
get { return selectCommand; }
|
||||
set { selectCommand = value; }
|
||||
public SqlCommand SelectCommand {
|
||||
get {
|
||||
return selectCommand;
|
||||
}
|
||||
set {
|
||||
selectCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
public new SqlCommand UpdateCommand {
|
||||
get { return updateCommand; }
|
||||
set { updateCommand = value; }
|
||||
public SqlCommand UpdateCommand {
|
||||
get {
|
||||
return updateCommand;
|
||||
}
|
||||
set {
|
||||
updateCommand = value;
|
||||
}
|
||||
}
|
||||
|
||||
IDbCommand IDbDataAdapter.DeleteCommand {
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
namespace System.Data.SqlTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// compare option values for SqlString
|
||||
/// Specifies the compare option values for a SqlString structure.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
[Serializable]
|
||||
public enum SqlCompareOptions {
|
||||
BinarySort,
|
||||
IgnoreCase,
|
||||
IgnoreKanaType,
|
||||
IgnoreNonSpace,
|
||||
IgnoreWidth,
|
||||
None
|
||||
BinarySort = 0x8000,
|
||||
IgnoreCase = 0x1,
|
||||
IgnoreKanaType = 0x8,
|
||||
IgnoreNonSpace = 0x2,
|
||||
IgnoreWidth = 0x10,
|
||||
None = 0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
// System.Data.Constraint.cs
|
||||
//
|
||||
// Author:
|
||||
// Daniel Morgan
|
||||
// Franklin Wise <[email protected]>
|
||||
// Daniel Morgan
|
||||
//
|
||||
//
|
||||
// (C) Ximian, Inc. 2002
|
||||
//
|
||||
@@ -16,32 +18,49 @@ using System.Runtime.Serialization;
|
||||
namespace System.Data
|
||||
{
|
||||
[Serializable]
|
||||
public abstract class Constraint {
|
||||
internal delegate void DelegateConstraintNameChange(object sender,
|
||||
string newName);
|
||||
|
||||
[Serializable]
|
||||
public abstract class Constraint
|
||||
{
|
||||
internal event DelegateConstraintNameChange
|
||||
BeforeConstraintNameChange;
|
||||
|
||||
protected string name = null;
|
||||
protected PropertyCollection properties = null;
|
||||
//if constraintName is not set then a name is
|
||||
//created when it is added to
|
||||
//the ConstraintCollection
|
||||
//it can not be set to null, empty or duplicate
|
||||
//once it has been added to the collection
|
||||
private string _constraintName = null;
|
||||
private PropertyCollection _properties = null;
|
||||
|
||||
[MonoTODO]
|
||||
protected Constraint() {
|
||||
properties = new PropertyCollection();
|
||||
//Used for membership checking
|
||||
private ConstraintCollection _constraintCollection;
|
||||
|
||||
protected Constraint()
|
||||
{
|
||||
_properties = new PropertyCollection();
|
||||
}
|
||||
|
||||
public virtual string ConstraintName {
|
||||
[MonoTODO]
|
||||
get{
|
||||
return name;
|
||||
return "" + _constraintName;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
set{
|
||||
name = value;
|
||||
//This should only throw an exception when it
|
||||
//is a member of a ConstraintCollection which
|
||||
//means we should let the ConstraintCollection
|
||||
//handle exceptions when this value changes
|
||||
_onConstraintNameChange(value);
|
||||
_constraintName = value;
|
||||
}
|
||||
}
|
||||
|
||||
public PropertyCollection ExtendedProperties {
|
||||
[MonoTODO]
|
||||
get {
|
||||
return properties;
|
||||
return _properties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,14 +68,46 @@ namespace System.Data
|
||||
get;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public override string ToString() {
|
||||
return name;
|
||||
/// <summary>
|
||||
/// Gets the ConstraintName, if there is one, as a string.
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return "" + _constraintName;
|
||||
}
|
||||
|
||||
//[MonoTODO]
|
||||
//[ClassInterface(ClassInterfaceType.AutoDual)]
|
||||
//~Constraint() {
|
||||
//}
|
||||
internal ConstraintCollection ConstraintCollection {
|
||||
get{
|
||||
return _constraintCollection;
|
||||
}
|
||||
set{
|
||||
_constraintCollection = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void _onConstraintNameChange(string newName)
|
||||
{
|
||||
if (null != BeforeConstraintNameChange)
|
||||
{
|
||||
BeforeConstraintNameChange(this, newName);
|
||||
}
|
||||
}
|
||||
|
||||
//call once before adding a constraint to a collection
|
||||
//will throw an exception to prevent the add if a rule is broken
|
||||
internal protected abstract void AddToConstraintCollectionSetup(
|
||||
ConstraintCollection collection);
|
||||
|
||||
//call once before removing a constraint to a collection
|
||||
//can throw an exception to prevent the removal
|
||||
internal protected abstract void RemoveFromConstraintCollectionCleanup(
|
||||
ConstraintCollection collection);
|
||||
|
||||
|
||||
//Call to Validate the constraint
|
||||
//Will throw if constraint is violated
|
||||
internal abstract void AssertConstraint();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
// System.Data.ConstraintCollection.cs
|
||||
//
|
||||
// Author:
|
||||
// Franklin Wise <[email protected]>
|
||||
// Daniel Morgan
|
||||
//
|
||||
//
|
||||
// (C) Ximian, Inc. 2002
|
||||
// (C) 2002 Franklin Wise
|
||||
// (C) 2002 Daniel Morgan
|
||||
//
|
||||
|
||||
@@ -14,63 +16,175 @@ using System.ComponentModel;
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
[Serializable]
|
||||
internal delegate void DelegateValidateRemoveConstraint(ConstraintCollection sender,
|
||||
Constraint constraintToRemove, ref bool fail,ref string failReason);
|
||||
|
||||
/// <summary>
|
||||
/// hold collection of constraints for data table
|
||||
/// </summary>
|
||||
public class ConstraintCollection : InternalDataCollectionBase {
|
||||
[Serializable]
|
||||
public class ConstraintCollection : InternalDataCollectionBase
|
||||
{
|
||||
private bool beginInit = false;
|
||||
|
||||
public event CollectionChangeEventHandler CollectionChanged;
|
||||
internal event DelegateValidateRemoveConstraint ValidateRemoveConstraint;
|
||||
|
||||
//Don't allow public instantiation
|
||||
//Will be instantianted from DataTable
|
||||
internal ConstraintCollection(){}
|
||||
|
||||
public virtual Constraint this[string name] {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
//If the name is not found we just return null
|
||||
int index = IndexOf(name); //case insensitive
|
||||
if (-1 == index) return null;
|
||||
return this[index];
|
||||
}
|
||||
}
|
||||
|
||||
public virtual Constraint this[int index] {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
if (index < 0 || index >= List.Count)
|
||||
throw new IndexOutOfRangeException();
|
||||
return (Constraint)List[index];
|
||||
}
|
||||
}
|
||||
|
||||
private void _handleBeforeConstraintNameChange(object sender, string newName)
|
||||
{
|
||||
//null or empty
|
||||
if (newName == null || newName == "")
|
||||
throw new ArgumentException("ConstraintName cannot be set to null or empty " +
|
||||
" after it has been added to a ConstraintCollection.");
|
||||
|
||||
if (_isDuplicateConstraintName(newName,(Constraint)sender))
|
||||
throw new DuplicateNameException("Constraint name already exists.");
|
||||
}
|
||||
|
||||
private bool _isDuplicateConstraintName(string constraintName, Constraint excludeFromComparison)
|
||||
{
|
||||
string cmpr = constraintName.ToUpper();
|
||||
foreach (Constraint cst in List)
|
||||
{
|
||||
//Case insensitive comparision
|
||||
if ( cmpr.CompareTo(cst.ConstraintName.ToUpper()) == 0 &&
|
||||
cst != excludeFromComparison)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//finds an open name slot of ConstraintXX
|
||||
//where XX is a number
|
||||
private string _createNewConstraintName()
|
||||
{
|
||||
bool loopAgain = false;
|
||||
int index = 1;
|
||||
|
||||
do
|
||||
{
|
||||
loopAgain = false;
|
||||
foreach (Constraint cst in List)
|
||||
{
|
||||
//Case insensitive
|
||||
if (cst.ConstraintName.ToUpper().CompareTo("CONSTRAINT" +
|
||||
index.ToString()) == 0 )
|
||||
{
|
||||
loopAgain = true;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
} while (loopAgain);
|
||||
|
||||
return "Constraint" + index.ToString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Overloaded Add method (5 of them)
|
||||
// to add Constraint object to the collection
|
||||
|
||||
[MonoTODO]
|
||||
public void Add(Constraint constraint) {
|
||||
public void Add(Constraint constraint)
|
||||
{
|
||||
//not null
|
||||
if (null == constraint) throw new ArgumentNullException("Can not add null.");
|
||||
|
||||
throw new NotImplementedException ();
|
||||
//check constraint membership
|
||||
//can't already exist in this collection or any other
|
||||
if (this == constraint.ConstraintCollection)
|
||||
throw new ArgumentException("Constraint already belongs to this collection.");
|
||||
if (null != constraint.ConstraintCollection)
|
||||
throw new ArgumentException("Constraint already belongs to another collection.");
|
||||
|
||||
//check for duplicate name
|
||||
if (_isDuplicateConstraintName(constraint.ConstraintName,null) )
|
||||
throw new DuplicateNameException("Constraint name already exists.");
|
||||
|
||||
//Allow constraint to run validation rules and setup
|
||||
constraint.AddToConstraintCollectionSetup(this); //may throw if it can't setup
|
||||
|
||||
//Run Constraint to check existing data in table
|
||||
constraint.AssertConstraint();
|
||||
|
||||
//if name is null or empty give it a name
|
||||
if (constraint.ConstraintName == null ||
|
||||
constraint.ConstraintName == "" )
|
||||
{
|
||||
constraint.ConstraintName = _createNewConstraintName();
|
||||
}
|
||||
|
||||
//Add event handler for ConstraintName change
|
||||
constraint.BeforeConstraintNameChange += new DelegateConstraintNameChange(
|
||||
_handleBeforeConstraintNameChange);
|
||||
|
||||
constraint.ConstraintCollection = this;
|
||||
List.Add(constraint);
|
||||
|
||||
OnCollectionChanged( new CollectionChangeEventArgs( CollectionChangeAction.Add, this) );
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual Constraint Add(string name,
|
||||
DataColumn column, bool primaryKey) {
|
||||
|
||||
|
||||
throw new NotImplementedException ();
|
||||
public virtual Constraint Add(string name, DataColumn column, bool primaryKey)
|
||||
{
|
||||
|
||||
UniqueConstraint uc = new UniqueConstraint(name, column, primaryKey);
|
||||
Add(uc);
|
||||
|
||||
return uc;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual Constraint Add(string name,
|
||||
DataColumn primaryKeyColumn,
|
||||
DataColumn foreignKeyColumn) {
|
||||
public virtual Constraint Add(string name, DataColumn primaryKeyColumn,
|
||||
DataColumn foreignKeyColumn)
|
||||
{
|
||||
ForeignKeyConstraint fc = new ForeignKeyConstraint(name, primaryKeyColumn,
|
||||
foreignKeyColumn);
|
||||
Add(fc);
|
||||
|
||||
throw new NotImplementedException ();
|
||||
return fc;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual Constraint Add(string name,
|
||||
DataColumn[] columns, bool primaryKey) {
|
||||
public virtual Constraint Add(string name, DataColumn[] columns, bool primaryKey)
|
||||
{
|
||||
UniqueConstraint uc = new UniqueConstraint(name, columns, primaryKey);
|
||||
Add(uc);
|
||||
|
||||
throw new NotImplementedException ();
|
||||
return uc;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual Constraint Add(string name,
|
||||
DataColumn[] primaryKeyColumns,
|
||||
DataColumn[] foreignKeyColumns) {
|
||||
public virtual Constraint Add(string name, DataColumn[] primaryKeyColumns,
|
||||
DataColumn[] foreignKeyColumns)
|
||||
{
|
||||
ForeignKeyConstraint fc = new ForeignKeyConstraint(name, primaryKeyColumns,
|
||||
foreignKeyColumns);
|
||||
Add(fc);
|
||||
|
||||
throw new NotImplementedException ();
|
||||
return fc;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -79,63 +193,152 @@ namespace System.Data
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public bool CanRemove(Constraint constraint) {
|
||||
public bool CanRemove(Constraint constraint)
|
||||
{
|
||||
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
//Rule A UniqueConstraint can't be removed if there is
|
||||
//a foreign key relationship to that column
|
||||
|
||||
[MonoTODO]
|
||||
public void Clear() {
|
||||
//not null
|
||||
//LAMESPEC: MSFT implementation throws and exception here
|
||||
//spec says nothing about this
|
||||
if (null == constraint) throw new ArgumentNullException("Constraint can't be null.");
|
||||
|
||||
//LAMESPEC: spec says return false (which makes sense) and throw exception for False case (?).
|
||||
//TODO: I may want to change how this is done
|
||||
//maybe put a CanRemove on the Constraint class
|
||||
//and have the Constraint fire this event
|
||||
|
||||
//discover if there is a related ForeignKey
|
||||
string failReason ="";
|
||||
return _canRemoveConstraint(constraint, ref failReason);
|
||||
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public bool Contains(string name) {
|
||||
throw new NotImplementedException ();
|
||||
public void Clear()
|
||||
{
|
||||
|
||||
//CanRemove? See Lamespec below.
|
||||
|
||||
//the Constraints have a reference to us
|
||||
//and we listen to name change events
|
||||
//we should remove these before clearing
|
||||
foreach (Constraint con in List)
|
||||
{
|
||||
con.ConstraintCollection = null;
|
||||
con.BeforeConstraintNameChange -= new DelegateConstraintNameChange(
|
||||
_handleBeforeConstraintNameChange);
|
||||
}
|
||||
|
||||
//LAMESPEC: MSFT implementation allows this
|
||||
//even when a ForeignKeyConstraint exist for a UniqueConstraint
|
||||
//thus violating the CanRemove logic
|
||||
List.Clear(); //Will violate CanRemove rule
|
||||
OnCollectionChanged( new CollectionChangeEventArgs(CollectionChangeAction.Refresh, this) );
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public int IndexOf(Constraint constraint) {
|
||||
throw new NotImplementedException ();
|
||||
public bool Contains(string name)
|
||||
{
|
||||
return (-1 != IndexOf(name));
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual int IndexOf(string constraintName) {
|
||||
throw new NotImplementedException ();
|
||||
public int IndexOf(Constraint constraint)
|
||||
{
|
||||
return List.IndexOf(constraint);
|
||||
}
|
||||
|
||||
public virtual int IndexOf(string constraintName)
|
||||
{
|
||||
//LAMESPEC: Spec doesn't say case insensitive
|
||||
//it should to be consistant with the other
|
||||
//case insensitive comparisons in this class
|
||||
|
||||
int index = 0;
|
||||
foreach (Constraint con in List)
|
||||
{
|
||||
if (constraintName.ToUpper().CompareTo( con.ConstraintName.ToUpper() ) == 0)
|
||||
{
|
||||
return index;
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
return -1; //not found
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void Remove(Constraint constraint) {
|
||||
throw new NotImplementedException ();
|
||||
//LAMESPEC: spec doesn't document the ArgumentException the
|
||||
//will be thrown if the CanRemove rule is violated
|
||||
|
||||
//LAMESPEC: spec says an exception will be thrown
|
||||
//if the element is not in the collection. The implementation
|
||||
//doesn't throw an exception. ArrayList.Remove doesn't throw if the
|
||||
//element doesn't exist
|
||||
//ALSO the overloaded remove in the spec doesn't say it throws any exceptions
|
||||
|
||||
//not null
|
||||
if (null == constraint) throw new ArgumentNullException();
|
||||
|
||||
string failReason = "";
|
||||
if (! _canRemoveConstraint(constraint, ref failReason) )
|
||||
{
|
||||
if (failReason != null || failReason != "")
|
||||
throw new ArgumentException(failReason);
|
||||
else
|
||||
throw new ArgumentException("Can't remove constraint.");
|
||||
}
|
||||
|
||||
constraint.RemoveFromConstraintCollectionCleanup(this);
|
||||
List.Remove(constraint);
|
||||
OnCollectionChanged( new CollectionChangeEventArgs(CollectionChangeAction.Remove,this));
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void Remove(string name) {
|
||||
throw new NotImplementedException ();
|
||||
public void Remove(string name)
|
||||
{
|
||||
//if doesn't exist fail quietly
|
||||
int index = IndexOf(name);
|
||||
if (-1 == index) return;
|
||||
|
||||
Remove(this[index]);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void RemoveAt(int index) {
|
||||
throw new NotImplementedException ();
|
||||
public void RemoveAt(int index)
|
||||
{
|
||||
if (index < 0 || index + 1 > List.Count)
|
||||
throw new IndexOutOfRangeException("Index out of range, index = "
|
||||
+ index.ToString() + ".");
|
||||
|
||||
this[index].RemoveFromConstraintCollectionCleanup(this);
|
||||
List.RemoveAt(index);
|
||||
OnCollectionChanged( new CollectionChangeEventArgs(CollectionChangeAction.Remove,this));
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public event CollectionChangeEventHandler CollectionChanged;
|
||||
|
||||
protected override ArrayList List {
|
||||
[MonoTODO]
|
||||
get{
|
||||
throw new NotImplementedException ();
|
||||
return base.List;
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected virtual void OnCollectionChanged(
|
||||
CollectionChangeEventArgs ccevent) {
|
||||
protected virtual void OnCollectionChanged( CollectionChangeEventArgs ccevent)
|
||||
{
|
||||
if (null != CollectionChanged)
|
||||
{
|
||||
CollectionChanged(this, ccevent);
|
||||
}
|
||||
}
|
||||
|
||||
throw new NotImplementedException ();
|
||||
private bool _canRemoveConstraint(Constraint constraint, ref string failReason )
|
||||
{
|
||||
bool cancel = false;
|
||||
string tmp = "";
|
||||
if (null != ValidateRemoveConstraint)
|
||||
{
|
||||
ValidateRemoveConstraint(this, constraint, ref cancel, ref tmp);
|
||||
}
|
||||
failReason = tmp;
|
||||
return !cancel;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,11 +16,26 @@ using System.ComponentModel;
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
internal delegate void DelegateColumnValueChange(DataColumn column,
|
||||
DataRow row, object proposedValue);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Summary description for DataColumn.
|
||||
/// </summary>
|
||||
public class DataColumn : MarshalByValueComponent
|
||||
{
|
||||
#region Events
|
||||
[MonoTODO]
|
||||
//used for constraint validation
|
||||
//if an exception is fired during this event the change should be canceled
|
||||
internal event DelegateColumnValueChange ValidateColumnValueChange;
|
||||
|
||||
//used for FK Constraint Cascading rules
|
||||
internal event DelegateColumnValueChange ColumnValueChanging;
|
||||
#endregion //Events
|
||||
|
||||
|
||||
#region Fields
|
||||
|
||||
private bool allowDBNull = true;
|
||||
@@ -39,7 +54,7 @@ namespace System.Data
|
||||
private int ordinal = -1;
|
||||
private string prefix = null;
|
||||
private bool readOnly = false;
|
||||
private DataTable table = null;
|
||||
private DataTable _table = null;
|
||||
private bool unique = false;
|
||||
|
||||
#endregion // Fields
|
||||
@@ -269,11 +284,11 @@ namespace System.Data
|
||||
readOnly = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public DataTable Table
|
||||
{
|
||||
get {
|
||||
return table;
|
||||
return _table;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,10 +339,36 @@ namespace System.Data
|
||||
|
||||
[MonoTODO]
|
||||
internal void SetTable(DataTable table) {
|
||||
this.table = table;
|
||||
// FIXME: this will get called by DataTable
|
||||
_table = table;
|
||||
// FIXME: this will get called by DataTable
|
||||
// and DataColumnCollection
|
||||
}
|
||||
|
||||
|
||||
// Returns true if all the same collumns are in columnSet and compareSet
|
||||
internal static bool AreColumnSetsTheSame(DataColumn[] columnSet, DataColumn[] compareSet)
|
||||
{
|
||||
if (null == columnSet && null == compareSet) return true;
|
||||
if (null == columnSet || null == compareSet) return false;
|
||||
|
||||
if (columnSet.Length != compareSet.Length) return false;
|
||||
|
||||
foreach (DataColumn col in columnSet)
|
||||
{
|
||||
bool matchFound = false;
|
||||
foreach (DataColumn compare in compareSet)
|
||||
{
|
||||
if (col == compare)
|
||||
{
|
||||
matchFound = true;
|
||||
}
|
||||
}
|
||||
if (! matchFound) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ namespace System.Data
|
||||
{
|
||||
DataColumn column = new DataColumn("Column" + defaultNameIndex.ToString());
|
||||
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
|
||||
|
||||
column.SetTable(parentTable);
|
||||
base.List.Add(column);
|
||||
OnCollectionChanged(e);
|
||||
defaultNameIndex++;
|
||||
@@ -103,6 +105,8 @@ namespace System.Data
|
||||
else
|
||||
{
|
||||
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
|
||||
|
||||
column.SetTable( parentTable);
|
||||
base.List.Add(column);
|
||||
OnCollectionChanged(e);
|
||||
return;
|
||||
@@ -132,6 +136,7 @@ namespace System.Data
|
||||
DataColumn column = new DataColumn(columnName);
|
||||
|
||||
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
|
||||
column.SetTable(parentTable);
|
||||
base.List.Add(column);
|
||||
OnCollectionChanged(e);
|
||||
return column;
|
||||
@@ -160,6 +165,7 @@ namespace System.Data
|
||||
{
|
||||
DataColumn column = new DataColumn(columnName, type);
|
||||
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
|
||||
column.SetTable(parentTable);
|
||||
base.List.Add(column);
|
||||
OnCollectionChanged(e);
|
||||
return column;
|
||||
@@ -189,6 +195,7 @@ namespace System.Data
|
||||
{
|
||||
DataColumn column = new DataColumn(columnName, type, expression);
|
||||
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
|
||||
column.SetTable(parentTable);
|
||||
base.List.Add(column);
|
||||
OnCollectionChanged(e);
|
||||
return column;
|
||||
|
||||
@@ -73,7 +73,9 @@ namespace System.Data
|
||||
/// Gets or sets the data stored in the column specified by name.
|
||||
/// </summary>
|
||||
public object this[string columnName] {
|
||||
[MonoTODO] //FIXME: will return different values depending on DataRowState
|
||||
get { return this[columnName, DataRowVersion.Current]; }
|
||||
[MonoTODO]
|
||||
set {
|
||||
DataColumn column = table.Columns[columnName];
|
||||
if (column == null)
|
||||
@@ -86,7 +88,10 @@ namespace System.Data
|
||||
/// Gets or sets the data stored in specified DataColumn
|
||||
/// </summary>
|
||||
public object this[DataColumn column] {
|
||||
get { return this[column, DataRowVersion.Current]; }
|
||||
[MonoTODO] //FIXME: will return different values depending on DataRowState
|
||||
get { return this[column, DataRowVersion.Current]; }
|
||||
|
||||
[MonoTODO]
|
||||
set {
|
||||
bool objIsDBNull = value.Equals(DBNull.Value);
|
||||
if (column == null)
|
||||
@@ -116,10 +121,12 @@ namespace System.Data
|
||||
/// Gets or sets the data stored in column specified by index.
|
||||
/// </summary>
|
||||
public object this[int columnIndex] {
|
||||
[MonoTODO] //FIXME: not always supposed to return current
|
||||
get { return this[columnIndex, DataRowVersion.Current]; }
|
||||
[MonoTODO]
|
||||
set {
|
||||
DataColumn column = table.Columns[columnIndex];
|
||||
if (column == null)
|
||||
DataColumn column = table.Columns[columnIndex]; //FIXME: will throw
|
||||
if (column == null)
|
||||
throw new IndexOutOfRangeException ();
|
||||
this[column] = value;
|
||||
}
|
||||
@@ -129,8 +136,9 @@ namespace System.Data
|
||||
/// Gets the specified version of data stored in the named column.
|
||||
/// </summary>
|
||||
public object this[string columnName, DataRowVersion version] {
|
||||
[MonoTODO]
|
||||
get {
|
||||
DataColumn column = table.Columns[columnName];
|
||||
DataColumn column = table.Columns[columnName]; //FIXME: will throw
|
||||
if (column == null)
|
||||
throw new IndexOutOfRangeException ();
|
||||
return this[column, version];
|
||||
@@ -175,8 +183,9 @@ namespace System.Data
|
||||
/// retrieve.
|
||||
/// </summary>
|
||||
public object this[int columnIndex, DataRowVersion version] {
|
||||
[MonoTODO]
|
||||
get {
|
||||
DataColumn column = table.Columns[columnIndex];
|
||||
DataColumn column = table.Columns[columnIndex]; //FIXME: throws
|
||||
if (column == null)
|
||||
throw new IndexOutOfRangeException ();
|
||||
return this[column, version];
|
||||
@@ -186,6 +195,7 @@ namespace System.Data
|
||||
/// <summary>
|
||||
/// Gets or sets all of the values for this row through an array.
|
||||
/// </summary>
|
||||
[MonoTODO]
|
||||
public object[] ItemArray {
|
||||
get { return current; }
|
||||
set {
|
||||
@@ -206,11 +216,15 @@ namespace System.Data
|
||||
continue;
|
||||
}
|
||||
|
||||
//FIXME: int strings can be converted to ints
|
||||
if (table.Columns[i].DataType != value[i].GetType())
|
||||
throw new InvalidCastException ();
|
||||
}
|
||||
|
||||
//FIXME: BeginEdit() not correct
|
||||
BeginEdit (); // implicitly called
|
||||
//FIXME: this isn't correct. a shorter array can set the first few values
|
||||
//and not touch the rest. So not all the values will get replaced
|
||||
proposed = value;
|
||||
}
|
||||
}
|
||||
@@ -246,6 +260,7 @@ namespace System.Data
|
||||
/// Commits all the changes made to this row since the last time AcceptChanges was
|
||||
/// called.
|
||||
/// </summary>
|
||||
[MonoTODO]
|
||||
public void AcceptChanges ()
|
||||
{
|
||||
this.EndEdit ();
|
||||
@@ -259,7 +274,7 @@ namespace System.Data
|
||||
rowState = DataRowState.Unchanged;
|
||||
break;
|
||||
case DataRowState.Deleted:
|
||||
table.Rows.Remove (this);
|
||||
table.Rows.Remove (this); //FIXME: this should occur in end edit
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -269,6 +284,7 @@ namespace System.Data
|
||||
/// <summary>
|
||||
/// Begins an edit operation on a DataRow object.
|
||||
/// </summary>
|
||||
[MonoTODO]
|
||||
public void BeginEdit()
|
||||
{
|
||||
if (rowState == DataRowState.Deleted)
|
||||
@@ -279,7 +295,9 @@ namespace System.Data
|
||||
proposed = new object[table.Columns.Count];
|
||||
Array.Copy (current, proposed, table.Columns.Count);
|
||||
}
|
||||
//TODO: Suspend validation
|
||||
|
||||
//FIXME: this doesn't happen on begin edit
|
||||
if (!HasVersion (DataRowVersion.Original))
|
||||
{
|
||||
original = new object[table.Columns.Count];
|
||||
@@ -290,8 +308,11 @@ namespace System.Data
|
||||
/// <summary>
|
||||
/// Cancels the current edit on the row.
|
||||
/// </summary>
|
||||
[MonoTODO]
|
||||
public void CancelEdit ()
|
||||
{
|
||||
//FIXME: original doesn't get erased on CancelEdit
|
||||
//TODO: Events
|
||||
if (HasVersion (DataRowVersion.Proposed))
|
||||
{
|
||||
original = null;
|
||||
@@ -313,22 +334,26 @@ namespace System.Data
|
||||
/// <summary>
|
||||
/// Deletes the DataRow.
|
||||
/// </summary>
|
||||
[MonoTODO]
|
||||
public void Delete ()
|
||||
{
|
||||
if (rowState == DataRowState.Deleted)
|
||||
throw new DeletedRowInaccessibleException ();
|
||||
|
||||
//TODO: Events, Constraints
|
||||
rowState = DataRowState.Deleted;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ends the edit occurring on the row.
|
||||
/// </summary>
|
||||
[MonoTODO]
|
||||
public void EndEdit ()
|
||||
{
|
||||
if (HasVersion (DataRowVersion.Proposed))
|
||||
{
|
||||
rowState = DataRowState.Modified;
|
||||
//TODO: Validate Constraints, Events
|
||||
Array.Copy (proposed, current, table.Columns.Count);
|
||||
proposed = null;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace System.Data
|
||||
dataSet = null;
|
||||
// _defaultView = null; // FIXME: temporarily commented
|
||||
_columnCollection = new DataColumnCollection(this);
|
||||
//_constraintCollection = new ConstraintCollection(); TODO: uncomment after ConstraintCollection is built.
|
||||
_constraintCollection = new ConstraintCollection();
|
||||
_extendedProperties = null;
|
||||
_tableName = "";
|
||||
_nameSpace = null;
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
// System.Data.ForeignKeyConstraint.cs
|
||||
//
|
||||
// Author:
|
||||
// Franklin Wise <[email protected]>
|
||||
// Daniel Morgan <[email protected]>
|
||||
//
|
||||
// (C) 2002 Franklin Wise
|
||||
// (C) 2002 Daniel Morgan
|
||||
//
|
||||
|
||||
@@ -15,122 +17,280 @@ using System.Runtime.InteropServices;
|
||||
namespace System.Data
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
[Serializable]
|
||||
public class ForeignKeyConstraint : Constraint {
|
||||
|
||||
private UniqueConstraint _parentUniqueConstraint;
|
||||
private DataColumn [] _parentColumns;
|
||||
private DataColumn [] _childColumns;
|
||||
private Rule _deleteRule;
|
||||
private Rule _updateRule;
|
||||
private AcceptRejectRule _acceptRejectRule;
|
||||
|
||||
#region Constructors
|
||||
|
||||
[MonoTODO]
|
||||
public ForeignKeyConstraint(DataColumn parentColumn,
|
||||
DataColumn childColumn) {
|
||||
public ForeignKeyConstraint(DataColumn parentColumn, DataColumn childColumn)
|
||||
{
|
||||
if (null == parentColumn || null == childColumn) {
|
||||
throw new ArgumentNullException("Neither parentColumn or" +
|
||||
" childColumn can be null.");
|
||||
}
|
||||
|
||||
_foreignKeyConstraint(null, new DataColumn[] {parentColumn},
|
||||
new DataColumn[] {childColumn});
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public ForeignKeyConstraint(DataColumn[] parentColumns,
|
||||
DataColumn[] childColumns) {
|
||||
public ForeignKeyConstraint(DataColumn[] parentColumns, DataColumn[] childColumns)
|
||||
{
|
||||
_foreignKeyConstraint(null, parentColumns, childColumns);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public ForeignKeyConstraint(string constraintName,
|
||||
DataColumn parentColumn, DataColumn childColumn) {
|
||||
public ForeignKeyConstraint(string constraintName,
|
||||
DataColumn parentColumn, DataColumn childColumn)
|
||||
{
|
||||
if (null == parentColumn || null == childColumn) {
|
||||
throw new ArgumentNullException("Neither parentColumn or" +
|
||||
" childColumn can be null.");
|
||||
}
|
||||
|
||||
_foreignKeyConstraint(constraintName, new DataColumn[] {parentColumn},
|
||||
new DataColumn[] {childColumn});
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public ForeignKeyConstraint(string constraintName,
|
||||
DataColumn[] parentColumns,
|
||||
DataColumn[] childColumns) {
|
||||
public ForeignKeyConstraint(string constraintName,
|
||||
DataColumn[] parentColumns, DataColumn[] childColumns)
|
||||
{
|
||||
_foreignKeyConstraint(constraintName, parentColumns, childColumns);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public ForeignKeyConstraint(string constraintName,
|
||||
string parentTableName, string[] parentColumnNames,
|
||||
string[] childColumnNames,
|
||||
AcceptRejectRule acceptRejectRule, Rule deleteRule,
|
||||
|
||||
//special case
|
||||
[MonoTODO]
|
||||
public ForeignKeyConstraint(string constraintName,
|
||||
string parentTableName, string[] parentColumnNames,
|
||||
string[] childColumnNames,
|
||||
AcceptRejectRule acceptRejectRule, Rule deleteRule,
|
||||
Rule updateRule) {
|
||||
}
|
||||
|
||||
|
||||
private void _foreignKeyConstraint(string constraintName, DataColumn[] parentColumns,
|
||||
DataColumn[] childColumns)
|
||||
{
|
||||
|
||||
//Validate
|
||||
_validateCtor(parentColumns, childColumns);
|
||||
|
||||
//Set Constraint Name
|
||||
base.ConstraintName = constraintName;
|
||||
|
||||
//Keep reference to columns
|
||||
_parentColumns = parentColumns;
|
||||
_childColumns = childColumns;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
private void _validateCtor(DataColumn[] parentColumns, DataColumn[] childColumns)
|
||||
{
|
||||
//not null
|
||||
if (null == parentColumns || null == childColumns)
|
||||
throw new ArgumentNullException();
|
||||
|
||||
if (parentColumns.Length < 1 || childColumns.Length < 1)
|
||||
throw new ArgumentException("Neither ParentColumns or ChildColumns can't be" +
|
||||
" zero length.");
|
||||
|
||||
//DataTypes must match
|
||||
//column sets must all be from the same table
|
||||
|
||||
DataTable ptable = parentColumns[0].Table;
|
||||
DataTable ctable = childColumns[0].Table;
|
||||
|
||||
//not null check
|
||||
//TODO: columns must belong to a table else ArgumentException
|
||||
|
||||
|
||||
foreach (DataColumn pc in parentColumns)
|
||||
{
|
||||
|
||||
foreach (DataColumn cc in childColumns)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Tables must be from same datasets
|
||||
if (ptable.DataSet != ctable.DataSet)
|
||||
{
|
||||
throw new InvalidOperationException("Tables must belong to the same dataset.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Helpers
|
||||
private void _validateRemoveParentConstraint(ConstraintCollection sender,
|
||||
Constraint constraint, ref bool cancel, ref string failReason)
|
||||
{
|
||||
//if we hold a reference to the parent then cancel it
|
||||
if (constraint == _parentUniqueConstraint)
|
||||
{
|
||||
cancel = true;
|
||||
failReason = "Cannot remove UniqueConstraint because the"
|
||||
+ " ForeignKeyConstraint " + this.ConstraintName + " exists.";
|
||||
}
|
||||
}
|
||||
|
||||
//Checks to see if a related unique constraint exists
|
||||
//if it doesn't then a unique constraint is created.
|
||||
//if a unique constraint can't be created an exception will be thrown
|
||||
private void _ensureUniqueConstraintExists(ConstraintCollection collection,
|
||||
DataColumn [] parentColumns)
|
||||
{
|
||||
//not null
|
||||
if (null == parentColumns) throw new ArgumentNullException(
|
||||
"ParentColumns can't be null");
|
||||
|
||||
UniqueConstraint uc = null;
|
||||
|
||||
//see if unique constraint already exists
|
||||
//if not create unique constraint
|
||||
uc = UniqueConstraint.GetUniqueConstraintForColumnSet(collection, parentColumns);
|
||||
|
||||
if (null == uc) uc = new UniqueConstraint(parentColumns, false); //could throw
|
||||
|
||||
//keep reference
|
||||
_parentUniqueConstraint = uc;
|
||||
|
||||
//if this unique constraint is attempted to be removed before us
|
||||
//we can fail the validation
|
||||
collection.ValidateRemoveConstraint += new DelegateValidateRemoveConstraint(
|
||||
_validateRemoveParentConstraint);
|
||||
}
|
||||
|
||||
|
||||
#endregion //Helpers
|
||||
|
||||
|
||||
#region Properites
|
||||
|
||||
|
||||
public virtual AcceptRejectRule AcceptRejectRule {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
return _acceptRejectRule;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
_acceptRejectRule = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DataColumn[] Columns {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual Rule DeleteRule {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
return _deleteRule;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
_deleteRule = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DataColumn[] RelatedColumns {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DataTable RelatedTable {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override DataTable Table {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual Rule UpdateRule {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
return _updateRule;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
_updateRule = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DataColumn[] Columns {
|
||||
get {
|
||||
return _childColumns;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DataColumn[] RelatedColumns {
|
||||
get {
|
||||
return _parentColumns;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DataTable RelatedTable {
|
||||
get {
|
||||
if (_parentColumns != null)
|
||||
if (_parentColumns.Length > 0)
|
||||
return _parentColumns[0].Table;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public override DataTable Table {
|
||||
get {
|
||||
if (_childColumns != null)
|
||||
if (_childColumns.Length > 0)
|
||||
return _childColumns[0].Table;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
[MonoTODO]
|
||||
public override bool Equals(object key) {
|
||||
throw new NotImplementedException ();
|
||||
public override bool Equals(object key)
|
||||
{
|
||||
ForeignKeyConstraint fkc = key as ForeignKeyConstraint;
|
||||
if (null == fkc) return false;
|
||||
|
||||
//if the fk constrains the same columns then they are equal
|
||||
if (! DataColumn.AreColumnSetsTheSame( this.RelatedColumns, fkc.RelatedColumns))
|
||||
return false;
|
||||
if (! DataColumn.AreColumnSetsTheSame( this.Columns, fkc.Columns) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
[MonoTODO]
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
protected internal override void AddToConstraintCollectionSetup(
|
||||
ConstraintCollection collection)
|
||||
{
|
||||
|
||||
//TODO:Should run Ctor rules again
|
||||
|
||||
_ensureUniqueConstraintExists(collection, _parentColumns);
|
||||
|
||||
}
|
||||
|
||||
|
||||
[MonoTODO]
|
||||
protected internal override void RemoveFromConstraintCollectionCleanup(
|
||||
ConstraintCollection collection)
|
||||
{
|
||||
return; //no rules yet
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
internal override void AssertConstraint()
|
||||
{
|
||||
//Constraint only works if both tables are part of the same dataset
|
||||
|
||||
//if DataSet ...
|
||||
|
||||
//check for orphaned children
|
||||
//check for...
|
||||
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace System.Data
|
||||
/// <summary>
|
||||
/// Represents a SQL statement that is executed while connected to a data source, and is implemented by .NET data providers that access relational databases.
|
||||
/// </summary>
|
||||
public interface IDbCommand
|
||||
public interface IDbCommand : IDisposable
|
||||
{
|
||||
void Cancel();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace System.Data
|
||||
/// <summary>
|
||||
/// Represents an open connection to a data source, and is implemented by .NET data providers that access relational databases.
|
||||
/// </summary>
|
||||
public interface IDbConnection
|
||||
public interface IDbConnection : IDisposable
|
||||
{
|
||||
IDbTransaction BeginTransaction();
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
// System.Data.UniqueConstraint.cs
|
||||
//
|
||||
// Author:
|
||||
// Franklin Wise <[email protected]>
|
||||
// Daniel Morgan <[email protected]>
|
||||
//
|
||||
//
|
||||
// (C) 2002 Franklin Wise
|
||||
// (C) 2002 Daniel Morgan
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -14,89 +15,220 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
public class UniqueConstraint : Constraint {
|
||||
public class UniqueConstraint : Constraint
|
||||
{
|
||||
private bool _isPrimaryKey = false;
|
||||
private DataTable _dataTable; //set by ctor except when unique case
|
||||
|
||||
private DataColumn [] _dataColumns;
|
||||
|
||||
//TODO:provide helpers for this case
|
||||
private string [] _dataColumnNames; //unique case
|
||||
|
||||
|
||||
#region Constructors
|
||||
|
||||
[MonoTODO]
|
||||
public UniqueConstraint(DataColumn column) {
|
||||
throw new NotImplementedException ();
|
||||
|
||||
_uniqueConstraint ("", column, false);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public UniqueConstraint(DataColumn[] columns) {
|
||||
|
||||
throw new NotImplementedException ();
|
||||
|
||||
_uniqueConstraint ("", columns, false);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public UniqueConstraint(DataColumn column,
|
||||
public UniqueConstraint(DataColumn column,
|
||||
bool isPrimaryKey) {
|
||||
|
||||
throw new NotImplementedException ();
|
||||
_uniqueConstraint ("", column, isPrimaryKey);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public UniqueConstraint(DataColumn[] columns, bool isPrimaryKey) {
|
||||
|
||||
throw new NotImplementedException ();
|
||||
_uniqueConstraint ("", columns, isPrimaryKey);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public UniqueConstraint(string name, DataColumn column) {
|
||||
|
||||
throw new NotImplementedException ();
|
||||
_uniqueConstraint (name, column, false);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public UniqueConstraint(string name, DataColumn[] columns) {
|
||||
|
||||
throw new NotImplementedException ();
|
||||
_uniqueConstraint (name, columns, false);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public UniqueConstraint(string name, DataColumn column,
|
||||
public UniqueConstraint(string name, DataColumn column,
|
||||
bool isPrimaryKey) {
|
||||
|
||||
throw new NotImplementedException ();
|
||||
_uniqueConstraint (name, column, isPrimaryKey);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public UniqueConstraint(string name,
|
||||
public UniqueConstraint(string name,
|
||||
DataColumn[] columns, bool isPrimaryKey) {
|
||||
|
||||
throw new NotImplementedException ();
|
||||
_uniqueConstraint (name, columns, isPrimaryKey);
|
||||
}
|
||||
|
||||
//Special case. Can only be added to the Collection with AddRange
|
||||
[MonoTODO]
|
||||
public UniqueConstraint(string name,
|
||||
public UniqueConstraint(string name,
|
||||
string[] columnNames, bool isPrimaryKey) {
|
||||
|
||||
throw new NotImplementedException ();
|
||||
throw new NotImplementedException(); //need to finish related logic
|
||||
/*
|
||||
base.ConstraintName = name;
|
||||
|
||||
//set unique
|
||||
//must set unique when added to the collection
|
||||
|
||||
//keep list of names to resolve later
|
||||
_dataColumnNames = columnNames;
|
||||
|
||||
_isPrimaryKey = isPrimaryKey;
|
||||
*/
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
//helper ctor
|
||||
private void _uniqueConstraint(string name,
|
||||
DataColumn column, bool isPrimaryKey) {
|
||||
|
||||
//validate
|
||||
_validateColumn (column);
|
||||
|
||||
//Set Constraint Name
|
||||
base.ConstraintName = name;
|
||||
|
||||
//set unique
|
||||
column.Unique = true;
|
||||
|
||||
//keep reference
|
||||
_dataColumns = new DataColumn [] {column};
|
||||
|
||||
//PK?
|
||||
_isPrimaryKey = isPrimaryKey;
|
||||
|
||||
//Get table reference
|
||||
_dataTable = column.Table;
|
||||
}
|
||||
|
||||
//helpter ctor
|
||||
public void _uniqueConstraint(string name,
|
||||
DataColumn[] columns, bool isPrimaryKey) {
|
||||
|
||||
//validate
|
||||
_validateColumns (columns, out _dataTable);
|
||||
|
||||
//Set Constraint Name
|
||||
base.ConstraintName = name;
|
||||
|
||||
//set unique
|
||||
_setColumnsUnique (columns);
|
||||
|
||||
//keep reference
|
||||
_dataColumns = columns;
|
||||
|
||||
//PK?
|
||||
_isPrimaryKey = isPrimaryKey;
|
||||
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Helpers
|
||||
private void _setColumnsUnique(DataColumn [] columns) {
|
||||
if (null == columns) return;
|
||||
foreach (DataColumn col in columns) {
|
||||
col.Unique = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Validates a collection of columns with the ctor rules
|
||||
private void _validateColumns(DataColumn [] columns, out DataTable table) {
|
||||
table = null;
|
||||
|
||||
//not null
|
||||
if (null == columns) throw new ArgumentNullException();
|
||||
|
||||
//check that there is at least one column
|
||||
//LAMESPEC: not in spec
|
||||
if (columns.Length < 1)
|
||||
throw new InvalidConstraintException("Must be at least one column.");
|
||||
|
||||
DataTable compareTable = columns[0].Table;
|
||||
//foreach
|
||||
foreach (DataColumn col in columns){
|
||||
|
||||
//check individual column rules
|
||||
_validateColumn (col);
|
||||
|
||||
|
||||
//check that columns are all from the same table??
|
||||
//LAMESPEC: not in spec
|
||||
if (compareTable != col.Table)
|
||||
throw new InvalidConstraintException("Columns must be from the same table.");
|
||||
|
||||
}
|
||||
|
||||
table = compareTable;
|
||||
}
|
||||
|
||||
//validates a column with the ctor rules
|
||||
private void _validateColumn(DataColumn column) {
|
||||
|
||||
//not null
|
||||
if (null == column) throw new ArgumentNullException();
|
||||
|
||||
//column must belong to a table
|
||||
//LAMESPEC: not in spec
|
||||
if (null == column.Table)
|
||||
throw new ArgumentException("Column " + column.ColumnName + " must belong to a table.");
|
||||
|
||||
}
|
||||
|
||||
internal static UniqueConstraint GetUniqueConstraintForColumnSet(ConstraintCollection collection,
|
||||
DataColumn[] columns)
|
||||
{
|
||||
if (null == columns ) return null;
|
||||
|
||||
UniqueConstraint uniqueConstraint;
|
||||
IEnumerator enumer = collection.GetEnumerator();
|
||||
while (enumer.MoveNext())
|
||||
{
|
||||
uniqueConstraint = enumer.Current as UniqueConstraint;
|
||||
if (uniqueConstraint != null)
|
||||
{
|
||||
if ( DataColumn.AreColumnSetsTheSame(uniqueConstraint.Columns, columns) )
|
||||
{
|
||||
return uniqueConstraint;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion //Helpers
|
||||
|
||||
#region Properties
|
||||
|
||||
public virtual DataColumn[] Columns {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
return _dataColumns;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPrimaryKey {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
return _isPrimaryKey;
|
||||
}
|
||||
}
|
||||
|
||||
public override DataTable Table {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
return _dataTable;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,16 +236,46 @@ namespace System.Data
|
||||
|
||||
#region Methods
|
||||
|
||||
[MonoTODO]
|
||||
public override bool Equals(object key2) {
|
||||
throw new NotImplementedException ();
|
||||
|
||||
UniqueConstraint cst = key2 as UniqueConstraint;
|
||||
if (null == cst) return false;
|
||||
|
||||
//according to spec if the cols are equal
|
||||
//then two UniqueConstraints are equal
|
||||
return DataColumn.AreColumnSetsTheSame(cst.Columns, this.Columns);
|
||||
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
|
||||
internal protected override void AddToConstraintCollectionSetup(
|
||||
ConstraintCollection collection)
|
||||
{
|
||||
//TODO:Should run Ctor rules again
|
||||
|
||||
//make sure a unique constraint doesn't already exists for these columns
|
||||
UniqueConstraint uc = UniqueConstraint.GetUniqueConstraintForColumnSet(collection, this.Columns);
|
||||
if (null != uc) throw new ArgumentException("Unique constraint already exists for these" +
|
||||
" columns.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
internal protected override void RemoveFromConstraintCollectionCleanup(
|
||||
ConstraintCollection collection)
|
||||
{
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
internal override void AssertConstraint()
|
||||
{
|
||||
//Unique?
|
||||
}
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,55 @@
|
||||
2002-08-15 Franklin Wise <[email protected]>
|
||||
|
||||
* AllTests.cs: Added ForeignKeyConstraintTest to active running tests.
|
||||
|
||||
* NewFile: System.Data\ForeignKeyConstraintTest.cs
|
||||
|
||||
* System.Data\ConstraintTest: Added new test.
|
||||
|
||||
* System.Data\UniqueConstraintTest: Added more tests.
|
||||
|
||||
2002-08-14 Daniel Morgan <[email protected]>
|
||||
|
||||
* SqlSharpCli.cs: modified
|
||||
- implemented the following commands:
|
||||
\f FILENAME to read a batch of Sql# commands/queries from file.");
|
||||
\o FILENAME to write out the result of Sql# commands executed to file.");
|
||||
\load FILENAME to load from file SQL commands into SQL buffer.");
|
||||
\save FILENAME to save SQL commands from SQL buffer to file.
|
||||
\print - show what's in the SQL buffer now.
|
||||
- can save output of result to an html file or text
|
||||
- entering command "\provider mysql" will dynamically load mysql provider
|
||||
from its assembly Mono.Data.MySql.dll
|
||||
|
||||
2002-08-13 Daniel Morgan <[email protected]>
|
||||
|
||||
* Test/SqlSharpCli.cs: modified
|
||||
- removed dependency on Mono.Data.MySql assembly and classes
|
||||
(if you still want to use Mono.Data.MySql, use \loadextprovider to load it).
|
||||
- added use of provider System.Data.OleDb classes; however, you must
|
||||
have a working libgda.
|
||||
- added dynamic loading of .NET Data Provider's assembly and Connection class
|
||||
which can be loaded via \loadextprovider
|
||||
- renamed providers: postgresclient to postgresql, oracleclient to oracle
|
||||
- add new command \exenonquery to execute non queries
|
||||
- add new command \exescalar to execute and return one row/one column of data
|
||||
- added beginnings of internal variables by adding new commands: \set, \unset, and
|
||||
\variable
|
||||
- add new command \r to reset (clear) the query buffer
|
||||
- if quiting, need to close database connection if still open
|
||||
|
||||
2002-08-12 Franklin Wise <[email protected]>
|
||||
* NewFile: Added test for System.Data.UniqueConstraintTest.cs
|
||||
|
||||
* NewFile: Added test for System.Data.ConstraintTest.cs
|
||||
|
||||
* NewFile: Added test for System.Data.ConstraintCollection.cs
|
||||
|
||||
* Added blank test for DataColumnTest so that NUnit won't warn
|
||||
of no tests
|
||||
|
||||
* Updated System.Data.AllTests.cs to include the new tests
|
||||
|
||||
2002-05-27 Tim Coleman <[email protected]>
|
||||
* TestSqlDataAdapter.cs: remove explicit opening of connection.
|
||||
This should occur implicitly now.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// visit http://www.go-mono.com/
|
||||
//
|
||||
// To build SqlSharpCli.cs:
|
||||
// $ mcs SqlSharpCli.cs -r System.Data.dll -r Mono.Data.MySql.dll
|
||||
// $ mcs SqlSharpCli.cs -r System.Data.dll
|
||||
//
|
||||
// To run with mono:
|
||||
// $ mono SqlSharpCli.exe
|
||||
@@ -31,27 +31,58 @@
|
||||
// (C)Copyright 2002 Daniel Morgan
|
||||
//
|
||||
|
||||
using Mono.Data.MySql;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Data.OleDb;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Remoting;
|
||||
using System.Text;
|
||||
|
||||
namespace Mono.Data.SqlSharp {
|
||||
|
||||
|
||||
public enum FileFormat {
|
||||
Html,
|
||||
Xml,
|
||||
CommaSeparatedValues,
|
||||
TabSeparated,
|
||||
Normal
|
||||
}
|
||||
|
||||
// SQL Sharp - Command Line Interface
|
||||
public class SqlSharpCli {
|
||||
|
||||
private IDbConnection conn = null;
|
||||
private string provider = "POSTGRESCLIENT";
|
||||
|
||||
private string provider = "POSTGRESQL"; // name of internal provider
|
||||
// {OleDb,SqlClient,MySql,Odbc,Oracle,PostgreSql} however, it
|
||||
// can be set to LOADEXTPROVIDER to load an external provider
|
||||
private string providerAssembly = ""; // filename of assembly
|
||||
// for example: "Mono.Data.MySql"
|
||||
private string providerConnectionClass = ""; // Connection class
|
||||
// in the provider assembly that implements the IDbConnection
|
||||
// interface. for example: "Mono.Data.MySql.MySqlConnection"
|
||||
|
||||
private StringBuilder build = null; // SQL string to build
|
||||
private string buff = ""; // SQL string buffer
|
||||
|
||||
private string connectionString =
|
||||
"host=localhost;dbname=test;user=postgres";
|
||||
|
||||
private string inputFilename = "";
|
||||
private string outputFilename = "";
|
||||
private StreamReader inputFilestream = null;
|
||||
private StreamWriter outputFilestream = null;
|
||||
|
||||
private FileFormat outputFileFormat = FileFormat.Html;
|
||||
|
||||
private bool silent = false;
|
||||
private bool showHeader = true;
|
||||
|
||||
private Hashtable internalVariables = new Hashtable();
|
||||
|
||||
// DisplayResult - used to Read() display a result set
|
||||
// called by DisplayData()
|
||||
@@ -74,9 +105,9 @@ namespace Mono.Data.SqlSharp {
|
||||
line = new StringBuilder();
|
||||
hdrUnderline = new StringBuilder();
|
||||
|
||||
Console.WriteLine("Fields in Query Result: " +
|
||||
reader.FieldCount);
|
||||
Console.WriteLine();
|
||||
OutputLine("Fields in Query Result: " +
|
||||
reader.FieldCount);
|
||||
OutputLine("");
|
||||
|
||||
for(c = 0; c < schemaTable.Rows.Count; c++) {
|
||||
|
||||
@@ -96,7 +127,7 @@ namespace Mono.Data.SqlSharp {
|
||||
if(dataType.Equals("System.Boolean")) {
|
||||
columnSize = 5;
|
||||
}
|
||||
if(provider.Equals("POSTGRESCLIENT"))
|
||||
if(provider.Equals("POSTGRESQL"))
|
||||
if(dataTypeName.Equals("text"))
|
||||
columnSize = 32; // text will be truncated to 32
|
||||
|
||||
@@ -108,11 +139,11 @@ namespace Mono.Data.SqlSharp {
|
||||
line.Append(" ");
|
||||
hdrUnderline.Append(" ");
|
||||
}
|
||||
Console.WriteLine(line.ToString());
|
||||
OutputHeader(line.ToString());
|
||||
line = null;
|
||||
|
||||
Console.WriteLine(hdrUnderline);
|
||||
Console.WriteLine();
|
||||
OutputHeader(hdrUnderline.ToString());
|
||||
OutputHeader("");
|
||||
hdrUnderline = null;
|
||||
|
||||
// DEBUG - need to know the columnSize
|
||||
@@ -152,7 +183,7 @@ namespace Mono.Data.SqlSharp {
|
||||
if(dataType.Equals("System.Boolean")) {
|
||||
columnSize = 5;
|
||||
}
|
||||
if(provider.Equals("POSTGRESCLIENT"))
|
||||
if(provider.Equals("POSTGRESQL"))
|
||||
if(dataTypeName.Equals("text"))
|
||||
columnSize = 32; // text will be truncated to 32
|
||||
|
||||
@@ -182,12 +213,68 @@ namespace Mono.Data.SqlSharp {
|
||||
}
|
||||
|
||||
}
|
||||
Console.WriteLine(line.ToString());
|
||||
OutputData(line.ToString());
|
||||
line = null;
|
||||
}
|
||||
Console.WriteLine("\nRows retrieved: " + rows);
|
||||
OutputLine("\nRows retrieved: " + rows.ToString());
|
||||
}
|
||||
|
||||
|
||||
public void OutputDataToHtmlFile(IDataReader rdr, DataTable dt) {
|
||||
|
||||
StringBuilder strHtml = new StringBuilder();
|
||||
|
||||
strHtml.Append("<html> \n <head> <title>");
|
||||
strHtml.Append("Results");
|
||||
strHtml.Append("</title> </head>");
|
||||
strHtml.Append("<body>");
|
||||
strHtml.Append("<h1> Results </h1>");
|
||||
strHtml.Append("<table border=1>");
|
||||
|
||||
outputFilestream.WriteLine(strHtml.ToString());
|
||||
|
||||
strHtml = null;
|
||||
strHtml = new StringBuilder();
|
||||
|
||||
strHtml.Append("<tr>");
|
||||
foreach (DataRow schemaRow in dt.Rows) {
|
||||
strHtml.Append("<td> <b>");
|
||||
object dataObj = schemaRow["ColumnName"];
|
||||
string sColumnName = dataObj.ToString();
|
||||
strHtml.Append(sColumnName);
|
||||
strHtml.Append("</b> </td>");
|
||||
}
|
||||
strHtml.Append("</tr>");
|
||||
outputFilestream.WriteLine(strHtml.ToString());
|
||||
strHtml = null;
|
||||
|
||||
int col = 0;
|
||||
string dataValue = "";
|
||||
|
||||
while(rdr.Read()) {
|
||||
strHtml = new StringBuilder();
|
||||
|
||||
strHtml.Append("<tr>");
|
||||
for(col = 0; col < rdr.FieldCount; col++) {
|
||||
|
||||
// column data
|
||||
if(rdr.IsDBNull(col) == true)
|
||||
dataValue = "NULL";
|
||||
else {
|
||||
object obj = rdr.GetValue(col);
|
||||
dataValue = obj.ToString();
|
||||
}
|
||||
strHtml.Append("<td>");
|
||||
strHtml.Append(dataValue);
|
||||
strHtml.Append("</td>");
|
||||
}
|
||||
strHtml.Append("\t\t</tr>");
|
||||
outputFilestream.WriteLine(strHtml.ToString());
|
||||
strHtml = null;
|
||||
}
|
||||
outputFilestream.WriteLine(" </table> </body> \n </html>");
|
||||
strHtml = null;
|
||||
}
|
||||
|
||||
// DisplayData - used to display any Result Sets
|
||||
// from execution of SQL SELECT Query or Queries
|
||||
// called by DisplayData.
|
||||
@@ -199,14 +286,14 @@ namespace Mono.Data.SqlSharp {
|
||||
DataTable schemaTable = null;
|
||||
int ResultSet = 0;
|
||||
|
||||
Console.WriteLine("Display any result sets...");
|
||||
OutputLine("Display any result sets...");
|
||||
|
||||
do {
|
||||
// by Default, SqlDataReader has the
|
||||
// first Result set if any
|
||||
|
||||
ResultSet++;
|
||||
Console.WriteLine("Display the result set " + ResultSet);
|
||||
OutputLine("Display the result set " + ResultSet);
|
||||
|
||||
schemaTable = reader.GetSchemaTable();
|
||||
|
||||
@@ -223,13 +310,32 @@ namespace Mono.Data.SqlSharp {
|
||||
else {
|
||||
// SQL Query (SELECT)
|
||||
// RecordsAffected -1 and DataTable has a reference
|
||||
DisplayResult(reader, schemaTable);
|
||||
OutputQueryResult(reader, schemaTable);
|
||||
}
|
||||
|
||||
// get next result set (if anymore is left)
|
||||
// get next result set (if anymore is left)
|
||||
} while(reader.NextResult());
|
||||
}
|
||||
|
||||
public void OutputQueryResult(IDataReader dreader, DataTable dtable) {
|
||||
if(outputFilestream == null) {
|
||||
DisplayResult(dreader, dtable);
|
||||
}
|
||||
else {
|
||||
switch(outputFileFormat) {
|
||||
case FileFormat.Normal:
|
||||
DisplayResult(dreader, dtable);
|
||||
break;
|
||||
case FileFormat.Html:
|
||||
OutputDataToHtmlFile(dreader, dtable);
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Error: Output data file format not supported.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ExecuteSql - Execute the SQL Command(s) and/or Query(ies)
|
||||
public void ExecuteSql(string sql) {
|
||||
|
||||
@@ -238,21 +344,7 @@ namespace Mono.Data.SqlSharp {
|
||||
IDbCommand cmd = null;
|
||||
IDataReader reader = null;
|
||||
|
||||
// create a Command object based on the provider
|
||||
switch(provider) {
|
||||
//case "OLEDB":
|
||||
// cmd = new OleDbCommand();
|
||||
// break;
|
||||
case "MYSQL":
|
||||
cmd = new MySqlCommand();
|
||||
break;
|
||||
case "POSTGRESCLIENT":
|
||||
cmd = new SqlCommand();
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Error: PostgreSQL is only supported, and it through SqlClient.");
|
||||
return;
|
||||
}
|
||||
cmd = conn.CreateCommand();
|
||||
|
||||
// set command properties
|
||||
cmd.CommandType = CommandType.Text;
|
||||
@@ -263,20 +355,79 @@ namespace Mono.Data.SqlSharp {
|
||||
reader = cmd.ExecuteReader();
|
||||
DisplayData(reader);
|
||||
reader.Close();
|
||||
//reader = null;
|
||||
//cmd.Dispose();
|
||||
//cmd = null;
|
||||
reader = null;
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Exception Caught Executing SQL: " + e);
|
||||
//if(reader != null) {
|
||||
// if(reader.IsClosed == false)
|
||||
// reader.Close();
|
||||
// reader = null;
|
||||
reader = null;
|
||||
//}
|
||||
// cmd.Dispose();
|
||||
//cmd = null;
|
||||
}
|
||||
finally {
|
||||
// cmd.Dispose();
|
||||
cmd = null;
|
||||
}
|
||||
}
|
||||
|
||||
// ExecuteSql - Execute the SQL Commands (no SELECTs)
|
||||
public void ExecuteSqlNonQuery(string sql) {
|
||||
|
||||
Console.WriteLine("Execute SQL Non Query: " + sql);
|
||||
|
||||
IDbCommand cmd = null;
|
||||
int rowsAffected = -1;
|
||||
|
||||
cmd = conn.CreateCommand();
|
||||
|
||||
// set command properties
|
||||
cmd.CommandType = CommandType.Text;
|
||||
cmd.CommandText = sql;
|
||||
cmd.Connection = conn;
|
||||
|
||||
try {
|
||||
rowsAffected = cmd.ExecuteNonQuery();
|
||||
cmd = null;
|
||||
Console.WriteLine("Rows affected: " + rowsAffected);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Exception Caught Executing SQL: " + e);
|
||||
}
|
||||
finally {
|
||||
// cmd.Dispose();
|
||||
cmd = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteSqlScalar(string sql) {
|
||||
Console.WriteLine("Execute SQL Non Query: " + sql);
|
||||
|
||||
IDbCommand cmd = null;
|
||||
string retrievedValue = "";
|
||||
|
||||
cmd = conn.CreateCommand();
|
||||
|
||||
// set command properties
|
||||
cmd.CommandType = CommandType.Text;
|
||||
cmd.CommandText = sql;
|
||||
cmd.Connection = conn;
|
||||
|
||||
try {
|
||||
retrievedValue = (string) cmd.ExecuteScalar().ToString();
|
||||
Console.WriteLine("Retrieved value: " + retrievedValue);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Exception Caught Executing SQL: " + e);
|
||||
}
|
||||
finally {
|
||||
// cmd.Dispose();
|
||||
cmd = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteSqlXml(string sql) {
|
||||
Console.WriteLine("Error: Not implemented yet.");
|
||||
}
|
||||
|
||||
// like ShowHelp - but only show at the beginning
|
||||
@@ -287,7 +438,7 @@ namespace Mono.Data.SqlSharp {
|
||||
Console.WriteLine(@" \ConnectionString to set the ConnectionString");
|
||||
Console.WriteLine(@" \Provider to set the Provider:");
|
||||
Console.WriteLine(@" {OleDb,SqlClient,MySql,Odbc,");
|
||||
Console.WriteLine(@" OracleClient,PostgresClient}");
|
||||
Console.WriteLine(@" Oracle,PostgreSql)");
|
||||
Console.WriteLine(@" \Open to open the connection");
|
||||
Console.WriteLine(@" \Close to close the connection");
|
||||
Console.WriteLine(@" \Execute to execute SQL command(s)/queries(s)");
|
||||
@@ -303,15 +454,30 @@ namespace Mono.Data.SqlSharp {
|
||||
Console.WriteLine(@" \ConnectionString to set the ConnectionString");
|
||||
Console.WriteLine(@" \Provider to set the Provider:");
|
||||
Console.WriteLine(@" {OleDb,SqlClient,MySql,Odbc,");
|
||||
Console.WriteLine(@" OracleClient,PostgresClient}");
|
||||
Console.WriteLine(@" Oracle,PostgreSql}");
|
||||
Console.WriteLine(@" \Open to open the connection");
|
||||
Console.WriteLine(@" \Close to close the connection");
|
||||
Console.WriteLine(@" \Execute to execute SQL command(s)/queries(s)");
|
||||
Console.WriteLine(@" \f FILENAME to read a batch of commands from");
|
||||
Console.WriteLine(@" \o FILENAME to read a batch of commands from");
|
||||
Console.WriteLine(@" \exenonquery execute an SQL non query (not a SELECT).");
|
||||
Console.WriteLine(@" \exescalar execute SQL to get a single row/single column result.");
|
||||
Console.WriteLine(@" \f FILENAME to read a batch of Sql# commands/queries from.");
|
||||
Console.WriteLine(@" \o FILENAME to write out the result of commands executed.");
|
||||
Console.WriteLine(@" \load FILENAME to load from file SQL commands into SQL buffer.");
|
||||
Console.WriteLine(@" \save FILENAME to save SQL commands from SQL buffer to file.");
|
||||
Console.WriteLine(@" \h to show this help.");
|
||||
Console.WriteLine(@" \defaults to show default variables.");
|
||||
Console.WriteLine(@" \defaults to show default variables, such as,");
|
||||
Console.WriteLine(@" Provider and ConnectionString.");
|
||||
Console.WriteLine(@" \s {TRUE, FALSE} to silent messages.");
|
||||
Console.WriteLine(@" \r reset (clear) the query buffer.");
|
||||
Console.WriteLine(@" \set NAME VALUE - set an internal variable.");
|
||||
Console.WriteLine(@" \unset NAME - remove an internal variable.");
|
||||
Console.WriteLine(@" \variable NAME - display the value of an internal variable.");
|
||||
Console.WriteLine(@" \loadprovider CLASS - load the provider");
|
||||
Console.WriteLine(@" use the complete name of its connection class.");
|
||||
Console.WriteLine(@" \loadextprovider ASSEMBLY CLASS - load the provider");
|
||||
Console.WriteLine(@" use the complete name of its assembly and");
|
||||
Console.WriteLine(@" its Connection class.");
|
||||
Console.WriteLine(@" \print - show what's in the SQL buffer now.");
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
@@ -319,6 +485,12 @@ namespace Mono.Data.SqlSharp {
|
||||
public void ShowDefaults() {
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("The default Provider is " + provider);
|
||||
if(provider.Equals("LOADEXTPROVIDER")) {
|
||||
Console.WriteLine(" Assembly: " +
|
||||
providerAssembly);
|
||||
Console.WriteLine(" Connection Class: " +
|
||||
providerConnectionClass);
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("The default ConnectionString is: ");
|
||||
Console.WriteLine(" \"" + connectionString + "\"");
|
||||
@@ -330,19 +502,26 @@ namespace Mono.Data.SqlSharp {
|
||||
|
||||
Console.WriteLine("Attempt to Open...");
|
||||
|
||||
switch(provider) {
|
||||
//case "OLEDB":
|
||||
// conn = new OleDbConnection();
|
||||
// break;
|
||||
case "MYSQL":
|
||||
conn = new MySqlConnection();
|
||||
break;
|
||||
case "POSTGRESCLIENT":
|
||||
conn = new SqlConnection();
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Error: Bad argument or provider not supported.");
|
||||
break;
|
||||
try {
|
||||
switch(provider) {
|
||||
case "OLEDB":
|
||||
conn = new OleDbConnection();
|
||||
break;
|
||||
case "POSTGRESQL":
|
||||
conn = new SqlConnection();
|
||||
break;
|
||||
case "LOADEXTPROVIDER":
|
||||
if(LoadExternalProvider() == false)
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Error: Bad argument or provider not supported.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Error: Unable to create Connection object. " + e);
|
||||
return;
|
||||
}
|
||||
|
||||
conn.ConnectionString = connectionString;
|
||||
@@ -350,7 +529,7 @@ namespace Mono.Data.SqlSharp {
|
||||
try {
|
||||
conn.Open();
|
||||
if(conn.State == ConnectionState.Open)
|
||||
Console.WriteLine("Open was successfully.");
|
||||
Console.WriteLine("Open was successfull.");
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Exception Caught Opening. " + e);
|
||||
@@ -360,16 +539,18 @@ namespace Mono.Data.SqlSharp {
|
||||
|
||||
// CloseDataSource - close the connection to the data source
|
||||
public void CloseDataSource() {
|
||||
Console.WriteLine("Attempt to Close...");
|
||||
|
||||
try {
|
||||
conn.Close();
|
||||
Console.WriteLine("Close was successfull.");
|
||||
|
||||
if(conn != null) {
|
||||
Console.WriteLine("Attempt to Close...");
|
||||
try {
|
||||
conn.Close();
|
||||
Console.WriteLine("Close was successfull.");
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Exeception Caught Closing. " + e);
|
||||
}
|
||||
conn = null;
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Exeception Caught Closing. " + e);
|
||||
}
|
||||
conn = null;
|
||||
}
|
||||
|
||||
// ChangeProvider - change the provider string variable
|
||||
@@ -378,25 +559,39 @@ namespace Mono.Data.SqlSharp {
|
||||
if(parms.Length == 2) {
|
||||
string parm = parms[1].ToUpper();
|
||||
switch(parm) {
|
||||
case "ORACLECLIENT":
|
||||
case "ORACLE":
|
||||
case "ODBC":
|
||||
case "GDA":
|
||||
Console.WriteLine("Error: Provider not currently supported.");
|
||||
break;
|
||||
case "MYSQL":
|
||||
string[] extp = new string[3] {
|
||||
"\\loadextprovider",
|
||||
"Mono.Data.MySql",
|
||||
"Mono.Data.MySql.MySqlConnection"};
|
||||
SetupExternalProvider(extp);
|
||||
break;
|
||||
case "SQLCLIENT":
|
||||
provider = "POSTGRESCLIENT";
|
||||
provider = "POSTGRESQL";
|
||||
Console.WriteLine("Warning: Currently, the SqlClient provider is the PostgreSQL provider.");
|
||||
break;
|
||||
//case "OLEDB":
|
||||
case "MYSQL":
|
||||
case "POSTGRESCLIENT":
|
||||
case "GDA":
|
||||
provider = "OLEDB";
|
||||
break;
|
||||
case "OLEDB":
|
||||
case "POSTGRESQL":
|
||||
provider = parm;
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Error: " + "Bad argument or Provider not supported.");
|
||||
break;
|
||||
}
|
||||
Console.WriteLine("Provider: " + provider);
|
||||
Console.WriteLine("The default Provider is " + provider);
|
||||
if(provider.Equals("LOADEXTPROVIDER")) {
|
||||
Console.WriteLine(" Assembly: " +
|
||||
providerAssembly);
|
||||
Console.WriteLine(" Connection Class: " +
|
||||
providerConnectionClass);
|
||||
}
|
||||
}
|
||||
else
|
||||
Console.WriteLine("Error: provider only has one parameter.");
|
||||
@@ -411,29 +606,76 @@ namespace Mono.Data.SqlSharp {
|
||||
connectionString = "";
|
||||
}
|
||||
|
||||
public void SetupInputFile(string[] parms) {
|
||||
if(parms.Length >= 2) {
|
||||
public void ReadCommandsFromFile(StreamReader inCmds) {
|
||||
}
|
||||
|
||||
public void SetupOutputResultsFile(string[] parms) {
|
||||
if(parms.Length != 2) {
|
||||
Console.WriteLine("Error: wrong number of parameters");
|
||||
return;
|
||||
}
|
||||
inputFilename = parms[1];
|
||||
// TODO:
|
||||
// open input file
|
||||
// while each line, do the SqlSharpCli command or SQL
|
||||
// close input file
|
||||
try {
|
||||
outputFilestream = new StreamWriter(parms[1]);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Error: Unable to setup output results file. " + e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupOutputFile(string[] parms) {
|
||||
if(parms.Length == 1) {
|
||||
outputFilename = "";
|
||||
// TODO: close the output file
|
||||
}
|
||||
else if(parms.Length > 2) {
|
||||
public void SetupInputCommandsFile(string[] parms) {
|
||||
if(parms.Length != 2) {
|
||||
Console.WriteLine("Error: wrong number of parameters");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
outputFilename = parms[1];
|
||||
// TODO: open the output file
|
||||
try {
|
||||
inputFilestream = new StreamReader(parms[1]);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Error: Unable to setup input commmands file. " + e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadBufferFromFile(string[] parms) {
|
||||
if(parms.Length != 2) {
|
||||
Console.WriteLine("Error: wrong number of parameters");
|
||||
return;
|
||||
}
|
||||
string inFilename = parms[1];
|
||||
try {
|
||||
StreamReader sr = new StreamReader( inFilename);
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
string NextLine;
|
||||
|
||||
while((NextLine = sr.ReadLine()) != null) {
|
||||
buffer.Append(NextLine);
|
||||
buffer.Append("\n");
|
||||
}
|
||||
sr.Close();
|
||||
buff = buffer.ToString();
|
||||
build = null;
|
||||
build = new StringBuilder();
|
||||
build.Append(buff);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Error: Unable to read file into SQL Buffer. " + e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveBufferToFile(string[] parms) {
|
||||
if(parms.Length != 2) {
|
||||
Console.WriteLine("Error: wrong number of parameters");
|
||||
return;
|
||||
}
|
||||
string outFilename = parms[1];
|
||||
try {
|
||||
StreamWriter sw = new StreamWriter(outFilename);
|
||||
sw.WriteLine(buff);
|
||||
sw.Close();
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Error: Could not save SQL Buffer to file." + e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,23 +692,146 @@ namespace Mono.Data.SqlSharp {
|
||||
else
|
||||
Console.WriteLine("Error: invalid parameter.");
|
||||
}
|
||||
|
||||
public void SetInternalVariable(string[] parms) {
|
||||
if(parms.Length < 2) {
|
||||
Console.WriteLine("Error: wrong number of parameters.");
|
||||
return;
|
||||
}
|
||||
string parm = parms[1].ToUpper();
|
||||
StringBuilder ps = new StringBuilder();
|
||||
|
||||
for(int i = 2; i < parms.Length; i++)
|
||||
ps.Append(parms[i]);
|
||||
|
||||
public void OutputLine(string line) {
|
||||
if(silent == false)
|
||||
Console.WriteLine(line);
|
||||
internalVariables[parm] = ps.ToString();
|
||||
}
|
||||
|
||||
public void ExecuteBatch() {
|
||||
// TODO:
|
||||
Console.WriteLine("Error: Execution of Batch Commands not implemented yet");
|
||||
public void UnSetInternalVariable(string[] parms) {
|
||||
if(parms.Length != 2) {
|
||||
Console.WriteLine("Error: wrong number of parameters.");
|
||||
return;
|
||||
}
|
||||
string parm = parms[1].ToUpper();
|
||||
|
||||
try {
|
||||
internalVariables.Remove(parm);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Error: internal variable does not exist.");
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowInternalVariable(string[] parms) {
|
||||
string internalVariableValue = "";
|
||||
|
||||
if(parms.Length != 2) {
|
||||
Console.WriteLine("Error: wrong number of parameters.");
|
||||
return;
|
||||
}
|
||||
|
||||
string parm = parms[1].ToUpper();
|
||||
|
||||
if(GetInternalVariable(parm, out internalVariableValue) == true)
|
||||
Console.WriteLine("Internal Variable - Name: " +
|
||||
parm + " Value: " + internalVariableValue);
|
||||
}
|
||||
|
||||
public bool GetInternalVariable(string name, out string sValue) {
|
||||
sValue = "";
|
||||
bool valueReturned = false;
|
||||
|
||||
try {
|
||||
if(internalVariables.ContainsKey(name) == true) {
|
||||
sValue = (string) internalVariables[name];
|
||||
valueReturned = true;
|
||||
}
|
||||
else
|
||||
Console.WriteLine("Error: internal variable does not exist.");
|
||||
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Error: internal variable does not exist.");
|
||||
}
|
||||
return valueReturned;
|
||||
}
|
||||
|
||||
// to be used for loading .NET Data Providers that exist in
|
||||
// the System.Data assembly, but are not explicitly handling
|
||||
// in SQL#
|
||||
public void LoadProvider(string[] parms) {
|
||||
Console.WriteLine("Error: not implemented yet.");
|
||||
}
|
||||
|
||||
public void SetupExternalProvider(string[] parms) {
|
||||
if(parms.Length != 3) {
|
||||
Console.WriteLine("Error: Wrong number of parameters.");
|
||||
return;
|
||||
}
|
||||
provider = "LOADEXTPROVIDER";
|
||||
providerAssembly = parms[1];
|
||||
providerConnectionClass = parms[2];
|
||||
}
|
||||
|
||||
public bool LoadExternalProvider() {
|
||||
|
||||
bool success = false;
|
||||
|
||||
// For example: for the MySQL provider in Mono.Data.MySql
|
||||
// \LoadExtProvider Mono.Data.MySql Mono.Data.MySql.MySqlConnection
|
||||
// \ConnectionString dbname=test
|
||||
// \open
|
||||
// insert into sometable (tid, tdesc, aint) values ('abc','def',12)
|
||||
// \exenonquery
|
||||
// \close
|
||||
// \quit
|
||||
|
||||
try {
|
||||
Console.WriteLine("Loading external provider...");
|
||||
Console.Out.Flush();
|
||||
|
||||
Assembly ps = Assembly.Load(providerAssembly);
|
||||
Type typ = ps.GetType(providerConnectionClass);
|
||||
conn = (IDbConnection) Activator.CreateInstance(typ);
|
||||
success = true;
|
||||
|
||||
Console.WriteLine("External provider loaded.");
|
||||
Console.Out.Flush();
|
||||
}
|
||||
catch(FileNotFoundException f) {
|
||||
Console.WriteLine("Error: unable to load the assembly of the provider: " +
|
||||
providerAssembly);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
// used for outputting message, but if silent is set,
|
||||
// don't display
|
||||
public void OutputLine(string line) {
|
||||
if(silent == false)
|
||||
OutputData(line);
|
||||
}
|
||||
|
||||
// used for outputting the header columns of a result
|
||||
public void OutputHeader(string line) {
|
||||
if(showHeader == true)
|
||||
OutputData(line);
|
||||
}
|
||||
|
||||
// OutputData() - used for outputting data
|
||||
// if an output filename is set, then the data will
|
||||
// go to a file; otherwise, it will go to the Console.
|
||||
public void OutputData(string line) {
|
||||
if(outputFilestream == null)
|
||||
Console.WriteLine(line);
|
||||
else
|
||||
outputFilestream.WriteLine(line);
|
||||
}
|
||||
|
||||
// HandleCommand - handle SqlSharpCli commands entered
|
||||
public void HandleCommand(string entry) {
|
||||
|
||||
public void HandleCommand(string entry) {
|
||||
string[] parms;
|
||||
|
||||
// maybe a SQL# Command was found
|
||||
parms = entry.Split(new char[1] {' '});
|
||||
string userCmd = parms[0].ToUpper();
|
||||
|
||||
@@ -477,6 +842,13 @@ namespace Mono.Data.SqlSharp {
|
||||
case "\\CONNECTIONSTRING":
|
||||
ChangeConnectionString(entry);
|
||||
break;
|
||||
case "\\LOADPROVIDER":
|
||||
// TODO:
|
||||
//SetupProvider(parms);
|
||||
break;
|
||||
case "\\LOADEXTPROVIDER":
|
||||
SetupExternalProvider(parms);
|
||||
break;
|
||||
case "\\OPEN":
|
||||
OpenDataSource();
|
||||
break;
|
||||
@@ -497,19 +869,55 @@ namespace Mono.Data.SqlSharp {
|
||||
if(build == null)
|
||||
Console.WriteLine("Error: SQL Buffer is empty.");
|
||||
else {
|
||||
ExecuteSql(build.ToString());
|
||||
buff = build.ToString();
|
||||
ExecuteSql(buff);
|
||||
}
|
||||
build = null;
|
||||
}
|
||||
break;
|
||||
case "\\EXENONQUERY":
|
||||
if(conn == null)
|
||||
Console.WriteLine("Error: connection is not Open.");
|
||||
else if(conn.State == ConnectionState.Closed)
|
||||
Console.WriteLine("Error: connection is not Open.");
|
||||
else {
|
||||
if(build == null)
|
||||
Console.WriteLine("Error: SQL Buffer is empty.");
|
||||
else {
|
||||
buff = build.ToString();
|
||||
ExecuteSqlNonQuery(buff);
|
||||
}
|
||||
build = null;
|
||||
}
|
||||
break;
|
||||
case "\\EXESCALAR":
|
||||
if(conn == null)
|
||||
Console.WriteLine("Error: connection is not Open.");
|
||||
else if(conn.State == ConnectionState.Closed)
|
||||
Console.WriteLine("Error: connection is not Open.");
|
||||
else {
|
||||
if(build == null)
|
||||
Console.WriteLine("Error: SQL Buffer is empty.");
|
||||
else {
|
||||
buff = build.ToString();
|
||||
ExecuteSqlScalar(buff);
|
||||
}
|
||||
build = null;
|
||||
}
|
||||
break;
|
||||
case "\\F":
|
||||
// Batch Input File: \f FILENAME
|
||||
SetupInputFile(parms);
|
||||
ExecuteBatch();
|
||||
SetupInputCommandsFile(parms);
|
||||
break;
|
||||
case "\\O":
|
||||
// Batch Output File: \o FILENAME
|
||||
SetupOutputFile(parms);
|
||||
SetupOutputResultsFile(parms);
|
||||
break;
|
||||
case "\\LOAD":
|
||||
// Load file into SQL buffer: \load FILENAME
|
||||
LoadBufferFromFile(parms);
|
||||
break;
|
||||
case "\\SAVE":
|
||||
// Save SQL buffer to file: \save FILENAME
|
||||
SaveBufferToFile(parms);
|
||||
break;
|
||||
case "\\H":
|
||||
case "\\HELP":
|
||||
@@ -517,12 +925,35 @@ namespace Mono.Data.SqlSharp {
|
||||
ShowHelp();
|
||||
break;
|
||||
case "\\DEFAULTS":
|
||||
// show the defaults for provider and connection strings
|
||||
ShowDefaults();
|
||||
break;
|
||||
case "\\Q":
|
||||
case "\\QUIT":
|
||||
// Quit
|
||||
break;
|
||||
case "\\R":
|
||||
// reset (clear) the query buffer
|
||||
build = null;
|
||||
break;
|
||||
case "\\SET":
|
||||
// sets internal variable
|
||||
// \set name value
|
||||
SetInternalVariable(parms);
|
||||
break;
|
||||
case "\\UNSET":
|
||||
// deletes internal variable
|
||||
// \unset name
|
||||
UnSetInternalVariable(parms);
|
||||
break;
|
||||
case "\\VARIABLE":
|
||||
ShowInternalVariable(parms);
|
||||
break;
|
||||
case "\\PRINT":
|
||||
if(build == null)
|
||||
Console.WriteLine("SQL Buffer is empty.");
|
||||
else
|
||||
Console.WriteLine("SQL Bufer\n" + buff);
|
||||
default:
|
||||
// Error
|
||||
Console.WriteLine("Error: Unknown user command.");
|
||||
@@ -543,14 +974,16 @@ namespace Mono.Data.SqlSharp {
|
||||
Console.WriteLine("Error: Missing FILENAME for -f switch");
|
||||
else {
|
||||
inputFilename = args[a + 1];
|
||||
ExecuteBatch();
|
||||
inputFilestream = new StreamReader(inputFilename);
|
||||
}
|
||||
break;
|
||||
case "O":
|
||||
if(a + 1 >= args.Length)
|
||||
Console.WriteLine("Error: Missing FILENAME for -o switch");
|
||||
else
|
||||
else {
|
||||
outputFilename = args[a + 1];
|
||||
outputFilestream = new StreamWriter(outputFilename);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Error: Unknow switch: " + args[a]);
|
||||
@@ -560,6 +993,29 @@ namespace Mono.Data.SqlSharp {
|
||||
}
|
||||
}
|
||||
|
||||
public string ReadSqlSharpCommand() {
|
||||
string entry = "";
|
||||
|
||||
if(inputFilestream == null) {
|
||||
Console.Write("\nSQL# ");
|
||||
entry = Console.ReadLine();
|
||||
}
|
||||
else {
|
||||
try {
|
||||
entry = inputFilestream.ReadLine();
|
||||
if(entry == null) {
|
||||
Console.WriteLine("Executing SQL# Commands from file done.");
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("Error: Reading command from file.");
|
||||
}
|
||||
Console.Write("\nSQL# ");
|
||||
entry = Console.ReadLine();
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
public void Run(string[] args) {
|
||||
|
||||
DealWithArgs(args);
|
||||
@@ -578,10 +1034,7 @@ namespace Mono.Data.SqlSharp {
|
||||
while(entry.ToUpper().Equals("\\Q") == false &&
|
||||
entry.ToUpper().Equals("\\QUIT") == false) {
|
||||
|
||||
Console.Write("\nSQL# ");
|
||||
entry = Console.ReadLine();
|
||||
|
||||
Console.WriteLine("Entered: " + entry);
|
||||
entry = ReadSqlSharpCommand();
|
||||
|
||||
if(entry.Substring(0,1).Equals("\\")) {
|
||||
HandleCommand(entry);
|
||||
@@ -598,7 +1051,9 @@ namespace Mono.Data.SqlSharp {
|
||||
build = new StringBuilder();
|
||||
}
|
||||
build.Append(entry);
|
||||
ExecuteSql(build.ToString());
|
||||
build.Append("\n");
|
||||
buff = build.ToString();
|
||||
ExecuteSql(buff);
|
||||
build = null;
|
||||
}
|
||||
}
|
||||
@@ -608,14 +1063,17 @@ namespace Mono.Data.SqlSharp {
|
||||
if(build == null) {
|
||||
build = new StringBuilder();
|
||||
}
|
||||
build.Append(entry + " ");
|
||||
build.Append(entry + "\n");
|
||||
buff = build.ToString();
|
||||
}
|
||||
}
|
||||
CloseDataSource();
|
||||
if(outputFilestream != null)
|
||||
outputFilestream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public class SqlSharpDriver {
|
||||
|
||||
public static void Main(string[] args) {
|
||||
SqlSharpCli sqlCommandLineEngine = new SqlSharpCli();
|
||||
sqlCommandLineEngine.Run(args);
|
||||
|
||||
@@ -22,6 +22,10 @@ namespace MonoTests.System.Data
|
||||
get {
|
||||
TestSuite suite = new TestSuite ();
|
||||
suite.AddTest (new TestSuite (typeof (DataColumnTest)));
|
||||
suite.AddTest (new TestSuite (typeof (UniqueConstraintTest)));
|
||||
suite.AddTest (new TestSuite (typeof (ConstraintTest)));
|
||||
suite.AddTest (new TestSuite (typeof (ConstraintCollectionTest)));
|
||||
suite.AddTest (new TestSuite (typeof (ForeignKeyConstraintTest)));
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
// ConstraintCollection.cs - NUnit Test Cases for testing the ConstraintCollection
|
||||
// class.
|
||||
//
|
||||
//
|
||||
// Franklin Wise ([email protected])
|
||||
//
|
||||
// (C) Franklin Wise
|
||||
//
|
||||
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
|
||||
namespace MonoTests.System.Data
|
||||
{
|
||||
|
||||
|
||||
public class ConstraintCollectionTest : TestCase
|
||||
{
|
||||
private DataTable _table;
|
||||
private DataTable _table2;
|
||||
private Constraint _constraint1;
|
||||
private Constraint _constraint2;
|
||||
|
||||
public ConstraintCollectionTest() : base ("MonoTests.System.Data.ConstraintCollectionTest") {}
|
||||
public ConstraintCollectionTest(string name) : base(name) {}
|
||||
|
||||
public void PublicSetup(){SetUp();}
|
||||
protected override void SetUp()
|
||||
{
|
||||
//Setup DataTable
|
||||
_table = new DataTable("TestTable");
|
||||
_table.Columns.Add("Col1",typeof(int));
|
||||
_table.Columns.Add("Col2",typeof(int));
|
||||
_table.Columns.Add("Col3",typeof(int));
|
||||
|
||||
_table2 = new DataTable("TestTable");
|
||||
_table2.Columns.Add("Col1",typeof(int));
|
||||
_table2.Columns.Add("Col2",typeof(int));
|
||||
|
||||
//Use UniqueConstraint to test Constraint Base Class
|
||||
_constraint1 = new UniqueConstraint(_table.Columns[0],false);
|
||||
_constraint2 = new UniqueConstraint(_table.Columns[1],false);
|
||||
}
|
||||
|
||||
protected override void TearDown() {}
|
||||
|
||||
public static ITest Suite
|
||||
{
|
||||
get
|
||||
{
|
||||
return new TestSuite(typeof(ConstraintCollectionTest));
|
||||
}
|
||||
}
|
||||
|
||||
public void TestAdd()
|
||||
{
|
||||
ConstraintCollection col = _table.Constraints;
|
||||
col.Add(_constraint1);
|
||||
col.Add(_constraint2);
|
||||
|
||||
Assertion.AssertEquals("Count doesn't equal added.",2, col.Count);
|
||||
}
|
||||
|
||||
public void TestAddExceptions()
|
||||
{
|
||||
ConstraintCollection col = _table.Constraints;
|
||||
|
||||
//null
|
||||
try
|
||||
{
|
||||
col.Add(null);
|
||||
Assertion.Fail("B1: Failed to throw ArgumentNullException.");
|
||||
}
|
||||
catch (ArgumentNullException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch
|
||||
{
|
||||
Assertion.Fail("A1: Wrong exception type");
|
||||
}
|
||||
|
||||
//duplicate name
|
||||
try
|
||||
{
|
||||
_constraint1.ConstraintName = "Dog";
|
||||
_constraint2.ConstraintName = "dog"; //case insensitive
|
||||
col.Add(_constraint1);
|
||||
col.Add(_constraint2);
|
||||
Assertion.Fail("Failed to throw Duplicate name exception.");
|
||||
}
|
||||
catch (DuplicateNameException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Assertion.Fail("A2: Wrong exception type. " + exc.ToString());
|
||||
}
|
||||
|
||||
//Constraint Already exists
|
||||
try
|
||||
{
|
||||
col.Add(_constraint1);
|
||||
Assertion.Fail("B2: Failed to throw ArgumentException.");
|
||||
}
|
||||
catch (ArgumentException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch
|
||||
{
|
||||
Assertion.Fail("A3: Wrong exception type");
|
||||
}
|
||||
}
|
||||
|
||||
public void TestIndexer()
|
||||
{
|
||||
Constraint c1 = new UniqueConstraint(_table.Columns[0]);
|
||||
Constraint c2 = new UniqueConstraint(_table.Columns[1]);
|
||||
|
||||
c1.ConstraintName = "first";
|
||||
c2.ConstraintName = "second";
|
||||
|
||||
|
||||
_table.Constraints.Add(c1);
|
||||
_table.Constraints.Add(c2);
|
||||
|
||||
Assertion.AssertSame("A1", c1, _table.Constraints[0]);
|
||||
Assertion.AssertSame("A2", c2, _table.Constraints[1]);
|
||||
|
||||
Assertion.AssertSame("A3", c1, _table.Constraints["first"]);
|
||||
Assertion.AssertSame("A4", c2, _table.Constraints["sEcond"]); //case insensitive
|
||||
|
||||
}
|
||||
|
||||
public void TestIndexOf()
|
||||
{
|
||||
Constraint c1 = new UniqueConstraint(_table.Columns[0]);
|
||||
Constraint c2 = new UniqueConstraint(_table.Columns[1]);
|
||||
|
||||
c1.ConstraintName = "first";
|
||||
c2.ConstraintName = "second";
|
||||
|
||||
_table.Constraints.Add(c1);
|
||||
_table.Constraints.Add(c2);
|
||||
|
||||
Assertion.AssertEquals("A1", 0, _table.Constraints.IndexOf(c1));
|
||||
Assertion.AssertEquals("A2", 1, _table.Constraints.IndexOf(c2));
|
||||
Assertion.AssertEquals("A3", 0, _table.Constraints.IndexOf("first"));
|
||||
Assertion.AssertEquals("A4", 1, _table.Constraints.IndexOf("second"));
|
||||
}
|
||||
|
||||
public void TestContains()
|
||||
{
|
||||
Constraint c1 = new UniqueConstraint(_table.Columns[0]);
|
||||
Constraint c2 = new UniqueConstraint(_table.Columns[1]);
|
||||
|
||||
c1.ConstraintName = "first";
|
||||
c2.ConstraintName = "second";
|
||||
|
||||
_table.Constraints.Add(c1);
|
||||
|
||||
Assertion.Assert("A1", _table.Constraints.Contains(c1.ConstraintName)); //true
|
||||
Assertion.Assert("A2", _table.Constraints.Contains(c2.ConstraintName) == false); //doesn't contain
|
||||
}
|
||||
|
||||
public void TestIndexerFailures()
|
||||
{
|
||||
_table.Constraints.Add(new UniqueConstraint(_table.Columns[0]));
|
||||
|
||||
//This doesn't throw
|
||||
Assertion.AssertNull(_table.Constraints["notInCollection"]);
|
||||
|
||||
//Index too high
|
||||
try
|
||||
{
|
||||
Constraint c = _table.Constraints[_table.Constraints.Count];
|
||||
Assertion.Fail("B1: Failed to throw IndexOutOfRangeException.");
|
||||
}
|
||||
catch (IndexOutOfRangeException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch
|
||||
{
|
||||
Assertion.Fail("A1: Wrong exception type");
|
||||
}
|
||||
|
||||
//Index too low
|
||||
try
|
||||
{
|
||||
Constraint c = _table.Constraints[-1];
|
||||
Assertion.Fail("B2: Failed to throw IndexOutOfRangeException.");
|
||||
}
|
||||
catch (IndexOutOfRangeException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch
|
||||
{
|
||||
Assertion.Fail("A2: Wrong exception type");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//TODO: Implementation not ready for this test yet
|
||||
// public void TestAddFkException1()
|
||||
// {
|
||||
// DataSet ds = new DataSet();
|
||||
// ds.Tables.Add(_table);
|
||||
// ds.Tables.Add(_table2);
|
||||
//
|
||||
// _table.Rows.Add(new object [] {1});
|
||||
// _table.Rows.Add(new object [] {1});
|
||||
//
|
||||
// //FKC: can't create unique constraint because duplicate values already exist
|
||||
// try
|
||||
// {
|
||||
// ForeignKeyConstraint fkc = new ForeignKeyConstraint( _table.Columns[0],
|
||||
// _table2.Columns[0]);
|
||||
//
|
||||
// _table2.Constraints.Add(fkc); //should throw
|
||||
// Assertion.Fail("B1: Failed to throw ArgumentException.");
|
||||
// }
|
||||
// catch (ArgumentException) {}
|
||||
// catch (AssertionFailedError exc) {throw exc;}
|
||||
// catch (Exception exc)
|
||||
// {
|
||||
// Assertion.Fail("A1: Wrong Exception type. " + exc.ToString());
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
//TODO: Implementation not ready for this test yet
|
||||
// public void TestAddFkException2()
|
||||
// {
|
||||
// //Foreign key rules only work when the tables
|
||||
// //are apart of the dataset
|
||||
// DataSet ds = new DataSet();
|
||||
// ds.Tables.Add(_table);
|
||||
// ds.Tables.Add(_table2);
|
||||
//
|
||||
// _table.Rows.Add(new object [] {1});
|
||||
//
|
||||
// // will need a matching parent value in
|
||||
// // _table
|
||||
// _table2.Rows.Add(new object [] {3});
|
||||
//
|
||||
//
|
||||
// //FKC: no matching parent value
|
||||
// try
|
||||
// {
|
||||
// ForeignKeyConstraint fkc = new ForeignKeyConstraint( _table.Columns[0],
|
||||
// _table2.Columns[0]);
|
||||
//
|
||||
// _table2.Constraints.Add(fkc); //should throw
|
||||
// Assertion.Fail("B1: Failed to throw ArgumentException.");
|
||||
// }
|
||||
// catch (ArgumentException) {}
|
||||
// catch (AssertionFailedError exc) {throw exc;}
|
||||
// catch (Exception exc)
|
||||
// {
|
||||
// Assertion.Fail("A1: Wrong Exception type. " + exc.ToString());
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
//TODO: Implementation not ready for this test yet
|
||||
// public void TestAddUniqueExceptions()
|
||||
// {
|
||||
//
|
||||
//
|
||||
// //UC: can't create unique constraint because duplicate values already exist
|
||||
// try
|
||||
// {
|
||||
// _table.Rows.Add(new object [] {1});
|
||||
// _table.Rows.Add(new object [] {1});
|
||||
// UniqueConstraint uc = new UniqueConstraint( _table.Columns[0]);
|
||||
//
|
||||
// _table.Constraints.Add(uc); //should throw
|
||||
// Assertion.Fail("B1: Failed to throw ArgumentException.");
|
||||
// }
|
||||
// catch (ArgumentException) {}
|
||||
// catch (AssertionFailedError exc) {throw exc;}
|
||||
// catch (Exception exc)
|
||||
// {
|
||||
// Assertion.Fail("A1: Wrong Exception type. " + exc.ToString());
|
||||
// }
|
||||
// }
|
||||
|
||||
public void TestAddRange()
|
||||
{
|
||||
}
|
||||
|
||||
public void TestClear()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void TestCanRemove()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void TestCollectionChanged()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void TestRemoveAt()
|
||||
{
|
||||
}
|
||||
|
||||
public void TestRemove()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public void TestRemoveExceptions()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
// ConstraintTest.cs - NUnit Test Cases for testing the abstract class System.Data.Constraint
|
||||
// The tests use an inherited class (UniqueConstraint) to test the Constraint class.
|
||||
//
|
||||
// Franklin Wise <[email protected]>
|
||||
//
|
||||
// (C) 2002 Franklin Wise
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace MonoTests.System.Data
|
||||
{
|
||||
// public class MyUniqueConstraint: UniqueConstraint {
|
||||
// public MyUniqueConstraint(DataColumn col, bool pk): base(col,pk){}
|
||||
// string _myval = "";
|
||||
// public override string ConstraintName {
|
||||
// get{
|
||||
// return _myval;
|
||||
// return base.ConstraintName;
|
||||
// }
|
||||
// set{
|
||||
// Console.WriteLine("NameSet = " + value);
|
||||
// base.ConstraintName = value;
|
||||
// _myval = value;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public class ConstraintTest : TestCase
|
||||
{
|
||||
private DataTable _table;
|
||||
private Constraint _constraint1;
|
||||
private Constraint _constraint2;
|
||||
|
||||
public ConstraintTest() : base ("MonoTests.System.Data.ConstraintTest") {}
|
||||
public ConstraintTest(string name) : base(name) {}
|
||||
|
||||
public void PublicSetup(){SetUp();}
|
||||
protected override void SetUp() {
|
||||
|
||||
//Setup DataTable
|
||||
_table = new DataTable("TestTable");
|
||||
_table.Columns.Add("Col1",typeof(int));
|
||||
_table.Columns.Add("Col2",typeof(int));
|
||||
|
||||
//Use UniqueConstraint to test Constraint Base Class
|
||||
_constraint1 = new UniqueConstraint(_table.Columns[0],false);
|
||||
_constraint2 = new UniqueConstraint(_table.Columns[1],false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void TearDown() {}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
return new TestSuite(typeof(ConstraintTest));
|
||||
}
|
||||
}
|
||||
|
||||
public void TestSetConstraintNameNullOrEmptyExceptions() {
|
||||
bool exceptionCaught = false;
|
||||
string name = null;
|
||||
|
||||
_table.Constraints.Add (_constraint1);
|
||||
|
||||
Console.WriteLine(_constraint1.ConstraintName);
|
||||
|
||||
for (int i = 0; i <= 1; i++) {
|
||||
exceptionCaught = false;
|
||||
if (0 == i) name = null;
|
||||
if (1 == i) name = String.Empty;
|
||||
|
||||
try {
|
||||
|
||||
//Next line should throw ArgumentException
|
||||
//Because ConstraintName can't be set to null
|
||||
//or empty while the constraint is part of the
|
||||
//collection
|
||||
_constraint1.ConstraintName = name;
|
||||
}
|
||||
catch (ArgumentException){
|
||||
exceptionCaught = true;
|
||||
}
|
||||
catch {
|
||||
Assertion.Fail("Wrong exception type thrown.");
|
||||
}
|
||||
|
||||
Assertion.Assert("Failed to throw exception.",
|
||||
true == exceptionCaught);
|
||||
}
|
||||
}
|
||||
|
||||
public void TestSetConstraintNameDuplicateException() {
|
||||
_constraint1.ConstraintName = "Dog";
|
||||
_constraint2.ConstraintName = "Cat";
|
||||
|
||||
_table.Constraints.Add(_constraint1);
|
||||
_table.Constraints.Add(_constraint2);
|
||||
|
||||
try {
|
||||
//Should throw DuplicateNameException
|
||||
_constraint2.ConstraintName = "Dog";
|
||||
|
||||
Assertion.Fail("Failed to throw " +
|
||||
" DuplicateNameException exception.");
|
||||
}
|
||||
catch (DuplicateNameException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch {
|
||||
Assertion.Fail("Wrong exception type thrown.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void TestToString() {
|
||||
_constraint1.ConstraintName = "Test";
|
||||
Assertion.Assert("ToString is the same as constraint name.", _constraint1.ConstraintName.CompareTo( _constraint1.ToString()) == 0);
|
||||
|
||||
_constraint1.ConstraintName = null;
|
||||
Assertion.AssertNotNull("ToString should return empty.",_constraint1.ToString());
|
||||
}
|
||||
|
||||
public void TestGetExtendedProperties() {
|
||||
PropertyCollection col = _constraint1.ExtendedProperties as
|
||||
PropertyCollection;
|
||||
|
||||
Assertion.AssertNotNull("ExtendedProperties returned null or didn't " +
|
||||
"return the correct type", col);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -26,5 +26,7 @@ namespace MonoTests.System.Data
|
||||
return new TestSuite (typeof (DataColumnTest));
|
||||
}
|
||||
}
|
||||
|
||||
public void TestBlank() {} //Remove me when we add some tests
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
// ForeignKeyConstraintTest.cs - NUnit Test Cases for [explain here]
|
||||
//
|
||||
// Franklin Wise ([email protected])
|
||||
//
|
||||
// (C) Franklin Wise
|
||||
//
|
||||
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace MonoTests.System.Data
|
||||
{
|
||||
|
||||
public class ForeignKeyConstraintTest : TestCase
|
||||
{
|
||||
private DataSet _ds;
|
||||
|
||||
//NOTE: fk constraints only work when the table is part of a DataSet
|
||||
|
||||
public ForeignKeyConstraintTest() : base ("MonoTests.System.Data.ForeignKeyConstraintTest") {}
|
||||
public ForeignKeyConstraintTest(string name) : base(name) {}
|
||||
|
||||
protected override void SetUp()
|
||||
{
|
||||
_ds = new DataSet();
|
||||
|
||||
//Setup DataTable
|
||||
DataTable table;
|
||||
table = new DataTable("TestTable");
|
||||
table.Columns.Add("Col1",typeof(int));
|
||||
table.Columns.Add("Col2",typeof(int));
|
||||
table.Columns.Add("Col3",typeof(int));
|
||||
|
||||
_ds.Tables.Add(table);
|
||||
|
||||
table = new DataTable("TestTable2");
|
||||
table.Columns.Add("Col1",typeof(int));
|
||||
table.Columns.Add("Col2",typeof(int));
|
||||
table.Columns.Add("Col3",typeof(int));
|
||||
|
||||
_ds.Tables.Add(table);
|
||||
|
||||
}
|
||||
|
||||
protected override void TearDown() {}
|
||||
|
||||
public static ITest Suite
|
||||
{
|
||||
get
|
||||
{
|
||||
return new TestSuite(typeof(ForeignKeyConstraintTest));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void TestCtorExceptions ()
|
||||
{
|
||||
ForeignKeyConstraint fkc;
|
||||
|
||||
DataTable localTable = new DataTable();
|
||||
localTable.Columns.Add("Col1",typeof(int));
|
||||
localTable.Columns.Add("Col2",typeof(bool));
|
||||
|
||||
//Null
|
||||
try
|
||||
{
|
||||
fkc = new ForeignKeyConstraint((DataColumn)null,(DataColumn)null);
|
||||
Assertion.Fail("Failed to throw ArgumentNullException.");
|
||||
}
|
||||
catch (ArgumentNullException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Assertion.Fail("A1: Wrong Exception type. " + exc.ToString());
|
||||
}
|
||||
|
||||
//zero length collection
|
||||
try
|
||||
{
|
||||
fkc = new ForeignKeyConstraint(new DataColumn[]{},new DataColumn[]{});
|
||||
Assertion.Fail("B1: Failed to throw ArgumentException.");
|
||||
}
|
||||
catch (ArgumentException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Assertion.Fail("A1: Wrong Exception type. " + exc.ToString());
|
||||
}
|
||||
|
||||
//different datasets
|
||||
try
|
||||
{
|
||||
fkc = new ForeignKeyConstraint(_ds.Tables[0].Columns[0], localTable.Columns[0]);
|
||||
Assertion.Fail("Failed to throw InvalidOperationException.");
|
||||
}
|
||||
catch (InvalidOperationException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Assertion.Fail("A1: Wrong Exception type. " + exc.ToString());
|
||||
}
|
||||
|
||||
//different dataTypes
|
||||
try
|
||||
{
|
||||
fkc = new ForeignKeyConstraint(_ds.Tables[0].Columns[0], localTable.Columns[1]);
|
||||
Assertion.Fail("Failed to throw InvalidOperationException.");
|
||||
}
|
||||
catch (InvalidOperationException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Assertion.Fail("A1: Wrong Exception type. " + exc.ToString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
// UniqueConstraintTest.cs - NUnit Test Cases for testing the class System.Data.UniqueConstraint
|
||||
//
|
||||
// Franklin Wise <[email protected]>
|
||||
//
|
||||
// (C) 2002 Franklin Wise
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace MonoTests.System.Data
|
||||
{
|
||||
public class UniqueConstraintTest : TestCase
|
||||
{
|
||||
private DataTable _table;
|
||||
|
||||
public UniqueConstraintTest() : base ("MonoTests.System.Data.UniqueConstraintTest") {}
|
||||
public UniqueConstraintTest(string name) : base(name) {}
|
||||
|
||||
public void PublicSetup() {this.SetUp();}
|
||||
protected override void SetUp() {
|
||||
|
||||
//Setup DataTable
|
||||
_table = new DataTable("TestTable");
|
||||
_table.Columns.Add("Col1",typeof(int));
|
||||
_table.Columns.Add("Col2",typeof(int));
|
||||
_table.Columns.Add("Col3",typeof(int));
|
||||
|
||||
}
|
||||
|
||||
protected override void TearDown() {}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
return new TestSuite(typeof(UniqueConstraintTest));
|
||||
}
|
||||
}
|
||||
|
||||
public void TestCtorExceptions() {
|
||||
//UniqueConstraint(string name, DataColumn column, bool isPrimaryKey)
|
||||
|
||||
UniqueConstraint cst;
|
||||
|
||||
//must have DataTable exception
|
||||
try{
|
||||
//Should throw an ArgumentException
|
||||
//Can only add DataColumns that are attached
|
||||
//to a DataTable
|
||||
cst = new UniqueConstraint(new DataColumn(""));
|
||||
|
||||
Assertion.Fail("Failed to throw ArgumentException.");
|
||||
}
|
||||
catch (ArgumentException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch {
|
||||
Assertion.Fail("A1: Wrong Exception type.");
|
||||
}
|
||||
|
||||
//Null exception
|
||||
try {
|
||||
//Should throw argument null exception
|
||||
cst = new UniqueConstraint((DataColumn)null);
|
||||
}
|
||||
catch (ArgumentNullException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch {
|
||||
Assertion.Fail("A2: Wrong Exception type.");
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
//Should throw exception
|
||||
//must have at least one valid column
|
||||
//InvalidConstraintException is thrown by msft ver
|
||||
cst = new UniqueConstraint(new DataColumn [] {});
|
||||
|
||||
Assertion.Fail("B1: Failed to throw InvalidConstraintException.");
|
||||
}
|
||||
catch (InvalidConstraintException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch {
|
||||
Assertion.Fail("A3: Wrong Exception type.");
|
||||
}
|
||||
|
||||
DataTable dt = new DataTable("Table1");
|
||||
dt.Columns.Add("Col1",typeof(int));
|
||||
DataTable dt2 = new DataTable("Table2");
|
||||
dt2.Columns.Add("Col1",typeof(int));
|
||||
|
||||
DataSet ds = new DataSet();
|
||||
ds.Tables.Add(dt);
|
||||
ds.Tables.Add(dt2);
|
||||
|
||||
//columns from two different tables.
|
||||
try {
|
||||
//next line should throw
|
||||
//can't have columns from two different tables
|
||||
cst = new UniqueConstraint(new DataColumn [] {
|
||||
dt.Columns[0], dt2.Columns[0]});
|
||||
|
||||
Assertion.Fail("B2: Failed to throw InvalidConstraintException");
|
||||
}
|
||||
catch (InvalidConstraintException) {}
|
||||
catch (AssertionFailedError exc) {throw exc;}
|
||||
catch {
|
||||
Assertion.Fail("A4: Wrong Exception type.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void TestCtor() {
|
||||
|
||||
UniqueConstraint cst;
|
||||
|
||||
//Success case
|
||||
try {
|
||||
cst = new UniqueConstraint(_table.Columns[0]);
|
||||
}
|
||||
catch (Exception exc) {
|
||||
Assertion.Fail("A1: Failed to ctor. " + exc.ToString());
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
cst = new UniqueConstraint( new DataColumn [] {
|
||||
_table.Columns[0], _table.Columns[1]});
|
||||
}
|
||||
catch (Exception exc) {
|
||||
Assertion.Fail("A2: Failed to ctor. " + exc.ToString());
|
||||
}
|
||||
|
||||
|
||||
//table is set on ctor
|
||||
cst = new UniqueConstraint(_table.Columns[0]);
|
||||
|
||||
Assertion.AssertSame("B1", cst.Table, _table);
|
||||
|
||||
//table is set on ctor
|
||||
cst = new UniqueConstraint( new DataColumn [] {
|
||||
_table.Columns[0], _table.Columns[1]});
|
||||
Assertion.AssertSame ("B2", cst.Table, _table);
|
||||
|
||||
cst = new UniqueConstraint("MyName",_table.Columns[0],true);
|
||||
|
||||
//Test ctor parm set for ConstraintName & IsPrimaryKey
|
||||
Assertion.AssertEquals("ConstraintName not set in ctor.",
|
||||
"MyName", cst.ConstraintName);
|
||||
Assertion.AssertEquals("IsPrimaryKey not set in ctor.",
|
||||
true, cst.IsPrimaryKey);
|
||||
|
||||
}
|
||||
|
||||
public void TestEquals() {
|
||||
UniqueConstraint cst = new UniqueConstraint( new DataColumn [] {
|
||||
_table.Columns[0], _table.Columns[1]});
|
||||
UniqueConstraint cst2 = new UniqueConstraint( new DataColumn [] {
|
||||
_table.Columns[1], _table.Columns[0]});
|
||||
|
||||
UniqueConstraint cst3 = new UniqueConstraint(_table.Columns[0]);
|
||||
UniqueConstraint cst4 = new UniqueConstraint(_table.Columns[2]);
|
||||
|
||||
//true
|
||||
Assertion.Assert(cst.Equals(cst2) == true);
|
||||
|
||||
//false
|
||||
Assertion.Assert("A1", cst.Equals(23) == false);
|
||||
Assertion.Assert("A2", cst.Equals(cst3) == false);
|
||||
Assertion.Assert("A3", cst3.Equals(cst) == false);
|
||||
Assertion.Assert("A4", cst.Equals(cst4) == false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -91,25 +91,31 @@ System.Data.Common/DataColumnMappingCollection.cs
|
||||
System.Data.Common/DataTableMapping.cs
|
||||
System.Data.Common/DataTableMappingCollection.cs
|
||||
System.Data.Common/DbDataAdapter.cs
|
||||
System.Data.Common/DbDataPermission.cs
|
||||
System.Data.Common/DbDataPermissionAttribute.cs
|
||||
System.Data.Common/RowUpdatedEventArgs.cs
|
||||
System.Data.Common/RowUpdatingEventArgs.cs
|
||||
System.Data.OleDb/libgda.cs
|
||||
System.Data.OleDb/OleDbCommand.cs
|
||||
System.Data.OleDb/OleDbCommandBuilder.cs
|
||||
System.Data.OleDb/OleDbConnection.cs
|
||||
System.Data.OleDb/OleDbDataAdapter.cs
|
||||
System.Data.OleDb/OleDbDataReader.cs
|
||||
System.Data.OleDb/OleDbError.cs
|
||||
System.Data.OleDb/OleDbErrorCollection.cs
|
||||
System.Data.OleDb/OleDbException.cs
|
||||
System.Data.OleDb/OleDbInfoMessageEventArgs.cs
|
||||
System.Data.OleDb/OleDbInfoMessageEventHandler.cs
|
||||
System.Data.OleDb/OleDbLiteral.cs
|
||||
System.Data.OleDb/OleDbParameter.cs
|
||||
System.Data.OleDb/OleDbParameterCollection.cs
|
||||
System.Data.OleDb/OleDbPermission.cs
|
||||
System.Data.OleDb/OleDbPermissionAttribute.cs
|
||||
System.Data.OleDb/OleDbRowUpdatedEventArgs.cs
|
||||
System.Data.OleDb/OleDbRowUpdatedEventHandler.cs
|
||||
System.Data.OleDb/OleDbRowUpdatingEventArgs.cs
|
||||
System.Data.OleDb/OleDbRowUpdatingEventHandler.cs
|
||||
System.Data.OleDb/OleDbSchemaGuid.cs
|
||||
System.Data.OleDb/OleDbTransaction.cs
|
||||
System.Data.OleDb/OleDbType.cs
|
||||
System.Data.SqlClient/ParmUtil.cs
|
||||
|
||||
@@ -2,9 +2,14 @@ topdir = ../..
|
||||
|
||||
LIBRARY = ../lib/System.Data.dll
|
||||
|
||||
LIB_LIST = list
|
||||
LIB_FLAGS = -r corlib -r System -r System.Xml
|
||||
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=\
|
||||
./Test* \
|
||||
*TestGDA.cs \
|
||||
./System.Xml*
|
||||
|
||||
export MONO_PATH_PREFIX = ../lib:
|
||||
|
||||
include ../library.make
|
||||
@@ -1,3 +1,7 @@
|
||||
2002-07-28 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* ColorTranslator.cs: use Color.Name.
|
||||
|
||||
2002-07-18 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Color.cs: implemented SystemColors and NamedColors properties that
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace System.Drawing {
|
||||
string result;
|
||||
|
||||
if (c.IsNamedColor)
|
||||
result = c.ToString ();
|
||||
result = c.Name;
|
||||
else
|
||||
result = String.Format ("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B);
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@ topdir = ../..
|
||||
|
||||
LIBRARY = ../lib/System.Drawing.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = -r corlib -r System
|
||||
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=\
|
||||
./Test*
|
||||
|
||||
export MONO_PATH_PREFIX = ../lib:
|
||||
|
||||
include ../library.make
|
||||
@@ -1,3 +1,20 @@
|
||||
2002-08-13 Tim Coleman <[email protected]>
|
||||
* list: new files added to build
|
||||
|
||||
2002-08-08 Tim Coleman <[email protected]>
|
||||
* list: new files added to build.
|
||||
|
||||
2002-08-07 Tim Coleman <[email protected]>
|
||||
* list: new files added to build.
|
||||
|
||||
2002-08-06 Tim Coleman <[email protected]>
|
||||
* list: new files added to build.
|
||||
* System.EnterpriseServices.CompensatingResourceManager:
|
||||
New directory added
|
||||
|
||||
2002-08-03 Tim Coleman <[email protected]>
|
||||
* list: new files added to build list.
|
||||
|
||||
2002-07-22 Tim Coleman <[email protected]>
|
||||
* makefile.gnu: added to build on linux
|
||||
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
2002-08-13 Tim Coleman <[email protected]>
|
||||
* Clerk.cs:
|
||||
* Compensator.cs:
|
||||
New stubs added.
|
||||
|
||||
2002-08-07 Tim Coleman <[email protected]>
|
||||
* CompensatorOptions.cs:
|
||||
* LogRecordFlags.cs:
|
||||
* TransactionState.cs:
|
||||
Changed enum values to agree with .NET
|
||||
* LogRecord.cs:
|
||||
New stubs added
|
||||
|
||||
2002-08-06 Tim Coleman <[email protected]>
|
||||
* ChangeLog.cs:
|
||||
* CompensatorOptions.cs:
|
||||
* LogRecordFlags.cs:
|
||||
* TransactionState.cs:
|
||||
New stubs added
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// System.EnterpriseServices.CompensatingResourceManager.Clerk.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.EnterpriseServices;
|
||||
|
||||
namespace System.EnterpriseServices.CompensatingResourceManager {
|
||||
public sealed class Clerk {
|
||||
|
||||
#region Constructors
|
||||
|
||||
//internal Clerk (CrmLogControl logControl)
|
||||
//{
|
||||
//}
|
||||
|
||||
[MonoTODO]
|
||||
public Clerk (string compensator, string description, CompensatorOptions flags)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public Clerk (Type compensator, string description, CompensatorOptions flags)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public int LogRecordCount {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public string TransactionUOW {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
[MonoTODO]
|
||||
~Clerk ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void ForceLog ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void ForceTransactionToAbort ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void ForgetLogRecord ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void WriteLogRecord (object record)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// System.EnterpriseServices.CompensatingResourceManager.Compensator.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.EnterpriseServices;
|
||||
|
||||
namespace System.EnterpriseServices.CompensatingResourceManager {
|
||||
public class Compensator : ServicedComponent{
|
||||
|
||||
#region Constructors
|
||||
|
||||
[MonoTODO]
|
||||
public Compensator ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public Clerk Clerk {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
[MonoTODO]
|
||||
public virtual bool AbortRecord (LogRecord rec)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual void BeginAbort (bool fRecovery)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual void BeginCommit (bool fRecovery)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual void BeginPrepare ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual void CommitRecord (LogRecord rec)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual void EndAbort ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual void EndCommit ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual bool EndPrepare ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual bool PrepareRecord (LogRecord rec)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// System.EnterpriseServices.CompensatingResourceManager.CompensatorOptions.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices.CompensatingResourceManager {
|
||||
[Flags]
|
||||
[Serializable]
|
||||
public enum CompensatorOptions {
|
||||
PreparePhase = 0x1,
|
||||
CommitPhase = 0x2,
|
||||
AbortPhase = 0x4,
|
||||
AllPhases = 0x7,
|
||||
FailIfInDoubtsRemain = 0x10
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// System.EnterpriseServices.CompensatingResourceManager.LogRecord.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.EnterpriseServices;
|
||||
|
||||
namespace System.EnterpriseServices.CompensatingResourceManager {
|
||||
|
||||
public sealed class LogRecord {
|
||||
|
||||
#region Fields
|
||||
|
||||
LogRecordFlags flags;
|
||||
object record;
|
||||
int sequence;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
[MonoTODO]
|
||||
internal LogRecord ()
|
||||
{
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
internal LogRecord (_LogRecord logRecord)
|
||||
{
|
||||
flags = (LogRecordFlags) logRecord.dwCrmFlags;
|
||||
sequence = logRecord.dwSequenceNumber;
|
||||
record = logRecord.blobUserData;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public LogRecordFlags Flags {
|
||||
get { return flags; }
|
||||
}
|
||||
|
||||
public object Record {
|
||||
get { return record; }
|
||||
}
|
||||
|
||||
public int Sequence {
|
||||
get { return sequence; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
|
||||
internal struct _LogRecord {
|
||||
|
||||
#region Fields
|
||||
|
||||
public int dwCrmFlags;
|
||||
public int dwSequenceNumber;
|
||||
public object blobUserData; // FIXME: This is not the correct type
|
||||
|
||||
#endregion // Fields
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// System.EnterpriseServices.CompensatingResourceManager.LogRecordFlags.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices.CompensatingResourceManager {
|
||||
[Flags]
|
||||
[Serializable]
|
||||
public enum LogRecordFlags {
|
||||
ForgetTarget = 0x1,
|
||||
WrittenDuringPrepare = 0x2,
|
||||
WrittenDuringCommit = 0x4,
|
||||
WrittenDuringAbort = 0x8,
|
||||
WrittenDurringRecovery = 0x10, // Typo present in .NET
|
||||
WrittenDuringReplay = 0x20,
|
||||
ReplayInProgress = 0x40
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// System.EnterpriseServices.CompensatingResourceManager.TransactionState.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices.CompensatingResourceManager {
|
||||
[Serializable]
|
||||
public enum TransactionState {
|
||||
Active = 0x0,
|
||||
Committed = 0x1,
|
||||
Aborted = 0x2,
|
||||
Indoubt = 0x3
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// System.EnterpriseServices.AccessChecksLevelOption.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[Serializable]
|
||||
public enum AccessChecksLevelOption {
|
||||
Application,
|
||||
ApplicationComponent
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// System.EnterpriseServices.ActivationOption.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[Serializable]
|
||||
public enum ActivationOption {
|
||||
Library,
|
||||
Server
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// System.EnterpriseServices.ApplicationAccessControlAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Assembly)]
|
||||
public sealed class ApplicationAccessControlAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
AccessChecksLevelOption accessChecksLevel;
|
||||
AuthenticationOption authentication;
|
||||
ImpersonationLevelOption impersonation;
|
||||
bool val;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ApplicationAccessControlAttribute ()
|
||||
{
|
||||
this.val = false;
|
||||
}
|
||||
|
||||
public ApplicationAccessControlAttribute (bool val)
|
||||
{
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public AccessChecksLevelOption AccessChecksLevel {
|
||||
get { return accessChecksLevel; }
|
||||
set { accessChecksLevel = value; }
|
||||
}
|
||||
|
||||
public AuthenticationOption Authentication {
|
||||
get { return authentication; }
|
||||
set { authentication = value; }
|
||||
}
|
||||
|
||||
public ImpersonationLevelOption Impersonation {
|
||||
get { return impersonation; }
|
||||
set { impersonation = value; }
|
||||
}
|
||||
|
||||
public bool Value {
|
||||
get { return val; }
|
||||
set { val = value; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// System.EnterpriseServices.ApplicationActivationAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Assembly)]
|
||||
public sealed class ApplicationActivationAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
ActivationOption opt;
|
||||
string soapMailbox;
|
||||
string soapVRoot;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ApplicationActivationAttribute (ActivationOption opt)
|
||||
{
|
||||
this.opt = opt;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public string SoapMailbox {
|
||||
get { return soapMailbox; }
|
||||
set { soapMailbox = value; }
|
||||
}
|
||||
|
||||
public string SoapVRoot {
|
||||
get { return soapVRoot; }
|
||||
set { soapVRoot = value; }
|
||||
}
|
||||
|
||||
public ActivationOption Value {
|
||||
get { return opt; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// System.EnterpriseServices.ApplicationIDAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Assembly)]
|
||||
public sealed class ApplicationIDAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
Guid guid;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ApplicationIDAttribute (string guid)
|
||||
{
|
||||
this.guid = new Guid (guid);
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public Guid Value {
|
||||
get { return guid; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// System.EnterpriseServices.ApplicationNameAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Assembly)]
|
||||
public sealed class ApplicationNameAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
string name;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ApplicationNameAttribute (string name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public string Value {
|
||||
get { return name; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// System.EnterpriseServices.ApplicationQueuingAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Assembly)]
|
||||
public sealed class ApplicationQueuingAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
bool enabled;
|
||||
int maxListenerThreads;
|
||||
bool queueListenerEnabled;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ApplicationQueuingAttribute ()
|
||||
{
|
||||
enabled = true;
|
||||
queueListenerEnabled = false;
|
||||
maxListenerThreads = 0;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public bool Enabled {
|
||||
get { return enabled; }
|
||||
set { enabled = value; }
|
||||
}
|
||||
|
||||
public int MaxListenerThreads {
|
||||
get { return maxListenerThreads; }
|
||||
set { maxListenerThreads = value; }
|
||||
}
|
||||
|
||||
public bool QueueListenerEnabled {
|
||||
get { return queueListenerEnabled; }
|
||||
set { queueListenerEnabled = value; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// System.EnterpriseServices.AuthenticationOption.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[Serializable]
|
||||
public enum AuthenticationOption {
|
||||
Call,
|
||||
Connect,
|
||||
Default,
|
||||
Integrity,
|
||||
None,
|
||||
Packet,
|
||||
Privacy
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// System.EnterpriseServices.AutoCompleteAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Method)]
|
||||
public sealed class AutoCompleteAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
bool val;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public AutoCompleteAttribute ()
|
||||
{
|
||||
val = true;
|
||||
}
|
||||
|
||||
public AutoCompleteAttribute (bool val)
|
||||
{
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public bool Value {
|
||||
get { return val; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// System.EnterpriseServices.BOID.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
public struct BOID {
|
||||
|
||||
#region Fields
|
||||
|
||||
public byte[] rgb;
|
||||
|
||||
#endregion // Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// System.EnterpriseServices.BYOT.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
public sealed class BYOT {
|
||||
|
||||
#region Methods
|
||||
|
||||
[MonoTODO]
|
||||
public static object CreateWithTipTransaction (string url, Type t)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static object CreateWithTransaction (object transaction, Type t)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// System.EnterpriseServices.COMTIIntrinsicsAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Class)]
|
||||
public sealed class COMTIIntrinsicsAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
bool val;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public COMTIIntrinsicsAttribute ()
|
||||
{
|
||||
this.val = false;
|
||||
}
|
||||
|
||||
public COMTIIntrinsicsAttribute (bool val)
|
||||
{
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public bool Value {
|
||||
get { return val; }
|
||||
set { val = value; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,99 @@
|
||||
2002-08-10 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* RegistrationHelper.cs: fixed compilation.
|
||||
|
||||
2002-08-09 Tim Coleman <[email protected]>
|
||||
* RegistrationHelperTx.cs:
|
||||
Commit the add of RegistrationHelperTx.cs
|
||||
|
||||
2002-08-08 Tim Coleman <[email protected]>
|
||||
* ISecurityCallContext.cs:
|
||||
* ISecurityCallersColl.cs:
|
||||
* ISecurityIdentityColl.cs:
|
||||
* ISharedProperty.cs:
|
||||
* ISharedPropertyGroup.cs:
|
||||
* RegistrationHelperTx.cs:
|
||||
* ResourcePool.cs:
|
||||
* SecureMethodAttribute.cs:
|
||||
* SecurityCallContext.cs:
|
||||
* SecurityCallers.cs:
|
||||
* SecurityIdentity.cs:
|
||||
* SecurityRoleAttribute.cs:
|
||||
* ServicedComponentException.cs:
|
||||
* SharedProperty.cs:
|
||||
* SharedPropertyGroup.cs:
|
||||
* SharedPropertyGroupManager.cs:
|
||||
* SynchronizationAttribute.cs:
|
||||
* SynchronizationOption.cs:
|
||||
* TransactionAttribute.cs:
|
||||
* TransactionIsolationLevel.cs:
|
||||
New files added.
|
||||
* ContextUtil.cs:
|
||||
New internal constructor added, methods added.
|
||||
* IRemoteDispatch.cs:
|
||||
AutoComplete attributes added to methods
|
||||
* TODOAttribute.cs:
|
||||
Namespace adjusted.
|
||||
|
||||
|
||||
2002-08-07 Tim Coleman <[email protected]>
|
||||
* RegistrationErrorInfo.cs:
|
||||
* RegistrationException.cs:
|
||||
* RegistrationHelper.cs:
|
||||
* ServicedComponent.cs:
|
||||
New stubs added
|
||||
|
||||
2002-08-06 Tim Coleman <[email protected]>
|
||||
* IRegistrationHelper.cs:
|
||||
* IRemoteDispatch.cs:
|
||||
* IServicedComponentInfo.cs:
|
||||
* ITransaction.cs:
|
||||
Comment out Guid attribute for now
|
||||
because it doesn't build with CSC unless
|
||||
you supply a valid Guid.
|
||||
|
||||
2002-08-06 Tim Coleman <[email protected]>
|
||||
* DescriptionAttribute.cs:
|
||||
* EventClassAttribute.cs:
|
||||
* EventTrackingEnabledAttribute.cs:
|
||||
* ExceptionClassAttribute.cs:
|
||||
* IISIntrinsicsAttribute.cs:
|
||||
* IRegistrationHelper.cs:
|
||||
* IRemoteDispatch.cs:
|
||||
* IServicedComponentInfo.cs:
|
||||
* ITransaction.cs:
|
||||
* InstallationFlags.cs:
|
||||
* InterfaceQueuingAttribute.cs:
|
||||
* JustInTimeActivationAttribute.cs:
|
||||
* LoadBalancingSupportedAttribute.cs:
|
||||
* MustRunInClientContextAttribute.cs:
|
||||
* ObjectPoolingAttribute.cs:
|
||||
* PrivateComponentAttribute.cs:
|
||||
* PropertyLockMode.cs:
|
||||
* PropertyReleaseMode.cs:
|
||||
* XACTTRANSINFO.cs:
|
||||
New stubs added.
|
||||
|
||||
2002-08-03 Tim Coleman <[email protected]>
|
||||
* AccessChecksLevelOption.cs:
|
||||
* ActivationOption.cs:
|
||||
* ApplicationAccessControlAttribute.cs:
|
||||
* ApplicationActivationAttribute.cs:
|
||||
* ApplicationIDAttribute.cs:
|
||||
* ApplicationNameAttribute.cs:
|
||||
* ApplicationQueuingAttribute.cs:
|
||||
* AuthenticationOption.cs:
|
||||
* AutoCompleteAttribute.cs:
|
||||
* BOID.cs:
|
||||
* BYOT.cs:
|
||||
* COMTIIntrinsicsAttribute.cs:
|
||||
* ComponentAccessControlAttribute.cs:
|
||||
* ConstructionEnabledAttribute.cs:
|
||||
* ContextUtil.cs:
|
||||
* ImpersonationLevelOption.cs:
|
||||
* TransactionVote.cs:
|
||||
New stubs added
|
||||
|
||||
2002-07-22 Tim Coleman <[email protected]>
|
||||
* TransactionOption.cs: New enum added as
|
||||
required by System.Web.Services
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// System.EnterpriseServices.ComponentAccessControlAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Class)]
|
||||
public sealed class ComponentAccessControlAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
bool val;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ComponentAccessControlAttribute ()
|
||||
{
|
||||
this.val = false;
|
||||
}
|
||||
|
||||
public ComponentAccessControlAttribute (bool val)
|
||||
{
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public bool Value {
|
||||
get { return val; }
|
||||
set { val = value; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// System.EnterpriseServices.ConstructionEnabledAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Class)]
|
||||
public sealed class ConstructionEnabledAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
string def;
|
||||
bool val;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ConstructionEnabledAttribute ()
|
||||
{
|
||||
def = String.Empty;
|
||||
this.val = false;
|
||||
}
|
||||
|
||||
public ConstructionEnabledAttribute (bool val)
|
||||
{
|
||||
def = String.Empty;
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public string Default {
|
||||
get { return def; }
|
||||
set { def = value; }
|
||||
}
|
||||
|
||||
public bool Value {
|
||||
get { return val; }
|
||||
set { val = value; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// System.EnterpriseServices.ContextUtil.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
public sealed class ContextUtil {
|
||||
|
||||
#region Fields
|
||||
|
||||
static bool deactivateOnReturn;
|
||||
static TransactionVote myTransactionVote;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal ContextUtil ()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public static Guid ActivityId {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public static Guid ApplicationId {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public static Guid ApplicationInstanceId {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public static Guid ContextId {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public static bool DeactivateOnReturn {
|
||||
get { return deactivateOnReturn; }
|
||||
set { deactivateOnReturn = value; }
|
||||
}
|
||||
|
||||
public static bool IsInTransaction {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public static bool IsSecurityEnabled {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static TransactionVote MyTransactionVote {
|
||||
get { return myTransactionVote; }
|
||||
set { myTransactionVote = value; }
|
||||
}
|
||||
|
||||
public static Guid PartitionId {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public static object Transaction {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public static Guid TransactionId {
|
||||
[MonoTODO]
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
[MonoTODO]
|
||||
public static void DisableCommit ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static void EnableCommit ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static object GetNamedProperty ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static bool IsCallerInRole ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static void SetAbort ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static void SetComplete ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// System.EnterpriseServices.DescriptionAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Interface)]
|
||||
public sealed class DescriptionAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
string desc;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public DescriptionAttribute (string desc)
|
||||
{
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// System.EnterpriseServices.EventClassAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Class)]
|
||||
public sealed class EventClassAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
bool allowInProcSubscribers;
|
||||
bool fireInParallel;
|
||||
string publisherFilter;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public EventClassAttribute ()
|
||||
{
|
||||
allowInProcSubscribers = true;
|
||||
fireInParallel = false;
|
||||
publisherFilter = null;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public bool AllowInProcSubscribers {
|
||||
get { return allowInProcSubscribers; }
|
||||
set { allowInProcSubscribers = value; }
|
||||
}
|
||||
|
||||
public bool FireInParallel {
|
||||
get { return fireInParallel; }
|
||||
set { fireInParallel = value; }
|
||||
}
|
||||
|
||||
public string PublisherFilter {
|
||||
get { return publisherFilter; }
|
||||
set { publisherFilter = value; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// System.EnterpriseServices.EventTrackingEnabledAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Class)]
|
||||
public sealed class EventTrackingEnabledAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
bool val;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public EventTrackingEnabledAttribute ()
|
||||
{
|
||||
val = true;
|
||||
}
|
||||
|
||||
public EventTrackingEnabledAttribute (bool val)
|
||||
{
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public bool Value {
|
||||
get { return val; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// System.EnterpriseServices.ExceptionClassAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Class)]
|
||||
public sealed class ExceptionClassAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
string name;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ExceptionClassAttribute (string name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public string Value {
|
||||
get { return name; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// System.EnterpriseServices.IISIntrinsicsAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
[AttributeUsage (AttributeTargets.Class)]
|
||||
public sealed class IISIntrinsicsAttribute : Attribute {
|
||||
|
||||
#region Fields
|
||||
|
||||
bool val;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public IISIntrinsicsAttribute ()
|
||||
{
|
||||
val = true;
|
||||
}
|
||||
|
||||
public IISIntrinsicsAttribute (bool val)
|
||||
{
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
public bool Value {
|
||||
get { return val; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// System.EnterpriseServices.IRegistrationHelper.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
//[Guid ("")]
|
||||
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
|
||||
public interface IRegistrationHelper {
|
||||
|
||||
#region Methods
|
||||
|
||||
void InstallAssembly (string assembly, out string application, out string tlb, InstallationFlags installFlags);
|
||||
void UninstallAssembly (string assembly, string application);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// System.EnterpriseServices.IRemoteDispatch.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
//[Guid ("")]
|
||||
public interface IRemoteDispatch {
|
||||
|
||||
#region Methods
|
||||
|
||||
[AutoComplete]
|
||||
string RemoteDispatchAutoDone (string s);
|
||||
|
||||
[AutoComplete]
|
||||
string RemoteDispatchNotAutoDone (string s);
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// System.EnterpriseServices.ISecurityCallContext.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
internal interface ISecurityCallContext {
|
||||
|
||||
#region Properties
|
||||
|
||||
int Count {
|
||||
get;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
void GetEnumerator (ref IEnumerator enumerator);
|
||||
object GetItem (string user);
|
||||
bool IsCallerInRole (string role);
|
||||
bool IsSecurityEnabled ();
|
||||
bool IsUserInRole (ref object user, string role);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// System.EnterpriseServices.ISecurityCallersColl.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
internal interface ISecurityCallersColl {
|
||||
|
||||
#region Properties
|
||||
|
||||
int Count {
|
||||
get;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
void GetEnumerator (out IEnumerator enumerator);
|
||||
ISecurityIdentityColl GetItem (int idx);
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// System.EnterpriseServices.ISecurityIdentityColl.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
internal interface ISecurityIdentityColl {
|
||||
|
||||
#region Properties
|
||||
|
||||
int Count {
|
||||
get;
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
void GetEnumerator (out IEnumerator enumerator);
|
||||
SecurityIdentity GetItem (int idx);
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// System.EnterpriseServices.IServicedComponentInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
//[Guid ("")]
|
||||
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
|
||||
public interface IServicedComponentInfo {
|
||||
|
||||
#region Methods
|
||||
|
||||
void GetComponentInfo (ref int infoMask, out string[] infoArray);
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// System.EnterpriseServices.SharedProperty.cs
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.EnterpriseServices {
|
||||
internal interface ISharedProperty {
|
||||
|
||||
#region Properties
|
||||
|
||||
object Value {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Loaded 100 of 904 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user