Compare commits

..
1 Commits
Author SHA1 Message Date
nobody f4d7c3d9ef This commit was manufactured by cvs2svn to create tag 'MCS_0_20'.
svn path=/tags/MCS_0_20/mcs/; revision=11909
2003-02-24 00:08:31 +00:00
394 changed files with 6767 additions and 22950 deletions

No files matched your search

-4
View File
@@ -1,7 +1,3 @@
2003-02-13 Gonzalo Paniagua Javier <[email protected]>
* data/machine.config: added default sessionState section and handler.
2003-02-17 Daniel Morgan <[email protected]>
* doc/provider-factory: add new web page
-341
View File
@@ -1,344 +1,3 @@
Hello everyone!
The Mono Team introduces the best Mono release so far we have
done. Thanks to everyone who contributed fixes, code, ideas, and bug
reports.
Mono 0.20 has been released, it is available at the usual location:
http://www.go-mono.com/download.html
This is a truly heroic release of Mono. Major architectural
chunks that were missing, or were miss-implemented have been fixed in
this release, and we are very proud of it. Please see the list of
features, because there is no short way of introducing just how good
this release is. A big thanks goes to Piers for setting up a
Tinderbox that monitors problems with the Mono CVS repository.
We released packages for SuSE 8.0, Mandrake 8.2, and various
Red Hat releases. It is also available from Red Carpet on the Mono
channel.
Source code for Mono, MCS, the Mono Debugger, XSP is available as
well from that web page. The sources are:
MCS package (Class Libraries, C# and VB.NET compiler and managed tools):
http://www.go-mono.com/archive/mcs-0.20.tar.gz
Mono package (Runtime engine, JIT compiler):
http://www.go-mono.com/archive/mono-0.20.tar.gz
XSP package (XSP test web server for ASP.NET webforms):
http://www.go-mono.com/archive/xsp-0.3.tar.gz
This release is brought to you by: Alvaro del Castillo, Alan Tam,
Alp Toker, Alejandro Sánchez, Alexandre Pigolkin, Atsushi Enomoto,
Brian Ritchie, Christopher Bockner, Daniel Lopez, Daniel Morgan,
Dennis Hayes, Dick Porter, Dietmar Maurer, Duncan Mak, Gaurav Vaish,
Gonzalo Paniagua, Jackson Harper, Jaime Anguiano, Jeff Stedfast,
Johannes Roith, John Sohn, Jonathan Pryor, "Lee Mallabone, "Lluis
Sanchez, "Marco Ridoni, Mark Crichton, Martin Baulig, Martin Willemoes
Hansen, Miguel de Icaza, Mike Kestner, Nick Drochak, Paolo Molaro,
Patrik Torstensson, Pedro Martinez, Per Arneng, Peter Williams, Petr
Danecek, Piers Haken, Radek Doulik, Rafael Teixeira, Rodrigo Moya,
Sebastien Pouliot, Tim Coleman, Ville Palo, and Zoltan Varga.
They commited 1810 changes to CVS patches in the past 33 days.
* New in this release
* Zoltan and IKVM
Zoltan's patches to run Jeroen's IKVM (the Java VM that
translates JVM bytecodes into .NET bytecodes) are in.
* Remoting.
The remoting team's patches that were held off on the previous
release are here. Lluis and Patrik have done a fantastic job
in getting remoting to work. Many low-level runtime engine
changes, and plenty of work on the class-library stuff.
Lluis has posted a couple of sample applications to the
mailing list, you can try those out.
The new release includes a working BinaryFormatter and
BinaryFormatterSink. It means that together with TcpChannel
it is possible to make remote calls with any type of
parameters and return values, including value types,
MarshalByRefObject types (that are properly
marshalled/unmarshalled), delegates, enums, etc.
RemotingConfiguration is partially implemented. It cannot read
from config files, but manual configuration using the api is
fully working.
Implemented full support for client activated types and for
well known objects (both singleton and single call).
Lease manager fully working (it manages the lifetime of server
objects).
Implemented interception of the new operator, so it is
possible to create a remote object using "new", if the type is
properly registered in RemotingConfiguration.
In Lluis' words: `Basically, 0.20 will have almost all needed
for a distributed application with Remoting'
* New threading semantics, IO-layer
Dick Porter in a couple of weeks has heroically redone much of
the threading support to match the .NET behavior (details are
on the .NET threading book as posted on the Mono site).
He also did a lot of bug fixes in the IO/threading space. The
threading implementation now contains a new and faster Monitor
implementation, as well as a correct Pulse()/Wait()
implementation.
GC thread finalization has been re-enabled. This means that
finalizers will be ran on a separate thread, as done in the
Microsoft.NET Framework. This might expose some bugs on
existing finalizer code.
* Moved to NUnit2
Nick and Gonzalo helped us move to the new NUnit2 platform for
all of our tests. A big applause goes to them.
* Cross Appdomain invocations work now.
ASP.NET and NUnit2 both used cross appdomain invocations, we
have fixed a number of problems, and they are now functional.
The AppDomain fixes and the Remoting fixes have allowed us to
remove a number of hacks in the ASP.NET implementation that
were previously there.
Implemented CrossAppDomainChannel, for calls between domains.
* C# Compiler and Debugging.
When generating debugging information in the compiler (with
-debug, -g or -debug+) the compiler will embed the debugging
information into the resulting executable instead of
generating a separate file. Very nice.
Generating debugging information has also improved vastly
performance-wise, and now it is possible to always use
debugging builds for software development.
A number of bugs were fixed on the compiler as well and
by using the Mono profiler we have reduced the memory
consumption and accelerated the compiler.
Thanks to Jackson, Martin, Paolo and for helping here.
* VB.NET Compiler.
Plenty of new features are included in the compiler in our
path to conformance. See <FIXME:get-url-for-posting> for
details on the status of the compiler, and the pieces missing.
* ILasm and Mono.PEToolkit.
Work on the IL assembler has resumed, but it is not yet ready
for production use. The Mono IL Assembler uses the
Mono.PEToolkit library done by Sergey and Jackson to
manipulate CIL image files.
* Cryptographic work.
Sebastien has provided a cert2spc and secutil tools for
certificate management. This is the first release that ships
an assembly for System.Security
Also a new internal assembly used only on Windows allows Mono
users to use the unmanaged crypto providers.
* System.XML
Atsushi has continued to improve the work on our XML
implementation: fixing bugs and more closely matching the
Microsoft implementation.
* More PowerPC/Alpha support.
Taylor Christopher has contributed more code generation macros
for PPC and Laramie Leavitt for Alpha.
* System.XML.Xsl
Gonzalo continued the implementation of our XSLT transformation
API (custom .NET functions are still missing though). It no
longer uses temporary files to apply transformations. Thanks
to an idea from Zdravko Tashev. Xslt Web controls work as
part of this fix.
* ASP.NET
Gonzalo has cleaned up a lot the code base, and now our test
server supports a --root and --virtual command line options
for better control.
Also, now we generate a much nicer error page on errors. We
are looking for volunteers to improve the default look of this
page.
Authentication is now supported
* Mobile Controls.
Gaurav Vaish continues on his quest to complete the
implementation of the Mobile controls. These controls are
required to run a stock IBuySpy application.
* Class Libraries:
New Mono.Posix class library that contains classes for working
on a Posix systems. Things like Unix domain sockets are here.
* System.Windows.Forms
Alexandre Pigolkine continues to contribute more code to our
Windows.Forms implementation. Currently it only runs on
Windows (or in Linux without GC enabled, due to the
pthread/Wine threading library mismatch. This is being
actively addressed as part of the Wine work due to the
movement to the new thread implementation available in RH 8.1).
* Database providers
Christopher Bockner has updated his DB2 database provider (now
with prepared statement functionality) and Tim Coleman has
continued work on the Oracle database provider (welcome back
Tim!)
* Database code.
Dan Morgan continues to develop core components in System.Data
(and now we welcome Alan Tam to the System.Data core hackers)
The SQL# tool now supports MySQLNet, Npgsql, DB2Client, and
Oracle clients.
* Runtime
mono --profile now performs memory allocation profiling too.
* Runtime fixes.
We now support multi-module with external file reference
assemblies.
The above in English means that we can now run Eiffel.NET code
in Mono.
* Monograph:
More statistics supported now.
* System.Web.Mail
Per has contributed the code for this namespace.
* Bugs
Plenty of bugs were closed.
-------------------------------------------------------------------------
Hello everyone!
We have made a new release of Mono available. Despite the fact
that we just did Mono 0.18, this release is packed with new features.
* Availability.
Mono 0.19 is available in package format from:
http://www.go-mono.com/download.html
We released packages for SuSE 8.0, Mandrake 8.2, Debian and various
Red Hat releases. It is also available from Red Carpet on the Mono
channel.
Source code for Mono, MCS, the Mono Debugger, XSP is available as
well from that web page.
* New in this release
* Remoting news:
Lluis has implemented and documented the Binary formatter
Woohoo! He has done a lot of work as well to support
remoting.
Patrik has also been working heavily on fixing a
number of remoting related bugs and missing features.
Ajay also implemented 1-d array serialization in System.Xml
* New database provider: IBM DB2
Christopher Bockner has contributed a DB2 data
provider for System.Data. We have a very complete
range of data providers.
* System.Web.Mobile
Gaurav has started work on this assembly, this will
allow us to run the unmodified reference ASP.NET
applications that were designed to support Mobile
browsing.
* System.Data and System.XML:
More implementation work on XmlDataDocument from Ville
and plenty of fixes from Atsushi.
* MacOS patches:
Paolo integrated John Duncan's and Benjamin Reed
patches to make Mono run on MacOS X out of the box.
* IsolatedStorage
The initial implementation of it was done by Jonathan
Pryor and included in this release.
* Compilers:
More work on the Mono Visual Basic compiler (it is now
included in the packages).
Plenty of bug fixes from Jackson, Miguel to the C#
compiler.
Patches from Francesco and Daniel to the VB.NET
support runtime.
* Debugger support
Plenty of updates to run the new Mono Debugger from Martin.
* Main missing bits:
Some of everyone's favorite patches or code chunks have not yet
been integrated, hopefully Mono 0.20 will have them:
* Zoltan's patch to run IKVM is not yet on this release
* Some parts of Patrik's remoting code did not make it to the
release either.
* Reggie's MySQL native provider is also missing.
Enjoy!
Miguel.
-------------------------------------------------------------------------
Hello everyone!
We have made a new release of Mono available. Despite the fact
+1 -1
View File
@@ -1,7 +1,7 @@
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono, 0.21)
AM_INIT_AUTOMAKE(mono, 0.20)
AM_MAINTAINER_MODE
#
-3
View File
@@ -19,8 +19,6 @@
type="System.Web.Configuration.AuthorizationConfigHandler, System.Web" />
<section name="globalization"
type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web" />
<section name="sessionState"
type="System.Web.SessionState.SessionStateSectionHandler, System.Web" />
</sectionGroup>
</configSections>
<system.web>
@@ -51,7 +49,6 @@
culture="en-US"
uiculture="en-US" />
-->
<sessionState mode="InProc" />
</system.web>
<appSettings>
+45 -69
View File
@@ -27,14 +27,14 @@
* RNGCryptoServiceProvider is currently only working on Linux.
The current implementation reside in Mono's runtime and use
the <code>/dev/[u]random</code> device (which do not exists
under Windows). A Windows specific alternative is available
using the Mono.Security.Win32 assembly.
under Windows). A Windows alternative is in the work (see
Mono.Security.Win32 assembly section).
* Keypair persistance for RSA and DSA. This persistance must
somehow be linked with X509 certificate stores (in planning).
* <code>PasswordDeriveBytes.CryptDeriveKey</code> is included
in MS BCL to provide compatibility with existing Windows
in the BCL to provide compatibility with existing Windows
applications. The main problem is that the key derivation
algorithm can be different for every CSP (Crypto Service
Provider). However for compatibility we should provide an
@@ -54,9 +54,6 @@
classes named <code>*CryptoServiceProvider</code>, with the
exception of <code>RNGCryptoServiceProvider</code> (which
resides in the runtime).
* Look at assembly Mono.Security.Win32 if you require more
compatiblity with the Microsoft implementation (like accessing
a particuliar keypair container in a CSP).
</ul>
@@ -65,17 +62,17 @@
**** Status
<ul>
* X.509 certificates are parsed using 100% managed code
(using the Mono.Security.ASN1 class).
(using an internal ASN.1 class).
* Software Publisher Certificates (SPC) used by Authenticode
(tm) to sign assemblies are supported (extraction from PE
files) but <b>not</b> validated.
* Unit tests are generated from a set of existing certificates
* Tests are generated from a set of existing certificates
(about a dozen) each having different properties. Another
set of certificates (more than 300) are used for a more
complete test (but isn't part of the standard test suite for
size and time consideration).
complete test (but isn't part of the test suite for size
and time consideration).
</ul>
**** TODO
@@ -92,20 +89,18 @@
**** Notes
<ul>
* Except for their structure <b>there are no validation of the
certificates</b> done by this class (this is by design and
isn't a restriction of Mono!). This means that certificate
signatures and validity dates are <b>never</b> checked
(except when used for Authenticode, i.e.
* <b>There's no validation of the certificates</b> done in this
class (this isn't a restriction of Mono!). This means that
certificate signatures and validity dates are <b>never</b>
checked (except when used for Authenticode, i.e.
<code>CreateFromSignedFile</code>).
* The newer X509Certificate class included in Microsoft's Web
Service Enhancement (WSE) is a little better (as it includes
CryptoAPI's validation) when <code>IsCurrent</code> is called.
See assembly <b>Microsoft.Web.Services</b> for more details.
* Microsoft implementation of <code>X509Certificate</code> is
done by using CryptoAPI (unmanaged code). From the exceptions
done by using CryptoAPI (unmanaged). From the exceptions
thrown Authenticode(tm) support is done via COM.
</ul>
@@ -120,10 +115,13 @@
**** Status
<ul>
* All classes are present but some (most Transforms) are only
* All classes are present but some (Transforms) are only
stubbed.
* Most classes have their unit tests.
* This assembly is present in CVS but only available when
building using NAnt (i.e. makefile are missing).
</ul>
**** TODO
@@ -134,30 +132,8 @@
signing (not because the transforms works). In the short
term <code>libxml2</code> could be used to provide C14N, but
in the long term a fully managed class would be much better.
</ul>
<hr>
** Assembly: Mono.Security
This assembly provides the missing pieces to .NET security. On Windows
CryptoAPI is often used to provide much needed functionalities (like
some cryptographic algorithms, code signing, X.509 certificates).
*** Namespace: Mono.Security
*** Namespace: Mono.Security.Authenticode
*** Namespace: Mono.Security.Cryptography
*** Namespace: Mono.Security.X509
*** Namespace: Mono.Security.X509.Extensions
**** Status
<ul>
* Work has been under way for quite some time - and should
start hitting CVS soon.
* A big part of this assembly is also included inside Mono's
corlib. The class are duplicated in this assembly so the
functionalities can be used with a dependency on Mono's
corlib (which depends on Mono's runtime).
* Makefile for building under non-Windows operating systems.
</ul>
<hr>
@@ -176,9 +152,7 @@
**** Status
<ul>
* A RNGCryptoServiceProvider built on top of CryptoAPI. This
allows Windows users to get around the limitation of the
runtime RNG (which requires <code>/dev/[u]random/</code>).
* A RNGCryptoServiceProvider built on top of CryptoAPI.
* Wrapper classes for unmanaged versions of hash algorithms:
MD2, MD4, MD5 and SHA1 are supported. <b>note</b>: some
@@ -205,34 +179,30 @@
Development Kit (WSDK) in it's beta days, is an add-on the .NET
framework that implements WS-Security (and other WS-* specifications).
It also includes improved support for XML Signature (replacing and/or
extending <code>System.Security.Cryptography.Xml</code>) and X.509
certificates classes.
extending <code>System.Security.Cryptography.Xml</code>) and X509
certificates.
Note: WSE is distributed as an add-on because some specifications,
like WS-Security, aren't yet completed by
<a href="http://www.oasis-open.org/committees/wss/">OASIS</a> or
other committees.
Note: WSE is distributed as an add-on because the WS-Security
specification isn't yet completed by
<a href="http://www.oasis-open.org/committees/wss/">OASIS</a>.
<b>[*] There are some licensing issues to consider before stating to
<b>There are some licensing issues to consider before stating to
implement WS-Security. All contributors must sign an agreement with
Microsoft before commiting anything related to WS-Security into CVS.
</b>
*** Namespace: Microsoft.Web.Services.Security
*** Namespace: Microsoft.Web.Services.Timestamp
**** Status
<ul>
* Nothing (yet) commited in CVS <b>[*]</b>.
* Nothing (yet) commited in CVS.
</ul>
*** Namespace: Microsoft.Web.Services.Security.X509
**** Status
<ul>
* Nothing (yet) commited in CVS. However the classes in this
namespace are outside WS-Security scope. So development
could be done without signing any agreements.
* Nothing (yet) commited in CVS.
</ul>
**** TODO
@@ -243,7 +213,21 @@
</ul>
<hr>
** Tools
** Other stuff
There are other, not so visible, uses of cryptography both inside and
outside the class library - such as:
<ul>
* SSL/TLS for secure communication (investigation under way).
* Assembly signing (and verification) using StrongNames.
* Assembly signing (and verification) using Authenticode(tm).
</ul>
*** Tools
There are many tools in the .NET framework that indirectly interacts
with some cryptographic classes. Mono will eventually need these tools.
@@ -283,14 +267,6 @@
Note that many of the tools requires the class library and/or the
runtime to be ready for them.
<hr>
** Other stuff
<ul>
* SSL/TLS for secure communication (a prototype is under way).
</ul>
<hr>
** How to Help
@@ -298,9 +274,9 @@
Add missing unit tests to classes or methods.
Write some documentation on the cryptographic classes for the
<a href="http://go-mono.com/tutorial/html/en/index.html">Mono
Handbook</a> as I'm not a good writer (at least in English).
Write some documentation on the cryptographic classes for MonkeyGuide
(as I'm not a good writer, at least in English, but you must be a good
reader if you got to this part).
Optimization can also be done on algorithms as crypto is never fast
enough. Just be sure to test every optimization (using the unit test)
@@ -311,4 +287,4 @@
informations about the status of the cryptographic classes.
<hr>
Last reviewed: March 4, 2003 (post mono 0.21)
Last reviewed: February 5, 2003 (post mono 0.19)
+33 -147
View File
@@ -17,9 +17,9 @@
<tbody>
<tr bgcolor="#DDDDDD">
<td>
<b>Release 0.21</b><br>
<a href="archive/mono-0.21">Release notes</a><br>
Jan 21th, 2003
<b>Release 0.19</b><br>
<a href="archive/mono-0.19">Release notes</a><br>
Jan 20th, 2003
</td>
<td>
<table cellspacing="1" cellpadding="3">
@@ -29,10 +29,11 @@
</td>
<td>
<ul>
<li><a href="archive/mcs-0.21.tar.gz">Mono Class Libraries and C# Compiler.</a>
<li><a href="archive/mono-0.21.tar.gz">Mono Runtime</a>
<li><a href="archive/mcs-0.19.tar.gz">Mono Class Libraries and C# Compiler.</a>
<li><a href="archive/mono-0.19.tar.gz">Mono Runtime</a>
<li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
<li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
<li><a href="archive/xsp-0.2.tar.gz">XSP web server</a> <b><font color="#dd0000">New!</font></b>
<li><a href="archive/mono-debugger-0.2.0.tar.gz">Mono Debugger 0.2.0</a> <b><font color="#dd0000">New!</font></b>
</ul>
</td>
</tr>
@@ -44,7 +45,7 @@
<td>
<ul>
<li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
<li><a href="archive/mono-0.21-1.src.rpm">mono-0.21-1.src.rpm</a>
<li><a href="archive/mono-0.19-1.src.rpm">mono-0.19-1.src.rpm</a>
</ul>
</td>
</tr>
@@ -57,8 +58,8 @@
<ul>
<li><a href="archive/redhat-73-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-73-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-73-i386/mono-0.21-1.i386.rpm">mono-0.21-1.i386.rpm</a>
<li><a href="archive/redhat-73-i386/mono-devel-0.21-1.i386.rpm">mono-devel-0.21-1.i386.rpm</a>
<li><a href="archive/redhat-73-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
<li><a href="archive/redhat-73-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
</ul>
</td>
<td bgcolor="#999999">
@@ -66,8 +67,8 @@
<ul>
<li><a href="archive/redhat-72-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-72-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-72-i386/mono-0.21-1.i386.rpm">mono-0.21-1.i386.rpm</a>
<li><a href="archive/redhat-72-i386/mono-devel-0.21-1.i386.rpm">mono-devel-0.21-1.i386.rpm</a>
<li><a href="archive/redhat-72-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
<li><a href="archive/redhat-72-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
</ul>
</td>
</tr>
@@ -77,8 +78,8 @@
<ul>
<li><a href="archive/redhat-71-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-71-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-71-i386/mono-0.21-1.i386.rpm">mono-0.21-1.i386.rpm</a>
<li><a href="archive/redhat-71-i386/mono-devel-0.21-1.i386.rpm">mono-devel-0.21-1.i386.rpm</a>
<li><a href="archive/redhat-71-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
<li><a href="archive/redhat-71-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
</ul>
</td>
<td bgcolor="#999999">
@@ -86,8 +87,8 @@
<ul>
<li><a href="archive/mandrake-82-i386/libgc-6.1-1.i586.rpm">libgc-6.1-1.i586.rpm</a>
<li><a href="archive/mandrake-82-i386/libgc-devel-6.1-1.i586.rpm">libgc-devel-6.1-1.i586.rpm</a>
<li><a href="archive/mandrake-82-i386/mono-0.21-1.i586.rpm">mono-0.21-1.i586.rpm</a>
<li><a href="archive/mandrake-82-i386/mono-devel-0.21-1.i586.rpm">mono-devel-0.21-1.i586.rpm</a>
<li><a href="archive/mandrake-82-i386/mono-0.19-1.i586.rpm">mono-0.19-1.i586.rpm</a>
<li><a href="archive/mandrake-82-i386/mono-devel-0.19-1.i586.rpm">mono-devel-0.19-1.i586.rpm</a>
</ul>
</td>
</tr>
@@ -97,27 +98,34 @@
<ul>
<li><a href="archive/suse-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
<li><a href="archive/suse-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
<li><a href="archive/suse-80-i386/mono-0.21-1.i386.rpm">mono-0.21-1.i386.rpm</a>
<li><a href="archive/suse-80-i386/mono-devel-0.21-1.i386.rpm">mono-devel-0.21-1.i386.rpm</a>
<li><a href="archive/suse-80-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
<li><a href="archive/suse-80-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
</ul>
</td>
<td bgcolor="#999999">
<b>Red Hat 8.0/x86</b>
<ul>
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
</ul>
</td>
</tr>
<tr>
<td bgcolor="#999999">
<!-- <b>Windows Setup Wizard (NT/2000/XP)</b>␍ -->
<!-- <ul>␍ -->
<!-- <li><a href="archive/mono-0.19-stable.exe">Mono-Setup</a>␍ -->
<!-- </ul>␍ -->
<!-- </td>␍ -->
<td bgcolor="#999999">
<b>Debian packages</b>
<ul>
<li><a href="http://www.atoker.com/mono/">Alp's web site</a>
</ul>
</td>
</tr>
<tr>
<td bgcolor="#999999">
<b>Windows Setup Wizard (NT/2000/XP)</b>
<ul>
<li><a href="archive/mono-0.21-win32-1.exe">Mono-Setup</a>
</ul>
</td>
</tr>
</table>
</td>
</tr>
@@ -141,128 +149,6 @@
We provide binaries for older releases until we have packages for the new release.
<table>
<tbody>
<tr bgcolor="#DDDDDD">
<td>
<b>Release 0.20</b><br>
<a href="archive/mono-0.20">Release notes</a><br>
Jan 20th, 2003
</td>
<td>
<table cellspacing="1" cellpadding="3">
<tr bgcolor="#BBBBBB">
<td>
<b>Source Code</b>
</td>
<td>
<ul>
<li><a href="archive/mcs-0.20.tar.gz">Mono Class Libraries and C# Compiler.</a>
<li><a href="archive/mono-0.20.tar.gz">Mono Runtime</a>
<li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
<li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
</ul>
</td>
</tr>
<tr bgcolor="#BBBBBB">
<td>
<b>Source RPMs</b><br>
(No RPMS for XSP).
</td>
<td>
<ul>
<li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
<li><a href="archive/mono-0.20-1.src.rpm">mono-0.20-1.src.rpm</a>
</ul>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td bgcolor="#999999">
<b>Red Hat 8.0/x86</b>
<ul>
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/mono-0.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-1.i386.rpm</a>
</ul>
</td>
<td bgcolor="#999999">
<b>Debian packages</b>
<ul>
<li><a href="http://www.atoker.com/mono/">Alp's web site</a>
</ul>
</td>
</tr>
<tr>
<td bgcolor="#999999">
<b>Windows Setup Wizard (NT/2000/XP)</b>
<ul>
<li><a href="archive/mono-0.20-stable-win32-2.exe">Mono-Setup</a>
</ul>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<tr bgcolor="#CCCCC">
<td>
<b>Regression Tests</b><br>
</td>
<td>
You can get binaries for the Mono Regression Test
Suite <a href="archive/mono-tests.tar.gz">here</a>
</td>
</tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr bgcolor="#DDDDDD">
<td>
<b>Release 0.19</b><br>
<a href="archive/mono-0.19">Release notes</a><br>
Jan 20th, 2003
</td>
<td>
<table cellspacing="1" cellpadding="3">
<tr bgcolor="#BBBBBB">
<td>
<b>Source Code</b>
</td>
<td>
<ul>
<li><a href="archive/mcs-0.19.tar.gz">Mono Class Libraries and C# Compiler.</a>
<li><a href="archive/mono-0.19.tar.gz">Mono Runtime</a>
</ul>
</td>
</tr>
<tr bgcolor="#BBBBBB">
<td>
<b>Source RPMs</b><br>
(No RPMS for XSP).
</td>
<td>
<ul>
<li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
<li><a href="archive/mono-0.19-1.src.rpm">mono-0.19-1.src.rpm</a>
</ul>
</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr bgcolor="#DDDDDD">
+11 -29
View File
@@ -721,44 +721,26 @@ A: Replace the __stdcall attribute with the STDCALL macro, and include this
<a name="asp">
** Mono and ASP.NET
Q: Does Mono support ASP.NET?
Q: Is Mono supporting ASP.NET?
A: Yes.
Mono supports ASP.NET, we have shown an unmodified IBuySpy
installation running on Mono as well as various other programs. You can
try it yourself downloading the XSP server.
A: Yes. The development of the support for ASP.NET comes in various stages,
here is what Gonzalo has been working on: 1. The Parser. 2. Getting the
parser to generate output compatible with ASP.NET. 3. Running the sample
output with the real Microsoft runtime but using our generated page. 4.
Running the sample with our classes with the .NET runtime. 5. Running
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: How can I run ASP.NET-based applications with Mono?
A: You need the Mono runtime and a hosting web server. Currently we distribute a
small web server called `xsp' which is used to debug applications, or you can choose
to use Daniel's Apache 2 module.
Q: Any plan to make ASP.NET in mono works with Apache in Linux?.
A: Daniel has authored an Apache2 Module for Mono that hosts the ASP.NET runtime
and is available here: <a
href="http://apacheworld.org/modmono/">http://apacheworld.org/modmono/</a>
Q: Will you support Apache 1?
A: Modules developed for Apache 2 are not compatible with Apache 1.3
Daniel plans to support Apache 1.3 in the future but the current focus is on
Apache 2, because of the better support for threading and Windows.
Q: Can I run Apache 1 and Apache 2 on the same machine?
You can always keep a copy of Apache 2 running in paralell with your Apache
1.3 (either different port or using a reverse proxy).
You can also bind the two servers to different IP addresses on the
same physical machine.
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
-8
View File
@@ -13,14 +13,6 @@ Some of them may start contributing because they want a mention in the
* Mono Hackers
** Zoltan Varga
Zoltan has contributed significantly to Mono, with bug reports and bug
fixes as well as pushing the envelope of the things that can be done in
and with the mono runtime: the gcc-based ngen compiler, code coverage
and more recently his work with Reflection.Emit that got mono to the
point of running the IKVM Java virtual machine.
** Sergey Chaban
Sergey has been a long time contributor to the project, from the early
+8 -54
View File
@@ -102,62 +102,16 @@
</tr>
</table>
@item Mar 3rd, 2003: The Mono Hackers Hall Of Fame welcomes Zoltan Varga
<b>Upcoming presentations</b>
The <a href="hackers.html">Mono Hackers Hall Of Fame</a>
continues to show our appreciation to the excellent
contributors that make <b>mono::</b> a successful free
software project.
Paolo Molaro, core Mono architect and developer will be
talking about Mono on Florence on Saturday 22nd, February at
the the Italian <a
href="http://http://www.it.gnome.org/GUADIC">Guadic</a> Conference.
Zoltan has contributed significantly to Mono, with bug reports and bug
fixes as well as pushing the envelope of the things that can be done in
and with the mono runtime: the gcc-based ngen compiler, code coverage
and more recently his work with Reflection.Emit that got mono to the
point of running the <a href="http://www.ikvm.net">IKVM</a> Java virtual
machine.
@item Mar 2nd, 2003: New Mono mailing list.
A new mailing list for <a
href="http://lists.ximian.com/mailman/listinfo/mono-devel-list">Mono
Development</a> has been created.
@item Feb 27th, 2003: Mono 0.21 released
Mono 0.21 has been released. This is only a bug fix release.
The <a href="archive/mono-0.21">release notes</a> are available.
@item Feb 25th, 2003: Mono 0.20 for Windows released; New Apache module released.
Packages of Mono for Windows have been <a
href="archive/mono-0.20-stable-win32-2.exe">released</a>.
Thanks to Daniel, Johannes and Paolo for setting this up.
Daniel has released a new version of his Mono Apache module that
handles ASP.NET. The code is available at <a
href="http://apacheworld.org/modmono/">here</a>
Nick has posted an update on the progress on our <a
href="http://lists.ximian.com/archives/public/mono-list/2003-February/012467.html">regression
tests</a>. We are looking for more tests, and more volunteers to write them.
Also, remember to contribute to the Gtk# documentation effort,
momentum is picking up! See the entry for Feb 18th for more details.
@item Feb, 23rd, 2003: Mono 0.20 released; Gtk# 0.8 released.
Mono 0.20 has been released. Check out the <a
href="archive/mono-0.20">release notes</a> for an overview of
the changes. You can get it <a href="download.html">here</a>.
There are no major features in this release, mostly bug fixes
and performance improvements.
Gtk# 0.8 has been <a
href="http://lists.ximian.com/archives/public/gtk-sharp-list/2003-February/001114.html">released</a>
<b>Important</b>: The contributed binaries for Windows
binaries of Mono 0.20 contain a virus. Please read <a
href="virus.html">this</a> if you installed the binary.
Gonzalo Paniagua, core Mono developer (responsible for ASP.NET
in Mono) is doing a talk on Thursday in Badajoz, Spain.
Details are <a href="http://www.gulex.org/actividades.htm">here</a>
@item Feb 18th, 2003: Volunteers to document Gtk#
+6 -52
View File
@@ -6,16 +6,7 @@
There are a number of mailing lists for Mono in English:
<table border=1>
<tr>
<td>
<b><a
href="http://lists.ximian.com/mailman/listinfo/mono-announce-list">mono-announce-list</a></b>
</td>
<td>
Announcements of Mono developments.
</td>
</tr>
<table>
<tr>
<td>
<b><a
@@ -28,39 +19,11 @@
<tr>
<td>
<b><a
href="http://lists.ximian.com/mailman/listinfo/mono-devel-list">mono-devel-list</a></b>
</td>
<td>
A mailing list specifically dedicated to discussions
about developing Mono and programming *with* Mono.
Programmers that work on Mono are _strongly_ encouraged
to join this list. Third-party programmers interested
in running or compiling their managed applications with
Mono or that are interested in using mono-specific
technologies should join the list as well.
<p>
Examples of on-topic arguments are:
<ul>
<li>proposals and patches for new features for the mono runtime and programs
<li>discussions about bugs in the mono runtime and programs
<li>discussions about future directions
<li>embedding API, scripting language bridges
<li>mono/mcs build issues
<li>programming with mono-specific assemblies
<li>discussions about third-party compilers that target and/or use directly the CLR
<li>discussions about getting a managed application run with mono
</ul>
<p>Topics that are better discussed on other mailing lists:
<ul>
<li> general C# questions (use the specific lists at develop.com)
<li> issues that are already covered by a more specific mono
mailing list (like System.Windows.Forms or Gtk#)
<li> success reports about new apps running on mono, including
runtime/buildtime support for new programming languages (use
mono-list to reach a wider audience)
</ul>
href="http://lists.ximian.com/mailman/listinfo/mono-announce-list">mono-announce-list</a></b>
</td>
<td>
Announcements of Mono developments.
</td>
</tr>
<tr>
<td>
@@ -77,7 +40,7 @@
href="http://lists.ximian.com/mailman/listinfo/mono-patches">mono-patches</a></b>
</td>
<td>
Track the CVS activity of Mono on this mailing list (patches are sent to recipients). <p>
Track the CVS activity of Mono on this mailing list (patches are sent to recipients).
You can get <a href="http://www.go-mono.com/snapshots">daily snapshots</a> as well.
</td>
</tr>
@@ -117,15 +80,6 @@
Used to discuss the Windows.Forms implementatation for Mono using Wine.
</td>
</tr>
<tr>
<td>
<b><a
href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">gtk-sharp-list</a></b>
</td>
<td>
Used to discuss the Gtk bindings for Mono (<a href="http://gtk-sharp.sf.net">Gtk#</a>).
</td>
</tr>
</table>
Other mailing lists of interest:
+2 -2
View File
@@ -190,8 +190,8 @@
dbcmd.CommandText = sql;
IDataReader reader = dbcmd.ExecuteReader();
while(reader.Read()) {
string FirstName = (string) reader["firstname"];
string LastName = (string) reader["lastname"];
string FirstName = reader["firstname"];
string LastName = reader["lastname"];
Console.WriteLine("Name: " +
FirstName + " " + LastName);
}
+1 -1
View File
@@ -212,7 +212,7 @@ function clickHandler (evt)
if (evt.ctrlKey)
{
var strRoot = 'http://cvs.hispalinux.es/cgi-bin/cvsweb/mcs/class/';
var strExtra = '?cvsroot=mono';
var strExtra = '?cvsroot=Mono';
if (strAssembly)
{
+1 -4
View File
@@ -1,5 +1,4 @@
ROOT=C:/WINNT
CSCRIPT = $(ROOT)/system32/cscript.exe
CSCRIPT = $(SYSTEMROOT)/system32/cscript.exe
CSC=csc
CORCOMPARE=../../../mcs/tools/corcompare
@@ -149,8 +148,6 @@ src/%.xml: ../../../mcs/class/lib/%.dll $(CORCOMPARE)/CorCompare.exe
src/corlib.xml: ../../../mcs/class/lib/corlib_cmp.dll $(CORCOMPARE)/CorCompare.exe
$(CORCOMPARE)/CorCompare.exe -f corlib -ms mscorlib -x $@ $<
src/System.Security.xml: ../../../mcs/class/lib/System.Security_cmp.dll $(CORCOMPARE)/CorCompare.exe
$(CORCOMPARE)/CorCompare.exe -f System.Security -ms System.Security -x $@ $<
../class-status: ../class-status.in
cp -f $< $@
-9
View File
@@ -136,15 +136,6 @@ Provides a search path to mono and mint where to look for library files.
Directories are separated by the platform path separator (colons on unix). Example:
.B /home/username/lib:/usr/local/mono/lib
.PP
.TP
.I "MONO_DISABLE_SHM"
If this variable is set, it disables the Windows I/O Emulation layer,
and handles (files, events, mutexes, pipes) will not be shared across
processes. This option is only available on Unix.
.TP
.I "MONO_CFG_DIR"
If set, this variable overrides the default system configuration directory
($PREFIX/etc). It's used to locate machine.config file.
.SH FILES
On Unix assemblies are loaded from the installation lib directory. If you set
`prefix' to /usr, the assemblies will be located in /usr/lib. On
-1
View File
@@ -16,4 +16,3 @@ Class Libraries:
John Barnette ([email protected])
Daniel Morgan <[email protected]>
Sebastien Pouliot <[email protected]>
Per Arneng <[email protected]>
-4
View File
@@ -1,7 +1,3 @@
2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* makefile: added Mono.Posix and System.Management.
2003-02-16 Martin Baulig <[email protected]>
* docs/compiler: Added a few works about the new `Location' code.
-9
View File
@@ -1,12 +1,3 @@
2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* class/library.build:
* class/makefile.gnu: added Mono.Posix and System.Management.
2003-03-02 Jackson Harper <[email protected]>
* mcs/class: Add PEAPI directory
2003-02-22 Martin Baulig <[email protected]>
* library.make: Pass `MCS_FLAGS' to MCS.
File diff suppressed because it is too large. Load diff
@@ -299,6 +299,7 @@ namespace DB2ClientCS
}
#endregion
#region Prepare ()
///
/// Prepare a statement against the database
@@ -18,7 +18,7 @@ namespace DB2ClientCS
/// Summary description for DB2ClientDataReader.
/// DB2ClientDataReader.
/// </summary>
public class DB2ClientDataReader : IDataReader
unsafe public class DB2ClientDataReader : IDataReader
{
internal DataTable rs; //Our result set is a datatable
internal DB2ClientConnection db2Conn; //The connection we're working with
@@ -45,7 +45,7 @@ namespace DB2ClientCS
sqlRet = DB2ClientPrototypes.SQLNumResultCols(hwndStmt, ref numCols);
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols");
byte[][] dbVals = new byte[(int)numCols][];
IntPtr[] dbVals = new IntPtr[numCols];
IntPtr[] sqlLen_or_IndPtr = new IntPtr[numCols];
PrepareResults(dbVals, sqlLen_or_IndPtr);
@@ -69,10 +69,9 @@ namespace DB2ClientCS
sqlRet = DB2ClientPrototypes.SQLNumResultCols(hwndStmt, ref numCols);
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols");
byte[][] dbVals = new byte[(int)numCols][];
IntPtr[] dbVals = new IntPtr[numCols];
IntPtr[] sqlLen_or_IndPtr = new IntPtr[numCols];
PrepareResults(dbVals, sqlLen_or_IndPtr);
FetchResults(dbVals, sqlLen_or_IndPtr, rs);
isClosed = false;
@@ -185,7 +184,7 @@ namespace DB2ClientCS
/// <summary>
/// Does the describe and bind steps for the query result set. Called for both immediate and prepared queries.
/// </summary>
private void PrepareResults(byte[][] dbVals, IntPtr[] sqlLen_or_IndPtr)
private void PrepareResults(IntPtr[] dbVals, IntPtr[] sqlLen_or_IndPtr)
{
short sqlRet;
StringBuilder colName = new StringBuilder(18);
@@ -206,8 +205,7 @@ namespace DB2ClientCS
rs.Columns.Add(colName.ToString());
sqlLen_or_IndPtr[i-1] = new IntPtr();
dbVals[i-1] = new byte[(int)colSize];
dbVals[i-1] = Marshal.AllocHGlobal((int)colSize+1);
try
{
@@ -218,10 +216,10 @@ namespace DB2ClientCS
case DB2ClientConstants.SQL_TYPE_TIME:
case DB2ClientConstants.SQL_TYPE_TIMESTAMP:
case DB2ClientConstants.SQL_VARCHAR:
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, DB2ClientConstants.SQL_C_CHAR, dbVals[i-1],(short)colSize+1, (int)sqlLen_or_IndPtr[i-1]);
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, DB2ClientConstants.SQL_C_CHAR, dbVals[i-1],(short)colSize+1, ref sqlLen_or_IndPtr[i-1]);
break;
default:
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, (short)sqlDataType, dbVals[i-1],(short)colSize+1, (int)sqlLen_or_IndPtr[i-1]);
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, (short)sqlDataType, dbVals[i-1],(short)colSize+1, ref sqlLen_or_IndPtr[i-1]);
break;
}
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLBindCol");
@@ -230,8 +228,8 @@ namespace DB2ClientCS
{
System.Console.Write(e.Message);
}
isClosed = false;
}
isClosed = false;
}
/// <summary>
/// FetchResults does what it says.
@@ -239,7 +237,7 @@ namespace DB2ClientCS
/// <param name="dbVals"></param>
/// <param name="sqlLen_or_IndPtr"></param>
/// <param name="rs"></param>
private void FetchResults(byte[][] dbVals, IntPtr[] sqlLen_or_IndPtr, DataTable rs)
private void FetchResults(IntPtr[] dbVals, IntPtr[] sqlLen_or_IndPtr, DataTable rs)
{
short sqlRet = 0;
DB2ClientUtils util = new DB2ClientUtils();
@@ -251,12 +249,14 @@ namespace DB2ClientCS
{
DataRow newRow = rs.NewRow();
for (short y=1;y<=numCols;y++)
newRow[y-1] = System.Text.Encoding.Default.GetString(dbVals[y-1]);
newRow[y-1] = Marshal.PtrToStringAnsi(dbVals[y-1]);
rs.Rows.Add(newRow);
sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 2");
}
for (int n=0;n<numCols;n++)
Marshal.FreeHGlobal(dbVals[n]);
}
#endregion
@@ -369,10 +369,6 @@ namespace DB2ClientCS
///
/// GetDateTime method
///
public string NewGetDateTime(int col)
{
return Convert.ToString(this[col]);
}
public DateTime GetDateTime(int col)
{
return Convert.ToDateTime(this[col]);
@@ -23,7 +23,7 @@ namespace DB2ClientCS
{
this.message = Message;
}
public DB2ClientException(short sqlHandleType, IntPtr sqlHandle, string Message)
unsafe public DB2ClientException(short sqlHandleType, IntPtr sqlHandle, string Message)
{
StringBuilder sqlState = new StringBuilder(50);
StringBuilder errorMessage = new StringBuilder(1025);
@@ -20,47 +20,47 @@ namespace DB2ClientCS
internal class DB2ClientPrototypes
{
[DllImport("db2cli.dll", EntryPoint = "SQLAllocHandle")]
internal static extern short SQLAllocHandle(short handleType, IntPtr inputHandle, ref IntPtr outputHandle);
unsafe public static extern short SQLAllocHandle(short handleType, IntPtr inputHandle, ref IntPtr outputHandle);
[DllImport("db2cli.Dll", EntryPoint = "SQLConnect")]
internal static extern short SQLConnect(IntPtr sqlHdbc, string serverName, short serverNameLength, string userName, short userNameLength, string authentication, short authenticationLength);
unsafe public static extern short SQLConnect(IntPtr sqlHdbc, string serverName, short serverNameLength, string userName, short userNameLength, string authentication, short authenticationLength);
[DllImport("db2cli.Dll", CharSet = CharSet.Auto, EntryPoint = "SQLDisconnect")]
internal static extern short SQLDisconnect(IntPtr sqlHdbc);
unsafe public static extern short SQLDisconnect(IntPtr sqlHdbc);
[DllImport("db2cli.dll", EntryPoint = "SQLGetDiagRec")]
internal static extern short SQLGetDiagRec( short handleType, IntPtr handle, short recNum, [Out] StringBuilder sqlState, ref IntPtr nativeErrorPtr, [Out] StringBuilder errorMessage, short bufferLength, ref IntPtr shortTextLengthPtr);
unsafe public static extern short SQLGetDiagRec( short handleType, IntPtr handle, short recNum, [Out] StringBuilder sqlState, ref IntPtr nativeErrorPtr, [Out] StringBuilder errorMessage, short bufferLength, ref IntPtr shortTextLengthPtr);
[DllImport("db2cli.Dll", EntryPoint = "SQLSetConnectAttr")]
internal static extern short SQLSetConnectAttr(IntPtr sqlHdbc, long sqlAttr, [In] IntPtr sqlValuePtr, long sqlValueLength);
unsafe public static extern short SQLSetConnectAttr(IntPtr sqlHdbc, long sqlAttr, [In] IntPtr sqlValuePtr, long sqlValueLength);
[DllImport("db2cli.Dll", EntryPoint = "SQLEndTran")]
internal static extern short SQLEndTran (short handleType, IntPtr handle, short fType);
unsafe public static extern short SQLEndTran (short handleType, IntPtr handle, short fType);
[DllImport("db2cli.Dll", EntryPoint = "SQLCancel")]
internal static extern short SQLCancel(IntPtr handle);
unsafe public static extern short SQLCancel(IntPtr handle);
[DllImport("db2cli.dll", EntryPoint = "SQLNumResultCols")]
internal static extern short SQLNumResultCols(IntPtr handle, ref int numCols);
unsafe public static extern short SQLNumResultCols(IntPtr handle, ref int numCols);
[DllImport("db2cli.Dll", EntryPoint = "SQLFetch")]
internal static extern short SQLFetch(IntPtr handle);
unsafe public static extern short SQLFetch(IntPtr handle);
[DllImport("db2cli.dll", EntryPoint = "SQLRowCount")]
internal static extern short SQLRowCount(IntPtr stmtHandle, ref int numRows);
unsafe public static extern short SQLRowCount(IntPtr stmtHandle, ref int numRows);
[DllImport("db2cli.dll", EntryPoint = "SQLExecute")]
internal static extern short SQLExecute(IntPtr handle);
unsafe public static extern short SQLExecute(IntPtr handle);
[DllImport ("db2cli.dll", EntryPoint = "SQLExecDirect")]
internal static extern short SQLExecDirect(IntPtr stmtHandle, string stmt, int length);
unsafe public static extern short SQLExecDirect(IntPtr stmtHandle, string stmt, int length);
[DllImport("db2cli.Dll", EntryPoint = "SQLDescribeCol")]
internal static extern short SQLDescribeCol(IntPtr stmtHandle, ushort colNum, [Out] StringBuilder colName, short colNameMaxLength, IntPtr colNameLength, ref IntPtr dataType, ref IntPtr colSizePtr, ref IntPtr scalePtr, ref IntPtr nullablePtr );
unsafe public static extern short SQLDescribeCol(IntPtr stmtHandle, ushort colNum, [Out] StringBuilder colName, short colNameMaxLength, IntPtr colNameLength, ref IntPtr dataType, ref IntPtr colSizePtr, ref IntPtr scalePtr, ref IntPtr nullablePtr );
[DllImport("db2cli.dll", EntryPoint = "SQLBindCol")]
internal static extern short SQLBindCol(IntPtr stmtHandle, ushort colNum, int dataType, [Out] byte[] dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
unsafe public static extern short SQLBindCol(IntPtr stmtHandle, ushort colNum, int dataType,[In][Out] IntPtr dataBufferPtr, int dataBufferLength, ref IntPtr StrLen_or_IndPtr);
[DllImport("db2cli.dll", EntryPoint = "SQLDriverConnect")]
internal static extern short SQLDriverConnect(IntPtr hdbc, int centered, [In] string inConnectStr, [In] int inStrLength, [Out] StringBuilder outConnectStr, [Out] int outStrCapacity, [Out] IntPtr outStrLengthReturned, [In] int completion);
unsafe public static extern short SQLDriverConnect(IntPtr hdbc, int centered, [In] string inConnectStr, [In] int inStrLength, [Out] StringBuilder outConnectStr, [Out] int outStrCapacity, [Out] IntPtr outStrLengthReturned, [In] int completion);
[DllImport("db2cli.dll", EntryPoint = "SQLPrepare")]
internal static extern short SQLPrepare(IntPtr stmtHandle, string stmt, int length);
unsafe public static extern short SQLPrepare(IntPtr stmtHandle, string stmt, int length);
[DllImport("db2cli.dll", EntryPoint = "SQLDescribeParam")]
internal static extern short SQLDescribeParam(IntPtr stmtHandle, short paramNumber,ref IntPtr dataType, ref IntPtr paramSize, ref IntPtr decimalDigits, ref IntPtr nullable);
unsafe public static extern short SQLDescribeParam(IntPtr stmtHandle, short paramNumber,ref IntPtr dataType, ref IntPtr paramSize, ref IntPtr decimalDigits, ref IntPtr nullable);
[DllImport("db2cli.dll", EntryPoint = "SQLNumParams")]
internal static extern short SQLNumParams(IntPtr stmtHandle, ref IntPtr numParams);
unsafe public static extern short SQLNumParams(IntPtr stmtHandle, ref IntPtr numParams);
[DllImport("db2cli.dll")]
internal static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
short dataType, short valueType, short paramType, uint colSize, short decDigits,
byte[] dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
[DllImport("db2cli.dll", EntryPoint = "SQLBindParameter")]
internal static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
unsafe public static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
short dataType, short valueType, short paramType, uint colSize, short decDigits,
ref int dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
@@ -18,7 +18,7 @@ namespace DB2ClientCS
/// at the statement level, but I haven't worked that in here yet.
/// NOTE: AT THE MOMENT, SETTING OF THE ISOLATION LEVEL IS NOT WORKING
/// </summary>
public class DB2ClientTransaction : IDbTransaction
unsafe public class DB2ClientTransaction : IDbTransaction
{
DB2ClientUtils util = new DB2ClientUtils();
IsolationLevel IL = IsolationLevel.Unspecified;
-5
View File
@@ -1,12 +1,7 @@
2003-03-01 Jackson Harper <[email protected]>
* Image.cs: Write Metadata root
2003-02-23 Peter Williams <[email protected]>
* makefile.gnu (all): Give this dependencies
so that we don't rebuild every time.
(all): Take two.
2003-02-22 Jackson Harper <[email protected]>
+6 -5
View File
@@ -149,17 +149,18 @@ namespace Mono.PEToolkit {
coffHdr.Write (writer);
peHdr.Write (writer);
WriteSections (writer);
if (this.IsCLI) {
writer.BaseStream.Position = RVAToVA (peHdr.CLIHdrDir.virtAddr);
corHdr.Write (writer);
long pos = RVAToVA (corHdr.MetaData.virtAddr);
writer.BaseStream.Position = pos;
mdRoot.Write (writer);
/*
mdRoot = new MetaDataRoot(this);
reader.BaseStream.Position = RVAToVA(corHdr.MetaData.virtAddr);
mdRoot.Read(reader);
*/
}
}
+2 -4
View File
@@ -56,12 +56,10 @@ SOURCES_EXCLUDE=
#include $(topdir)/class/library.make
default: all mddump.exe
mddump.exe: $(SOURCES_INCLUDE)
mddump.exe: all
mcs /out:mddump.exe /unsafe $(SOURCES_INCLUDE)
full-clean: clean
clean:
rm -f mddump.exe
include $(topdir)/class/library.make
@@ -1,11 +1,3 @@
2003-03-01 Jackson Harper <[email protected]>
* MDStream.cs: Add methods to write metadata streams
2003-03-01 Jackson Harper <[email protected]>
* MetaDataRoot.cs: Add method to write Metadata
2003-02-20 Jackson Harper <[email protected]>
* MDStream.cs: Make Header a class and use a Read method to load it. Because it is no longer
+1 -33
View File
@@ -50,33 +50,10 @@ namespace Mono.PEToolkit.Metadata {
pos &= ~3;
if (stream != null)
pos += stream.Root.filePos;
// Advance file pointer.
reader.BaseStream.Position = pos;
}
public void Write (BinaryWriter writer, MDStream stream)
{
writer.Write (offs);
writer.Write (size);
for (int i=0; i<name.Length; i++)
writer.Write ((sbyte)name[i]);
writer.Write ((sbyte) '\0');
// Round up to dword boundary.
long pos = writer.BaseStream.Position;
if (stream != null)
pos -= stream.Root.filePos;
pos += 3;
pos &= ~3;
if (stream != null)
pos += stream.Root.filePos;
// Advance file pointer.
writer.BaseStream.Position = pos;
}
} // header
@@ -175,15 +152,6 @@ namespace Mono.PEToolkit.Metadata {
}
public void Write (BinaryWriter writer)
{
hdr.Write (writer, this);
long old_pos = writer.BaseStream.Position;
writer.BaseStream.Position = root.filePos + hdr.offs;
writer.Write (data);
writer.BaseStream.Position = old_pos;
}
/// <summary>
/// Initializes heap for this stream.
/// </summary>
@@ -101,7 +101,7 @@ namespace Mono.PEToolkit.Metadata {
unsafe public void Read(BinaryReader reader)
{
filePos = reader.BaseStream.Position;
sig = reader.ReadUInt32();
if (sig != Sig) {
throw new BadImageException("Invalid MetaData Signature.");
@@ -110,10 +110,10 @@ namespace Mono.PEToolkit.Metadata {
majVer = reader.ReadInt16();
minVer = reader.ReadInt16();
reserved = reader.ReadUInt32();
// Length of version string.
len = reader.ReadInt32();
// Read version string.
if (len != 0) {
sbyte* pVer = stackalloc sbyte [len];
@@ -141,9 +141,10 @@ namespace Mono.PEToolkit.Metadata {
} else {
VersionString = String.Empty;
}
flags = reader.ReadInt16();
nStreams = reader.ReadInt16();
streams = new Hashtable(nStreams);
// load all streams into memory
@@ -167,44 +168,6 @@ namespace Mono.PEToolkit.Metadata {
blobIdx = tabsHeap.BlobIndexSize;
}
public void Write (BinaryWriter writer)
{
filePos = writer.BaseStream.Position;
writer.Write (Sig);
writer.Write (majVer);
writer.Write (minVer);
writer.Write (reserved);
// Length of version string
writer.Write (verStr.Length);
if (verStr.Length > 0) {
long pos = writer.BaseStream.Position;
for (int i=0; i<verStr.Length; i++)
writer.Write ((sbyte) verStr[i]);
// Round up to dword boundary, relative to header start.
pos += verStr.Length;
pos -= filePos;
pos += 3;
pos &= ~3;
pos += filePos;
// Advance file pointer
writer.BaseStream.Position = pos;
}
writer.Write (flags);
writer.Write (nStreams);
// load all streams into memory
foreach (MDStream stream in streams.Values)
stream.Write (writer);
}
public TablesHeap TablesHeap {
get {
MDStream tabs = Streams["#~"] as MDStream;
-4
View File
@@ -1,4 +0,0 @@
2003-03-02 Jackson Harper <[email protected]>
* PEAPI.cs: Add file
* README.txt: Add file
File diff suppressed because it is too large. Load diff
-31
View File
@@ -1,31 +0,0 @@
PEAPI
-----
This is a preliminary version of our PE writer component. It is a managed
component which presents on the client side an API and constructs program
executable files.
We have tested this component as an alternative backend for Gardens Point
Component Pascal .NET. Our previous versions of gpcp produced textual CIL and
invoked ilasm. The new backend can create a program executable file in almost
exactly the same length of time as it takes to write the equivalent CIL text
file.
PEAPI is written in C# and is released as open source under a FreeBSD-like
licence. Included in this release is pdf documentation and both html and
chm documentation. The main documentation is written as if it was a new
Appendix to John Gough's book Compiling for the .NET Common Language Runtime,
Prentice-Hall 2002.
The current release implements most of the facilities of the API however,
some final features not required for component pascal have yet to be added.
We expect to update the component incrementally as additional features are
added. Currently the component does not produce debugger information (pdb
files). We are considering possible ways of doing this or alternatively
producing rotor-format debugging information.
The team has a committment to maintain and update the component into the
foreseeable future, as several other projects here depend on it. Users are
encouraged to send feedback on missing features, bug reports etc. to assist
in this quest.
@@ -1,63 +1,3 @@
2003-03-04 Tim Coleman <[email protected]>
* System.Data.OracleClient.Oci/IOciDescriptorHandle.cs:
* System.Data.OracleClient.Oci/IOciHandle.cs:
* System.Data.OracleClient.Oci/OciDescriptorType.cs:
Removed. These are no longer used.
* System.Data.OracleClient.Oci/OciParameterDescriptor.cs:
Add new class
* list:
Add System.Data.OracleClient.Oci/OciParameterDescriptor.cs
Rem System.Data.OracleClient.Oci/IOciDescriptorHandle.cs
Rem System.Data.OracleClient.Oci/IOciHandle.cs
Rem System.Data.OracleClient.Oci/OciDescriptorType.cs
* System.Data.OracleClient/OciGlue.cs:
Move the OCIAttrGet* methods into OciHandle
* System.Data.OracleClient/OracleDataReader.cs:
* System.Data.OracleClient/OracleParameter.cs:
Change the way that columns are bound and described
* System.Data.OracleClient.Oci/OciBindHandle.cs:
* System.Data.OracleClient.Oci/OciDefineHandle.cs:
* System.Data.OracleClient.Oci/OciDescriptorHandle.cs:
* System.Data.OracleClient.Oci/OciEnvironmentHandle.cs:
* System.Data.OracleClient.Oci/OciErrorHandle.cs:
* System.Data.OracleClient.Oci/OciHandle.cs:
* System.Data.OracleClient.Oci/OciLobLocator.cs:
* System.Data.OracleClient.Oci/OciServerHandle.cs:
* System.Data.OracleClient.Oci/OciServiceHandle.cs:
* System.Data.OracleClient.Oci/OciSessionHandle.cs:
* System.Data.OracleClient.Oci/OciStatementHandle.cs:
* System.Data.OracleClient.Oci/OciTransactionHandle.cs:
All handles now derive from OciHandle, and these classes
have been rewritten as such. Also attempted to implement
the Dispose () methods for these classes.
* System.Data.OracleClient.Oci/OciHandleType.cs:
Add descriptor types into here because handles and
descriptors are used in many of the same OCI functions.
2003-02-26 Tim Coleman <[email protected]>
* System.Data.OracleClient/OracleConnection.cs:
Rollback transactions when connection closes if they
are open.
* System.Data.OracleClient/OracleDataReader.cs:
Implement GetOracleLob ()
* System.Data.OracleClient/OracleLob.cs:
Implement some of the details, like Read/Write/Seek
* System.Data.OracleClient.Oci/OciBindHandle.cs:
Remove debug message.
* System.Data.OracleClient.Oci/OciDefineHandle.cs:
Add LOB support.
* System.Data.OracleClient.Oci/OciEnvironmentHandle.cs:
Minor formatting changes
* System.Data.OracleClient.Oci/OciLobLocator.cs:
Huge amounts of code to make it work. Lots of ugly
OCI P/Invoke code.
* Test/TestOracleClient.cs:
Improve the LOBTest.
2003-02-24 Gonzalo Paniagua Javier <[email protected]>
* System.Data.OracleClient/OracleMonthSpan.cs: fixed compilation.
2003-02-21 Tim Coleman <[email protected]>
* System.Data.OracleClient/OracleDateTime.cs:
* System.Data.OracleClient/OracleInfoMessageEventArgs.cs:
@@ -0,0 +1,30 @@
//
// IOciDescriptorHandle.cs
//
// Part of managed C#/.NET library System.Data.OracleClient.dll
//
// Part of the Mono class libraries at
// mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
//
// Assembly: System.Data.OracleClient.dll
// Namespace: System.Data.OracleClient.Oci
//
// Author:
// Tim Coleman <[email protected]>
//
// Copyright (C) Tim Coleman, 2003
//
using System;
namespace System.Data.OracleClient.Oci {
internal interface IOciDescriptorHandle
{
#region Properties
IntPtr Handle { get; set; }
OciDescriptorType HandleType { get; }
#endregion // Properties
}
}
@@ -0,0 +1,30 @@
//
// IOciHandle.cs
//
// Part of managed C#/.NET library System.Data.OracleClient.dll
//
// Part of the Mono class libraries at
// mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
//
// Assembly: System.Data.OracleClient.dll
// Namespace: System.Data.OracleClient.Oci
//
// Author:
// Tim Coleman <[email protected]>
//
// Copyright (C) Tim Coleman, 2003
//
using System;
namespace System.Data.OracleClient.Oci {
internal interface IOciHandle
{
#region Properties
IntPtr Handle { get; set; }
OciHandleType HandleType { get; }
#endregion // Properties
}
}
@@ -20,45 +20,143 @@ using System.Runtime.InteropServices;
using System.Text;
namespace System.Data.OracleClient.Oci {
internal sealed class OciBindHandle : OciHandle, IDisposable
internal sealed class OciBindHandle : IOciHandle, IDisposable
{
#region Fields
bool disposed = false;
IntPtr handle;
string name;
IntPtr value;
OciStatementHandle statement;
OciDataType type;
int size;
int indicator;
#endregion // Fields
#region Constructors
public OciBindHandle (OciHandle parent, IntPtr newHandle)
: base (OciHandleType.Bind, parent, newHandle)
public OciBindHandle (string name)
{
this.name = name;
this.value = IntPtr.Zero;
this.indicator = 0;
}
#endregion // Constructors
#region Properties
public IntPtr Value {
get { return value; }
set { this.value = value; }
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
#endregion // Properties
public OciHandleType HandleType {
get { return OciHandleType.Bind; }
}
public string Name {
get { return name; }
set { name = value; }
}
public int Size {
get { return size; }
set { size = value; }
}
public OciDataType Type {
get { return type; }
set { type = value; }
}
public IntPtr Value {
get { return value; }
}
#endregion
#region Methods
protected override void Dispose (bool disposing)
[DllImport ("oci", EntryPoint = "OCIBindByName")]
public static extern int OCIBindByName (IntPtr stmtp,
out IntPtr bindpp,
IntPtr errhp,
string placeholder,
int placeh_len,
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
ref int indp,
IntPtr alenp,
ushort rcodep,
uint maxarr_len,
IntPtr curelp,
uint mode);
public void Bind (OciStatementHandle statement, object val)
{
if (!disposed) {
try {
Marshal.FreeHGlobal (value);
disposed = true;
} finally {
base.Dispose (disposing);
Console.WriteLine ("IN BIND");
handle = IntPtr.Zero;
this.statement = statement;
int indp = 0;
ushort alenp = 0;
IntPtr rcodep = IntPtr.Zero;
int status = 0;
OciDataType bindType = Type;
int definedSize = 0;
string stringValue = val.ToString ();
if (val == DBNull.Value)
indicator = -1;
else {
switch (Type) {
case OciDataType.Number:
case OciDataType.Integer:
case OciDataType.Float:
case OciDataType.VarNum:
bindType = OciDataType.Char;
definedSize = stringValue.Length;
value = Marshal.StringToHGlobalAnsi (stringValue);
break;
case OciDataType.Date:
break;
default:
bindType = OciDataType.Char;
definedSize = stringValue.Length;
value = Marshal.StringToHGlobalAnsi (stringValue);
break;
}
}
status = OCIBindByName (statement.Handle,
out handle,
statement.ErrorHandle.Handle,
name,
name.Length,
value,
definedSize,
bindType,
ref indicator,
IntPtr.Zero,
0,
0,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public void Dispose ()
{
Marshal.FreeHGlobal (value);
}
#endregion // Methods
@@ -21,12 +21,10 @@ using System.Runtime.InteropServices;
using System.Text;
namespace System.Data.OracleClient.Oci {
internal sealed class OciDefineHandle : OciHandle, IDisposable
internal sealed class OciDefineHandle : IOciHandle, IDisposable
{
#region Fields
bool disposed = false;
IntPtr handle;
IntPtr value;
short indicator;
@@ -35,30 +33,93 @@ namespace System.Data.OracleClient.Oci {
OciDataType definedType;
int definedSize;
int rlenp;
short scale;
OciErrorHandle errorHandle;
sbyte scale;
OciLobLocator lobLocator;
byte[] date;
#endregion // Fields
#region Constructors
public OciDefineHandle (OciHandle parent, IntPtr newHandle)
: base (OciHandleType.Define, parent, newHandle)
public OciDefineHandle (OciStatementHandle statement, int position)
{
}
int ociTypeInt;
int status = 0;
public void DefineByPosition (int position)
{
OciParameterDescriptor parameter = ((OciStatementHandle) Parent).GetParameter (position);
definedSize = parameter.GetDataSize ();
scale = parameter.GetScale ();
definedType = parameter.GetDataType ();
Define (position);
parameter.Dispose ();
IntPtr parameterHandle = statement.CreateParameterHandle (position);
status = OciGlue.OCIAttrGetInt32 (parameterHandle,
(uint) OciDescriptorType.Parameter,
out definedSize,
IntPtr.Zero,
OciAttributeType.DataSize,
statement.ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
status = OciGlue.OCIAttrGetSByte (parameterHandle,
(uint) OciDescriptorType.Parameter,
out scale,
IntPtr.Zero,
OciAttributeType.DataSize,
statement.ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
status = OciGlue.OCIAttrGetInt32 (parameterHandle,
(uint) OciDescriptorType.Parameter,
out ociTypeInt,
IntPtr.Zero,
OciAttributeType.DataType,
statement.ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
definedType = (OciDataType) ociTypeInt;
switch (definedType) {
case OciDataType.Number:
ociType = OciDataType.Char;
break;
case OciDataType.Date:
ociType = OciDataType.Char;
definedSize = 20;
break;
case OciDataType.Clob:
lobLocator = (OciLobLocator) statement.Environment.AllocateDescriptor (OciDescriptorType.LobLocator);
value = lobLocator.Handle;
ociType = definedType;
break;
default:
ociType = definedType;
break;
}
value = Marshal.AllocHGlobal (definedSize);
status = OCIDefineByPos (statement.Handle,
out handle,
statement.ErrorHandle.Handle,
position,
value,
definedSize,
ociType,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
statement.FreeParameterHandle (parameterHandle);
}
#endregion // Constructors
@@ -73,16 +134,20 @@ namespace System.Data.OracleClient.Oci {
get { return definedSize; }
}
public OciErrorHandle ErrorHandle {
get { return errorHandle; }
set { errorHandle = value; }
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
public OciHandleType HandleType {
get { return OciHandleType.Define; }
}
public bool IsNull {
get { return (indicator == -1); }
}
public short Scale {
public sbyte Scale {
get { return scale; }
}
@@ -111,148 +176,14 @@ namespace System.Data.OracleClient.Oci {
IntPtr rcodep,
uint mode);
[DllImport ("oci", EntryPoint="OCIDefineByPos")]
public static extern int OCIDefineByPosPtr (IntPtr stmtp,
out IntPtr defnpp,
IntPtr errhp,
[MarshalAs (UnmanagedType.U4)] int position,
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
ref short indp,
ref int rlenp,
IntPtr rcodep,
uint mode);
[DllImport ("oci")]
static extern int OCIDateTimeGetDate (IntPtr hndl,
IntPtr err,
byte[] datetime,
out short year,
out byte month,
out byte day);
void Define (int position)
public void Dispose ()
{
switch (definedType) {
case OciDataType.Date:
definedSize = 7;
DefineDate (position);
return;
case OciDataType.Clob:
case OciDataType.Blob:
definedSize = -1;
DefineLob (position, definedType);
return;
default:
DefineChar (position); // HANDLE ALL OTHERS AS CHAR FOR NOW
return;
}
}
void DefineDate (int position)
{
ociType = OciDataType.Date;
value = Marshal.AllocHGlobal (definedSize);
int status = 0;
status = OCIDefineByPos (Parent,
out handle,
ErrorHandle,
position + 1,
value,
definedSize,
ociType,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
void DefineChar (int position)
{
ociType = OciDataType.Char;
value = Marshal.AllocHGlobal (definedSize);
int status = 0;
status = OCIDefineByPos (Parent,
out handle,
ErrorHandle,
position + 1,
value,
definedSize,
ociType,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
void DefineLob (int position, OciDataType type)
{
ociType = type;
int status = 0;
definedSize = -1;
lobLocator = (OciLobLocator) Parent.Parent.Allocate (OciHandleType.LobLocator);
if (lobLocator == null) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
value = lobLocator.Handle;
lobLocator.ErrorHandle = ErrorHandle;
lobLocator.Service = ((OciStatementHandle) Parent).Service;
status = OCIDefineByPosPtr (Parent,
out handle,
ErrorHandle,
position + 1,
ref value,
definedSize,
ociType,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
[MonoTODO ("This will be an override when this is properly derived from OciHandle.")]
protected override void Dispose (bool disposing)
{
if (!disposed) {
try {
Marshal.FreeHGlobal (value);
disposed = true;
} finally {
base.Dispose (disposing);
}
}
Marshal.FreeHGlobal (value);
}
public OracleLob GetOracleLob ()
{
return new OracleLob (lobLocator, ociType);
return new OracleLob (lobLocator);
}
public object GetValue ()
@@ -290,31 +221,15 @@ namespace System.Data.OracleClient.Oci {
return Double.Parse (String.Copy ((string) tmp));
break;
case OciDataType.Date:
return UnpackDate ();
tmp = Marshal.PtrToStringAnsi (Value, Size);
if (tmp != null)
return DateTime.Parse ((string) tmp);
break;
}
return DBNull.Value;
}
[MonoTODO ("Be able to handle negative dates... i.e. BCE.")]
public DateTime UnpackDate ()
{
byte century = Marshal.ReadByte (value, 0);
byte year = Marshal.ReadByte (value, 1);
byte month = Marshal.ReadByte (value, 2);
byte day = Marshal.ReadByte (value, 3);
byte hour = Marshal.ReadByte (value, 4);
byte minute = Marshal.ReadByte (value, 5);
byte second = Marshal.ReadByte (value, 6);
return new DateTime ((century - 100) * 100 + (year - 100),
month,
day,
hour - 1,
minute - 1,
second - 1);
}
#endregion // Methods
}
}
@@ -16,32 +16,44 @@
//
using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal abstract class OciDescriptorHandle : OciHandle
internal abstract class OciDescriptorHandle : IOciDescriptorHandle
{
#region Fields
IntPtr handle;
OciEnvironmentHandle environment;
OciDescriptorType type;
#endregion // Fields
#region Constructors
public OciDescriptorHandle (OciHandleType type, OciHandle parent, IntPtr newHandle)
: base (type, parent, newHandle)
public OciDescriptorHandle (OciDescriptorType type, OciEnvironmentHandle environment, IntPtr newHandle)
{
this.type = type;
this.environment = environment;
this.handle = newHandle;
}
#endregion // Constructors
#region Methods
#region Properties
[DllImport ("oci")]
static extern int OCIDescriptorFree (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type);
protected override void FreeHandle ()
{
int status = 0;
status = OCIDescriptorFree (Handle, HandleType);
public OciEnvironmentHandle Environment {
get { return environment; }
}
#endregion // Methods
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
public OciDescriptorType HandleType {
get { return type; }
}
#endregion // Properties
}
}
@@ -0,0 +1,45 @@
//
// OciDescriptorType.cs
//
// Part of managed C#/.NET library System.Data.OracleClient.dll
//
// Part of the Mono class libraries at
// mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
//
// Assembly: System.Data.OracleClient.dll
// Namespace: System.Data.OracleClient.Oci
//
// Author:
// Tim Coleman <[email protected]>
//
// Copyright (C) Tim Coleman, 2003
//
using System;
namespace System.Data.OracleClient.Oci {
internal enum OciDescriptorType {
LobLocator = 0x32,
Snapshot = 0x33,
ResultSet = 0x34,
Parameter = 0x35,
RowId = 0x36,
ComplexObject = 0x37,
FileLobLocator = 0x38,
EnqueueOptions = 0x39,
DequeueOptions = 0x3a,
MessageProperties = 0x3b,
Agent = 0x3c,
Locator = 0x3d,
IntervalYearToMonth = 0x3e,
IntervalDayToSecond = 0x3f,
Notify = 0x40,
Date = 0x41,
Time = 0x42,
TimeWithTZ = 0x43,
TimeStamp = 0x44,
TimeStampWithTZ = 0x45,
TimeStampLocal = 0x46,
UserCallback = 0x47
}
}
@@ -19,8 +19,14 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal class OciEnvironmentHandle : OciHandle, IDisposable
internal class OciEnvironmentHandle : IOciHandle, IDisposable
{
#region Fields
IntPtr handle;
#endregion // Fields
#region Constructors
public OciEnvironmentHandle ()
@@ -29,35 +35,140 @@ namespace System.Data.OracleClient.Oci {
}
public OciEnvironmentHandle (OciEnvironmentMode mode)
: base (OciHandleType.Environment, null, IntPtr.Zero)
{
int status = 0;
IntPtr newHandle = IntPtr.Zero;
status = OCIEnvCreate (out newHandle,
mode,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
0,
IntPtr.Zero);
this.handle = IntPtr.Zero;
SetHandle (newHandle);
status = OCIEnvCreate (out handle, mode,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
0,
IntPtr.Zero);
}
#endregion // Constructors
#region Properties
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
public OciHandleType HandleType {
get { return OciHandleType.Environment; }
}
#endregion // Properties
#region Methods
[DllImport ("oci")]
static extern int OCIEnvCreate (out IntPtr envhpp,
[MarshalAs (UnmanagedType.U4)] OciEnvironmentMode mode,
IntPtr ctxp,
IntPtr malocfp,
IntPtr ralocfp,
IntPtr mfreep,
int xtramem_sz,
IntPtr usrmempp);
public static extern int OCIEnvCreate (out IntPtr envhpp,
[MarshalAs (UnmanagedType.U4)] OciEnvironmentMode mode,
IntPtr ctxp,
IntPtr malocfp,
IntPtr ralocfp,
IntPtr mfreep,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
public static extern int OCIHandleAlloc (IntPtr parenth,
out IntPtr hndlpp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
public static extern int OCIDescriptorAlloc (IntPtr parenth,
out IntPtr descpp,
[MarshalAs (UnmanagedType.U4)] OciDescriptorType type,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
public static extern int OCIHandleFree (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type);
[DllImport ("oci")]
public static extern int OCIDescriptorFree (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciDescriptorType type);
public IOciHandle Allocate (OciHandleType type)
{
IntPtr newHandle = IntPtr.Zero;
int status = 0;
status = OCIHandleAlloc (Handle,
out newHandle,
type,
0,
IntPtr.Zero);
if (status != 0 && status != 1)
return null;
switch (type) {
case OciHandleType.Service:
return new OciServiceHandle (this, newHandle);
case OciHandleType.Error:
return new OciErrorHandle (this, newHandle);
case OciHandleType.Server:
return new OciServerHandle (this, newHandle);
case OciHandleType.Session:
return new OciSessionHandle (this, newHandle);
case OciHandleType.Statement:
return new OciStatementHandle (this, newHandle);
case OciHandleType.Transaction:
return new OciTransactionHandle (this, newHandle);
default:
OCIHandleFree (newHandle, type);
newHandle = IntPtr.Zero;
throw new ArgumentException ("Invalid handle type.");
}
}
public IOciDescriptorHandle AllocateDescriptor (OciDescriptorType type)
{
IntPtr newHandle = IntPtr.Zero;
int status = 0;
status = OCIDescriptorAlloc (Handle,
out newHandle,
type,
0,
IntPtr.Zero);
if (status != 0 && status != 1)
return null;
switch (type) {
case OciDescriptorType.LobLocator:
return new OciLobLocator (this, newHandle);
default:
OCIDescriptorFree (newHandle, type);
newHandle = IntPtr.Zero;
throw new ArgumentException ("Invalid handle type.");
}
}
public void Dispose ()
{
FreeHandle (this);
}
public void FreeHandle (IOciHandle toBeDisposed)
{
OCIHandleFree (toBeDisposed.Handle, toBeDisposed.HandleType);
toBeDisposed.Handle = IntPtr.Zero;
}
public void FreeDescriptor (IOciDescriptorHandle toBeDisposed)
{
OCIDescriptorFree (toBeDisposed.Handle, toBeDisposed.HandleType);
toBeDisposed.Handle = IntPtr.Zero;
}
public OciErrorInfo HandleError ()
{
@@ -68,7 +179,7 @@ namespace System.Data.OracleClient.Oci {
info.ErrorCode = 0;
info.ErrorMessage = String.Empty;
OciGlue.OCIErrorGet (Handle,
OciGlue.OCIErrorGet (handle,
1,
IntPtr.Zero,
out info.ErrorCode,
@@ -19,18 +19,12 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciErrorHandle : OciHandle, IDisposable
internal sealed class OciErrorHandle : OciHandle, IOciHandle, IDisposable
{
#region Fields
bool disposed = false;
#endregion // Fields
#region Constructors
public OciErrorHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Error, parent, handle)
public OciErrorHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Error, environment, handle)
{
}
@@ -38,12 +32,9 @@ namespace System.Data.OracleClient.Oci {
#region Methods
protected override void Dispose (bool disposing)
public void Dispose ()
{
if (!disposed) {
disposed = true;
base.Dispose (disposing);
}
Environment.FreeHandle (this);
}
public OciErrorInfo HandleError ()
@@ -16,53 +16,38 @@
//
using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal abstract class OciHandle : IDisposable
internal abstract class OciHandle : IOciHandle
{
#region Fields
bool disposed = false;
IntPtr handle;
OciHandle parent;
OciEnvironmentHandle environment;
OciHandleType type;
#endregion // Fields
#region Constructors
public OciHandle (OciHandleType type, OciHandle parent, IntPtr newHandle)
public OciHandle (OciHandleType type, OciEnvironmentHandle environment, IntPtr newHandle)
{
this.type = type;
this.parent = parent;
this.environment = environment;
this.handle = newHandle;
}
~OciHandle ()
{
Dispose (false);
}
#endregion // Constructors
#region Properties
public OciHandle Parent {
get { return parent; }
public OciEnvironmentHandle Environment {
get { return environment; }
}
/*
public HandleRef Handle {
get {
HandleRef hr = new HandleRef (this, handle);
GC.KeepAlive (this);
return hr;
}
}
*/
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
public OciHandleType HandleType {
@@ -70,257 +55,5 @@ namespace System.Data.OracleClient.Oci {
}
#endregion // Properties
#region Methods
[DllImport ("oci")]
static extern int OCIAttrGet (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out IntPtr attributep,
out int sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
static extern int OCIAttrGetSByte (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out sbyte attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
static extern int OCIAttrGetByte (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out byte attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
static extern int OCIAttrGetUInt16 (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out ushort attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
static extern int OCIAttrGetInt32 (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out int attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci")]
static extern int OCIDescriptorAlloc (IntPtr parenth,
out IntPtr hndlpp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
static extern int OCIHandleAlloc (IntPtr parenth,
out IntPtr descpp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
static extern int OCIHandleFree (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type);
public OciHandle Allocate (OciHandleType type)
{
int status = 0;
IntPtr newHandle = IntPtr.Zero;
if (type < OciHandleType.LobLocator)
status = OCIHandleAlloc (this,
out newHandle,
type,
0,
IntPtr.Zero);
else
status = OCIDescriptorAlloc (this,
out newHandle,
type,
0,
IntPtr.Zero);
if (status != 0 && status != 1)
throw new Exception (String.Format ("Could not allocate new OCI Handle of type {0}", type));
switch (type) {
case OciHandleType.Service:
return new OciServiceHandle (this, newHandle);
case OciHandleType.Error:
return new OciErrorHandle (this, newHandle);
case OciHandleType.Server:
return new OciServerHandle (this, newHandle);
case OciHandleType.Session:
return new OciSessionHandle (this, newHandle);
case OciHandleType.Statement:
return new OciStatementHandle (this, newHandle);
case OciHandleType.Transaction:
return new OciTransactionHandle (this, newHandle);
case OciHandleType.LobLocator:
return new OciLobLocator (this, newHandle);
}
return null;
}
protected virtual void Dispose (bool disposing)
{
if (!disposed) {
if (disposing) {
parent = null;
}
FreeHandle ();
disposed = true;
}
}
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void FreeHandle ()
{
OCIHandleFree (Handle, HandleType);
handle = IntPtr.Zero;
}
public bool GetAttributeBool (OciAttributeType attrType, OciErrorHandle errorHandle)
{
return (GetAttributeInt32 (attrType, errorHandle) != 0);
}
public sbyte GetAttributeSByte (OciAttributeType attrType, OciErrorHandle errorHandle)
{
int status = 0;
sbyte output;
status = OCIAttrGetSByte (Handle,
HandleType,
out output,
IntPtr.Zero,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public byte GetAttributeByte (OciAttributeType attrType, OciErrorHandle errorHandle)
{
int status = 0;
byte output;
status = OCIAttrGetByte (Handle,
HandleType,
out output,
IntPtr.Zero,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public ushort GetAttributeUInt16 (OciAttributeType attrType, OciErrorHandle errorHandle)
{
int status = 0;
ushort output;
status = OCIAttrGetUInt16 (Handle,
HandleType,
out output,
IntPtr.Zero,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public int GetAttributeInt32 (OciAttributeType attrType, OciErrorHandle errorHandle)
{
int status = 0;
int output;
status = OCIAttrGetInt32 (Handle,
HandleType,
out output,
IntPtr.Zero,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public string GetAttributeString (OciAttributeType attrType, OciErrorHandle errorHandle)
{
string output = String.Empty;
IntPtr outputPtr = IntPtr.Zero;
int outSize;
int status = 0;
status = OCIAttrGet (Handle,
HandleType,
out outputPtr,
out outSize,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
if (outputPtr != IntPtr.Zero && outSize > 0) {
object str = Marshal.PtrToStringAnsi (outputPtr, outSize);
if (str != null)
output = String.Copy ((string) str);
}
return output;
}
public void SetHandle (IntPtr h)
{
handle = h;
}
#endregion // Methods
#region Operators and Type Conversions
public static implicit operator IntPtr (OciHandle h)
{
return h.Handle;
}
#endregion // Operators and Type Conversions
}
}
@@ -35,31 +35,6 @@ namespace System.Data.OracleClient.Oci {
DirectPathContext = 0x0e,
DirectPathColumnArray = 0x0f,
DirectPathStream = 0x10,
Process = 0x11,
// Descriptor handles
LobLocator = 0x32,
Snapshot = 0x33,
ResultSet = 0x34,
Parameter = 0x35,
RowId = 0x36,
//ComplexObject = 0x37,
FileLobLocator = 0x38,
EnqueueOptions = 0x39,
DequeueOptions = 0x3a,
MessageProperties = 0x3b,
Agent = 0x3c,
Locator = 0x3d,
IntervalYearToMonth = 0x3e,
IntervalDayToSecond = 0x3f,
Notify = 0x40,
Date = 0x41,
Time = 0x42,
TimeWithTZ = 0x43,
TimeStamp = 0x44,
TimeStampWithTZ = 0x45,
TimeStampLocal = 0x46,
UserCallback = 0x47
Process = 0x11
}
}
@@ -16,297 +16,25 @@
//
using System;
using System.Data.OracleClient;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciLobLocator : OciDescriptorHandle, IDisposable
internal sealed class OciLobLocator : OciDescriptorHandle, IOciDescriptorHandle, IDisposable
{
#region Fields
bool disposed = false;
OciErrorHandle errorHandle;
OciServiceHandle service;
OciDataType type;
#endregion // Fields
#region Constructors
public OciLobLocator (OciHandle parent, IntPtr handle)
: base (OciHandleType.LobLocator, parent, handle)
public OciLobLocator (OciEnvironmentHandle environment, IntPtr handle)
: base (OciDescriptorType.LobLocator, environment, handle)
{
}
#endregion // Constructors
#region Properties
public OciErrorHandle ErrorHandle {
get { return errorHandle; }
set { errorHandle = value; }
}
public OciServiceHandle Service {
get { return service; }
set { service = value; }
}
public OciDataType LobType {
get { return type; }
set { type = value; }
}
#endregion // Properties
#region Methods
[DllImport ("oci")]
static extern int OCILobClose (IntPtr svchp,
IntPtr errhp,
IntPtr locp);
[DllImport ("oci")]
static extern int OCILobCopy (IntPtr svchp,
IntPtr errhp,
IntPtr dst_locp,
IntPtr src_locp,
uint amount,
uint dst_offset,
uint src_offset);
[DllImport ("oci")]
static extern int OCILobErase (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
ref uint amount,
uint offset);
[DllImport ("oci")]
static extern int OCILobGetChunkSize (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
out uint chunk_size);
[DllImport ("oci")]
static extern int OCILobGetLength (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
out uint lenp);
[DllImport ("oci")]
static extern int OCILobOpen (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
byte mode);
[DllImport ("oci")]
static extern int OCILobRead (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
ref uint amtp,
uint offset,
byte[] bufp,
uint bufl,
IntPtr ctxp,
IntPtr cbfp,
ushort csid,
byte csfrm);
[DllImport ("oci")]
static extern int OCILobTrim (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
uint newlen);
[DllImport ("oci")]
static extern int OCILobWrite (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
ref uint amtp,
uint offset,
byte[] bufp,
uint bufl,
byte piece,
IntPtr ctxp,
IntPtr cbfp,
ushort csid,
byte csfrm);
public void BeginBatch (OracleLobOpenMode mode)
public void Dispose ()
{
int status = 0;
status = OCILobOpen (service.Handle,
errorHandle.Handle,
Handle,
(byte) mode);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public uint Copy (OciLobLocator destination, uint amount, uint destinationOffset, uint sourceOffset)
{
OCILobCopy (Service,
ErrorHandle,
destination,
Handle,
amount,
destinationOffset,
sourceOffset);
return amount;
}
protected override void Dispose (bool disposing)
{
if (!disposed) {
disposed = true;
base.Dispose ();
}
}
public void EndBatch ()
{
int status = 0;
status = OCILobClose (service.Handle,
errorHandle.Handle,
Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public uint Erase (uint offset, uint amount)
{
int status = 0;
uint output = amount;
status = OCILobErase (service.Handle,
errorHandle.Handle,
Handle,
ref output,
(uint) offset);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public int GetChunkSize ()
{
int status = 0;
uint output;
status = OCILobGetChunkSize (service.Handle,
errorHandle.Handle,
Handle,
out output);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return (int) output;
}
public long GetLength (bool binary)
{
int status = 0;
uint output;
status = OCILobGetLength (service.Handle,
errorHandle.Handle,
Handle,
out output);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
if (!binary)
output *= 2;
return (long) output;
}
public int Read (byte[] buffer, uint offset, uint count, bool binary)
{
int status = 0;
uint amount = count;
// Character types are UTF-16, so amount of characters is 1/2
// the amount of bytes
if (!binary)
amount /= 2;
status = OCILobRead (service.Handle,
errorHandle.Handle,
Handle,
ref amount,
offset,
buffer,
count,
IntPtr.Zero,
IntPtr.Zero,
1000, // OCI_UCS2ID
0); // Ignored if csid is specified as above
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return (int) amount;
}
public void Trim (uint newlen)
{
int status = 0;
status = OCILobTrim (service.Handle,
errorHandle.Handle,
Handle,
newlen);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public int Write (byte[] buffer, uint offset, uint count, OracleType type)
{
int status = 0;
uint amount = count;
if (type == OracleType.Clob)
amount /= 2;
status = OCILobWrite (service.Handle,
errorHandle.Handle,
Handle,
ref amount,
offset,
buffer,
count,
0, // OCI_ONE_PIECE
IntPtr.Zero,
IntPtr.Zero,
1000, // OCI_UCS2ID
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return (int) amount;
Environment.FreeDescriptor (this);
}
#endregion // Methods
@@ -1,85 +0,0 @@
//
// OciLobLocator.cs
//
// Part of managed C#/.NET library System.Data.OracleClient.dll
//
// Part of the Mono class libraries at
// mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
//
// Assembly: System.Data.OracleClient.dll
// Namespace: System.Data.OracleClient.Oci
//
// Author:
// Tim Coleman <[email protected]>
//
// Copyright (C) Tim Coleman, 2003
//
using System;
using System.Data.OracleClient;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciParameterDescriptor : OciDescriptorHandle
{
#region Fields
OciErrorHandle errorHandle;
OciServiceHandle service;
OciDataType type;
#endregion // Fields
#region Constructors
public OciParameterDescriptor (OciHandle parent, IntPtr handle)
: base (OciHandleType.Parameter, parent, handle)
{
}
#endregion // Constructors
#region Properties
public OciErrorHandle ErrorHandle {
get { return errorHandle; }
set { errorHandle = value; }
}
#endregion // Properties
#region Methods
public string GetName ()
{
return GetAttributeString (OciAttributeType.Name, ErrorHandle);
}
public int GetDataSize ()
{
return (int) GetAttributeUInt16 (OciAttributeType.DataSize, ErrorHandle);
}
public OciDataType GetDataType ()
{
return (OciDataType) GetAttributeInt32 (OciAttributeType.DataType, ErrorHandle);
}
public short GetPrecision ()
{
return (short) GetAttributeByte (OciAttributeType.Precision, ErrorHandle);
}
public short GetScale ()
{
return (short) GetAttributeSByte (OciAttributeType.Scale, ErrorHandle);
}
public bool GetIsNull ()
{
return GetAttributeBool (OciAttributeType.IsNull, ErrorHandle);
}
#endregion // Methods
}
}
@@ -19,12 +19,11 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciServerHandle : OciHandle, IDisposable
internal sealed class OciServerHandle : OciHandle, IOciHandle, IDisposable
{
#region Fields
bool disposed = false;
bool attached = false;
bool attached;
OciErrorHandle errorHandle;
string tnsname;
@@ -32,9 +31,10 @@ namespace System.Data.OracleClient.Oci {
#region Constructors
public OciServerHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Server, parent, handle)
public OciServerHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Server, environment, handle)
{
attached = false;
}
#endregion // Constructors
@@ -79,17 +79,14 @@ namespace System.Data.OracleClient.Oci {
return attached;
}
protected override void Dispose (bool disposing)
public void Dispose ()
{
if (!disposed) {
try {
if (attached)
OCIServerDetach (Handle, errorHandle, 0);
disposed = true;
} finally {
base.Dispose (disposing);
}
if (attached) {
OCIServerDetach (Handle,
errorHandle.Handle,
0);
}
Environment.FreeHandle (this);
}
#endregion // Methods
@@ -19,22 +19,20 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciServiceHandle : OciHandle
internal sealed class OciServiceHandle : OciHandle, IOciHandle, IDisposable
{
#region Fields
bool disposed = false;
OciSessionHandle session;
OciServerHandle server;
OciSessionHandle sessionHandle;
OciServerHandle serverHandle;
OciErrorHandle errorHandle;
#endregion // Fields
#region Constructors
public OciServiceHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Service, parent, handle)
public OciServiceHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Service, environment, handle)
{
}
@@ -51,46 +49,34 @@ namespace System.Data.OracleClient.Oci {
#region Methods
protected override void Dispose (bool disposing)
public void Dispose ()
{
if (!disposed) {
try {
if (disposing) {
if (server != null)
server.Dispose ();
if (session != null)
session.Dispose ();
}
disposed = true;
} finally {
base.Dispose (disposing);
}
}
Environment.FreeHandle (this);
}
public bool SetServer (OciServerHandle handle)
{
server = handle;
serverHandle = handle;
int status = 0;
status = OciGlue.OCIAttrSet (Handle,
HandleType,
server,
serverHandle.Handle,
0,
OciAttributeType.Server,
errorHandle);
errorHandle.Handle);
return (status == 0);
}
public bool SetSession (OciSessionHandle handle)
{
session = handle;
sessionHandle = handle;
int status = 0;
status = OciGlue.OCIAttrSet (Handle,
HandleType,
session,
sessionHandle.Handle,
0,
OciAttributeType.Session,
errorHandle);
errorHandle.Handle);
return (status == 0);
}
@@ -19,14 +19,13 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciSessionHandle : OciHandle, IDisposable
internal sealed class OciSessionHandle : OciHandle, IOciHandle, IDisposable
{
#region Fields
OciErrorHandle errorHandle;
OciServiceHandle serviceHandle;
bool begun = false;
bool disposed = false;
bool begun;
string username;
string password;
@@ -34,9 +33,10 @@ namespace System.Data.OracleClient.Oci {
#region Constructors
public OciSessionHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Session, parent, handle)
public OciSessionHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Session, environment, handle)
{
begun = false;
}
#endregion // Constructors
@@ -118,21 +118,15 @@ namespace System.Data.OracleClient.Oci {
return true;
}
protected override void Dispose (bool disposing)
public void Dispose ()
{
if (!disposed) {
try {
if (begun) {
OCISessionEnd (Service.Handle,
errorHandle.Handle,
Handle,
0);
}
disposed = false;
} finally {
base.Dispose (disposing);
}
if (begun) {
OCISessionEnd (Service.Handle,
errorHandle.Handle,
Handle,
0);
}
Environment.FreeHandle (this);
}
#endregion // Methods
@@ -20,7 +20,7 @@ using System.Collections;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciStatementHandle : OciHandle, IDisposable
internal sealed class OciStatementHandle : OciHandle, IOciHandle, IDisposable
{
#region Fields
@@ -32,7 +32,6 @@ namespace System.Data.OracleClient.Oci {
ArrayList values;
ArrayList parameters;
bool disposed = false;
bool moreResults;
int columnCount;
@@ -40,8 +39,8 @@ namespace System.Data.OracleClient.Oci {
#region Constructors
public OciStatementHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Statement, parent, handle)
public OciStatementHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Statement, environment, handle)
{
parameters = new ArrayList ();
language = OciStatementLanguage.NTV;
@@ -81,41 +80,25 @@ namespace System.Data.OracleClient.Oci {
#region Methods
[DllImport ("oci")]
static extern int OCIBindByName (IntPtr stmtp,
out IntPtr bindpp,
IntPtr errhp,
string placeholder,
int placeh_len,
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U4)] OciDataType dty,
ref int indp,
IntPtr alenp,
ushort rcodep,
uint maxarr_len,
IntPtr curelp,
uint mode);
public static extern int OCIDescriptorFree (IntPtr descp,
[MarshalAs (UnmanagedType.U4)] OciDescriptorType type);
[DllImport ("oci")]
static extern int OCIDescriptorFree (IntPtr descp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type);
public static extern int OCIParamGet (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType htype,
IntPtr errhp,
out IntPtr parmdpp,
[MarshalAs (UnmanagedType.U4)] int pos);
[DllImport ("oci")]
static extern int OCIParamGet (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType htype,
IntPtr errhp,
out IntPtr parmdpp,
[MarshalAs (UnmanagedType.U4)] int pos);
[DllImport ("oci")]
static extern int OCIStmtExecute (IntPtr svchp,
IntPtr stmthp,
IntPtr errhp,
[MarshalAs (UnmanagedType.U4)] bool iters,
uint rowoff,
IntPtr snap_in,
IntPtr snap_out,
[MarshalAs (UnmanagedType.U4)] OciExecuteMode mode);
public static extern int OCIStmtExecute (IntPtr svchp,
IntPtr stmthp,
IntPtr errhp,
[MarshalAs (UnmanagedType.U4)] bool iters,
uint rowoff,
IntPtr snap_in,
IntPtr snap_out,
[MarshalAs (UnmanagedType.U4)] OciExecuteMode mode);
[DllImport ("oci")]
public static extern int OCIStmtFetch (IntPtr stmtp,
@@ -133,15 +116,7 @@ namespace System.Data.OracleClient.Oci {
[MarshalAs (UnmanagedType.U4)] OciStatementLanguage language,
[MarshalAs (UnmanagedType.U4)] OciStatementMode mode);
protected override void Dispose (bool disposing)
{
if (!disposed) {
disposed = true;
base.Dispose (disposing);
}
}
public OciParameterDescriptor GetParameter (int position)
public IntPtr CreateParameterHandle (int position)
{
IntPtr handle = IntPtr.Zero;
int status = 0;
@@ -150,88 +125,47 @@ namespace System.Data.OracleClient.Oci {
OciHandleType.Statement,
ErrorHandle.Handle,
out handle,
position + 1);
position);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
OciParameterDescriptor output = new OciParameterDescriptor (this, handle);
output.ErrorHandle = ErrorHandle;
return output;
return handle;
}
public OciDefineHandle GetDefineHandle (int position)
public void FreeBindHandle (IntPtr handle)
{
OciDefineHandle defineHandle = new OciDefineHandle (this, IntPtr.Zero);
defineHandle.ErrorHandle = ErrorHandle;
defineHandle.DefineByPosition (position);
return defineHandle;
}
public OciBindHandle GetBindHandle (string name, object val, OciDataType type)
{
IntPtr handle = IntPtr.Zero;
IntPtr value = IntPtr.Zero;
int indicator = 0;
string stringValue = val.ToString ();
int definedSize = 0;
int status = 0;
if (val == DBNull.Value)
indicator = -1;
else
switch (type) {
case OciDataType.Number:
case OciDataType.Integer:
case OciDataType.Float:
case OciDataType.VarNum:
type = OciDataType.Char;
definedSize = stringValue.Length;
value = Marshal.StringToHGlobalAnsi (stringValue);
break;
case OciDataType.Date:
break;
default:
type = OciDataType.Char;
definedSize = stringValue.Length;
value = Marshal.StringToHGlobalAnsi (stringValue);
break;
}
status = OCIBindByName (Handle,
out handle,
ErrorHandle,
name,
name.Length,
value,
definedSize,
type,
ref indicator,
IntPtr.Zero,
0,
0,
IntPtr.Zero,
0);
//status = OCIDescriptorFree (handle, OciDescriptorType.Parameter);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
OciBindHandle output = new OciBindHandle (this, handle);
output.Value = value;
return output;
public void FreeParameterHandle (IntPtr handle)
{
int status = 0;
status = OCIDescriptorFree (handle, OciDescriptorType.Parameter);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
void Define ()
{
values = new ArrayList ();
for (int i = 0; i < columnCount; i += 1)
values.Add (GetDefineHandle (i));
values.Add (new OciDefineHandle (this, i + 1));
}
public void Dispose ()
{
Environment.FreeHandle (this);
}
public bool ExecuteQuery ()
@@ -279,12 +213,192 @@ namespace System.Data.OracleClient.Oci {
void GetColumnCount ()
{
columnCount = GetAttributeInt32 (OciAttributeType.ParameterCount, ErrorHandle);
int status = 0;
status = OciGlue.OCIAttrGetInt32 ( Handle,
(uint) OciHandleType.Statement,
out columnCount,
IntPtr.Zero,
OciAttributeType.ParameterCount,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public bool GetAttributeBool (IntPtr handle, OciAttributeType type)
{
bool output;
int status = 0;
status = OciGlue.OCIAttrGetBool (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public sbyte GetAttributeSByte (IntPtr handle, OciAttributeType type) {
sbyte output;
int status = 0;
status = OciGlue.OCIAttrGetSByte (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public byte GetAttributeByte (IntPtr handle, OciAttributeType type)
{
byte output;
int status = 0;
status = OciGlue.OCIAttrGetByte (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public ushort GetAttributeUInt16 (IntPtr handle, OciAttributeType type) {
int status = 0;
ushort output;
status = OciGlue.OCIAttrGetUInt16 (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public int GetAttributeInt32 (IntPtr handle, OciAttributeType type)
{
int status = 0;
int output;
status = OciGlue.OCIAttrGetInt32 (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
[MonoTODO]
public string GetAttributeString (IntPtr handle, OciAttributeType type)
{
string output = String.Empty;
IntPtr outputPtr = IntPtr.Zero;
int outSize;
int status = 0;
status = OciGlue.OCIAttrGet (handle,
(uint) OciDescriptorType.Parameter,
out outputPtr,
out outSize,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
if (outputPtr != IntPtr.Zero && outSize > 0) {
object name = Marshal.PtrToStringAnsi (outputPtr, outSize);
if (name != null) {
output = String.Copy ((string) name);
/* TRWC
* We shouldn't really free this, but how can we make Oracle
* do it?
*/
// Marshal.FreeHGlobal (outputPtr); -- this *may* leak memory
}
}
return output;
}
[MonoTODO]
public OciColumnInfo DescribeColumn (int ordinal)
{
int status = 0;
OciColumnInfo columnInfo;
string schemaName;
IntPtr parameterHandle = CreateParameterHandle (ordinal + 1);
columnInfo.ColumnName = GetAttributeString (parameterHandle, OciAttributeType.Name);
columnInfo.ColumnOrdinal = ordinal + 1;
columnInfo.ColumnSize = GetAttributeUInt16 (parameterHandle, OciAttributeType.DataSize);
columnInfo.Precision = GetAttributeByte (parameterHandle, OciAttributeType.Precision);
columnInfo.Scale = GetAttributeSByte (parameterHandle, OciAttributeType.Scale);
columnInfo.DataType = (OciDataType) GetAttributeInt32 (parameterHandle, OciAttributeType.DataType);
columnInfo.AllowDBNull = GetAttributeBool (parameterHandle, OciAttributeType.IsNull);
columnInfo.BaseColumnName = GetAttributeString (parameterHandle, OciAttributeType.Name);
// TRWC not sure what to do with this yet.
schemaName = GetAttributeString (parameterHandle, OciAttributeType.SchemaName);
FreeParameterHandle (parameterHandle);
return columnInfo;
}
public OciStatementType GetStatementType ()
{
return (OciStatementType) GetAttributeInt32 (OciAttributeType.StatementType, ErrorHandle);
int status = 0;
int statementType;
status = OciGlue.OCIAttrGetInt32 (Handle,
(uint) OciHandleType.Statement,
out statementType,
IntPtr.Zero,
OciAttributeType.StatementType,
errorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return (OciStatementType) statementType;
}
public bool Fetch ()
@@ -19,11 +19,10 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciTransactionHandle : OciHandle, IDisposable
internal sealed class OciTransactionHandle : OciHandle, IOciHandle, IDisposable
{
#region Fields
bool disposed = false;
OciErrorHandle errorHandle;
OciServiceHandle serviceHandle;
@@ -31,8 +30,8 @@ namespace System.Data.OracleClient.Oci {
#region Constructors
public OciTransactionHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Transaction, parent, handle)
public OciTransactionHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Transaction, environment, handle)
{
}
@@ -73,12 +72,12 @@ namespace System.Data.OracleClient.Oci {
public void AttachToServiceContext ()
{
int status = 0;
status = OciGlue.OCIAttrSet (Service,
status = OciGlue.OCIAttrSet (Service.Handle,
OciHandleType.Service,
this,
Handle,
0,
OciAttributeType.Transaction,
ErrorHandle);
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
@@ -91,10 +90,10 @@ namespace System.Data.OracleClient.Oci {
AttachToServiceContext ();
status = OCITransStart (Service,
ErrorHandle,
60,
OciTransactionFlags.New);
status = OCITransStart (Service.Handle,
ErrorHandle.Handle,
60,
OciTransactionFlags.New);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
@@ -106,7 +105,9 @@ namespace System.Data.OracleClient.Oci {
{
int status = 0;
AttachToServiceContext ();
status = OCITransCommit (Service, ErrorHandle, 0);
status = OCITransCommit (Service.Handle,
ErrorHandle.Handle,
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
@@ -114,19 +115,18 @@ namespace System.Data.OracleClient.Oci {
}
}
protected override void Dispose (bool disposing)
public void Dispose ()
{
if (!disposed) {
disposed = true;
base.Dispose (disposing);
}
Environment.FreeHandle (this);
}
public void Rollback ()
{
int status = 0;
AttachToServiceContext ();
status = OCITransRollback (Service, ErrorHandle, 0);
status = OCITransRollback (Service.Handle,
ErrorHandle.Handle,
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
@@ -67,6 +67,54 @@ namespace System.Data.OracleClient.Oci {
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci")]
public static extern int OCIAttrGet (IntPtr trgthndlp,
uint trghndltyp,
out IntPtr attributep,
out int sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetBool (IntPtr trgthndlp,
uint trghndltyp,
out bool attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetSByte (IntPtr trgthndlp,
uint trghndltyp,
out sbyte attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetByte (IntPtr trgthndlp,
uint trghndltyp,
out byte attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetUInt16 (IntPtr trgthndlp,
uint trghndltyp,
out ushort attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetInt32 (IntPtr trgthndlp,
uint trghndltyp,
out int attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci")]
public static extern int OCIErrorGet (IntPtr hndlp,
uint recordno,
@@ -178,10 +178,7 @@ namespace System.Data.OracleClient
public void Close ()
{
if (transaction != null)
transaction.Rollback ();
oci.Disconnect ();
oci.Disconnect();
state = ConnectionState.Closed;
}
@@ -267,7 +267,8 @@ namespace System.Data.OracleClient {
public string GetName (int i)
{
return statement.GetParameter (i).GetName ();
OciColumnInfo columnInfo = statement.DescribeColumn (i);
return columnInfo.ColumnName;
}
[MonoTODO]
@@ -282,11 +283,10 @@ namespace System.Data.OracleClient {
throw new NotImplementedException ();
}
[MonoTODO]
public OracleLob GetOracleLob (int i)
{
OracleLob output = ((OciDefineHandle) statement.Values [i]).GetOracleLob ();
output.connection = command.Connection;
return output;
throw new NotImplementedException ();
}
public OracleNumber GetOracleNumber (int i)
@@ -314,19 +314,18 @@ namespace System.Data.OracleClient {
for (int i = 0; i < statement.ColumnCount; i += 1) {
DataRow row = schemaTable.NewRow ();
OciColumnInfo columnInfo = statement.DescribeColumn (i);
OciParameterDescriptor parameter = statement.GetParameter (i);
row ["ColumnName"] = parameter.GetName ();
row ["ColumnOrdinal"] = i + 1;
row ["ColumnSize"] = parameter.GetDataSize ();
row ["NumericPrecision"] = parameter.GetPrecision ();
row ["NumericScale"] = parameter.GetScale ();
row ["ColumnName"] = columnInfo.ColumnName;
row ["ColumnOrdinal"] = i + 1;
row ["ColumnSize"] = (int) columnInfo.ColumnSize;
row ["NumericPrecision"] = (short) columnInfo.Precision;
row ["NumericScale"] = (short) columnInfo.Scale;
// FIXME: "DataType" need to implement
//row ["DataType"] = OciGlue.OciDataTypeToDbType (columnInfo.DataType);
row ["DataType"] = typeof(string);
row ["AllowDBNull"] = parameter.GetIsNull ();
row ["BaseColumnName"] = parameter.GetName ();
row ["DataType"] = typeof(string);
row ["AllowDBNull"] = columnInfo.AllowDBNull;
row ["BaseColumnName"] = columnInfo.BaseColumnName;
schemaTable.Rows.Add (row);
}
@@ -15,10 +15,9 @@
//
using System;
using System.IO;
using System.Data.OracleClient.Oci;
using System.Data.SqlTypes;
using System.IO;
using System.Text;
namespace System.Data.OracleClient {
public sealed class OracleLob : Stream, ICloneable, INullable
@@ -27,15 +26,11 @@ namespace System.Data.OracleClient {
public static readonly new OracleLob Null = new OracleLob ();
internal OracleConnection connection;
OracleConnection connection;
bool isBatched = false;
bool isOpen = true;
bool notNull = false;
OciLobLocator locator;
OracleType type;
long length = -1;
long position = 1;
#endregion // Fields
@@ -45,19 +40,10 @@ namespace System.Data.OracleClient {
{
}
internal OracleLob (OciLobLocator locator, OciDataType ociType)
internal OracleLob (OciLobLocator locator)
{
notNull = true;
this.locator = locator;
switch (ociType) {
case OciDataType.Blob:
type = OracleType.Blob;
break;
case OciDataType.Clob:
type = OracleType.Clob;
break;
}
}
#endregion // Constructors
@@ -79,9 +65,11 @@ namespace System.Data.OracleClient {
public int ChunkSize {
[MonoTODO]
get {
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
return locator.GetChunkSize ();
if (Connection.State == ConnectionState.Closed)
throw new InvalidOperationException ();
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
throw new InvalidOperationException ();
}
}
@@ -99,55 +87,60 @@ namespace System.Data.OracleClient {
public bool IsTemporary {
get {
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
if (Connection.State == ConnectionState.Closed)
throw new InvalidOperationException ();
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
throw new NotImplementedException ();
}
}
public override long Length {
[MonoTODO]
get {
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
if (length >= 0)
return length;
return locator.GetLength (LobType == OracleType.Blob);
if (Connection.State == ConnectionState.Closed)
throw new InvalidOperationException ();
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
throw new NotImplementedException ();
}
}
public OracleType LobType {
get { return type; }
[MonoTODO]
get {
throw new NotImplementedException ();
}
}
internal OciLobLocator Locator {
get { return locator; }
}
public override long Position {
[MonoTODO]
get {
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
return position;
if (Connection.State == ConnectionState.Closed)
throw new InvalidOperationException ();
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
throw new NotImplementedException ();
}
[MonoTODO]
set {
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
position = value;
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
if (value > Length)
throw new ArgumentOutOfRangeException ();
throw new NotImplementedException ();
}
}
public object Value {
[MonoTODO]
get {
AssertObjectNotDisposed ();
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
if (IsNull)
return DBNull.Value;
byte[] buffer = new byte [Length];
Read (buffer, 1, (int) Length);
if (LobType == OracleType.Clob)
return (new UnicodeEncoding ()).GetString (buffer);
return buffer;
throw new NotImplementedException ();
}
}
@@ -165,49 +158,14 @@ namespace System.Data.OracleClient {
throw new NotImplementedException ();
}
void AssertAmountIsEven (long amount, string argName)
{
if (amount % 2 == 1)
throw new ArgumentOutOfRangeException ("CLOB and NCLOB parameters require even number of bytes for this argument.");
}
void AssertAmountIsValid (long amount, string argName)
{
if (amount > UInt32.MaxValue)
throw new ArgumentOutOfRangeException ("Argument too big.");
if (LobType == OracleType.Clob || LobType == OracleType.NClob)
AssertAmountIsEven (amount, argName);
}
void AssertConnectionIsOpen ()
{
if (connection.State == ConnectionState.Closed)
throw new InvalidOperationException ("Invalid operation. The connection is closed.");
}
void AssertObjectNotDisposed ()
{
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
}
void AssertTransactionExists ()
{
if (connection.Transaction == null)
throw new InvalidOperationException ("Modifying a LOB requires that the connection be transacted.");
}
public void BeginBatch ()
{
BeginBatch (OracleLobOpenMode.ReadOnly);
}
[MonoTODO]
public void BeginBatch (OracleLobOpenMode mode)
{
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
locator.BeginBatch (mode);
isBatched = true;
}
@@ -220,32 +178,25 @@ namespace System.Data.OracleClient {
[MonoTODO]
public override void Close ()
{
locator.Dispose ();
isOpen = false;
throw new NotImplementedException ();
}
[MonoTODO]
public long CopyTo (OracleLob destination)
{
return CopyTo (0, destination, 0, Length);
throw new NotImplementedException ();
}
[MonoTODO]
public long CopyTo (OracleLob destination, long destinationOffset)
{
return CopyTo (0, destination, destinationOffset, Length);
throw new NotImplementedException ();
}
[MonoTODO]
public long CopyTo (long sourceOffset, OracleLob destination, long destinationOffset, long amount)
{
if (destination.IsNull)
throw new ArgumentNullException ();
AssertAmountIsValid (sourceOffset, "sourceOffset");
AssertAmountIsValid (destinationOffset, "destinationOffset");
AssertAmountIsValid (amount, "amount");
AssertTransactionExists ();
AssertConnectionIsOpen ();
return (long) locator.Copy (destination.Locator, (uint) amount, (uint) destinationOffset + 1, (uint) sourceOffset + 1);
throw new NotImplementedException ();
}
[MonoTODO]
@@ -254,116 +205,51 @@ namespace System.Data.OracleClient {
throw new NotImplementedException ();
}
[MonoTODO]
public void EndBatch ()
{
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
locator.EndBatch ();
isBatched = false;
}
[MonoTODO]
public long Erase ()
{
return Erase (1, Length);
throw new NotImplementedException ();
}
public long Erase (long offset, long amount)
{
if (offset < 0 || amount < 0)
throw new ArgumentOutOfRangeException ("Must be a positive value.");
if (offset + amount > Length)
throw new ArgumentOutOfRangeException ();
AssertAmountIsValid (offset, "offset");
AssertAmountIsValid (amount, "amount");
return (long) locator.Erase ((uint) offset + 1, (uint) amount);
throw new NotImplementedException ();
}
[MonoTODO]
public override void Flush ()
{
// No-op
throw new NotImplementedException ();
}
[MonoTODO]
public override int Read (byte[] buffer, int offset, int count)
{
if (buffer == null)
throw new ArgumentNullException ();
AssertAmountIsValid (offset, "offset");
AssertAmountIsValid (count, "count");
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
int bytesRead;
byte[] output = new byte[count];
bytesRead = locator.Read (output, (uint) Position, (uint) count, LobType == OracleType.Blob);
output.CopyTo (buffer, offset);
position += bytesRead;
return bytesRead;
throw new NotImplementedException ();
}
[MonoTODO]
public override long Seek (long offset, SeekOrigin origin)
{
long newPosition = position;
switch (origin) {
case SeekOrigin.Begin:
newPosition = offset;
break;
case SeekOrigin.Current:
newPosition += offset;
break;
case SeekOrigin.End:
newPosition = Length - offset;
break;
}
if (newPosition > Length)
throw new ArgumentOutOfRangeException ();
position = newPosition;
return position;
throw new NotImplementedException ();
}
[MonoTODO]
public override void SetLength (long value)
{
AssertAmountIsValid (value, "value");
AssertTransactionExists ();
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
locator.Trim ((uint) value);
length = value;
throw new InvalidOperationException ();
}
[MonoTODO]
public override void Write (byte[] buffer, int offset, int count)
{
if (buffer == null)
throw new ArgumentNullException ("Buffer is null.");
if (offset < 0 || count < 0)
throw new ArgumentOutOfRangeException ("Must be a positive value.");
if (offset + count > buffer.Length)
throw new ArgumentOutOfRangeException ("The offset and count values specified exceed the buffer provided.");
AssertAmountIsValid (offset, "offset");
AssertAmountIsValid (count, "count");
AssertTransactionExists ();
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
byte[] value = null;
if (offset + count == buffer.Length && offset == 0)
value = buffer;
else {
value = new byte[count];
Array.Copy (buffer, offset, value, 0, count);
}
position += locator.Write (value, (uint) offset, (uint) value.Length, LobType);
throw new NotSupportedException ();
}
#endregion // Methods
@@ -40,9 +40,8 @@ namespace System.Data.OracleClient {
}
public OracleMonthSpan (OracleMonthSpan from)
: this (from)
{
this.notNull = from.notNull;
this.value = from.value;
}
public OracleMonthSpan (int years, int months)
@@ -58,11 +57,10 @@ namespace System.Data.OracleClient {
get { return !notNull; }
}
public int Value {
public byte[] Value {
get {
if (IsNull)
throw new Exception ("Data is null.");
return value;
}
}
@@ -100,35 +98,35 @@ namespace System.Data.OracleClient {
{
if (x.IsNull || y.IsNull)
return OracleBoolean.Null;
return (x.value > y.value);
return (x.Value > y.Value);
}
public static OracleBoolean GreaterThanOrEqual (OracleMonthSpan x, OracleMonthSpan y)
{
if (x.IsNull || y.IsNull)
return OracleBoolean.Null;
return (x.value >= y.value);
return (x.Value >= y.Value);
}
public static OracleBoolean LessThan (OracleMonthSpan x, OracleMonthSpan y)
{
if (x.IsNull || y.IsNull)
return OracleBoolean.Null;
return (x.value < y.value);
return (x.Value < y.Value);
}
public static OracleBoolean LessThanOrEqual (OracleMonthSpan x, OracleMonthSpan y)
{
if (x.IsNull || y.IsNull)
return OracleBoolean.Null;
return (x.value <= y.value);
return (x.Value <= y.Value);
}
public static OracleBoolean NotEquals (OracleMonthSpan x, OracleMonthSpan y)
{
if (x.IsNull || y.IsNull)
return OracleBoolean.Null;
return (x.value != y.value);
return (x.Value != y.Value);
}
public static OracleMonthSpan Parse (string s)
@@ -179,7 +177,7 @@ namespace System.Data.OracleClient {
public static explicit operator int (OracleMonthSpan x)
{
return x.value;
return x.Value;
}
public static explicit operator OracleMonthSpan (string s)
@@ -28,7 +28,6 @@ namespace System.Data.OracleClient {
string name;
OracleType oracleType = OracleType.VarChar;
OciDataType ociType;
int size;
ParameterDirection direction;
bool isNullable;
@@ -55,6 +54,7 @@ namespace System.Data.OracleClient {
public OracleParameter (string name, object value)
{
bindHandle = new OciBindHandle (name);
this.name = name;
this.value = value;
SourceVersion = DataRowVersion.Current;
@@ -78,6 +78,7 @@ namespace System.Data.OracleClient {
public OracleParameter (string name, OracleType dataType, int size, ParameterDirection direction, bool isNullable, byte precision, byte scale, string srcColumn, DataRowVersion srcVersion, object value)
{
bindHandle = new OciBindHandle (name);
this.name = name;
this.size = size;
this.value = value;
@@ -123,8 +124,8 @@ namespace System.Data.OracleClient {
}
public string ParameterName {
get { return name; }
set { name = value; }
get { return bindHandle.Name; }
set { bindHandle.Name = value; }
}
public byte Precision {
@@ -166,7 +167,7 @@ namespace System.Data.OracleClient {
internal void Bind (OciStatementHandle handle)
{
bindHandle = handle.GetBindHandle (ParameterName, value, ociType);
bindHandle.Bind (handle, value);
}
[MonoTODO]
@@ -224,61 +225,61 @@ namespace System.Data.OracleClient {
switch (type) {
case DbType.AnsiString:
oracleType = OracleType.VarChar;
ociType = OciDataType.VarChar;
bindHandle.Type = OciDataType.VarChar;
break;
case DbType.AnsiStringFixedLength:
oracleType = OracleType.Char;
ociType = OciDataType.Char;
bindHandle.Type = OciDataType.Char;
break;
case DbType.Binary:
case DbType.Guid:
oracleType = OracleType.Raw;
ociType = OciDataType.Raw;
bindHandle.Type = OciDataType.Raw;
break;
case DbType.Boolean:
case DbType.Byte:
oracleType = OracleType.Byte;
ociType = OciDataType.Integer;
bindHandle.Type = OciDataType.Integer;
break;
case DbType.Currency:
case DbType.Decimal:
case DbType.Int64:
oracleType = OracleType.Number;
ociType = OciDataType.Number;
bindHandle.Type = OciDataType.Number;
break;
case DbType.Date:
case DbType.DateTime:
case DbType.Time:
oracleType = OracleType.DateTime;
ociType = OciDataType.Char;
bindHandle.Type = OciDataType.Char;
break;
case DbType.Double:
oracleType = OracleType.Double;
ociType = OciDataType.Float;
bindHandle.Type = OciDataType.Float;
break;
case DbType.Int16:
oracleType = OracleType.Int16;
ociType = OciDataType.Integer;
bindHandle.Type = OciDataType.Integer;
break;
case DbType.Int32:
oracleType = OracleType.Int32;
ociType = OciDataType.Integer;
bindHandle.Type = OciDataType.Integer;
break;
case DbType.Object:
oracleType = OracleType.Blob;
ociType = OciDataType.Blob;
bindHandle.Type = OciDataType.Blob;
break;
case DbType.Single:
oracleType = OracleType.Float;
ociType = OciDataType.Float;
bindHandle.Type = OciDataType.Float;
break;
case DbType.String:
oracleType = OracleType.NVarChar;
ociType = OciDataType.VarChar;
bindHandle.Type = OciDataType.VarChar;
break;
case DbType.StringFixedLength:
oracleType = OracleType.NChar;
ociType = OciDataType.Char;
bindHandle.Type = OciDataType.Char;
break;
default:
throw new ArgumentException (exception);
@@ -296,76 +297,76 @@ namespace System.Data.OracleClient {
case OracleType.LongRaw:
case OracleType.Raw:
dbType = DbType.Binary;
ociType = OciDataType.Raw;
bindHandle.Type = OciDataType.Raw;
break;
case OracleType.Byte:
dbType = DbType.Byte;
ociType = OciDataType.Integer;
bindHandle.Type = OciDataType.Integer;
break;
case OracleType.Char:
dbType = DbType.AnsiStringFixedLength;
ociType = OciDataType.Char;
bindHandle.Type = OciDataType.Char;
break;
case OracleType.Clob:
case OracleType.LongVarChar:
case OracleType.RowId:
case OracleType.VarChar:
dbType = DbType.AnsiString;
ociType = OciDataType.VarChar;
bindHandle.Type = OciDataType.VarChar;
break;
case OracleType.Cursor:
case OracleType.IntervalDayToSecond:
dbType = DbType.Object;
ociType = OciDataType.Blob;
bindHandle.Type = OciDataType.Blob;
break;
case OracleType.DateTime:
case OracleType.Timestamp:
case OracleType.TimestampLocal:
case OracleType.TimestampWithTZ:
dbType = DbType.DateTime;
ociType = OciDataType.Char;
bindHandle.Type = OciDataType.Char;
break;
case OracleType.Double:
dbType = DbType.Double;
ociType = OciDataType.Float;
bindHandle.Type = OciDataType.Float;
break;
case OracleType.Float:
dbType = DbType.Single;
ociType = OciDataType.Float;
bindHandle.Type = OciDataType.Float;
break;
case OracleType.Int16:
dbType = DbType.Int16;
ociType = OciDataType.Integer;
bindHandle.Type = OciDataType.Integer;
break;
case OracleType.Int32:
case OracleType.IntervalYearToMonth:
dbType = DbType.Int32;
ociType = OciDataType.Integer;
bindHandle.Type = OciDataType.Integer;
break;
case OracleType.NChar:
dbType = DbType.StringFixedLength;
ociType = OciDataType.Char;
bindHandle.Type = OciDataType.Char;
break;
case OracleType.NClob:
case OracleType.NVarChar:
dbType = DbType.String;
ociType = OciDataType.VarChar;
bindHandle.Type = OciDataType.VarChar;
break;
case OracleType.Number:
dbType = DbType.VarNumeric;
ociType = OciDataType.Number;
bindHandle.Type = OciDataType.Number;
break;
case OracleType.SByte:
dbType = DbType.SByte;
ociType = OciDataType.Integer;
bindHandle.Type = OciDataType.Integer;
break;
case OracleType.UInt16:
dbType = DbType.UInt16;
ociType = OciDataType.Integer;
bindHandle.Type = OciDataType.Integer;
break;
case OracleType.UInt32:
dbType = DbType.UInt32;
ociType = OciDataType.Integer;
bindHandle.Type = OciDataType.Integer;
break;
default:
throw new ArgumentException (exception);
@@ -21,11 +21,9 @@
// 3 new rows where ENAME being: 'conn3', 'conn9', and 'conn1'
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Data;
using System.Data.OracleClient;
using System.Text;
namespace Test.OracleClient
{
@@ -278,58 +276,23 @@ namespace Test.OracleClient
OracleCommand insert = connection.CreateCommand ();
insert.Transaction = transaction;
insert.CommandText = "INSERT INTO LOBTEST VALUES (EMPTY_CLOB())";
insert.CommandText = "INSERT INTO LOBTEST VALUES ('1234')";
insert.ExecuteNonQuery ();
OracleCommand select = connection.CreateCommand ();
select.Transaction = transaction;
select.CommandText = "SELECT CLOB_COLUMN FROM LOBTEST FOR UPDATE";
select.CommandText = "SELECT CLOB_COLUMN FROM LOBTEST";
Console.WriteLine ("SELECTING A CLOB (CHARACTER) VALUE FROM CLOBTEST");
OracleDataReader reader = select.ExecuteReader ();
if (!reader.Read ())
Console.WriteLine ("ERROR: RECORD NOT FOUND");
Console.WriteLine ("TESTING OracleLob OBJECT ...");
OracleLob lob = reader.GetOracleLob (0);
Console.WriteLine ("LENGTH: {0}", lob.Length);
Console.WriteLine ("CHUNK SIZE: {0}", lob.ChunkSize);
//Console.WriteLine ("ABOUT TO READ VALUE ... SHOULD BE ''");
UnicodeEncoding encoding = new UnicodeEncoding ();
byte[] value = new byte [lob.Length * 2];
//lob.Read (value, 0, (int) lob.Length * 2);
//Console.WriteLine ("VALUE: {0}", encoding.GetString (value));
Console.WriteLine ("CURRENT POSITION: {0}", lob.Position);
Console.WriteLine ("UPDATING VALUE TO 'TEST ME!'");
value = encoding.GetBytes ("TEST ME!");
lob.Write (value, 0, value.Length);
Console.WriteLine ("CURRENT POSITION: {0}", lob.Position);
Console.WriteLine ("RE-READ VALUE...");
lob.Seek (1, SeekOrigin.Begin);
Console.WriteLine ("CURRENT POSITION: {0}", lob.Position);
value = new byte [lob.Length * 2];
lob.Read (value, 0, value.Length);
Console.WriteLine ("VALUE: {0}", encoding.GetString (value));
Console.WriteLine ("CURRENT POSITION: {0}", lob.Position);
Console.WriteLine ("CLOSE OracleLob...");
lob.Close ();
Console.WriteLine ("CLOSING READER...");
reader.Close ();
transaction.Commit ();
Console.WriteLine ("DROP TABLE...");
OracleCommand command = connection.CreateCommand ();
command.CommandText = "DROP TABLE LOBTEST";
command.ExecuteNonQuery ();
Console.WriteLine ("ROLLBACK TRANSACTION ...");
transaction.Rollback ();
}
static void Wait(string msg)
@@ -382,7 +345,6 @@ namespace Test.OracleClient
Console.WriteLine ("LOB Test BEGIN...");
LOBTest (con1);
Console.WriteLine ("LOB Test END.");
Wait ("Press enter to continue ...");
Console.WriteLine ("Read Simple Test BEGIN...");
ReadSimpleTest(con1);
+3 -1
View File
@@ -1,9 +1,12 @@
System.Data.OracleClient.Oci/IOciHandle.cs
System.Data.OracleClient.Oci/IOciDescriptorHandle.cs
System.Data.OracleClient.Oci/OciAttributeType.cs
System.Data.OracleClient.Oci/OciBindHandle.cs
System.Data.OracleClient.Oci/OciColumnInfo.cs
System.Data.OracleClient.Oci/OciCredentialType.cs
System.Data.OracleClient.Oci/OciDataType.cs
System.Data.OracleClient.Oci/OciDefineHandle.cs
System.Data.OracleClient.Oci/OciDescriptorType.cs
System.Data.OracleClient.Oci/OciDescriptorHandle.cs
System.Data.OracleClient.Oci/OciEnvironmentHandle.cs
System.Data.OracleClient.Oci/OciEnvironmentMode.cs
@@ -14,7 +17,6 @@ System.Data.OracleClient.Oci/OciHandle.cs
System.Data.OracleClient.Oci/OciHandleType.cs
System.Data.OracleClient.Oci/OciLobLocator.cs
System.Data.OracleClient.Oci/OciLobType.cs
System.Data.OracleClient.Oci/OciParameterDescriptor.cs
System.Data.OracleClient.Oci/OciPointerType.cs
System.Data.OracleClient.Oci/OciServerHandle.cs
System.Data.OracleClient.Oci/OciServiceHandle.cs
@@ -1,26 +1,3 @@
2003-02-28 Aleksey Demakov <[email protected]>
* DbDataAdapter.cs: Update (DataSet) updates the default
table only.
2003-02-25 Alan Tam <[email protected]>
* DbDataAdapter.cs: Added support for filling when schema is present.
Fixed incorrect behavior when ColumnMapping is present
when more than one fields have the same name. Implemented Dispose.
Fixed error when there is no ColumnMapping at all.
Still have some problems in finding the correct TableMapping
because the SourceTable name is not present in BuildSchema
2003-02-24 Aleksey Demakov <[email protected]>
* DbDataAdapter.cs: The original code might pass a null DataTableMapping
value which is then used to create a RowUpdatingEventArgs
instance. So RowUpdatingEvent handler (for instance
CommandBuilder) could get null DataTableMapping which
might be unexpected. The patch makes sure that a non-null
DataTableMapping is passed.
2003-01-26 Gonzalo Paniagua Javier <[email protected]>
* DbEnumerator.cs: why does the runtime throw an invalid cast here? The
@@ -74,14 +74,9 @@ namespace System.Data.Common {
return args;
}
[MonoTODO]
protected override void Dispose (bool disposing)
{
if (disposing) {
((IDbDataAdapter) this).SelectCommand = null;
((IDbDataAdapter) this).InsertCommand = null;
((IDbDataAdapter) this).UpdateCommand = null;
((IDbDataAdapter) this).DeleteCommand = null;
}
}
public override int Fill (DataSet dataSet)
@@ -102,6 +97,7 @@ namespace System.Data.Common {
return Fill (dataSet, 0, 0, srcTable, SelectCommand, CommandBehavior.Default);
}
[MonoTODO ("Support filling after we have already filled.")]
protected virtual int Fill (DataTable dataTable, IDataReader dataReader)
{
int count = 0;
@@ -140,6 +136,7 @@ namespace System.Data.Common {
return this.Fill (dataSet, startRecord, maxRecords, srcTable, SelectCommand, CommandBehavior.Default);
}
[MonoTODO ("Support filling after we have already filled.")]
protected virtual int Fill (DataSet dataSet, string srcTable, IDataReader dataReader, int startRecord, int maxRecords)
{
if (startRecord < 0)
@@ -294,31 +291,30 @@ namespace System.Data.Common {
[MonoTODO ("Test")]
private void BuildSchema (IDataReader reader, DataTable table, SchemaType schemaType)
{
ArrayList primaryKey = new ArrayList ();
ArrayList sourceColumns = new ArrayList ();
string sourceColumnName;
string sourceTableName;
string dsColumnName;
ArrayList primaryKey = new ArrayList ();
table.Columns.Clear ();
foreach (DataRow schemaRow in reader.GetSchemaTable ().Rows) {
string sourceTableName;
if (schemaRow ["BaseTableName"].Equals (DBNull.Value))
sourceTableName = table.TableName;
else
sourceTableName = (string) schemaRow ["BaseTableName"];
// generate a unique column name in the source table.
string sourceColumnName;
// generate a unique column name in the dataset table.
if (schemaRow ["BaseColumnName"].Equals (DBNull.Value))
sourceColumnName = DefaultSourceColumnName;
else
sourceColumnName = (string) schemaRow ["BaseColumnName"];
string realSourceColumnName = sourceColumnName;
dsColumnName = sourceColumnName;
for (int i = 1; sourceColumns.Contains (realSourceColumnName); i += 1)
realSourceColumnName = String.Format ("{0}{1}", sourceColumnName, i);
sourceColumns.Add(realSourceColumnName);
for (int i = 1; table.Columns.Contains (dsColumnName); i += 1)
dsColumnName = String.Format ("{0}{1}", sourceColumnName, i);
if (schemaRow ["BaseTableName"].Equals (DBNull.Value))
sourceTableName = table.TableName;
else
sourceTableName = (string) schemaRow ["BaseTableName"];
// generate DataSetColumnName from DataTableMapping, if any
string dsColumnName = realSourceColumnName;
DataTableMapping tableMapping = null;
if (schemaType == SchemaType.Mapped)
tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (TableMappings, sourceTableName, table.TableName, MissingMappingAction.Ignore);
@@ -326,9 +322,7 @@ namespace System.Data.Common {
table.TableName = tableMapping.DataSetTable;
// check to see if the column mapping exists
if (tableMapping.ColumnMappings.Contains (dsColumnName)) {
dsColumnName = tableMapping.ColumnMappings [realSourceColumnName].DataSetColumn;
} else {
if (tableMapping.ColumnMappings.IndexOfDataSetColumn (dsColumnName) < 0) {
if (MissingSchemaAction == MissingSchemaAction.Error)
throw new SystemException ();
tableMapping.ColumnMappings.Add (sourceColumnName, dsColumnName);
@@ -337,8 +331,8 @@ namespace System.Data.Common {
TableMappings.Add (tableMapping);
}
if (!table.Columns.Contains(dsColumnName))
table.Columns.Add (dsColumnName, (Type) schemaRow ["DataType"]);
table.Columns.Add (dsColumnName, (Type) schemaRow ["DataType"]);
if (!schemaRow["IsKey"].Equals (DBNull.Value))
if ((bool) (schemaRow ["IsKey"]))
@@ -362,7 +356,10 @@ namespace System.Data.Common {
public override int Update (DataSet dataSet)
{
return Update (dataSet, DefaultSourceTableName);
int result = 0;
foreach (DataTable table in dataSet.Tables)
result += Update (table);
return result;
}
public int Update (DataTable dataTable)
@@ -430,9 +427,7 @@ namespace System.Data.Common {
DataColumnMappingCollection columnMappings = tableMapping.ColumnMappings;
foreach (IDataParameter parameter in command.Parameters) {
string dsColumnName = parameter.SourceColumn;
DataColumnMapping mapping = columnMappings [parameter.SourceColumn];
if (mapping != null) dsColumnName = mapping.DataSetColumn;
string dsColumnName = columnMappings [parameter.SourceColumn].DataSetColumn;
DataRowVersion rowVersion = DataRowVersion.Proposed;
// Parameter version is ignored for non-update commands
@@ -452,16 +447,11 @@ namespace System.Data.Common {
public int Update (DataSet dataSet, string sourceTable)
{
MissingMappingAction mappingAction = MissingMappingAction;
if (mappingAction == MissingMappingAction.Ignore)
mappingAction = MissingMappingAction.Error;
DataTableMapping tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (TableMappings, sourceTable, sourceTable, mappingAction);
DataTable dataTable = dataSet.Tables[tableMapping.DataSetTable];
if (dataTable == null)
throw new ArgumentException ("sourceTable");
return Update (dataTable, tableMapping);
int result = 0;
DataTableMapping tableMapping = TableMappings [sourceTable];
foreach (DataTable dataTable in dataSet.Tables)
result += Update (dataTable, tableMapping);
return result;
}
protected virtual void OnFillError (FillErrorEventArgs value)
@@ -1,7 +1,3 @@
2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* SqlException.cs: implemented GetObjectData ().
2003-02-16 Daniel Morgan <[email protected]>
* ChangeLog: added this file
@@ -99,13 +99,10 @@ namespace System.Data.SqlClient {
return new SqlException (e.Class, e.LineNumber, e.Message, e.Number, e.Procedure, e.Server, "Mono SqlClient Data Provider", e.State);
}
[MonoTODO ("Determine how to serialize this class.")]
public override void GetObjectData (SerializationInfo si, StreamingContext context)
{
if (si == null)
throw new ArgumentNullException ("si");
si.AddValue ("errors", errors);
base.GetObjectData (si, context);
throw new NotImplementedException ();
}
#endregion // Methods
@@ -1,31 +1,3 @@
2003-02-28 Ville Palo <[email protected]>
* ExpressionElement.cs: More implementation.
2003-02-28 Alan Tam <[email protected]>
* DataSet.cs: Changed WriteTable so that it now calls the newly written
WriteObjectXml to direct the call to the respective XmlConvert method.
This fixes the wrong format written to XML files of bool, float,
double, DateTime and TimeSpan types.
2003-02-25 Alan Tam <[email protected]>
* DataRelation.cs: Added SetDataSet for DataSetRelationCollection to use.
* DataRelationCollection.cs: Implemented AddRange and Contains.
Implemented AddRange, Clear, List and RemoveCore for DataSetRelationColletion.
Implemented AddCore, List and RemoveCore for DataTableRelationCollection.
Reimplemented most Add methods to eliminate duplicated checks.
Centralized RelationName generation procedure in GetNextDefaultRelationName.
2003-02-25 Alan Tam <[email protected]>
* DataColumn.cs: Fixed wrong storage representation of Expression
(using empty string instead of null) so that ToString() returns nothing.
* DataColumnCollection.cs: Reimplemented GetNextDefaultColumnName so that
auto column naming now works as expected. Reimplemented some Add methods
to eliminate code duplication.
2003-02-19 Ville Palo <[email protected]>
* DataTable.cs: DataTable.CaseSensitive follows parent
@@ -56,7 +56,7 @@ namespace System.Data {
private string _columnName = null;
private Type _dataType = Type.GetType ("System.String");
private object _defaultValue = DBNull.Value;
private string expression = null;
private string expression = "";
private PropertyCollection _extendedProperties = new PropertyCollection ();
private int maxLength = -1; //-1 represents no length limit
private string nameSpace = "";
@@ -168,7 +168,7 @@ namespace System.Data {
if(value == true)
{
//Can't be true if this is a computed column
if (Expression != null)
if(!Expression.Equals(String.Empty))
{
throw new ArgumentException("Can not Auto Increment a computed column.");
}
@@ -21,12 +21,16 @@ namespace System.Data {
[DefaultEvent ("CollectionChanged")]
public class DataColumnCollection : InternalDataCollectionBase
{
// The defaultNameIndex is used to create a default name for a column if one wasn't given.
private int defaultNameIndex;
//table should be the DataTable this DataColumnCollection belongs to.
private DataTable parentTable = null;
// Internal Constructor. This Class can only be created from other classes in this assembly.
internal DataColumnCollection(DataTable table):base()
{
defaultNameIndex = 1;
parentTable = table;
}
@@ -101,10 +105,8 @@ namespace System.Data {
private string GetNextDefaultColumnName ()
{
string defColumnName = "Column";
for (int index = 1; Contains (defColumnName); ++index) {
defColumnName = "Column" + index;
}
string defColumnName = "Column" + defaultNameIndex.ToString();
defaultNameIndex++;
return defColumnName;
}
@@ -114,32 +116,37 @@ namespace System.Data {
/// <param name="column">The DataColumn to add.</param>
[MonoTODO]
public void Add(DataColumn column)
{
if (column.ColumnName.Equals(String.Empty))
{
column.ColumnName = GetNextDefaultColumnName ();
}
else if (Contains(column.ColumnName))
{
if(column.ColumnName.Equals(String.Empty)) {
column.ColumnName = GetNextDefaultColumnName ();
}
//FIXME:
if(Contains(column.ColumnName))
{
throw new DuplicateNameException("A column named " + column.ColumnName + " already belongs to this DataTable.");
}
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
column.SetTable (parentTable);
int ordinal = base.List.Add(column);
column.SetOrdinal (ordinal);
//add constraints if neccesary
if (column.Unique)
else
{
UniqueConstraint uc = new UniqueConstraint(column);
parentTable.Constraints.Add(uc);
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
column.SetTable( parentTable);
int ordinal = base.List.Add(column);
column.SetOrdinal (ordinal);
//add constraints if neccesary
if(column.Unique)
{
UniqueConstraint uc = new UniqueConstraint(column);
parentTable.Constraints.Add(uc);
}
//TODO: add missing constraints. i.e. Primary/Foreign keys
OnCollectionChanged(e);
return;
}
//TODO: add missing constraints. i.e. Primary/Foreign keys
OnCollectionChanged (e);
}
/// <summary>
@@ -149,14 +156,29 @@ namespace System.Data {
/// <returns>The newly created DataColumn.</returns>
public virtual DataColumn Add(string columnName)
{
//FIXME: this wont work. If the user decides to add a column named
//"ColumnXX" where XX is a number these two will conflict.
if (columnName == null || columnName == String.Empty)
{
columnName = GetNextDefaultColumnName ();
}
DataColumn column = new DataColumn(columnName);
Add (column);
return column;
if(Contains(columnName))
{
throw new DuplicateNameException("A column named " + columnName + " already belongs to this DataTable.");
}
else
{
DataColumn column = new DataColumn(columnName);
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
column.SetTable(parentTable);
int ordinal = base.List.Add(column);
column.SetOrdinal( ordinal );
OnCollectionChanged(e);
return column;
}
}
/// <summary>
@@ -169,12 +191,25 @@ namespace System.Data {
{
if (columnName == null || columnName == "")
{
//FIXME: this wont work. If the user decides to add a column named
//"ColumnXX" where XX is a number these two will conflict.
columnName = GetNextDefaultColumnName ();
}
DataColumn column = new DataColumn(columnName, type);
Add (column);
return column;
if(Contains(columnName))
{
throw new DuplicateNameException("A column named " + columnName + " already belongs to this DataTable.");
}
else
{
DataColumn column = new DataColumn(columnName, type);
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
column.SetTable(parentTable);
int ordinal = base.List.Add(column);
column.SetOrdinal( ordinal );
OnCollectionChanged(e);
return column;
}
}
/// <summary>
@@ -184,16 +219,28 @@ namespace System.Data {
/// <param name="type">The DataType of the new column.</param>
/// <param name="expression">The expression to assign to the Expression property.</param>
/// <returns>The newly created DataColumn.</returns>
public virtual DataColumn Add(string columnName, Type type, string expression)
public virtual DataColumn Add(string columnName, Type type, string expression)
{
//FIXME: See Add Logic
if (columnName == null || columnName == "")
{
columnName = GetNextDefaultColumnName ();
}
DataColumn column = new DataColumn(columnName, type, expression);
Add (column);
return column;
if(Contains(columnName))
{
throw new DuplicateNameException("A column named " + columnName + " already belongs to this DataTable.");
}
else
{
DataColumn column = new DataColumn(columnName, type, expression);
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
column.SetTable(parentTable);
int ordinal = base.List.Add(column);
column.SetOrdinal( ordinal );
OnCollectionChanged(e);
return column;
}
}
/// <summary>
@@ -160,10 +160,6 @@ namespace System.Data
parentKeyConstraint = uniqueConstraint;
}
internal void SetDataSet(DataSet ds) {
dataSet = ds;
}
public virtual DataTable ParentTable {
get {
return parentColumns[0].Table;
@@ -55,6 +55,7 @@ namespace System.Data {
/// <summary>
/// Gets the DataRelation object at the specified index.
/// </summary>
[MonoTODO]
public override DataRelation this [int index]
{
get {
@@ -71,13 +72,13 @@ namespace System.Data {
/// Performs verification on the table.
/// </summary>
/// <param name="relation">The relation to check.</param>
[MonoTODO]
protected override void AddCore (DataRelation relation)
{
base.AddCore (relation);
if (relation.ChildTable.DataSet != this.dataSet || relation.ParentTable.DataSet != this.dataSet)
throw new DataException ();
List.Add (relation);
relation.SetDataSet (dataSet);
relation.ParentTable.ChildRelations.Add (relation);
relation.ChildTable.ParentRelations.Add (relation);
ForeignKeyConstraint foreignKeyConstraint = null;
@@ -107,33 +108,6 @@ namespace System.Data {
relation.SetParentKeyConstraint (uniqueConstraint);
relation.SetChildKeyConstraint (foreignKeyConstraint);
}
public override void AddRange (DataRelation[] relations)
{
base.AddRange (relations);
}
public override void Clear ()
{
base.Clear ();
}
protected override void RemoveCore (DataRelation relation)
{
base.RemoveCore (relation);
relation.SetDataSet (null);
relation.ParentTable.ChildRelations.Remove (relation);
relation.ChildTable.ParentRelations.Remove (relation);
ForeignKeyConstraint foreignKeyConstraint = null;
relation.SetParentKeyConstraint (null);
relation.SetChildKeyConstraint (null);
}
protected override ArrayList List {
get {
return base.List;
}
}
}
/// <summary>
@@ -166,6 +140,7 @@ namespace System.Data {
/// <summary>
/// Gets the DataRelation object at the specified index.
/// </summary>
[MonoTODO]
public override DataRelation this [int index]
{
get {
@@ -177,34 +152,6 @@ namespace System.Data {
{
return dataTable.DataSet;
}
protected override void AddCore (DataRelation relation)
{
base.AddCore (relation);
GetDataSet ().Relations.Add(relation);
}
public override void AddRange (DataRelation[] relations)
{
base.AddRange (relations);
}
public override void Clear ()
{
base.Clear ();
}
protected override void RemoveCore (DataRelation relation)
{
base.RemoveCore (relation);
GetDataSet ().Relations.Remove (relation);
}
protected override ArrayList List {
get {
return base.List;
}
}
}
private int defaultNameIndex;
@@ -232,15 +179,6 @@ namespace System.Data {
#region Add Methods
private string GetNextDefaultRelationName ()
{
string defRelationName = "Relation";
for (int index = 1; Contains (defRelationName); ++index) {
defRelationName = "Relation" + index;
}
return defRelationName;
}
/// <summary>
/// Adds a DataRelation to the DataRelationCollection.
/// </summary>
@@ -249,9 +187,13 @@ namespace System.Data {
public void Add(DataRelation relation)
{
this.AddCore (relation);
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
List.Add(relation);
OnCollectionChanged(e);
if(List != null)
{
//CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
List.Add(relation);
//OnCollectionChanged(e);
}
return;
}
/// <summary>
@@ -263,10 +205,32 @@ namespace System.Data {
/// <param name="parentColumn">parent column of relation.</param>
/// <param name="childColumn">child column of relation.</param>
/// <returns>The created DataRelation.</returns>
[MonoTODO]
public virtual DataRelation Add(DataColumn parentColumn, DataColumn childColumn)
{
DataRelation dataRelation = new DataRelation(GetNextDefaultRelationName (), parentColumn, childColumn);
Add(dataRelation);
if(parentColumn == null)
{
throw new ArgumentNullException("parentColumn");
}
else if( childColumn == null)
{
throw new ArgumentNullException("childColumn");
}
// FIXME: temporarily commented so we can compile
/*
if(parentColumn.Table.DataSet != childColumn.Table.DataSet)
{
throw new InvalidConstraintException("my ex");
}
*/
DataRelation dataRelation = new DataRelation("Relation" + defaultNameIndex.ToString(), parentColumn, childColumn);
this.AddCore (dataRelation);
//CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
List.Add(dataRelation);
//OnCollectionChanged(e);
defaultNameIndex++;
return dataRelation;
}
@@ -279,10 +243,13 @@ namespace System.Data {
/// <param name="parentColumns">An array of parent DataColumn objects.</param>
/// <param name="childColumns">An array of child DataColumn objects.</param>
/// <returns>The created DataRelation.</returns>
[MonoTODO]
public virtual DataRelation Add(DataColumn[] parentColumns, DataColumn[] childColumns)
{
DataRelation dataRelation = new DataRelation(GetNextDefaultRelationName (), parentColumns, childColumns);
Add(dataRelation);
DataRelation dataRelation = new DataRelation("Relation" + defaultNameIndex.ToString(), parentColumns, childColumns);
this.AddCore (dataRelation);
List.Add(dataRelation);
defaultNameIndex++;
return dataRelation;
}
@@ -297,13 +264,19 @@ namespace System.Data {
/// <param name="parentColumn">parent column of relation.</param>
/// <returns>The created DataRelation.</returns>
/// <returns></returns>
[MonoTODO]
public virtual DataRelation Add(string name, DataColumn parentColumn, DataColumn childColumn)
{
//If no name was supplied, give it a default name.
if (name == null || name == "") name = GetNextDefaultRelationName ();
if ((name == null) || (name == ""))
{
name = "Relation" + defaultNameIndex.ToString();
defaultNameIndex++;
}
DataRelation dataRelation = new DataRelation(name, parentColumn, childColumn);
Add(dataRelation);
this.AddCore (dataRelation);
List.Add(dataRelation);
return dataRelation;
}
@@ -314,13 +287,19 @@ namespace System.Data {
/// <param name="parentColumns">An array of parent DataColumn objects.</param>
/// <param name="childColumns">An array of child DataColumn objects.</param>
/// <returns>The created DataRelation.</returns>
[MonoTODO]
public virtual DataRelation Add(string name, DataColumn[] parentColumns, DataColumn[] childColumns)
{
//If no name was supplied, give it a default name.
if (name == null || name == "") name = GetNextDefaultRelationName ();
if ((name == null) || (name == ""))
{
name = "Relation" + defaultNameIndex.ToString();
defaultNameIndex++;
}
DataRelation dataRelation = new DataRelation(name, parentColumns, childColumns);
Add(dataRelation);
this.AddCore (dataRelation);
List.Add(dataRelation);
return dataRelation;
}
@@ -336,13 +315,19 @@ namespace System.Data {
/// <param name="childColumn">child column of relation.</param>
/// <param name="createConstraints">true to create constraints; otherwise false. (default is true)</param>
/// <returns>The created DataRelation.</returns>
[MonoTODO]
public virtual DataRelation Add(string name, DataColumn parentColumn, DataColumn childColumn, bool createConstraints)
{
//If no name was supplied, give it a default name.
if (name == null || name == "") name = GetNextDefaultRelationName ();
if ((name == null) || (name == ""))
{
name = "Relation" + defaultNameIndex.ToString();
defaultNameIndex++;
}
DataRelation dataRelation = new DataRelation(name, parentColumn, childColumn, createConstraints);
Add(dataRelation);
this.AddCore (dataRelation);
List.Add(dataRelation);
return dataRelation;
}
@@ -355,13 +340,19 @@ namespace System.Data {
/// <param name="childColumns">An array of child DataColumn objects.</param>
/// <param name="createConstraints">true to create a constraint; otherwise false.</param>
/// <returns>The created DataRelation.</returns>
[MonoTODO]
public virtual DataRelation Add(string name, DataColumn[] parentColumns, DataColumn[] childColumns, bool createConstraints)
{
//If no name was supplied, give it a default name.
if (name == null || name == "") name = GetNextDefaultRelationName ();
if ((name == null) || (name == ""))
{
name = "Relation" + defaultNameIndex.ToString();
defaultNameIndex++;
}
DataRelation dataRelation = new DataRelation(name, parentColumns, childColumns, createConstraints);
Add(dataRelation);
AddCore (dataRelation);
List.Add(dataRelation);
return dataRelation;
}
#endregion
@@ -394,9 +385,22 @@ namespace System.Data {
/// Copies the elements of the specified DataRelation array to the end of the collection.
/// </summary>
/// <param name="relations">The array of DataRelation objects to add to the collection.</param>
[MonoTODO]
public virtual void AddRange(DataRelation[] relations)
{
foreach (DataRelation relation in relations) Add(relation);
//TODO: Implement
DataSet dataSet = GetDataSet();
throw new NotImplementedException ();
/*
foreach(DataRelation dataRelation in relations)
{
}
*/
}
[MonoTODO]
@@ -408,12 +412,13 @@ namespace System.Data {
public virtual void Clear()
{
List.Clear();
throw new NotImplementedException ();
}
[MonoTODO]
public virtual bool Contains(string name)
{
return IndexOf(name) != -1;
return false;
}
private CollectionChangeEventArgs CreateCollectionChangeEvent (CollectionChangeAction action)
@@ -447,7 +452,7 @@ namespace System.Data {
public void Remove (DataRelation relation)
{
RemoveCore (relation);
// TODO: RemoveCore (relation);
List.Remove (relation);
OnCollectionChanged (CreateCollectionChangeEvent (CollectionChangeAction.Remove));
}
@@ -465,7 +470,7 @@ namespace System.Data {
[MonoTODO]
protected virtual void RemoveCore(DataRelation relation)
{
// TODO: What have to be done?
throw new NotImplementedException ();
}
[ResDescriptionAttribute ("Occurs whenever this collection's membership changes.")]
+2 -38
View File
@@ -684,42 +684,6 @@ namespace System.Data {
#endregion
#region Private Xml Serialisation
private string WriteObjectXml( object o ) {
switch (Type.GetTypeCode (o.GetType ())) {
case TypeCode.Boolean:
return XmlConvert.ToString ((Boolean) o);
case TypeCode.Byte:
return XmlConvert.ToString ((Byte) o);
case TypeCode.Char:
return XmlConvert.ToString ((Char) o);
case TypeCode.DateTime:
return XmlConvert.ToString ((DateTime) o);
case TypeCode.Decimal:
return XmlConvert.ToString ((Decimal) o);
case TypeCode.Double:
return XmlConvert.ToString ((Double) o);
case TypeCode.Int16:
return XmlConvert.ToString ((Int16) o);
case TypeCode.Int32:
return XmlConvert.ToString ((Int32) o);
case TypeCode.Int64:
return XmlConvert.ToString ((Int64) o);
case TypeCode.SByte:
return XmlConvert.ToString ((SByte) o);
case TypeCode.Single:
return XmlConvert.ToString ((Single) o);
case TypeCode.UInt16:
return XmlConvert.ToString ((UInt16) o);
case TypeCode.UInt32:
return XmlConvert.ToString ((UInt32) o);
case TypeCode.UInt64:
return XmlConvert.ToString ((UInt64) o);
}
if (o is TimeSpan) return XmlConvert.ToString ((TimeSpan) o);
if (o is Guid) return XmlConvert.ToString ((Guid) o);
return o.ToString();
}
private void WriteTable( XmlWriter writer, DataTable table, XmlWriteMode mode )
{
@@ -770,7 +734,7 @@ namespace System.Data {
if( simple != null )
{
writer.WriteString( WriteObjectXml(row[simple]) );
writer.WriteString( row[simple].ToString() );
}
else
{
@@ -789,7 +753,7 @@ namespace System.Data {
//TODO check if I can get away with write element string
WriteStartElement( writer, mode, colnspc, col.Prefix, col.ColumnName );
writer.WriteString( WriteObjectXml(rowObject) );
writer.WriteString( rowObject.ToString() );
writer.WriteEndElement();
}
}
File diff suppressed because it is too large. Load diff
@@ -1,8 +1,3 @@
2003-02-28 Ville Palo <[email protected]>
* DataColumnCollectionTest.cs: Added more tests.
* DataRowCollectionTest.cs: Added more tests.
2003-04-02 Ville Palo <[email protected]>
* DataColumnTest.cs: Added tests for Expression property
@@ -2,16 +2,13 @@
//
// Author:
// Franklin Wise <[email protected]>
// Ville Palo <[email protected]>
//
// (C) Copyright 2002 Franklin Wise
// (C) Copyright 2003 Ville Palo
//
using NUnit.Framework;
using System;
using System.Data;
using System.Xml;
namespace MonoTests.System.Data
{
@@ -31,7 +28,7 @@ namespace MonoTests.System.Data
public static ITest Suite {
get {
return new TestSuite (typeof (DataColumnCollectionTest));
return new TestSuite (typeof (DataColumnCollectionTest));
}
}
@@ -43,489 +40,7 @@ namespace MonoTests.System.Data
//And get an exception
}
public void TestAdd ()
{
DataTable Table = new DataTable ("test_table");
DataColumnCollection Cols = Table.Columns;
DataColumn C = null;
Cols.Add ();
Cols.Add ();
C = Cols [0];
AssertEquals ("test#01", true, C.AllowDBNull);
AssertEquals ("test#02", false, C.AutoIncrement);
AssertEquals ("test#03", 0L, C.AutoIncrementSeed);
AssertEquals ("test#04", 1L, C.AutoIncrementStep);
AssertEquals ("test#05", "Column1", C.Caption);
AssertEquals ("test#06", "Element", C.ColumnMapping.ToString ());
AssertEquals ("test#07", "Column1", C.ColumnName);
AssertEquals ("test#08", true, C.Container == null);
AssertEquals ("test#09", typeof (string), C.DataType);
AssertEquals ("test#10", DBNull.Value, C.DefaultValue);
AssertEquals ("test#11", false, C.DesignMode);
AssertEquals ("test#12", "", C.Expression);
AssertEquals ("test#13", 0, C.ExtendedProperties.Count);
AssertEquals ("test#14", -1, C.MaxLength);
AssertEquals ("test#15", "", C.Namespace);
AssertEquals ("test#16", 0, C.Ordinal);
AssertEquals ("test#17", "", C.Prefix);
AssertEquals ("test#18", false, C.ReadOnly);
AssertEquals ("test#19", null, C.Site);
AssertEquals ("test#20", "test_table", C.Table.TableName);
AssertEquals ("test#21", "Column1", C.ToString ());
AssertEquals ("test#22", false, C.Unique);
C = Cols [1];
AssertEquals ("test#23", true, C.AllowDBNull);
AssertEquals ("test#24", false, C.AutoIncrement);
AssertEquals ("test#25", 0L, C.AutoIncrementSeed);
AssertEquals ("test#26", 1L, C.AutoIncrementStep);
AssertEquals ("test#27", "Column2", C.Caption);
AssertEquals ("test#28", "Element", C.ColumnMapping.ToString ());
AssertEquals ("test#29", "Column2", C.ColumnName);
AssertEquals ("test#30", true, C.Container == null);
AssertEquals ("test#31", typeof (string), C.DataType);
AssertEquals ("test#32", DBNull.Value, C.DefaultValue);
AssertEquals ("test#33", false, C.DesignMode);
AssertEquals ("test#34", "", C.Expression);
AssertEquals ("test#35", 0, C.ExtendedProperties.Count);
AssertEquals ("test#36", -1, C.MaxLength);
AssertEquals ("test#37", "", C.Namespace);
AssertEquals ("test#38", 1, C.Ordinal);
AssertEquals ("test#39", "", C.Prefix);
AssertEquals ("test#40", false, C.ReadOnly);
AssertEquals ("test#41", null, C.Site);
AssertEquals ("test#42", "test_table", C.Table.TableName);
AssertEquals ("test#43", "Column2", C.ToString ());
AssertEquals ("test#44", false, C.Unique);
Cols.Add ("test1", typeof (int), "");
Cols.Add ("test2", typeof (string), "Column1 + Column2");
C = Cols [2];
AssertEquals ("test#45", true, C.AllowDBNull);
AssertEquals ("test#46", false, C.AutoIncrement);
AssertEquals ("test#47", 0L, C.AutoIncrementSeed);
AssertEquals ("test#48", 1L, C.AutoIncrementStep);
AssertEquals ("test#49", "test1", C.Caption);
AssertEquals ("test#50", "Element", C.ColumnMapping.ToString ());
AssertEquals ("test#51", "test1", C.ColumnName);
AssertEquals ("test#52", true, C.Container == null);
AssertEquals ("test#53", typeof (int), C.DataType);
AssertEquals ("test#54", DBNull.Value, C.DefaultValue);
AssertEquals ("test#55", false, C.DesignMode);
AssertEquals ("test#56", "", C.Expression);
AssertEquals ("test#57", 0, C.ExtendedProperties.Count);
AssertEquals ("test#58", -1, C.MaxLength);
AssertEquals ("test#59", "", C.Namespace);
AssertEquals ("test#60", 2, C.Ordinal);
AssertEquals ("test#61", "", C.Prefix);
AssertEquals ("test#62", false, C.ReadOnly);
AssertEquals ("test#63", null, C.Site);
AssertEquals ("test#64", "test_table", C.Table.TableName);
AssertEquals ("test#65", "test1", C.ToString ());
AssertEquals ("test#66", false, C.Unique);
C = Cols [3];
AssertEquals ("test#45", true, C.AllowDBNull);
AssertEquals ("test#46", false, C.AutoIncrement);
AssertEquals ("test#47", 0L, C.AutoIncrementSeed);
AssertEquals ("test#48", 1L, C.AutoIncrementStep);
AssertEquals ("test#49", "test2", C.Caption);
AssertEquals ("test#50", "Element", C.ColumnMapping.ToString ());
AssertEquals ("test#51", "test2", C.ColumnName);
AssertEquals ("test#52", true, C.Container == null);
AssertEquals ("test#53", typeof (string), C.DataType);
AssertEquals ("test#54", DBNull.Value, C.DefaultValue);
AssertEquals ("test#55", false, C.DesignMode);
AssertEquals ("test#56", "Column1 + Column2", C.Expression);
AssertEquals ("test#57", 0, C.ExtendedProperties.Count);
AssertEquals ("test#58", -1, C.MaxLength);
AssertEquals ("test#59", "", C.Namespace);
AssertEquals ("test#60", 3, C.Ordinal);
AssertEquals ("test#61", "", C.Prefix);
AssertEquals ("test#62", true, C.ReadOnly);
AssertEquals ("test#63", null, C.Site);
AssertEquals ("test#64", "test_table", C.Table.TableName);
AssertEquals ("test#65", "test2 + Column1 + Column2", C.ToString ());
AssertEquals ("test#66", false, C.Unique);
C = new DataColumn ("test3", typeof (int));
Cols.Add (C);
C = Cols [4];
AssertEquals ("test#67", true, C.AllowDBNull);
AssertEquals ("test#68", false, C.AutoIncrement);
AssertEquals ("test#69", 0L, C.AutoIncrementSeed);
AssertEquals ("test#70", 1L, C.AutoIncrementStep);
AssertEquals ("test#71", "test3", C.Caption);
AssertEquals ("test#72", "Element", C.ColumnMapping.ToString ());
AssertEquals ("test#73", "test3", C.ColumnName);
AssertEquals ("test#74", true, C.Container == null);
AssertEquals ("test#75", typeof (int), C.DataType);
AssertEquals ("test#76", DBNull.Value, C.DefaultValue);
AssertEquals ("test#77", false, C.DesignMode);
AssertEquals ("test#78", "", C.Expression);
AssertEquals ("test#79", 0, C.ExtendedProperties.Count);
AssertEquals ("test#80", -1, C.MaxLength);
AssertEquals ("test#81", "", C.Namespace);
AssertEquals ("test#82", 4, C.Ordinal);
AssertEquals ("test#83", "", C.Prefix);
AssertEquals ("test#84", false, C.ReadOnly);
AssertEquals ("test#85", null, C.Site);
AssertEquals ("test#86", "test_table", C.Table.TableName);
AssertEquals ("test#87", "test3", C.ToString ());
AssertEquals ("test#88", false, C.Unique);
}
public void TestAddExceptions ()
{
DataTable Table = new DataTable ("test_table");
DataTable Table2 = new DataTable ("test_table2");
DataColumnCollection Cols = Table.Columns;
DataColumn C = null;
try {
Cols.Add (C);
Fail ("test#01");
} catch (Exception e) {
AssertEquals ("test#02", typeof (ArgumentNullException), e.GetType ());
AssertEquals ("test#03", "'column' argument cannot be null.\r\nParameter name: column", e.Message);
}
C = new DataColumn ("test");
Cols.Add (C);
try {
Cols.Add (C);
Fail ("test#04");
} catch (Exception e) {
AssertEquals ("test#05", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#06", "Column 'test' already belongs to this DataTable.", e.Message);
}
try {
Table2.Columns.Add (C);
Fail ("test#07");
} catch (Exception e) {
AssertEquals ("test#08", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#09", "Column 'test' already belongs to another DataTable.", e.Message);
}
DataColumn C2 = new DataColumn ("test");
try {
Cols.Add (C2);
Fail ("test#10");
} catch (Exception e) {
AssertEquals ("test#11", typeof (DuplicateNameException), e.GetType ());
AssertEquals ("test#12", "A column named 'test' already belongs to this DataTable.", e.Message);
}
try {
Cols.Add ("test2", typeof (string), "substring ('fdsafewq', 2)");
Fail ("test#13");
} catch (Exception e) {
AssertEquals ("test#14", true, e is InvalidExpressionException);
AssertEquals ("test#15", "Invalid number of arguments: function substring().", e.Message);
}
}
public void TestAddRange ()
{
DataTable Table = new DataTable ("test_table");
DataTable Table2 = new DataTable ("test_table2");
DataColumnCollection Cols = Table.Columns;
DataColumn C = null;
DataColumn [] ColArray = new DataColumn [2];
C = new DataColumn ("test1");
ColArray [0] = C;
C = new DataColumn ("test2");
C.AllowDBNull = false;
C.Caption = "Test_caption";
C.DataType = typeof (XmlReader);
ColArray [1] = C;
Cols.AddRange (ColArray);
C = Cols [0];
AssertEquals ("test#01", true, C.AllowDBNull);
AssertEquals ("test#02", false, C.AutoIncrement);
AssertEquals ("test#03", 0L, C.AutoIncrementSeed);
AssertEquals ("test#04", 1L, C.AutoIncrementStep);
AssertEquals ("test#05", "test1", C.Caption);
AssertEquals ("test#06", "Element", C.ColumnMapping.ToString ());
AssertEquals ("test#07", "test1", C.ColumnName);
AssertEquals ("test#08", true, C.Container == null);
AssertEquals ("test#09", typeof (string), C.DataType);
AssertEquals ("test#10", DBNull.Value, C.DefaultValue);
AssertEquals ("test#11", false, C.DesignMode);
AssertEquals ("test#12", "", C.Expression);
AssertEquals ("test#13", 0, C.ExtendedProperties.Count);
AssertEquals ("test#14", -1, C.MaxLength);
AssertEquals ("test#15", "", C.Namespace);
AssertEquals ("test#16", 0, C.Ordinal);
AssertEquals ("test#17", "", C.Prefix);
AssertEquals ("test#18", false, C.ReadOnly);
AssertEquals ("test#19", null, C.Site);
AssertEquals ("test#20", "test_table", C.Table.TableName);
AssertEquals ("test#21", "test1", C.ToString ());
AssertEquals ("test#22", false, C.Unique);
C = Cols [1];
AssertEquals ("test#01", false, C.AllowDBNull);
AssertEquals ("test#02", false, C.AutoIncrement);
AssertEquals ("test#03", 0L, C.AutoIncrementSeed);
AssertEquals ("test#04", 1L, C.AutoIncrementStep);
AssertEquals ("test#05", "Test_caption", C.Caption);
AssertEquals ("test#06", "Element", C.ColumnMapping.ToString ());
AssertEquals ("test#07", "test2", C.ColumnName);
AssertEquals ("test#08", true, C.Container == null);
AssertEquals ("test#09", typeof (XmlReader), C.DataType);
AssertEquals ("test#10", DBNull.Value, C.DefaultValue);
AssertEquals ("test#11", false, C.DesignMode);
AssertEquals ("test#12", "", C.Expression);
AssertEquals ("test#13", 0, C.ExtendedProperties.Count);
AssertEquals ("test#14", -1, C.MaxLength);
AssertEquals ("test#15", "", C.Namespace);
AssertEquals ("test#16", 1, C.Ordinal);
AssertEquals ("test#17", "", C.Prefix);
AssertEquals ("test#18", false, C.ReadOnly);
AssertEquals ("test#19", null, C.Site);
AssertEquals ("test#20", "test_table", C.Table.TableName);
AssertEquals ("test#21", "test2", C.ToString ());
AssertEquals ("test#22", false, C.Unique);
}
public void TestCanRemove ()
{
DataTable Table = new DataTable ("test_table");
DataTable Table2 = new DataTable ("test_table_2");
DataColumnCollection Cols = Table.Columns;
DataColumn C = new DataColumn ("test1");
Cols.Add ();
// LAMESPEC: MSDN says that if C doesn't belong to Cols
// Exception is thrown.
AssertEquals ("test#01", false, Cols.CanRemove (C));
Cols.Add (C);
AssertEquals ("test#02", true, Cols.CanRemove (C));
C = new DataColumn ();
C.Expression = "test1 + 2";
Cols.Add (C);
C = Cols ["test2"];
AssertEquals ("test#03", false, Cols.CanRemove (C));
C = new DataColumn ("t");
Table2.Columns.Add (C);
DataColumnCollection Cols2 = Table2.Columns;
AssertEquals ("test#04", true, Cols2.CanRemove (C));
DataRelation Rel = new DataRelation ("Rel", Table.Columns [0], Table2.Columns [0]);
DataSet Set = new DataSet ();
Set.Tables.Add (Table);
Set.Tables.Add (Table2);
Set.Relations.Add (Rel);
AssertEquals ("test#05", false, Cols2.CanRemove (C));
AssertEquals ("test#06", false, Cols.CanRemove (null));
}
public void TestClear ()
{
DataTable Table = new DataTable ("test_table");
DataTable Table2 = new DataTable ("test_table2");
DataSet Set = new DataSet ();
Set.Tables.Add (Table);
Set.Tables.Add (Table2);
DataColumnCollection Cols = Table.Columns;
DataColumnCollection Cols2 = Table2.Columns;
Cols.Add ();
Cols.Add ("testi");
Cols.Clear ();
AssertEquals ("test#01", 0, Cols.Count);
Cols.Add ();
Cols.Add ("testi");
Cols2.Add ();
Cols2.Add ();
DataRelation Rel = new DataRelation ("Rel", Cols [0], Cols2 [0]);
Set.Relations.Add (Rel);
try {
Cols.Clear ();
Fail ("test#02");
} catch (Exception e) {
AssertEquals ("test#03", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#04", "Cannot remove this column, because it is part of the parent key for relationship Rel.", e.Message);
}
}
public void TestContains ()
{
DataTable Table = new DataTable ("test_table");
DataColumnCollection Cols = Table.Columns;
Cols.Add ("test");
Cols.Add ("tesT2");
AssertEquals ("test#01", true, Cols.Contains ("test"));
AssertEquals ("test#02", false, Cols.Contains ("_test"));
AssertEquals ("test#03", true, Cols.Contains ("TEST"));
Table.CaseSensitive = true;
AssertEquals ("test#04", true, Cols.Contains ("TEST"));
AssertEquals ("test#05", true, Cols.Contains ("test2"));
AssertEquals ("test#06", false, Cols.Contains ("_test2"));
AssertEquals ("test#07", true, Cols.Contains ("TEST2"));
}
public void TestCopyTo ()
{
DataTable Table = new DataTable ("test_table");
DataColumnCollection Cols = Table.Columns;
Cols.Add ("test");
Cols.Add ("test2");
Cols.Add ("test3");
Cols.Add ("test4");
DataColumn [] array = new DataColumn [4];
Cols.CopyTo (array, 0);
AssertEquals ("test#01", 4, array.Length);
AssertEquals ("test#02", "test", array [0].ColumnName);
AssertEquals ("test#03", "test2", array [1].ColumnName);
AssertEquals ("test#04", "test3", array [2].ColumnName);
AssertEquals ("test#05", "test4", array [3].ColumnName);
array = new DataColumn [6];
Cols.CopyTo (array, 2);
AssertEquals ("test#06", 6, array.Length);
AssertEquals ("test#07", "test", array [2].ColumnName);
AssertEquals ("test#08", "test2", array [3].ColumnName);
AssertEquals ("test#09", "test3", array [4].ColumnName);
AssertEquals ("test#10", "test4", array [5].ColumnName);
AssertEquals ("test#11", null, array [0]);
AssertEquals ("test#12", null, array [1]);
}
public void TestEquals ()
{
DataTable Table = new DataTable ("test_table");
DataTable Table2 = new DataTable ("test_table");
DataColumnCollection Cols = Table.Columns;
DataColumnCollection Cols2 = Table2.Columns;
AssertEquals ("test#01", false, Cols.Equals (Cols2));
AssertEquals ("test#02", false, Cols2.Equals (Cols));
AssertEquals ("test#03", false, Object.Equals (Cols, Cols2));
AssertEquals ("test#04", true, Cols.Equals (Cols));
AssertEquals ("test#05", true, Cols2.Equals (Cols2));
AssertEquals ("test#06", true, Object.Equals (Cols2, Cols2));
}
public void TestIndexOf ()
{
DataTable Table = new DataTable ("test_table");
DataColumnCollection Cols = Table.Columns;
Cols.Add ("test");
Cols.Add ("test2");
Cols.Add ("test3");
Cols.Add ("test4");
AssertEquals ("test#01", 0, Cols.IndexOf ("test"));
AssertEquals ("test#02", 1, Cols.IndexOf ("TEST2"));
Table.CaseSensitive = true;
AssertEquals ("test#03", 1, Cols.IndexOf ("TEST2"));
AssertEquals ("test#04", 3, Cols.IndexOf (Cols [3]));
DataColumn C = new DataColumn ("error");
AssertEquals ("test#05", -1, Cols.IndexOf (C));
AssertEquals ("test#06", -1, Cols.IndexOf ("_error_"));
}
public void TestRemove ()
{
DataTable Table = new DataTable ("test_table");
DataColumnCollection Cols = Table.Columns;
Cols.Add ("test");
Cols.Add ("test2");
Cols.Add ("test3");
Cols.Add ("test4");
AssertEquals ("test#01", 4, Cols.Count);
Cols.Remove ("test2");
AssertEquals ("test#02", 3, Cols.Count);
Cols.Remove ("TEST3");
AssertEquals ("test#03", 2, Cols.Count);
try {
Cols.Remove ("_test_");
Fail ("test#04");
} catch (Exception e) {
AssertEquals ("test#05", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#06", "Column '_test_' does not belong to table test_table.", e.Message);
}
Cols.Add ();
Cols.Add ();
Cols.Add ();
Cols.Add ();
AssertEquals ("test#07", 6, Cols.Count);
Cols.Remove (Cols [0]);
Cols.Remove (Cols [0]);
AssertEquals ("test#08", 4, Cols.Count);
AssertEquals ("test#09", "Column1", Cols [0].ColumnName);
try {
Cols.Remove (new DataColumn ("Column1"));
Fail ("test#10");
} catch (Exception e) {
AssertEquals ("test#11", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#12", "Cannot remove a column that doesn't belong to this table.", e.Message);
}
Cols.Add ();
Cols.Add ();
Cols.Add ();
Cols.Add ();
AssertEquals ("test#13", 8, Cols.Count);
Cols.RemoveAt (7);
Cols.RemoveAt (1);
Cols.RemoveAt (0);
Cols.RemoveAt (0);
AssertEquals ("test#14", 4, Cols.Count);
AssertEquals ("test#15", "Column4", Cols [0].ColumnName);
AssertEquals ("test#16", "Column5", Cols [1].ColumnName);
try {
Cols.RemoveAt (10);
Fail ("test#17");
} catch (Exception e) {
AssertEquals ("test#18", typeof (IndexOutOfRangeException), e.GetType ());
AssertEquals ("test#19", "Cannot find column 10.", e.Message);
}
}
public void TestToString ()
{
DataTable Table = new DataTable ("test_table");
DataColumnCollection Cols = Table.Columns;
Cols.Add ("test");
Cols.Add ("test2");
Cols.Add ("test3");
AssertEquals ("test#01", "System.Data.DataColumnCollection", Cols.ToString ());
}
}
}
@@ -52,516 +52,5 @@ namespace MonoTests.System.Data
_tbl.Rows.Add(_tbl.NewRow());
//Assertion.AssertEquals("Inc 1" , 1, Convert.ToInt32(_tbl.Rows[0]["Auto"] ));
}
public void TestAdd ()
{
_tbl.Columns.Add ();
_tbl.Columns.Add ();
DataRow Row = _tbl.NewRow ();
DataRowCollection Rows = _tbl.Rows;
Rows.Add (Row);
AssertEquals ("test#01", 1, Rows.Count);
AssertEquals ("test#02", false, Rows.IsReadOnly);
AssertEquals ("test#03", false, Rows.IsSynchronized);
AssertEquals ("test#04", "System.Data.DataRowCollection", Rows.ToString ());
string [] cols = new string [2];
cols [0] = "first";
cols [1] = "second";
Rows.Add (cols);
cols [0] = "something";
cols [1] = "else";
Rows.Add (cols);
AssertEquals ("test#05", 3, Rows.Count);
AssertEquals ("test#06", "System.Data.DataRow", Rows [0].ToString ());
AssertEquals ("test#07", DBNull.Value, Rows [0] [0]);
AssertEquals ("test#08", DBNull.Value, Rows [0] [1]);
AssertEquals ("test#09", "first", Rows [1] [0]);
AssertEquals ("test#10", "something", Rows [2] [0]);
AssertEquals ("test#11", "second", Rows [1] [1]);
AssertEquals ("test#12", "else", Rows [2] [1]);
try {
Rows.Add (Row);
Fail ("test#13");
} catch (Exception e) {
AssertEquals ("test#14", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#15", "This row already belongs to this table.", e.Message);
}
try {
Row = null;
Rows.Add (Row);
Fail ("test#16");
} catch (Exception e) {
AssertEquals ("test#17", typeof (ArgumentNullException), e.GetType ());
AssertEquals ("test#18", "'row' argument cannot be null.\r\nParameter name: row", e.Message);
}
DataColumn Column = new DataColumn ("not_null");
Column.AllowDBNull = false;
_tbl.Columns.Add (Column);
cols = new string [3];
cols [0] = "first";
cols [1] = "second";
cols [2] = null;
try {
Rows.Add (cols);
Fail ("test#19");
} catch (Exception e) {
AssertEquals ("test#20", typeof (NoNullAllowedException), e.GetType ());
AssertEquals ("test#21", "Column 'not_null' does not allow nulls.", e.Message);
}
Column = _tbl.Columns [0];
Column.Unique = true;
cols = new string [3];
cols [0] = "first";
cols [1] = "second";
cols [2] = "blabal";
try {
Rows.Add (cols);
Fail ("test#22");
} catch (Exception e) {
AssertEquals ("test#23", typeof (ConstraintException), e.GetType ());
AssertEquals ("test#24", "Column 'Column1' is constrained to be unique. Value 'first' is already present.", e.Message);
}
Column = new DataColumn ("integer");
Column.DataType = typeof (short);
_tbl.Columns.Add (Column);
object [] obs = new object [4];
obs [0] = "_first";
obs [1] = "second";
obs [2] = "blabal";
obs [3] = "ads";
try {
Rows.Add (obs);
Fail ("test#25");
} catch (Exception e) {
// LAMESPEC: MSDN says this exception is InvalidCastException
AssertEquals ("test#26", typeof (ArgumentException), e.GetType ());
}
}
public void TestClear ()
{
DataRowCollection Rows = _tbl.Rows;
DataTable Table = new DataTable ("child");
Table.Columns.Add ("first", typeof (int));
Table.Columns.Add ("second", typeof (string));
_tbl.Columns.Add ("first", typeof (int));
_tbl.Columns.Add ("second", typeof (float));
string [] cols = new string [2];
cols [0] = "1";
cols [1] = "1,1";
Rows.Add (cols);
cols [0] = "2";
cols [1] = "2,1";
Rows.Add (cols);
cols [0] = "3";
cols [1] = "3,1";
Rows.Add (cols);
AssertEquals ("test#01", 3, Rows.Count);
Rows.Clear ();
// hmm... TODO: better tests
AssertEquals ("test#02", 0, Rows.Count);
cols [0] = "1";
cols [1] = "1,1";
Rows.Add (cols);
cols [0] = "2";
cols [1] = "2,1";
Rows.Add (cols);
cols [0] = "3";
cols [1] = "3,1";
Rows.Add (cols);
cols [0] = "1";
cols [1] = "test";
Table.Rows.Add (cols);
cols [0] = "2";
cols [1] = "test2";
Table.Rows.Add (cols);
cols [0] = "3";
cols [1] = "test3";
Table.Rows.Add (cols);
DataRelation Rel = new DataRelation ("REL", _tbl.Columns [0], Table.Columns [0]);
DataSet Set = new DataSet ();
Set.Tables.Add (_tbl);
Set.Tables.Add (Table);
Set.Relations.Add (Rel);
try {
Rows.Clear ();
Fail ("test#03");
} catch (Exception e) {
AssertEquals ("test#04", typeof (InvalidConstraintException), e.GetType ());
AssertEquals ("test#05", "Cannot clear table Table1 because ForeignKeyConstraint REL enforces constraints and there are child rows in child.", e.Message);
}
AssertEquals ("test#06", 3, Table.Rows.Count);
Table.Rows.Clear ();
AssertEquals ("test#07", 0, Table.Rows.Count);
}
public void TestContains ()
{
DataColumn C = new DataColumn ("key");
C.Unique = true;
C.DataType = typeof (int);
C.AutoIncrement = true;
C.AutoIncrementSeed = 0;
C.AutoIncrementStep = 1;
_tbl.Columns.Add (C);
_tbl.Columns.Add ("first", typeof (string));
_tbl.Columns.Add ("second", typeof (decimal));
DataRowCollection Rows = _tbl.Rows;
DataRow Row = _tbl.NewRow ();
_tbl.Rows.Add (Row);
Row = _tbl.NewRow ();
_tbl.Rows.Add (Row);
Row = _tbl.NewRow ();
_tbl.Rows.Add (Row);
Row = _tbl.NewRow ();
_tbl.Rows.Add (Row);
Rows [0] [1] = "test0";
Rows [0] [2] = 0;
Rows [1] [1] = "test1";
Rows [1] [2] = 1;
Rows [2] [1] = "test2";
Rows [2] [2] = 2;
Rows [3] [1] = "test3";
Rows [3] [2] = 3;
AssertEquals ("test#01", 3, _tbl.Columns.Count);
AssertEquals ("test#02", 4, _tbl.Rows.Count);
AssertEquals ("test#03", 0, _tbl.Rows [0] [0]);
AssertEquals ("test#04", 1, _tbl.Rows [1] [0]);
AssertEquals ("test#05", 2, _tbl.Rows [2] [0]);
AssertEquals ("test#06", 3, _tbl.Rows [3] [0]);
try {
Rows.Contains (1);
Fail ("test#07");
} catch (Exception e) {
AssertEquals ("test#08", typeof (MissingPrimaryKeyException), e.GetType ());
AssertEquals ("test#09", "Table doesn't have a primary key.", e.Message);
}
_tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0]};
AssertEquals ("test#10", true, Rows.Contains (1));
AssertEquals ("test#11", true, Rows.Contains (2));
AssertEquals ("test#12", false, Rows.Contains (4));
try {
Rows.Contains (new object [] {64, "test0"});
Fail ("test#13");
} catch (Exception e) {
AssertEquals ("test#14", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#15", "Expecting 1 value(s) for the key being indexed, but received 2 value(s).", e.Message);
}
_tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0], _tbl.Columns [1]};
AssertEquals ("test#16", false, Rows.Contains (new object [] {64, "test0"}));
AssertEquals ("test#17", false, Rows.Contains (new object [] {0, "test1"}));
AssertEquals ("test#18", true, Rows.Contains (new object [] {1, "test1"}));
AssertEquals ("test#19", true, Rows.Contains (new object [] {2, "test2"}));
try {
Rows.Contains (new object [] {2});
Fail ("test#20");
} catch (Exception e) {
AssertEquals ("test#21", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#22", "Expecting 2 value(s) for the key being indexed, but received 1 value(s).", e.Message);
}
}
public void TestCopyTo ()
{
_tbl.Columns.Add ();
_tbl.Columns.Add ();
_tbl.Columns.Add ();
DataRowCollection Rows = _tbl.Rows;
Rows.Add (new object [] {"1", "1", "1"});
Rows.Add (new object [] {"2", "2", "2"});
Rows.Add (new object [] {"3", "3", "3"});
Rows.Add (new object [] {"4", "4", "4"});
Rows.Add (new object [] {"5", "5", "5"});
Rows.Add (new object [] {"6", "6", "6"});
Rows.Add (new object [] {"7", "7", "7"});
DataRow [] dr = new DataRow [10];
try {
Rows.CopyTo (dr, 4);
Fail ("test#01");
} catch (Exception e) {
AssertEquals ("test#02", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#03", "Destination array was not long enough. Check destIndex and length, and the array's lower bounds.", e.Message);
}
dr = new DataRow [11];
Rows.CopyTo (dr, 4);
AssertEquals ("test#04", null, dr [0]);
AssertEquals ("test#05", null, dr [1]);
AssertEquals ("test#06", null, dr [2]);
AssertEquals ("test#07", null, dr [3]);
AssertEquals ("test#08", "1", dr [4] [0]);
AssertEquals ("test#09", "2", dr [5] [0]);
AssertEquals ("test#10", "3", dr [6] [0]);
AssertEquals ("test#11", "4", dr [7] [0]);
AssertEquals ("test#12", "5", dr [8] [0]);
AssertEquals ("test#13", "6", dr [9] [0]);
}
public void TestEquals ()
{
_tbl.Columns.Add ();
_tbl.Columns.Add ();
_tbl.Columns.Add ();
DataRowCollection Rows1 = _tbl.Rows;
Rows1.Add (new object [] {"1", "1", "1"});
Rows1.Add (new object [] {"2", "2", "2"});
Rows1.Add (new object [] {"3", "3", "3"});
Rows1.Add (new object [] {"4", "4", "4"});
Rows1.Add (new object [] {"5", "5", "5"});
Rows1.Add (new object [] {"6", "6", "6"});
Rows1.Add (new object [] {"7", "7", "7"});
DataRowCollection Rows2 = _tbl.Rows;
AssertEquals ("test#01", true, Rows2.Equals (Rows1));
AssertEquals ("test#02", true, Rows1.Equals (Rows2));
AssertEquals ("test#03", true, Rows1.Equals (Rows1));
DataTable Table = new DataTable ();
Table.Columns.Add ();
Table.Columns.Add ();
Table.Columns.Add ();
DataRowCollection Rows3 = Table.Rows;
Rows3.Add (new object [] {"1", "1", "1"});
Rows3.Add (new object [] {"2", "2", "2"});
Rows3.Add (new object [] {"3", "3", "3"});
Rows3.Add (new object [] {"4", "4", "4"});
Rows3.Add (new object [] {"5", "5", "5"});
Rows3.Add (new object [] {"6", "6", "6"});
Rows3.Add (new object [] {"7", "7", "7"});
AssertEquals ("test#04", false, Rows3.Equals (Rows1));
AssertEquals ("test#05", false, Rows3.Equals (Rows2));
AssertEquals ("test#06", false, Rows1.Equals (Rows3));
AssertEquals ("test#07", false, Rows2.Equals (Rows3));
}
public void TestFind ()
{
DataColumn Col = new DataColumn ("test_1");
Col.AllowDBNull = false;
Col.Unique = true;
Col.DataType = typeof (long);
_tbl.Columns.Add (Col);
Col = new DataColumn ("test_2");
Col.DataType = typeof (string);
_tbl.Columns.Add (Col);
DataRowCollection Rows = _tbl.Rows;
Rows.Add (new object [] {1, "first"});
Rows.Add (new object [] {2, "second"});
Rows.Add (new object [] {3, "third"});
Rows.Add (new object [] {4, "fourth"});
Rows.Add (new object [] {5, "fifth"});
try {
Rows.Find (1);
Fail ("test#01");
} catch (Exception e) {
AssertEquals ("test#02", typeof (MissingPrimaryKeyException), e.GetType ());
AssertEquals ("test#03", "Table doesn't have a primary key.", e.Message);
}
_tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0]};
DataRow row = Rows.Find (1);
AssertEquals ("test#04", 1L, row [0]);
row = Rows.Find (2);
AssertEquals ("test#05", 2L, row [0]);
row = Rows.Find ("2");
AssertEquals ("test#06", 2L, row [0]);
try {
row = Rows.Find ("test");
Fail ("test#07");
} catch (Exception e) {
AssertEquals ("test#08", typeof (FormatException), e.GetType ());
AssertEquals ("test#09", "Input string was not in a correct format.", e.Message);
}
String tes = null;
row = Rows.Find (tes);
AssertEquals ("test#10", null, row);
_tbl.PrimaryKey = null;
try {
Rows.Find (new object [] {1, "fir"});
Fail ("test#11");
} catch (Exception e) {
AssertEquals ("test#12", typeof (MissingPrimaryKeyException), e.GetType ());
AssertEquals ("tets#13", "Table doesn't have a primary key.", e.Message);
}
_tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0], _tbl.Columns [1]};
try {
Rows.Find (1);
Fail ("test#11");
} catch (Exception e) {
AssertEquals ("test#12", typeof (ArgumentException), e.GetType ());
AssertEquals ("test#13", "Expecting 2 value(s) for the key being indexed, but received 1 value(s).", e.Message);
}
row = Rows.Find (new object [] {1, "fir"});
AssertEquals ("test#14", null, row);
row = Rows.Find (new object [] {1, "first"});
AssertEquals ("test#15", 1L, row [0]);
}
public void TestInsertAt ()
{
_tbl.Columns.Add ();
_tbl.Columns.Add ();
_tbl.Columns.Add ();
DataRowCollection Rows = _tbl.Rows;
Rows.Add (new object [] {"a", "aa", "aaa"});
Rows.Add (new object [] {"b", "bb", "bbb"});
Rows.Add (new object [] {"c", "cc", "ccc"});
Rows.Add (new object [] {"d", "dd", "ddd"});
DataRow Row = _tbl.NewRow ();
Row [0] = "e";
Row [1] = "ee";
Row [2] = "eee";
try {
Rows.InsertAt (Row, -1);
Fail ("test#01");
} catch (Exception e) {
AssertEquals ("test#02", typeof (IndexOutOfRangeException), e.GetType ());
AssertEquals ("test#03", "The row insert position -1 is invalid.", e.Message);
}
Rows.InsertAt (Row, 0);
AssertEquals ("test#04", "e", Rows [0][0]);
AssertEquals ("test#05", "a", Rows [1][0]);
Row = _tbl.NewRow ();
Row [0] = "f";
Row [1] = "ff";
Row [2] = "fff";
Rows.InsertAt (Row, 5);
AssertEquals ("test#06", "f", Rows [5][0]);
Row = _tbl.NewRow ();
Row [0] = "g";
Row [1] = "gg";
Row [2] = "ggg";
Rows.InsertAt (Row, 500);
AssertEquals ("test#07", "g", Rows [6][0]);
}
public void TestRemove ()
{
_tbl.Columns.Add ();
_tbl.Columns.Add ();
_tbl.Columns.Add ();
DataRowCollection Rows = _tbl.Rows;
Rows.Add (new object [] {"a", "aa", "aaa"});
Rows.Add (new object [] {"b", "bb", "bbb"});
Rows.Add (new object [] {"c", "cc", "ccc"});
Rows.Add (new object [] {"d", "dd", "ddd"});
AssertEquals ("test#01", 4, _tbl.Rows.Count);
Rows.Remove (_tbl.Rows [1]);
AssertEquals ("test#02", 3, _tbl.Rows.Count);
AssertEquals ("test#03", "a", _tbl.Rows [0] [0]);
AssertEquals ("test#04", "c", _tbl.Rows [1] [0]);
AssertEquals ("test#05", "d", _tbl.Rows [2] [0]);
try {
Rows.Remove (null);
Fail ("test#06");
} catch (Exception e) {
AssertEquals ("test#07", typeof (IndexOutOfRangeException), e.GetType ());
AssertEquals ("test#08", "The given datarow is not in the current DataRowCollection.", e.Message);
}
DataRow Row = new DataTable ().NewRow ();
try {
Rows.Remove (Row);
Fail ("test#09");
} catch (Exception e) {
AssertEquals ("test#10", typeof (IndexOutOfRangeException), e.GetType ());
AssertEquals ("test#11", "The given datarow is not in the current DataRowCollection.", e.Message);
}
try {
Rows.RemoveAt (-1);
Fail ("test#12");
} catch (Exception e) {
AssertEquals ("test#13", typeof (IndexOutOfRangeException), e.GetType ());
AssertEquals ("test#14", "There is no row at position -1.", e.Message);
}
try {
Rows.RemoveAt (64);
Fail ("test#15");
} catch (Exception e) {
AssertEquals ("test#16", typeof (IndexOutOfRangeException), e.GetType ());
AssertEquals ("test#17", "There is no row at position 64.", e.Message);
}
Rows.RemoveAt (0);
Rows.RemoveAt (1);
AssertEquals ("test#18", 1, Rows.Count);
AssertEquals ("test#19", "c", Rows [0] [0]);
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -13,69 +13,13 @@ namespace System.Drawing.Drawing2D
/// <summary>
/// Summary description for AdjustableArrowCap.
/// </summary>
public sealed class AdjustableArrowCap : CustomLineCap
public class AdjustableArrowCap
{
private bool isFilled;
private float height;
private float width;
private float middleInset;
//Constructors
public AdjustableArrowCap(float width, float height, bool isFilled) {
this.isFilled = isFilled;
this.height = height;
this.width = width;
middleInset = 0;
public AdjustableArrowCap()
{
//
// TODO: Add constructor logic here
//
}
public AdjustableArrowCap(float width, float height) {
isFilled = true;
this.height = height;
this.width = width;
middleInset = 0;
//AdjustableArrowCap(width, height, true);
}
//Public Properities
[MonoTODO] //redraw on set
public bool Filled {
get {
return isFilled;
}
set {
isFilled = value;
//Redraw!
}
}
[MonoTODO] //redraw on set
public float Width {
get {
return width;
}
set {
width = value;
//Redraw!
}
}
[MonoTODO] //redraw on set
public float Height {
get {
return height;
}
set {
height = value;
//Redraw!
}
}
[MonoTODO] //redraw on set
public float MiddleInset {
get {
return middleInset;
}
set {
middleInset = value;
//Redraw!
}
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -13,71 +13,13 @@ namespace System.Drawing.Drawing2D
/// <summary>
/// Summary description for Blend.
/// </summary>
public sealed class Blend
public class Blend
{
private int count;
private float [] positions;
private float [] factors;
public Blend(int count) {
this.count = count;
if(count < 2){
throw new ArgumentOutOfRangeException("Count", count, "Must be at least 2");
}
if(count == 2){
//FIXME: call Blend!
count = 2;
positions = new float [1];
factors = new float [1];
positions[0] = 0.0F;
positions[1] = 1.0F;
factors[0] = 0.0F;
factors[1] = 1.0F;
}
int i;
for(i = 0; i < count; i++){
positions[i] = (1.0F/count) * i;
factors[i] = (1.0F/count) * i;
}
//fix any rounding errors that would generate an invald list.
positions[0] = 0.0F;
positions[1] = 1.0F;
factors[0] = 0.0F;
factors[1] = 1.0F;
}
public Blend() {
count = 2;
positions = new float [1];
factors = new float [1];
positions[0] = 0.0F;
positions[1] = 1.0F;
factors[0] = 0.0F;
factors[1] = 1.0F;
}
public float [] Factors{
get {
return factors;
}
set{
count = value.GetUpperBound(0) + 1;
if((value[0] !=0) | (value[count-1] != 1.0F)){
throw new ArgumentException(" First value must be 0.0, last value must be 1.0","Factors");
}
factors = value;
}
}
public float [] Positions{
get {
return Positions;
}
set{
count = value.GetUpperBound(0) + 1;
if((value[0] !=0) | (value[count-1] != 1.0F)){
throw new ArgumentException(" First value must be 0.0, last value must be 1.0","Positon");
}
positions = value;
}
public Blend()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -1,15 +1,3 @@
2003-3-5 DennisHayes <[email protected]>
* Added values for enums
* Stubbed and somewhat implmented Blend, ColorBlend, CustomLineCap
2003-3-2 DennisHayes <[email protected]>
* Created changelog
* updated copyrights to 2002/3
* changed namespace from System.Drawing, System.Drawing.Drawing2d to System.Drawing.Drawing2D
* cosmetic improvments
2002-10-13 DennisHayes <[email protected]>
* Changed namespace from *2d to *2D
* Changed comment header from system.Drawing to System.Drawing.Drawing2D
@@ -68,4 +56,4 @@
* Matrix.cs : MonoTODO everywhere.
* TODOAttribute.cs : Add here too.
* TODOAttribute.cs : Add here too.
@@ -4,77 +4,22 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
namespace System.Drawing.Drawing2D
{
public sealed class ColorBlend {
private int count;
private float [] positions;
private Color [] colors;
public ColorBlend(int count) {
//FIXME:
if(count < 2){
throw new ArgumentOutOfRangeException("Count", count, "Must be at least 2");
}
if(count == 2){
//FIXME: call ColorBlend!
count = 2;
positions = new float [1];
colors = new Color [1];
positions[0] = 0.0F;
positions[1] = 1.0F;
colors[0] = Color.FromArgb(0,0,0);
colors[1] = Color.FromArgb(255,255,255);
}
this.count = count;
int i;
for(i = 0; i < count; i++){
positions[i] = (1.0F/count) * i;
//FIXME: Do real default color blend
//FIXME: I used 254 to prevent overflow, should use 255, if anyone cares?
colors[i] = Color.FromArgb((1/count) * i * 254,(1/count) * i * 254,(1/count) * i * 254);
}
//fix any rounding errors that would generate an invald list.
positions[0] = 0.0F;
positions[1] = 1.0F;
colors[0] = Color.FromArgb(0,0,0);
colors[1] = Color.FromArgb(255,255,255);
}
public ColorBlend() {
count = 2;
positions = new float [1];
colors = new Color [1];
positions[0] = 0.0F;
positions[1] = 1.0F;
colors[0] = Color.FromArgb(0,0,0);
colors[1] = Color.FromArgb(255,255,255);
}
public Color [] Colors{
get {
return colors;
}
set{
count = value.GetUpperBound(0) + 1;
colors = value;
}
}
public float [] Positions{
get {
return Positions;
}
set{
count = value.GetUpperBound(0) + 1;
positions = value;
}
/// <summary>
/// Summary description for ColorBlend.
/// </summary>
public class ColorBlend
{
public ColorBlend()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -17,9 +17,9 @@ namespace System.Drawing.Drawing2D {
{
Complement = 5,
Exclude = 4,
Intersect = 1,
Intersect =4,
Replace = 0,
Union = 2,
Xor = 3
Xor =3
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -13,8 +13,9 @@ namespace System.Drawing.Drawing2D {
/// <summary>
/// Summary description for CompostingMode.
/// </summary>
public enum CompositingMode {
SourceCopy = 1,
SourceOver = 0
}
public enum CompositingMode {
SourceCopy,
SourceOver
}
}
@@ -1,11 +1,11 @@
//
// System.Drawing.Drawing2D.CompostingQuality.cs
// System.Drawing.CompostingQuality.cs
//
// Author:
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,11 +14,11 @@ namespace System.Drawing.Drawing2D {
/// Summary description for CompostingQuality.
/// </summary>
public enum CompositingQuality {
AssumeLinear = 4,
Default = 0,
GammaCorrected = 3,
HighQuality = 2,
HighSpeed = 1,
Invalid = -1
AssumeLinear,
Default,
GammaCorrected,
HighQuality,
HighSpeed,
Invalid
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,8 +14,8 @@ namespace System.Drawing.Drawing2D {
/// Summary description for CoordinateSpace.
/// </summary>
public enum CoordinateSpace {
Device = 2,
Page = 1,
World = 0
Device,
Page,
World
}
}
@@ -4,25 +4,22 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
namespace System.Drawing.Drawing2D {
namespace System.Drawing.Drawing2D
{
/// <summary>
/// Summary description for CustomLineCap.
/// </summary>
public class CustomLineCap {// : MarshalByRefObject, ICloneable, IDisposable {
protected CustomLineCap() {
}
public CustomLineCap(GraphicsPath fillPAth, GraphicsPath strokePAth, LineCap baseCap, float baseInset) {
}
public CustomLineCap(GraphicsPath fillPAth, GraphicsPath strokePAth, LineCap baseCap) {
}
public CustomLineCap(GraphicsPath fillPAth, GraphicsPath strokePAth) {
public class CustomLineCap
{
public CustomLineCap()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,11 +14,11 @@ namespace System.Drawing.Drawing2D
/// Summary description for DashStyle.
/// </summary>
public enum DashStyle {
Custom = 5,
Dash = 1,
DashDot = 3,
DashDotDot = 4,
Dot = 2,
Solid = 0
Custom,
Dash,
DashDot,
DashDotDot,
Dot,
Solid
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -15,7 +15,7 @@ namespace System.Drawing.Drawing2D {
/// Summary description for FillMode.
/// </summary>
public enum FillMode {
Alternate = 0,
Winding = 1
Alternate,
Winding
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,7 +14,7 @@ namespace System.Drawing.Drawing2D {
/// Summary description for FlushIntention.
/// </summary>
public enum FlushIntention {
Flush = 0,
Sync = 1
Flush,
Sync
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -17,6 +17,9 @@ namespace System.Drawing.Drawing2D
{
public GraphicsContainer()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
namespace System.Drawing.Drawing2D
@@ -15,8 +15,8 @@ namespace System.Drawing.Drawing2D
public sealed class GraphicsPath //: MarshalByRefObject, ICloneable, IDisposable
{
//[MonoTODO]
//public GraphicsPath() {
//}
public GraphicsPath() {
}
//[MonoTODO]
//public GraphicsPath(FillMode fillMode) : this() {
//}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -17,6 +17,9 @@ namespace System.Drawing.Drawing2D
{
public GraphicsPathIterator()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -17,6 +17,9 @@ namespace System.Drawing.Drawing2D
{
public GraphicsState()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -17,6 +17,9 @@ namespace System.Drawing.Drawing2D
{
public HatchBrush()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,62 +14,62 @@ namespace System.Drawing.Drawing2D {
/// <summary>
/// Summary description for HatchStyle.
/// </summary>
public enum HatchStyle {
BackwardDiagonal = 3,
Cross = 4,
DarkDownwardDiagonal = 20,
DarkHorizontal = 29,
DarkUpwardDiagonal = 21,
DarkVertical = 28,
DashedDownwardDiagonal = 30,
DashedHorizontal = 32,
DashedUpwardDiagonal = 31,
DashedVertical = 33,
DiagonalBrick = 38,
DiagonalCross = 5,
Divot = 42,
DottedDiamond = 44,
DottedGrid = 43,
ForwardDiagonal = 2,
Horizontal = 0,
HorizontalBrick = 39,
LargeCheckerBoard = 50,
LargeConfetti = 35,
LargeGrid = 4,
LightDownwardDiagonal = 18,
LightHorizontal = 25,
LightUpwardDiagonal = 19,
LightVertical = 24,
Max = 4,
Min = 0,
NarrowHorizontal = 27,
NarrowVertical = 26,
OutlinedDiamond = 51,
Percent05 = 6,
Percent10 = 7,
Percent20 = 8,
Percent25 = 9,
Percent30 = 10,
Percent40 = 11,
Percent50 = 12,
Percent60 = 13,
Percent70 = 14,
Percent75 = 15,
Percent80 = 16,
Percent90 = 17,
Plaid = 41,
Shingle = 45,
SmallCheckerBoard = 49,
SmallConfetti = 34,
SmallGrid = 48,
SolidDiamond = 52,
Sphere = 47,
Trellis = 46,
Vertical = 1,
Wave = 37,
Weave = 40,
WideDownwardDiagonal = 22,
WideUpwardDiagonal = 21,
ZigZag = 36
}
public enum HatchStyle {
BackwardDiagonal,
Cross,
DarkDownwardDiagonal,
DarkHorizontal,
DarkUpwardDiagonal,
DarkVertical,
DashedDownwardDiagonal,
DashedHorizontal,
DashedUpwardDiagonal,
DashedVertical,
DiagonalBrick,
DiagonalCross,
Divot,
DottedDiamond,
DottedGrid,
ForwardDiagonal,
Horizontal,
HorizontalBrick,
LargeCheckerBoard,
LargeConfetti,
LargeGrid,
LightDownwardDiagonal,
LightHorizontal,
LightUpwardDiagonal,
LightVertical,
Max,
Min,
NarrowHorizontal,
NarrowVertical,
OutlinedDiamond,
Percent05,
Percent10,
Percent20,
Percent25,
Percent30,
Percent40,
Percent50,
Percent60,
Percent70,
Percent75,
Percent80,
Percent90,
Plaid,
Shingle,
SmallCheckerBoard,
SmallConfetti,
SmallGrid,
SolidDiamond,
Sphere,
Trellis,
Vertical,
Wave,
Weave,
WideDownwardDiagonal,
WideUpwardDiagonal,
ZigZag
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,14 +14,14 @@ namespace System.Drawing.Drawing2D {
/// Summary description for InterpolationMode.
/// </summary>
public enum InterpolationMode {
Bicubic = 4,
Bilinear = 3,
Default = 0,
High = 2,
HighQualityBicubic = 7,
HighQualityBilinear = 6,
Invalid = -1,
Low = 1,
NearestNeighbour = 5
Bicubic,
Bilinear,
Default,
High,
HighQualityBicubic,
HighQualityBilinear,
Invalid,
Low,
NearestNeighbour
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,16 +14,16 @@ namespace System.Drawing.Drawing2D {
/// Summary description for LineCap.
/// </summary>
public enum LineCap {
AnchorMask = 240,
ArrowAnchor = 20,
Custom = 255,
DiamondAnchor = 19,
Flat = 0,
NoAnchor = 16,
Round = 2,
RoundAnchor = 18,
Square = 1,
SquareAnchor = 17,
Triangle = 3
AnchorMask,
ArrowAnchor,
Custom,
DiamondAnchor,
Flat,
NoAnchor,
Round,
RoundAnchor,
Square,
SquareAnchor,
Triangle
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,9 +14,9 @@ namespace System.Drawing.Drawing2D {
/// Summary description for LineJoin.
/// </summary>
public enum LineJoin {
Bevel = 1,
Miter = 0,
MiterClipped = 3,
Round = 2
Bevel,
Miter,
MiterClipped,
Round
}
}
@@ -4,11 +4,11 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
namespace System.Drawing2D
namespace System.Drawing.Drawing2D
{
/// <summary>
/// Summary description for LinearGradientBrush.
@@ -17,6 +17,9 @@ namespace System.Drawing2D
{
public LinearGradientBrush()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,9 +14,9 @@ namespace System.Drawing.Drawing2D {
/// Summary description for LinearGradientMode.
/// </summary>
public enum LinearGradientMode {
BackwardDiagonal = 3,
ForwardDiagonal = 2,
Horizontal = 0,
Vertical = 1
BackwardDiagonal,
ForwardDiagonal,
Horizontal,
Vertical
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,7 +14,7 @@ namespace System.Drawing.Drawing2D {
/// Summary description for MatrixOrder.
/// </summary>
public enum MatrixOrder {
Append = 1,
Prepend = 0
Append,
Prepend
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -17,6 +17,9 @@ namespace System.Drawing.Drawing2D
{
public PathData()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -17,6 +17,9 @@ namespace System.Drawing.Drawing2D
{
public PathGradientBrush()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
// (C) 2002 Ximian, Inc
//
using System;
@@ -14,13 +14,13 @@ namespace System.Drawing.Drawing2D {
/// Summary description for PathPointType.
/// </summary>
public enum PathPointType {
Bezier = 3,
Bezier3 = 3,
CloseSubpath = 128,
DashMode = 16,
Line = 1,
PathMarker = 32,
PathTypeMask = 7,
Start = 0
Bezier,
Bezier3,
CloseSubpath,
DashMode,
Line,
PathMarker,
PathTypeMask,
Start
}
}
Loaded 100 of 394 files, more files were not shown because too many files have changed in this diff. Show more