mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 03:51:19 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46a6b24b43 | ||
|
|
f74ec6eee5 | ||
|
|
308a67b9c3 | ||
|
|
aacbfb8210 | ||
|
|
3ec6689a51 | ||
|
|
bb6ef3268f | ||
|
|
dc0812150d | ||
|
|
ad4821f26a | ||
|
|
eaf0aa7fbe | ||
|
|
89d747ea99 | ||
|
|
ca97f02e5c | ||
|
|
af43004774 | ||
|
|
6d9d8d4224 | ||
|
|
f8abecbb7f | ||
|
|
3786083fc6 | ||
|
|
a56a1a0f39 | ||
|
|
5844cd840c | ||
|
|
63f894376b | ||
|
|
d808f4cd2c | ||
|
|
47cbf3c66b | ||
|
|
6ff5c436a3 | ||
|
|
029b4e1fce | ||
|
|
047c999e9e | ||
|
|
6c729d5040 | ||
|
|
c836c2b8e7 | ||
|
|
e9adfe4a34 | ||
|
|
83591627cb | ||
|
|
b4d47f5448 | ||
|
|
7132e98736 | ||
|
|
260fcb6b93 | ||
|
|
191a65c1ec | ||
|
|
efb4caccc5 | ||
|
|
43d6c847f4 | ||
|
|
31f33f23a3 | ||
|
|
2dddb5bd02 | ||
|
|
a771ee1188 | ||
|
|
b2c2697cf8 | ||
|
|
bd922647f4 | ||
|
|
b80347938e | ||
|
|
a3df14a694 | ||
|
|
a3fda2d3f8 | ||
|
|
9984280aca | ||
|
|
b7f52847d5 | ||
|
|
12f5301d37 | ||
|
|
832b6c0b5e | ||
|
|
6d7b6e68dd | ||
|
|
99d0fb74a3 | ||
|
|
e97d71bc98 | ||
|
|
a74e0bd2c6 | ||
|
|
cbe579519f | ||
|
|
2ae1fd351e | ||
|
|
eba56b9643 | ||
|
|
1af72c5084 | ||
|
|
9f7b2c132a | ||
|
|
2fbf90ef01 | ||
|
|
3accd72948 | ||
|
|
d783a927f4 | ||
|
|
7217ade08e | ||
|
|
2ed502499e | ||
|
|
8b911be307 | ||
|
|
61b1685675 | ||
|
|
2352aa0cf1 | ||
|
|
f55ca996ab | ||
|
|
2c5bcddb86 | ||
|
|
f80ac8be85 | ||
|
|
db03364a32 | ||
|
|
5f12cfc8d7 | ||
|
|
07feaea8d0 | ||
|
|
6ca7b36d86 | ||
|
|
d4a29fe97a | ||
|
|
bf9ad10d34 | ||
|
|
f4ad42ac18 | ||
|
|
67ff9f4b28 | ||
|
|
e11a99439c | ||
|
|
e6522fa2d6 | ||
|
|
5694aa2301 |
No files matched your search
@@ -1,3 +1,344 @@
|
||||
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
|
||||
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
#undef HAVE_INET_PTON
|
||||
#undef HAVE_INET_ATON
|
||||
#undef HAVE_SOL_IP
|
||||
#undef HAVE_SOL_TCP
|
||||
#undef HAVE_IP_PKTINFO
|
||||
#undef HAVE_STRUCT_IP_MREQN
|
||||
#undef HAVE_PTHREAD
|
||||
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
#undef USE_MONO_MUTEX
|
||||
#undef HAVE_LARGE_FILE_SUPPORT
|
||||
#undef PLATFORM_WIN32
|
||||
#undef HAVE_NEW_ICONV
|
||||
#undef NAME_DEV_RANDOM
|
||||
#undef HAVE_CRYPT_RNG
|
||||
#undef HAVE_BOEHM_GC
|
||||
|
||||
/* The number of bytes in a void *. */
|
||||
#undef SIZEOF_VOID_P
|
||||
|
||||
/* Define if you have the inet_aton function. */
|
||||
#undef HAVE_INET_ATON
|
||||
|
||||
/* Define if you have the inet_pton function. */
|
||||
#undef HAVE_INET_PTON
|
||||
|
||||
/* Define if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
#undef HAVE_NETDB_H
|
||||
|
||||
/* Define if you have the <sys/filio.h> header file. */
|
||||
#undef HAVE_SYS_FILIO_H
|
||||
|
||||
/* Define if you have the <sys/sockio.h> header file. */
|
||||
#undef HAVE_SYS_SOCKIO_H
|
||||
|
||||
/* Define if you have the <utime.h> header file. */
|
||||
#undef HAVE_UTIME_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
AC_INIT(README)
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono, 0.20)
|
||||
AM_INIT_AUTOMAKE(mono, 0.21)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
#
|
||||
|
||||
+69
-23
@@ -13,12 +13,16 @@
|
||||
section</a>, the <a
|
||||
href="http://www.go-mono.org/faq.html">FAQ</a>.
|
||||
|
||||
<b>Important</b>: The contributed binaries for Windows
|
||||
binaries of Mono 0.20 contained a virus. Please read <a
|
||||
href="virus.html">this</a> if you installed the binary.
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
<td>
|
||||
<b>Release 0.19</b><br>
|
||||
<a href="archive/mono-0.19">Release notes</a><br>
|
||||
<b>Release 0.20</b><br>
|
||||
<a href="archive/mono-0.20">Release notes</a><br>
|
||||
Jan 20th, 2003
|
||||
</td>
|
||||
<td>
|
||||
@@ -29,10 +33,10 @@
|
||||
</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>
|
||||
<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.2.tar.gz">XSP web server</a> <b><font color="#dd0000">New!</font></b>
|
||||
<li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
|
||||
<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>
|
||||
@@ -45,7 +49,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.19-1.src.rpm">mono-0.19-1.src.rpm</a>
|
||||
<li><a href="archive/mono-0.20-1.src.rpm">mono-0.20-1.src.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -58,8 +62,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.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>
|
||||
<li><a href="archive/redhat-73-i386/mono-0.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
@@ -67,8 +71,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.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>
|
||||
<li><a href="archive/redhat-72-i386/mono-0.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-72-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -78,8 +82,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.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>
|
||||
<li><a href="archive/redhat-71-i386/mono-0.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
@@ -87,8 +91,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.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>
|
||||
<li><a href="archive/mandrake-82-i386/mono-0.20-1.i586.rpm">mono-0.20-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-devel-0.20-1.i586.rpm">mono-devel-0.20-1.i586.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -98,8 +102,8 @@
|
||||
<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.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>
|
||||
<li><a href="archive/suse-80-i386/mono-0.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
@@ -107,18 +111,18 @@
|
||||
<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>
|
||||
<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>
|
||||
</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>␍ -->
|
||||
<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>
|
||||
<td bgcolor="#999999">
|
||||
<b>Debian packages</b>
|
||||
<ul>
|
||||
@@ -149,6 +153,48 @@
|
||||
|
||||
We provide binaries for older releases until we have packages for the new release.
|
||||
|
||||
<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">
|
||||
|
||||
@@ -102,16 +102,37 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<b>Upcoming presentations</b>
|
||||
@item Feb 25th, 2003: Mono 0.20 for Windows released; New Apache module released.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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>
|
||||
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.
|
||||
|
||||
@item Feb 18th, 2003: Volunteers to document Gtk#
|
||||
|
||||
|
||||
@@ -80,6 +80,16 @@
|
||||
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>
|
||||
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
|
||||
</table>
|
||||
|
||||
Other mailing lists of interest:
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
System.Object
|
||||
System.Exception
|
||||
System.ValueType
|
||||
System.Delegate
|
||||
System.MulticastDelegate
|
||||
System.Enum
|
||||
System.Activator
|
||||
System.ArgIterator
|
||||
System.__ComObject
|
||||
System.TypedReference
|
||||
System.Security.AllowPartiallyTrustedCallersAttribute
|
||||
System.Runtime.Serialization.Formatter
|
||||
System.Runtime.Serialization.FormatterConverter
|
||||
System.Runtime.Serialization.FormatterServices
|
||||
System.Runtime.Serialization.ObjectIDGenerator
|
||||
System.Runtime.Serialization.ObjectManager
|
||||
System.Reflection.ModuleResolveEventHandler
|
||||
System.Reflection.Pointer
|
||||
System.Globalization.CompareInfo
|
||||
System.Globalization.HebrewCalendar
|
||||
System.Globalization.HijriCalendar
|
||||
System.Globalization.JapaneseCalendar
|
||||
System.Globalization.KoreanCalendar
|
||||
System.Globalization.SortKey
|
||||
System.Globalization.StringInfo
|
||||
System.Globalization.TaiwanCalendar
|
||||
System.Globalization.TextElementEnumerator
|
||||
System.Globalization.TextInfo
|
||||
System.Globalization.ThaiBuddhistCalendar
|
||||
System.IO.IsolatedStorage.IsolatedStorageFile
|
||||
System.Reflection.Emit.MethodRental
|
||||
System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
|
||||
System.Runtime.CompilerServices.CallConvCdecl
|
||||
System.Runtime.CompilerServices.CallConvStdcall
|
||||
System.Runtime.CompilerServices.CallConvThiscall
|
||||
System.Runtime.CompilerServices.CallConvFastcall
|
||||
System.Runtime.CompilerServices.CustomConstantAttribute
|
||||
System.Runtime.CompilerServices.DateTimeConstantAttribute
|
||||
System.Runtime.CompilerServices.DiscardableAttribute
|
||||
System.Runtime.CompilerServices.DecimalConstantAttribute
|
||||
System.Runtime.CompilerServices.CompilationRelaxationsAttribute
|
||||
System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
|
||||
System.Runtime.CompilerServices.IDispatchConstantAttribute
|
||||
System.Runtime.CompilerServices.IsVolatile
|
||||
System.Runtime.CompilerServices.IUnknownConstantAttribute
|
||||
System.Runtime.CompilerServices.RequiredAttributeAttribute
|
||||
System.Runtime.InteropServices.ArrayWithOffset
|
||||
System.Runtime.InteropServices.DispIdAttribute
|
||||
System.Runtime.InteropServices.ClassInterfaceType
|
||||
System.Runtime.InteropServices.ClassInterfaceAttribute
|
||||
System.Runtime.InteropServices.ComVisibleAttribute
|
||||
System.Runtime.InteropServices.LCIDConversionAttribute
|
||||
System.Runtime.InteropServices.ComRegisterFunctionAttribute
|
||||
System.Runtime.InteropServices.ComUnregisterFunctionAttribute
|
||||
System.Runtime.InteropServices.ProgIdAttribute
|
||||
System.Runtime.InteropServices.ImportedFromTypeLibAttribute
|
||||
System.Runtime.InteropServices.IDispatchImplType
|
||||
System.Runtime.InteropServices.IDispatchImplAttribute
|
||||
System.Runtime.InteropServices.ComSourceInterfacesAttribute
|
||||
System.Runtime.InteropServices.ComConversionLossAttribute
|
||||
System.Runtime.InteropServices.TypeLibTypeFlags
|
||||
System.Runtime.InteropServices.TypeLibFuncFlags
|
||||
System.Runtime.InteropServices.TypeLibVarFlags
|
||||
System.Runtime.InteropServices.TypeLibTypeAttribute
|
||||
System.Runtime.InteropServices.TypeLibFuncAttribute
|
||||
System.Runtime.InteropServices.TypeLibVarAttribute
|
||||
System.Runtime.InteropServices.ComImportAttribute
|
||||
System.Runtime.InteropServices.PreserveSigAttribute
|
||||
System.Runtime.InteropServices.ComAliasNameAttribute
|
||||
System.Runtime.InteropServices.AutomationProxyAttribute
|
||||
System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
|
||||
System.Runtime.InteropServices.CoClassAttribute
|
||||
System.Runtime.InteropServices.ComEventInterfaceAttribute
|
||||
System.Runtime.InteropServices.COMException
|
||||
System.Runtime.InteropServices.ComMemberType
|
||||
System.Runtime.InteropServices.CurrencyWrapper
|
||||
System.Runtime.InteropServices.DispatchWrapper
|
||||
System.Runtime.InteropServices.ErrorWrapper
|
||||
System.Runtime.InteropServices.ExtensibleClassFactory
|
||||
System.Runtime.InteropServices.HandleRef
|
||||
System.Runtime.InteropServices.InvalidComObjectException
|
||||
System.Runtime.InteropServices.InvalidOleVariantTypeException
|
||||
System.Runtime.InteropServices.TypeLibImporterFlags
|
||||
System.Runtime.InteropServices.ExporterEventKind
|
||||
System.Runtime.InteropServices.ITypeLibExporterNotifySink
|
||||
System.Runtime.InteropServices.ITypeLibConverter
|
||||
System.Runtime.InteropServices.MarshalDirectiveException
|
||||
System.Runtime.InteropServices.ObjectCreationDelegate
|
||||
System.Runtime.InteropServices.RuntimeEnvironment
|
||||
System.Runtime.InteropServices.RegistrationServices
|
||||
System.Runtime.InteropServices.SafeArrayRankMismatchException
|
||||
System.Runtime.InteropServices.SafeArrayTypeMismatchException
|
||||
System.Runtime.InteropServices.SEHException
|
||||
System.Runtime.InteropServices.TypeLibConverter
|
||||
System.Runtime.InteropServices.BIND_OPTS
|
||||
System.Runtime.InteropServices.UCOMIBindCtx
|
||||
System.Runtime.InteropServices.UCOMIConnectionPointContainer
|
||||
System.Runtime.InteropServices.UCOMIConnectionPoint
|
||||
System.Runtime.InteropServices.UCOMIEnumMoniker
|
||||
System.Runtime.InteropServices.CONNECTDATA
|
||||
System.Runtime.InteropServices.UCOMIEnumConnections
|
||||
System.Runtime.InteropServices.UCOMIEnumConnectionPoints
|
||||
System.Runtime.InteropServices.UCOMIEnumString
|
||||
System.Runtime.InteropServices.UCOMIEnumVARIANT
|
||||
System.Runtime.InteropServices.FILETIME
|
||||
System.Runtime.InteropServices.UCOMIMoniker
|
||||
System.Runtime.InteropServices.UCOMIPersistFile
|
||||
System.Runtime.InteropServices.UCOMIRunningObjectTable
|
||||
System.Runtime.InteropServices.STATSTG
|
||||
System.Runtime.InteropServices.UCOMIStream
|
||||
System.Runtime.InteropServices.DESCKIND
|
||||
System.Runtime.InteropServices.BINDPTR
|
||||
System.Runtime.InteropServices.UCOMITypeComp
|
||||
System.Runtime.InteropServices.TYPEKIND
|
||||
System.Runtime.InteropServices.TYPEFLAGS
|
||||
System.Runtime.InteropServices.IMPLTYPEFLAGS
|
||||
System.Runtime.InteropServices.TYPEATTR
|
||||
System.Runtime.InteropServices.FUNCDESC
|
||||
System.Runtime.InteropServices.IDLFLAG
|
||||
System.Runtime.InteropServices.IDLDESC
|
||||
System.Runtime.InteropServices.PARAMFLAG
|
||||
System.Runtime.InteropServices.PARAMDESC
|
||||
System.Runtime.InteropServices.TYPEDESC
|
||||
System.Runtime.InteropServices.ELEMDESC
|
||||
System.Runtime.InteropServices.VARDESC
|
||||
System.Runtime.InteropServices.DISPPARAMS
|
||||
System.Runtime.InteropServices.EXCEPINFO
|
||||
System.Runtime.InteropServices.FUNCKIND
|
||||
System.Runtime.InteropServices.INVOKEKIND
|
||||
System.Runtime.InteropServices.CALLCONV
|
||||
System.Runtime.InteropServices.FUNCFLAGS
|
||||
System.Runtime.InteropServices.VARFLAGS
|
||||
System.Runtime.InteropServices.UCOMITypeInfo
|
||||
System.Runtime.InteropServices.SYSKIND
|
||||
System.Runtime.InteropServices.LIBFLAGS
|
||||
System.Runtime.InteropServices.TYPELIBATTR
|
||||
System.Runtime.InteropServices.UCOMITypeLib
|
||||
System.Runtime.InteropServices.UnknownWrapper
|
||||
System.Runtime.Remoting.IObjectHandle
|
||||
System.Runtime.Remoting.IRemotingTypeInfo
|
||||
System.Runtime.Remoting.IChannelInfo
|
||||
System.Runtime.Remoting.IEnvoyInfo
|
||||
System.Runtime.Remoting.RemotingConfiguration
|
||||
System.Runtime.Remoting.TypeEntry
|
||||
System.Runtime.Remoting.ActivatedClientTypeEntry
|
||||
System.Runtime.Remoting.ActivatedServiceTypeEntry
|
||||
System.Runtime.Remoting.WellKnownClientTypeEntry
|
||||
System.Runtime.Remoting.WellKnownServiceTypeEntry
|
||||
System.Runtime.Remoting.RemotingException
|
||||
System.Runtime.Remoting.ServerException
|
||||
System.Runtime.Remoting.RemotingTimeoutException
|
||||
System.Runtime.Remoting.RemotingServices
|
||||
System.Runtime.Remoting.InternalRemotingServices
|
||||
System.Runtime.Remoting.SoapServices
|
||||
System.Runtime.Remoting.Activation.UrlAttribute
|
||||
System.Runtime.Remoting.Messaging.IMessageSink
|
||||
System.Runtime.Remoting.Messaging.AsyncResult
|
||||
System.Runtime.Remoting.Messaging.CallContext
|
||||
System.Runtime.Remoting.Messaging.ILogicalThreadAffinative
|
||||
System.Runtime.Remoting.Messaging.InternalMessageWrapper
|
||||
System.Runtime.Remoting.Messaging.IMethodCallMessage
|
||||
System.Runtime.Remoting.Messaging.MethodCallMessageWrapper
|
||||
System.Runtime.Remoting.Messaging.HeaderHandler
|
||||
System.Runtime.Remoting.Messaging.IMessageCtrl
|
||||
System.Runtime.Remoting.Messaging.IRemotingFormatter
|
||||
System.Runtime.Remoting.Messaging.ReturnMessage
|
||||
System.Runtime.Remoting.Messaging.MethodCall
|
||||
System.Runtime.Remoting.Messaging.ConstructionCall
|
||||
System.Runtime.Remoting.Messaging.MethodResponse
|
||||
System.Runtime.Remoting.Messaging.ConstructionResponse
|
||||
System.Runtime.Remoting.Messaging.MethodReturnMessageWrapper
|
||||
System.Runtime.Remoting.Messaging.OneWayAttribute
|
||||
System.Runtime.Remoting.Messaging.MessageSurrogateFilter
|
||||
System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
|
||||
System.Runtime.Remoting.Contexts.CrossContextDelegate
|
||||
System.Runtime.Remoting.Contexts.ContextProperty
|
||||
System.Runtime.Remoting.Contexts.IContextPropertyActivator
|
||||
System.Runtime.Remoting.Contexts.IContributeClientContextSink
|
||||
System.Runtime.Remoting.Contexts.IContributeDynamicSink
|
||||
System.Runtime.Remoting.Contexts.IContributeEnvoySink
|
||||
System.Runtime.Remoting.Contexts.IContributeObjectSink
|
||||
System.Runtime.Remoting.Contexts.IContributeServerContextSink
|
||||
System.Runtime.Serialization.Formatters.InternalRM
|
||||
System.Runtime.Serialization.Formatters.InternalST
|
||||
System.Runtime.Serialization.Formatters.SoapMessage
|
||||
System.Runtime.Serialization.Formatters.SoapFault
|
||||
System.Runtime.Serialization.Formatters.ServerFault
|
||||
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
System.Security.Cryptography.CryptoConfig
|
||||
System.Security.Cryptography.KeyedHashAlgorithm
|
||||
System.Security.Cryptography.HMACSHA1
|
||||
System.Security.Cryptography.MACTripleDES
|
||||
System.Security.Cryptography.MaskGenerationMethod
|
||||
System.Security.Cryptography.PasswordDeriveBytes
|
||||
System.Security.Cryptography.PKCS1MaskGenerationMethod
|
||||
System.Security.Cryptography.RC2
|
||||
System.Security.Cryptography.RC2CryptoServiceProvider
|
||||
System.Security.Cryptography.RSACryptoServiceProvider
|
||||
System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter
|
||||
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
|
||||
System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter
|
||||
System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter
|
||||
System.Security.Cryptography.RSAPKCS1SignatureDeformatter
|
||||
System.Security.Cryptography.RSAPKCS1SignatureFormatter
|
||||
System.Security.Cryptography.SHA1Managed
|
||||
System.Security.Cryptography.TripleDES
|
||||
System.Security.Cryptography.TripleDESCryptoServiceProvider
|
||||
System.Security.Permissions.EnvironmentPermission
|
||||
System.Security.Permissions.FileDialogPermission
|
||||
System.Security.Permissions.IsolatedStorageFilePermission
|
||||
System.Security.Permissions.PrincipalPermissionAttribute
|
||||
System.Security.Permissions.SecurityPermissionAttribute
|
||||
System.Security.Permissions.PublisherIdentityPermissionAttribute
|
||||
System.Security.Permissions.PublisherIdentityPermission
|
||||
System.Security.Permissions.ReflectionPermission
|
||||
System.Security.Permissions.RegistryPermission
|
||||
System.Security.Permissions.PrincipalPermission
|
||||
System.Security.Permissions.SiteIdentityPermission
|
||||
System.Security.Permissions.StrongNameIdentityPermission
|
||||
System.Security.Permissions.StrongNamePublicKeyBlob
|
||||
System.Security.Permissions.UIPermission
|
||||
System.Security.Permissions.UrlIdentityPermission
|
||||
System.Security.Permissions.ZoneIdentityPermission
|
||||
System.Security.Policy.ApplicationDirectory
|
||||
System.Security.Policy.ApplicationDirectoryMembershipCondition
|
||||
System.Security.Policy.FirstMatchCodeGroup
|
||||
System.Security.Policy.Hash
|
||||
System.Security.Policy.HashMembershipCondition
|
||||
System.Security.Policy.NetCodeGroup
|
||||
System.Security.Policy.PermissionRequestEvidence
|
||||
System.Security.Policy.Publisher
|
||||
System.Security.Policy.PublisherMembershipCondition
|
||||
System.Security.Policy.Site
|
||||
System.Security.Policy.SiteMembershipCondition
|
||||
System.Security.Policy.StrongName
|
||||
System.Security.Policy.StrongNameMembershipCondition
|
||||
System.Security.Policy.UnionCodeGroup
|
||||
System.Security.Policy.Url
|
||||
System.Security.Policy.UrlMembershipCondition
|
||||
System.Security.Policy.Zone
|
||||
System.Security.Policy.ZoneMembershipCondition
|
||||
System.Security.Principal.WindowsIdentity
|
||||
System.Security.Principal.WindowsImpersonationContext
|
||||
System.Security.Principal.WindowsPrincipal
|
||||
System.Threading.CompressedStack
|
||||
|
||||
@@ -136,6 +136,11 @@ 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.
|
||||
.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
|
||||
|
||||
@@ -16,3 +16,4 @@ Class Libraries:
|
||||
John Barnette ([email protected])
|
||||
Daniel Morgan <[email protected]>
|
||||
Sebastien Pouliot <[email protected]>
|
||||
Per Arneng <[email protected]>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,6 +2,7 @@
|
||||
|
||||
* makefile.gnu (all): Give this dependencies
|
||||
so that we don't rebuild every time.
|
||||
(all): Take two.
|
||||
|
||||
2003-02-22 Jackson Harper <[email protected]>
|
||||
|
||||
|
||||
@@ -56,10 +56,12 @@ SOURCES_EXCLUDE=
|
||||
|
||||
#include $(topdir)/class/library.make
|
||||
|
||||
mddump.exe: all
|
||||
default: all mddump.exe
|
||||
|
||||
mddump.exe: $(SOURCES_INCLUDE)
|
||||
mcs /out:mddump.exe /unsafe $(SOURCES_INCLUDE)
|
||||
|
||||
clean:
|
||||
full-clean: clean
|
||||
rm -f mddump.exe
|
||||
|
||||
include $(topdir)/class/library.make
|
||||
|
||||
@@ -1,3 +1,27 @@
|
||||
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:
|
||||
|
||||
@@ -97,7 +97,6 @@ namespace System.Data.OracleClient.Oci {
|
||||
|
||||
public void Bind (OciStatementHandle statement, object val)
|
||||
{
|
||||
Console.WriteLine ("IN BIND");
|
||||
handle = IntPtr.Zero;
|
||||
|
||||
this.statement = statement;
|
||||
|
||||
+95
-37
@@ -35,6 +35,7 @@ namespace System.Data.OracleClient.Oci {
|
||||
int rlenp;
|
||||
sbyte scale;
|
||||
|
||||
OciStatementHandle statement;
|
||||
OciLobLocator lobLocator;
|
||||
|
||||
#endregion // Fields
|
||||
@@ -46,6 +47,8 @@ namespace System.Data.OracleClient.Oci {
|
||||
int ociTypeInt;
|
||||
int status = 0;
|
||||
|
||||
this.statement = statement;
|
||||
|
||||
IntPtr parameterHandle = statement.CreateParameterHandle (position);
|
||||
|
||||
status = OciGlue.OCIAttrGetInt32 (parameterHandle,
|
||||
@@ -82,42 +85,7 @@ namespace System.Data.OracleClient.Oci {
|
||||
}
|
||||
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);
|
||||
}
|
||||
Define (position);
|
||||
|
||||
statement.FreeParameterHandle (parameterHandle);
|
||||
}
|
||||
@@ -176,6 +144,96 @@ 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);
|
||||
|
||||
void Define (int position)
|
||||
{
|
||||
switch (definedType) {
|
||||
case OciDataType.Date:
|
||||
definedSize = 20;
|
||||
DefineChar (position); // HANDLE AS CHAR FOR NOW
|
||||
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 DefineChar (int position)
|
||||
{
|
||||
ociType = OciDataType.Char;
|
||||
value = Marshal.AllocHGlobal (definedSize);
|
||||
|
||||
int status = 0;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
void DefineLob (int position, OciDataType type)
|
||||
{
|
||||
ociType = type;
|
||||
int status = 0;
|
||||
|
||||
definedSize = -1;
|
||||
|
||||
lobLocator = (OciLobLocator) statement.Environment.AllocateDescriptor (OciDescriptorType.LobLocator);
|
||||
if (lobLocator == null) {
|
||||
OciErrorInfo info = statement.Environment.HandleError ();
|
||||
throw new OracleException (info.ErrorCode, info.ErrorMessage);
|
||||
}
|
||||
value = lobLocator.Handle;
|
||||
lobLocator.ErrorHandle = statement.ErrorHandle;
|
||||
lobLocator.Service = statement.Service;
|
||||
|
||||
status = OCIDefineByPosPtr (statement.Handle,
|
||||
out handle,
|
||||
statement.ErrorHandle.Handle,
|
||||
position,
|
||||
ref 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);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Marshal.FreeHGlobal (value);
|
||||
@@ -183,7 +241,7 @@ namespace System.Data.OracleClient.Oci {
|
||||
|
||||
public OracleLob GetOracleLob ()
|
||||
{
|
||||
return new OracleLob (lobLocator);
|
||||
return new OracleLob (lobLocator, ociType);
|
||||
}
|
||||
|
||||
public object GetValue ()
|
||||
|
||||
+3
@@ -108,6 +108,7 @@ namespace System.Data.OracleClient.Oci {
|
||||
type,
|
||||
0,
|
||||
IntPtr.Zero);
|
||||
|
||||
if (status != 0 && status != 1)
|
||||
return null;
|
||||
|
||||
@@ -141,8 +142,10 @@ namespace System.Data.OracleClient.Oci {
|
||||
type,
|
||||
0,
|
||||
IntPtr.Zero);
|
||||
|
||||
if (status != 0 && status != 1)
|
||||
return null;
|
||||
|
||||
switch (type) {
|
||||
case OciDescriptorType.LobLocator:
|
||||
return new OciLobLocator (this, newHandle);
|
||||
|
||||
@@ -16,11 +16,20 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Data.OracleClient;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Data.OracleClient.Oci {
|
||||
internal sealed class OciLobLocator : OciDescriptorHandle, IOciDescriptorHandle, IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
||||
OciErrorHandle errorHandle;
|
||||
OciServiceHandle service;
|
||||
OciDataType type;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
public OciLobLocator (OciEnvironmentHandle environment, IntPtr handle)
|
||||
@@ -30,8 +39,246 @@ namespace System.Data.OracleClient.Oci {
|
||||
|
||||
#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 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)
|
||||
{
|
||||
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 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;
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Environment.FreeDescriptor (this);
|
||||
|
||||
@@ -178,7 +178,10 @@ namespace System.Data.OracleClient
|
||||
|
||||
public void Close ()
|
||||
{
|
||||
oci.Disconnect();
|
||||
if (transaction != null)
|
||||
transaction.Rollback ();
|
||||
|
||||
oci.Disconnect ();
|
||||
state = ConnectionState.Closed;
|
||||
}
|
||||
|
||||
|
||||
@@ -283,10 +283,11 @@ namespace System.Data.OracleClient {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public OracleLob GetOracleLob (int i)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
OracleLob output = ((OciDefineHandle) statement.Values [i]).GetOracleLob ();
|
||||
output.connection = command.Connection;
|
||||
return output;
|
||||
}
|
||||
|
||||
public OracleNumber GetOracleNumber (int i)
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
//
|
||||
|
||||
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
|
||||
@@ -26,11 +27,15 @@ namespace System.Data.OracleClient {
|
||||
|
||||
public static readonly new OracleLob Null = new OracleLob ();
|
||||
|
||||
OracleConnection connection;
|
||||
internal OracleConnection connection;
|
||||
bool isBatched = false;
|
||||
bool isOpen = true;
|
||||
bool notNull = false;
|
||||
OciLobLocator locator;
|
||||
OracleType type;
|
||||
|
||||
long length = -1;
|
||||
long position = 1;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
@@ -40,10 +45,19 @@ namespace System.Data.OracleClient {
|
||||
{
|
||||
}
|
||||
|
||||
internal OracleLob (OciLobLocator locator)
|
||||
internal OracleLob (OciLobLocator locator, OciDataType ociType)
|
||||
{
|
||||
notNull = true;
|
||||
this.locator = locator;
|
||||
|
||||
switch (ociType) {
|
||||
case OciDataType.Blob:
|
||||
type = OracleType.Blob;
|
||||
break;
|
||||
case OciDataType.Clob:
|
||||
type = OracleType.Clob;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
@@ -69,7 +83,7 @@ namespace System.Data.OracleClient {
|
||||
throw new InvalidOperationException ();
|
||||
if (!isOpen)
|
||||
throw new ObjectDisposedException ("OracleLob");
|
||||
throw new InvalidOperationException ();
|
||||
return locator.GetChunkSize ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,51 +110,52 @@ namespace System.Data.OracleClient {
|
||||
}
|
||||
|
||||
public override long Length {
|
||||
[MonoTODO]
|
||||
get {
|
||||
if (Connection.State == ConnectionState.Closed)
|
||||
throw new InvalidOperationException ();
|
||||
if (!isOpen)
|
||||
throw new ObjectDisposedException ("OracleLob");
|
||||
throw new NotImplementedException ();
|
||||
if (length >= 0)
|
||||
return length;
|
||||
return locator.GetLength (LobType == OracleType.Blob);
|
||||
}
|
||||
}
|
||||
|
||||
public OracleType LobType {
|
||||
[MonoTODO]
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
get { return type; }
|
||||
}
|
||||
|
||||
|
||||
public override long Position {
|
||||
[MonoTODO]
|
||||
get {
|
||||
if (Connection.State == ConnectionState.Closed)
|
||||
throw new InvalidOperationException ();
|
||||
if (!isOpen)
|
||||
throw new ObjectDisposedException ("OracleLob");
|
||||
throw new NotImplementedException ();
|
||||
return position;
|
||||
}
|
||||
[MonoTODO]
|
||||
set {
|
||||
if (!isOpen)
|
||||
throw new ObjectDisposedException ("OracleLob");
|
||||
if (value > Length)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
throw new NotImplementedException ();
|
||||
position = value;
|
||||
}
|
||||
}
|
||||
|
||||
public object Value {
|
||||
[MonoTODO]
|
||||
get {
|
||||
if (!isOpen)
|
||||
throw new ObjectDisposedException ("OracleLob");
|
||||
if (IsNull)
|
||||
return DBNull.Value;
|
||||
throw new NotImplementedException ();
|
||||
|
||||
byte[] buffer = new byte [Length];
|
||||
Read (buffer, 1, (int) Length);
|
||||
|
||||
if (LobType == OracleType.Clob)
|
||||
return (new UnicodeEncoding ()).GetString (buffer);
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,10 +178,10 @@ namespace System.Data.OracleClient {
|
||||
BeginBatch (OracleLobOpenMode.ReadOnly);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void BeginBatch (OracleLobOpenMode mode)
|
||||
{
|
||||
isBatched = true;
|
||||
locator.BeginBatch (mode);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -178,7 +193,8 @@ namespace System.Data.OracleClient {
|
||||
[MonoTODO]
|
||||
public override void Close ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
locator.Dispose ();
|
||||
isOpen = false;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -205,51 +221,128 @@ namespace System.Data.OracleClient {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public void EndBatch ()
|
||||
{
|
||||
locator.EndBatch ();
|
||||
isBatched = false;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public long Erase ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return Erase (1, Length);
|
||||
}
|
||||
|
||||
public long Erase (long offset, long amount)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
if (offset < 0)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
if (amount < 0)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
if (offset + amount > Length)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
if (offset > UInt32.MaxValue)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
if (amount > UInt32.MaxValue)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
return (long) locator.Erase ((uint) offset + 1, (uint) amount);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public override void Flush ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
// No-op
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public override int Read (byte[] buffer, int offset, int count)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
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;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public override long Seek (long offset, SeekOrigin origin)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
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;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public override void SetLength (long value)
|
||||
{
|
||||
throw new InvalidOperationException ();
|
||||
if ((LobType == OracleType.Clob || LobType == OracleType.NClob) && (value % 2) == 1)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
if (value > UInt32.MaxValue)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
if (connection.Transaction == null)
|
||||
throw new InvalidOperationException ();
|
||||
if (IsNull)
|
||||
throw new InvalidOperationException ();
|
||||
if (Connection.State == ConnectionState.Closed)
|
||||
throw new InvalidOperationException ();
|
||||
if (!isOpen)
|
||||
throw new ObjectDisposedException ("OracleLob");
|
||||
|
||||
locator.Trim ((uint) value);
|
||||
length = value;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public override void Write (byte[] buffer, int offset, int count)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
if (buffer == null)
|
||||
throw new ArgumentNullException ("Buffer is null.");
|
||||
if (offset < 0)
|
||||
throw new ArgumentOutOfRangeException ("Offset parameter must be positive.");
|
||||
if (count < 0)
|
||||
throw new ArgumentOutOfRangeException ("Count parameter must be positive.");
|
||||
if (offset + count > buffer.Length)
|
||||
throw new ArgumentOutOfRangeException ("Offset + Count > buffer Length.");
|
||||
if (offset > UInt32.MaxValue)
|
||||
throw new ArgumentOutOfRangeException ("Offset too big.");
|
||||
if (count > UInt32.MaxValue)
|
||||
throw new ArgumentOutOfRangeException ("Count too big.");
|
||||
if (LobType == OracleType.Clob || LobType == OracleType.NClob) {
|
||||
if (offset % 2 == 1)
|
||||
throw new ArgumentOutOfRangeException ("Offset must be even.");
|
||||
if (count % 2 == 1)
|
||||
throw new ArgumentOutOfRangeException ("Count must be even.");
|
||||
}
|
||||
if (connection.Transaction == null)
|
||||
throw new InvalidOperationException ("Transaction is null.");
|
||||
if (IsNull)
|
||||
throw new InvalidOperationException ("LOB is null.");
|
||||
if (connection.State == ConnectionState.Closed)
|
||||
throw new InvalidOperationException ("Connection is closed.");
|
||||
if (!isOpen)
|
||||
throw new ObjectDisposedException ("OracleLob");
|
||||
|
||||
if (offset + count == buffer.Length && offset == 0)
|
||||
position += locator.Write (buffer, (uint) Position, (uint) buffer.Length, LobType);
|
||||
else {
|
||||
byte[] copy = new byte [count];
|
||||
Array.Copy (buffer, offset, copy, 0, count);
|
||||
position += locator.Write (copy, (uint) Position, (uint) copy.Length, LobType);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
|
||||
@@ -40,8 +40,9 @@ namespace System.Data.OracleClient {
|
||||
}
|
||||
|
||||
public OracleMonthSpan (OracleMonthSpan from)
|
||||
: this (from)
|
||||
{
|
||||
this.notNull = from.notNull;
|
||||
this.value = from.value;
|
||||
}
|
||||
|
||||
public OracleMonthSpan (int years, int months)
|
||||
@@ -57,10 +58,11 @@ namespace System.Data.OracleClient {
|
||||
get { return !notNull; }
|
||||
}
|
||||
|
||||
public byte[] Value {
|
||||
public int Value {
|
||||
get {
|
||||
if (IsNull)
|
||||
throw new Exception ("Data is null.");
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -98,35 +100,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)
|
||||
@@ -177,7 +179,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)
|
||||
|
||||
@@ -21,9 +21,11 @@
|
||||
// 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
|
||||
{
|
||||
@@ -276,23 +278,58 @@ namespace Test.OracleClient
|
||||
|
||||
OracleCommand insert = connection.CreateCommand ();
|
||||
insert.Transaction = transaction;
|
||||
insert.CommandText = "INSERT INTO LOBTEST VALUES ('1234')";
|
||||
insert.CommandText = "INSERT INTO LOBTEST VALUES (EMPTY_CLOB())";
|
||||
insert.ExecuteNonQuery ();
|
||||
|
||||
OracleCommand select = connection.CreateCommand ();
|
||||
select.Transaction = transaction;
|
||||
select.CommandText = "SELECT CLOB_COLUMN FROM LOBTEST";
|
||||
select.CommandText = "SELECT CLOB_COLUMN FROM LOBTEST FOR UPDATE";
|
||||
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 ("ROLLBACK TRANSACTION ...");
|
||||
Console.WriteLine ("DROP TABLE...");
|
||||
|
||||
OracleCommand command = connection.CreateCommand ();
|
||||
command.CommandText = "DROP TABLE LOBTEST";
|
||||
command.ExecuteNonQuery ();
|
||||
|
||||
transaction.Rollback ();
|
||||
}
|
||||
|
||||
static void Wait(string msg)
|
||||
@@ -345,6 +382,7 @@ 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);
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
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,9 +74,14 @@ 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)
|
||||
@@ -97,7 +102,6 @@ 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;
|
||||
@@ -136,7 +140,6 @@ 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)
|
||||
@@ -291,30 +294,31 @@ namespace System.Data.Common {
|
||||
[MonoTODO ("Test")]
|
||||
private void BuildSchema (IDataReader reader, DataTable table, SchemaType schemaType)
|
||||
{
|
||||
string sourceColumnName;
|
||||
string sourceTableName;
|
||||
string dsColumnName;
|
||||
|
||||
ArrayList primaryKey = new ArrayList ();
|
||||
table.Columns.Clear ();
|
||||
ArrayList primaryKey = new ArrayList ();
|
||||
ArrayList sourceColumns = new ArrayList ();
|
||||
|
||||
foreach (DataRow schemaRow in reader.GetSchemaTable ().Rows) {
|
||||
// generate a unique column name in the dataset table.
|
||||
if (schemaRow ["BaseColumnName"].Equals (DBNull.Value))
|
||||
sourceColumnName = DefaultSourceColumnName;
|
||||
else
|
||||
sourceColumnName = (string) schemaRow ["BaseColumnName"];
|
||||
|
||||
dsColumnName = sourceColumnName;
|
||||
|
||||
for (int i = 1; table.Columns.Contains (dsColumnName); i += 1)
|
||||
dsColumnName = String.Format ("{0}{1}", sourceColumnName, i);
|
||||
|
||||
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;
|
||||
if (schemaRow ["BaseColumnName"].Equals (DBNull.Value))
|
||||
sourceColumnName = DefaultSourceColumnName;
|
||||
else
|
||||
sourceColumnName = (string) schemaRow ["BaseColumnName"];
|
||||
|
||||
string realSourceColumnName = sourceColumnName;
|
||||
|
||||
for (int i = 1; sourceColumns.Contains (realSourceColumnName); i += 1)
|
||||
realSourceColumnName = String.Format ("{0}{1}", sourceColumnName, i);
|
||||
sourceColumns.Add(realSourceColumnName);
|
||||
|
||||
// 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);
|
||||
@@ -322,7 +326,9 @@ namespace System.Data.Common {
|
||||
table.TableName = tableMapping.DataSetTable;
|
||||
|
||||
// check to see if the column mapping exists
|
||||
if (tableMapping.ColumnMappings.IndexOfDataSetColumn (dsColumnName) < 0) {
|
||||
if (tableMapping.ColumnMappings.Contains (dsColumnName)) {
|
||||
dsColumnName = tableMapping.ColumnMappings [realSourceColumnName].DataSetColumn;
|
||||
} else {
|
||||
if (MissingSchemaAction == MissingSchemaAction.Error)
|
||||
throw new SystemException ();
|
||||
tableMapping.ColumnMappings.Add (sourceColumnName, dsColumnName);
|
||||
@@ -331,8 +337,8 @@ namespace System.Data.Common {
|
||||
TableMappings.Add (tableMapping);
|
||||
}
|
||||
|
||||
table.Columns.Add (dsColumnName, (Type) schemaRow ["DataType"]);
|
||||
|
||||
if (!table.Columns.Contains(dsColumnName))
|
||||
table.Columns.Add (dsColumnName, (Type) schemaRow ["DataType"]);
|
||||
|
||||
if (!schemaRow["IsKey"].Equals (DBNull.Value))
|
||||
if ((bool) (schemaRow ["IsKey"]))
|
||||
@@ -427,7 +433,9 @@ namespace System.Data.Common {
|
||||
DataColumnMappingCollection columnMappings = tableMapping.ColumnMappings;
|
||||
|
||||
foreach (IDataParameter parameter in command.Parameters) {
|
||||
string dsColumnName = columnMappings [parameter.SourceColumn].DataSetColumn;
|
||||
string dsColumnName = parameter.SourceColumn;
|
||||
DataColumnMapping mapping = columnMappings [parameter.SourceColumn];
|
||||
if (mapping != null) dsColumnName = mapping.DataSetColumn;
|
||||
DataRowVersion rowVersion = DataRowVersion.Proposed;
|
||||
|
||||
// Parameter version is ignored for non-update commands
|
||||
@@ -447,11 +455,16 @@ namespace System.Data.Common {
|
||||
|
||||
public int Update (DataSet dataSet, string sourceTable)
|
||||
{
|
||||
int result = 0;
|
||||
DataTableMapping tableMapping = TableMappings [sourceTable];
|
||||
foreach (DataTable dataTable in dataSet.Tables)
|
||||
result += Update (dataTable, tableMapping);
|
||||
return result;
|
||||
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);
|
||||
}
|
||||
|
||||
protected virtual void OnFillError (FillErrorEventArgs value)
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
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 = "";
|
||||
private string expression = null;
|
||||
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.Equals(String.Empty))
|
||||
if (Expression != null)
|
||||
{
|
||||
throw new ArgumentException("Can not Auto Increment a computed column.");
|
||||
}
|
||||
|
||||
@@ -21,16 +21,12 @@ 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;
|
||||
}
|
||||
|
||||
@@ -105,8 +101,10 @@ namespace System.Data {
|
||||
|
||||
private string GetNextDefaultColumnName ()
|
||||
{
|
||||
string defColumnName = "Column" + defaultNameIndex.ToString();
|
||||
defaultNameIndex++;
|
||||
string defColumnName = "Column";
|
||||
for (int index = 1; Contains (defColumnName); ++index) {
|
||||
defColumnName = "Column" + index;
|
||||
}
|
||||
return defColumnName;
|
||||
}
|
||||
|
||||
@@ -116,37 +114,32 @@ 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 ();
|
||||
}
|
||||
|
||||
//FIXME:
|
||||
if(Contains(column.ColumnName))
|
||||
{
|
||||
if (column.ColumnName.Equals(String.Empty))
|
||||
{
|
||||
column.ColumnName = GetNextDefaultColumnName ();
|
||||
}
|
||||
else if (Contains(column.ColumnName))
|
||||
{
|
||||
throw new DuplicateNameException("A column named " + column.ColumnName + " already belongs to this DataTable.");
|
||||
}
|
||||
else
|
||||
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)
|
||||
{
|
||||
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;
|
||||
UniqueConstraint uc = new UniqueConstraint(column);
|
||||
parentTable.Constraints.Add(uc);
|
||||
}
|
||||
|
||||
//TODO: add missing constraints. i.e. Primary/Foreign keys
|
||||
|
||||
OnCollectionChanged (e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -156,29 +149,14 @@ 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 ();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
DataColumn column = new DataColumn(columnName);
|
||||
Add (column);
|
||||
return column;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -191,25 +169,12 @@ 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 ();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
DataColumn column = new DataColumn(columnName, type);
|
||||
Add (column);
|
||||
return column;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -219,28 +184,16 @@ 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 ();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
DataColumn column = new DataColumn(columnName, type, expression);
|
||||
Add (column);
|
||||
return column;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -160,6 +160,10 @@ namespace System.Data
|
||||
parentKeyConstraint = uniqueConstraint;
|
||||
}
|
||||
|
||||
internal void SetDataSet(DataSet ds) {
|
||||
dataSet = ds;
|
||||
}
|
||||
|
||||
public virtual DataTable ParentTable {
|
||||
get {
|
||||
return parentColumns[0].Table;
|
||||
|
||||
@@ -55,7 +55,6 @@ namespace System.Data {
|
||||
/// <summary>
|
||||
/// Gets the DataRelation object at the specified index.
|
||||
/// </summary>
|
||||
[MonoTODO]
|
||||
public override DataRelation this [int index]
|
||||
{
|
||||
get {
|
||||
@@ -72,13 +71,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;
|
||||
@@ -108,6 +107,33 @@ 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>
|
||||
@@ -140,7 +166,6 @@ namespace System.Data {
|
||||
/// <summary>
|
||||
/// Gets the DataRelation object at the specified index.
|
||||
/// </summary>
|
||||
[MonoTODO]
|
||||
public override DataRelation this [int index]
|
||||
{
|
||||
get {
|
||||
@@ -152,6 +177,34 @@ 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;
|
||||
@@ -179,6 +232,15 @@ 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>
|
||||
@@ -187,13 +249,9 @@ namespace System.Data {
|
||||
public void Add(DataRelation relation)
|
||||
{
|
||||
this.AddCore (relation);
|
||||
if(List != null)
|
||||
{
|
||||
//CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
|
||||
List.Add(relation);
|
||||
//OnCollectionChanged(e);
|
||||
}
|
||||
return;
|
||||
CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
|
||||
List.Add(relation);
|
||||
OnCollectionChanged(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -205,32 +263,10 @@ 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)
|
||||
{
|
||||
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++;
|
||||
DataRelation dataRelation = new DataRelation(GetNextDefaultRelationName (), parentColumn, childColumn);
|
||||
Add(dataRelation);
|
||||
return dataRelation;
|
||||
}
|
||||
|
||||
@@ -243,13 +279,10 @@ 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("Relation" + defaultNameIndex.ToString(), parentColumns, childColumns);
|
||||
this.AddCore (dataRelation);
|
||||
List.Add(dataRelation);
|
||||
defaultNameIndex++;
|
||||
DataRelation dataRelation = new DataRelation(GetNextDefaultRelationName (), parentColumns, childColumns);
|
||||
Add(dataRelation);
|
||||
return dataRelation;
|
||||
}
|
||||
|
||||
@@ -264,19 +297,13 @@ 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 = "Relation" + defaultNameIndex.ToString();
|
||||
defaultNameIndex++;
|
||||
}
|
||||
if (name == null || name == "") name = GetNextDefaultRelationName ();
|
||||
|
||||
DataRelation dataRelation = new DataRelation(name, parentColumn, childColumn);
|
||||
this.AddCore (dataRelation);
|
||||
List.Add(dataRelation);
|
||||
Add(dataRelation);
|
||||
return dataRelation;
|
||||
}
|
||||
|
||||
@@ -287,19 +314,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(string name, DataColumn[] parentColumns, DataColumn[] childColumns)
|
||||
{
|
||||
//If no name was supplied, give it a default name.
|
||||
if ((name == null) || (name == ""))
|
||||
{
|
||||
name = "Relation" + defaultNameIndex.ToString();
|
||||
defaultNameIndex++;
|
||||
}
|
||||
if (name == null || name == "") name = GetNextDefaultRelationName ();
|
||||
|
||||
DataRelation dataRelation = new DataRelation(name, parentColumns, childColumns);
|
||||
this.AddCore (dataRelation);
|
||||
List.Add(dataRelation);
|
||||
Add(dataRelation);
|
||||
return dataRelation;
|
||||
}
|
||||
|
||||
@@ -315,19 +336,13 @@ 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 = "Relation" + defaultNameIndex.ToString();
|
||||
defaultNameIndex++;
|
||||
}
|
||||
if (name == null || name == "") name = GetNextDefaultRelationName ();
|
||||
|
||||
DataRelation dataRelation = new DataRelation(name, parentColumn, childColumn, createConstraints);
|
||||
this.AddCore (dataRelation);
|
||||
List.Add(dataRelation);
|
||||
Add(dataRelation);
|
||||
return dataRelation;
|
||||
}
|
||||
|
||||
@@ -340,19 +355,13 @@ 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 = "Relation" + defaultNameIndex.ToString();
|
||||
defaultNameIndex++;
|
||||
}
|
||||
if (name == null || name == "") name = GetNextDefaultRelationName ();
|
||||
|
||||
DataRelation dataRelation = new DataRelation(name, parentColumns, childColumns, createConstraints);
|
||||
AddCore (dataRelation);
|
||||
List.Add(dataRelation);
|
||||
Add(dataRelation);
|
||||
return dataRelation;
|
||||
}
|
||||
#endregion
|
||||
@@ -385,22 +394,9 @@ 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)
|
||||
{
|
||||
//TODO: Implement
|
||||
|
||||
DataSet dataSet = GetDataSet();
|
||||
|
||||
throw new NotImplementedException ();
|
||||
|
||||
/*
|
||||
foreach(DataRelation dataRelation in relations)
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
foreach (DataRelation relation in relations) Add(relation);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
@@ -412,13 +408,12 @@ namespace System.Data {
|
||||
|
||||
public virtual void Clear()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
List.Clear();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public virtual bool Contains(string name)
|
||||
{
|
||||
return false;
|
||||
return IndexOf(name) != -1;
|
||||
}
|
||||
|
||||
private CollectionChangeEventArgs CreateCollectionChangeEvent (CollectionChangeAction action)
|
||||
@@ -452,7 +447,7 @@ namespace System.Data {
|
||||
|
||||
public void Remove (DataRelation relation)
|
||||
{
|
||||
// TODO: RemoveCore (relation);
|
||||
RemoveCore (relation);
|
||||
List.Remove (relation);
|
||||
OnCollectionChanged (CreateCollectionChangeEvent (CollectionChangeAction.Remove));
|
||||
}
|
||||
@@ -470,7 +465,7 @@ namespace System.Data {
|
||||
[MonoTODO]
|
||||
protected virtual void RemoveCore(DataRelation relation)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
// TODO: What have to be done?
|
||||
}
|
||||
|
||||
[ResDescriptionAttribute ("Occurs whenever this collection's membership changes.")]
|
||||
|
||||
@@ -684,6 +684,42 @@ 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 )
|
||||
{
|
||||
@@ -734,7 +770,7 @@ namespace System.Data {
|
||||
|
||||
if( simple != null )
|
||||
{
|
||||
writer.WriteString( row[simple].ToString() );
|
||||
writer.WriteString( WriteObjectXml(row[simple]) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -753,7 +789,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( rowObject.ToString() );
|
||||
writer.WriteString( WriteObjectXml(rowObject) );
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,3 +1,8 @@
|
||||
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,13 +2,16 @@
|
||||
//
|
||||
// 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
|
||||
{
|
||||
@@ -28,7 +31,7 @@ namespace MonoTests.System.Data
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
return new TestSuite (typeof (DataColumnCollectionTest));
|
||||
return new TestSuite (typeof (DataColumnCollectionTest));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +43,489 @@ 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,5 +52,516 @@ 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
*.dll
|
||||
*.suo
|
||||
*.sln
|
||||
*.csproj.user
|
||||
bin
|
||||
obj
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
2003-02-25 Dave Bettin <[email protected]>
|
||||
* Test: Modified test cases to conform to nunit2 guidelines
|
||||
|
||||
2002-08-24 Tim Coleman <[email protected]>
|
||||
* list:
|
||||
New files added to build.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<VisualStudioProject>
|
||||
<CSHARP
|
||||
ProjectType = "Local"
|
||||
ProductVersion = "7.0.9466"
|
||||
SchemaVersion = "1.0"
|
||||
ProductVersion = "7.10.2292"
|
||||
SchemaVersion = "2.0"
|
||||
ProjectGuid = "{1E24995F-861C-4FCB-BE59-C7B518F02F64}"
|
||||
>
|
||||
<Build>
|
||||
@@ -16,7 +16,10 @@
|
||||
DefaultTargetSchema = "IE50"
|
||||
DelaySign = "false"
|
||||
OutputType = "Library"
|
||||
PreBuildEvent = ""
|
||||
PostBuildEvent = ""
|
||||
RootNamespace = "System.Web.Servces"
|
||||
RunPostBuildEvent = "OnBuildSuccess"
|
||||
StartupObject = ""
|
||||
>
|
||||
<Config
|
||||
@@ -30,6 +33,8 @@
|
||||
DebugSymbols = "true"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "true"
|
||||
NoStdLib = "false"
|
||||
NoWarn = ""
|
||||
Optimize = "false"
|
||||
OutputPath = "bin\Debug\"
|
||||
RegisterForComInterop = "false"
|
||||
@@ -48,6 +53,8 @@
|
||||
DebugSymbols = "false"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "false"
|
||||
NoStdLib = "false"
|
||||
NoWarn = ""
|
||||
Optimize = "true"
|
||||
OutputPath = "bin\Release\"
|
||||
RegisterForComInterop = "false"
|
||||
@@ -57,11 +64,6 @@
|
||||
/>
|
||||
</Settings>
|
||||
<References>
|
||||
<Reference
|
||||
Name = "System.Web"
|
||||
AssemblyName = "System.Web"
|
||||
HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Web.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.EnterpriseServices"
|
||||
AssemblyName = "System.EnterpriseServices"
|
||||
@@ -77,6 +79,11 @@
|
||||
AssemblyName = "System.Xml"
|
||||
HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Web"
|
||||
AssemblyName = "System.Web"
|
||||
HintPath = "..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Web.dll"
|
||||
/>
|
||||
</References>
|
||||
</Build>
|
||||
<Files>
|
||||
@@ -652,6 +659,11 @@
|
||||
SubType = "Component"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "System.Web.Services.Protocols\HttpServerProtocol.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "System.Web.Services.Protocols\HttpSimpleClientProtocol.cs"
|
||||
SubType = "Component"
|
||||
@@ -697,6 +709,11 @@
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "System.Web.Services.Protocols\MimeReturnWriter.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "System.Web.Services.Protocols\NopReturnReader.cs"
|
||||
SubType = "Code"
|
||||
@@ -707,6 +724,11 @@
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "System.Web.Services.Protocols\ServerProtocol.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "System.Web.Services.Protocols\SoapClientMessage.cs"
|
||||
SubType = "Code"
|
||||
@@ -852,6 +874,11 @@
|
||||
SubType = "Component"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "System.Web.Services.Protocols\WebServiceHandler.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "System.Web.Services.Protocols\WebServiceHandlerFactory.cs"
|
||||
SubType = "Code"
|
||||
@@ -862,6 +889,11 @@
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "System.Web.Services.Protocols\XmlReturnWriter.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
</Include>
|
||||
</Files>
|
||||
</CSHARP>
|
||||
|
||||
+5
-4
@@ -3,21 +3,22 @@
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
// Dave Bettin ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
//
|
||||
|
||||
using System.Web.Services;
|
||||
using System.Web.UI;
|
||||
|
||||
|
||||
namespace System.Web.Services.Protocols {
|
||||
public class WebServiceHandlerFactory : IHttpHandlerFactory {
|
||||
|
||||
#region Constructors
|
||||
|
||||
[MonoTODO]
|
||||
public WebServiceHandlerFactory ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
@@ -27,13 +28,13 @@ namespace System.Web.Services.Protocols {
|
||||
[MonoTODO]
|
||||
public IHttpHandler GetHandler (HttpContext context, string verb, string url, string filePath)
|
||||
{
|
||||
Type type = WebServiceParser.GetCompiledType(filePath, context);
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
|
||||
public void ReleaseHandler (IHttpHandler handler)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2003-02-25 Dave Bettin <[email protected]>
|
||||
* WebService.cs:
|
||||
Changed private application to HttpContext
|
||||
|
||||
2002-08-19 Tim Coleman <[email protected]>
|
||||
* WebService.cs:
|
||||
Change the attribute on Application to Description
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace System.Web.Services {
|
||||
|
||||
#region Fields
|
||||
|
||||
HttpApplication application;
|
||||
HttpContext _context;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace System.Web.Services {
|
||||
|
||||
public WebService ()
|
||||
{
|
||||
application = new HttpApplication ();
|
||||
}
|
||||
|
||||
#endregion // Constructors
|
||||
@@ -36,35 +35,35 @@ namespace System.Web.Services {
|
||||
[Description ("The ASP.NET application object for the current request.")]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public HttpApplicationState Application {
|
||||
get { return application.Application; }
|
||||
get { return _context.Application; }
|
||||
}
|
||||
|
||||
[Browsable (false)]
|
||||
[WebServicesDescription ("The ASP.NET context object for the current request.")]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public HttpContext Context {
|
||||
get { return application.Context; }
|
||||
get { return _context; }
|
||||
}
|
||||
|
||||
[Browsable (false)]
|
||||
[WebServicesDescription ("The ASP.NET utility object for the current request.")]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public HttpServerUtility Server {
|
||||
get { return application.Server; }
|
||||
get { return _context.Server; }
|
||||
}
|
||||
|
||||
[Browsable (false)]
|
||||
[WebServicesDescription ("The ASP.NET session object for the current request.")]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public HttpSessionState Session {
|
||||
get { return application.Session; }
|
||||
get { return _context.Session; }
|
||||
}
|
||||
|
||||
[Browsable (false)]
|
||||
[WebServicesDescription ("The ASP.NET user object for the current request. The object is used for authorization.")]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public IPrincipal User {
|
||||
get { return application.User; }
|
||||
get { return _context.User; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
@@ -1 +1,9 @@
|
||||
*.dll
|
||||
*.suo
|
||||
*.sln
|
||||
*.csproj.user
|
||||
bin
|
||||
obj
|
||||
.makefrag
|
||||
.response
|
||||
library-deps.stamp
|
||||
@@ -1,24 +0,0 @@
|
||||
// MonoTests.AllTests, System.Web.Services.dll
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests {
|
||||
public class AllTests : TestCase {
|
||||
public AllTests (string name) : base (name) {}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
TestSuite suite = new TestSuite ();
|
||||
suite.AddTest (System.Web.Services.AllTests.Suite);
|
||||
suite.AddTest (System.Web.Services.Configuration.AllTests.Suite);
|
||||
suite.AddTest (System.Web.Services.Discovery.AllTests.Suite);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
2003-02-23 Dave Bettin <[email protected]>
|
||||
* Added makefile.gnu
|
||||
* Added list for test classes to compile
|
||||
* Moved all tests over to nunit2
|
||||
|
||||
2002-08-09 Tim Coleman <[email protected]>
|
||||
* AllTests.cs:
|
||||
New test suites added.
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
// MonoTests.System.Web.Services.Configuration.AllTests, System.Web.Services.dll
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System.Web.Services.Configuration {
|
||||
public class AllTests : TestCase {
|
||||
public AllTests (string name) : base (name) {}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
TestSuite suite = new TestSuite ();
|
||||
suite.AddTest (XmlFormatExtensionAttributeTest.Suite);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
2003-02-22 Dave Bettin ([email protected])
|
||||
* Moved over to Nunit2 Tests
|
||||
* Removed AllTests.cs
|
||||
2002-08-09 Tim Coleman <[email protected]>
|
||||
* AllTests.cs:
|
||||
* ChangeLog:
|
||||
|
||||
+24
-41
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
// Dave Bettin ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
// Copyright (C) Dave Bettin, 2003
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
@@ -14,67 +16,48 @@ using System.Web.Services.Description;
|
||||
|
||||
namespace MonoTests.System.Web.Services.Configuration {
|
||||
|
||||
public class XmlFormatExtensionAttributeTest : TestCase {
|
||||
[TestFixture]
|
||||
public class XmlFormatExtensionAttributeTest {
|
||||
|
||||
public XmlFormatExtensionAttributeTest () :
|
||||
base ("[MonoTests.System.Web.Services.Configuration.XmlFormatExtensionAttributeTest]")
|
||||
{
|
||||
}
|
||||
|
||||
public XmlFormatExtensionAttributeTest (string name) :
|
||||
base (name)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void SetUp ()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void TearDown ()
|
||||
{
|
||||
}
|
||||
|
||||
public static ITest Suite {
|
||||
get { return new TestSuite (typeof (XmlFormatExtensionAttributeTest)); }
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestConstructors ()
|
||||
{
|
||||
XmlFormatExtensionAttribute attribute;
|
||||
|
||||
attribute = new XmlFormatExtensionAttribute ();
|
||||
AssertEquals (String.Empty, attribute.ElementName);
|
||||
AssertEquals (null, attribute.ExtensionPoints);
|
||||
AssertEquals (String.Empty, attribute.Namespace);
|
||||
/* attribute = new XmlFormatExtensionAttribute ();
|
||||
Assertion.AssertEquals (String.Empty, attribute.ElementName);
|
||||
Assertion.AssertEquals (null, attribute.ExtensionPoints);
|
||||
Assertion.AssertEquals (String.Empty, attribute.Namespace);
|
||||
|
||||
string elementName = "binding";
|
||||
string ns = "http://schemas.xmlsoap.org/wsdl/http/";
|
||||
Type[] types = new Type[4] {typeof (Binding), typeof (Binding), typeof (Binding), typeof (Binding)};
|
||||
|
||||
attribute = new XmlFormatExtensionAttribute (elementName, ns, types[0]);
|
||||
AssertEquals (elementName, attribute.ElementName);
|
||||
AssertEquals (new Type[1] {types[0]}, attribute.ExtensionPoints);
|
||||
AssertEquals (ns, attribute.Namespace);
|
||||
Assertion.AssertEquals (elementName, attribute.ElementName);
|
||||
Assertion.AssertEquals (new Type[1] {types[0]}, attribute.ExtensionPoints);
|
||||
Assertion.AssertEquals (ns, attribute.Namespace);
|
||||
|
||||
attribute = new XmlFormatExtensionAttribute (elementName, ns, types[0], types[1]);
|
||||
AssertEquals (elementName, attribute.ElementName);
|
||||
AssertEquals (new Type[2] {types[0], types[1]}, attribute.ExtensionPoints);
|
||||
AssertEquals (ns, attribute.Namespace);
|
||||
Assertion.AssertEquals (elementName, attribute.ElementName);
|
||||
Assertion.AssertEquals (new Type[2] {types[0], types[1]}, attribute.ExtensionPoints);
|
||||
Assertion.AssertEquals (ns, attribute.Namespace);
|
||||
|
||||
attribute = new XmlFormatExtensionAttribute (elementName, ns, types[0], types[1], types[2]);
|
||||
AssertEquals (elementName, attribute.ElementName);
|
||||
AssertEquals (new Type[3] {types[0], types[1], types[2]}, attribute.ExtensionPoints);
|
||||
AssertEquals (ns, attribute.Namespace);
|
||||
Assertion.AssertEquals (elementName, attribute.ElementName);
|
||||
Assertion.AssertEquals (new Type[3] {types[0], types[1], types[2]}, attribute.ExtensionPoints);
|
||||
Assertion.AssertEquals (ns, attribute.Namespace);
|
||||
|
||||
attribute = new XmlFormatExtensionAttribute (elementName, ns, types[0], types[1], types[2], types[3]);
|
||||
AssertEquals (elementName, attribute.ElementName);
|
||||
AssertEquals (new Type[4] {types[0], types[1], types[2], types[3]}, attribute.ExtensionPoints);
|
||||
AssertEquals (ns, attribute.Namespace);
|
||||
Assertion.AssertEquals (elementName, attribute.ElementName);
|
||||
Assertion.AssertEquals (new Type[4] {types[0], types[1], types[2], types[3]}, attribute.ExtensionPoints);
|
||||
Assertion.AssertEquals (ns, attribute.Namespace);
|
||||
|
||||
attribute = new XmlFormatExtensionAttribute (elementName, ns, types);
|
||||
AssertEquals (elementName, attribute.ElementName);
|
||||
AssertEquals (types, attribute.ExtensionPoints);
|
||||
AssertEquals (ns, attribute.Namespace);
|
||||
Assertion.AssertEquals (elementName, attribute.ElementName);
|
||||
Assertion.AssertEquals (types, attribute.ExtensionPoints);
|
||||
Assertion.AssertEquals (ns, attribute.Namespace);*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
// MonoTests.System.Web.Services.Discovery.AllTests, System.Web.Services.dll
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System.Web.Services.Discovery {
|
||||
public class AllTests : TestCase {
|
||||
public AllTests (string name) : base (name) {}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
TestSuite suite = new TestSuite ();
|
||||
suite.AddTest (ContractReferenceTest.Suite);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
2003-02-22 Dave Bettin ([email protected])
|
||||
* Moved over to Nunit2 Tests
|
||||
* Removed AllTests.cs
|
||||
2002-08-09 Tim Coleman <[email protected]>
|
||||
* AllTests.cs:
|
||||
* ChangeLog:
|
||||
|
||||
+7
-29
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
// Dave Bettin ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
// Copyright (C) Dave Bettin, 2003
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
@@ -13,43 +15,19 @@ using System.Web.Services.Discovery;
|
||||
|
||||
namespace MonoTests.System.Web.Services.Discovery {
|
||||
|
||||
public class ContractReferenceTest : TestCase {
|
||||
|
||||
public ContractReferenceTest () :
|
||||
base ("[MonoTests.System.Web.Services.Discovery.ContractReferenceTest]")
|
||||
{
|
||||
}
|
||||
|
||||
public ContractReferenceTest (string name) :
|
||||
base (name)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void SetUp ()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void TearDown ()
|
||||
{
|
||||
}
|
||||
|
||||
public static ITest Suite {
|
||||
get { return new TestSuite (typeof (ContractReferenceTest)); }
|
||||
}
|
||||
[TestFixture]
|
||||
public class ContractReferenceTest {
|
||||
|
||||
[Test]
|
||||
public void TestConstructors ()
|
||||
{
|
||||
ContractReference contractReference;
|
||||
|
||||
contractReference = new ContractReference ();
|
||||
AssertEquals (String.Empty, contractReference.DocRef);
|
||||
AssertEquals (String.Empty, contractReference.Ref);
|
||||
AssertEquals (String.Empty, contractReference.Url);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestConstants ()
|
||||
{
|
||||
AssertEquals ("http://schemas.xmlsoap.org/disco/scl/", ContractReference.Namespace);
|
||||
Assertion.AssertEquals ("http://schemas.xmlsoap.org/disco/scl/", ContractReference.Namespace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// MonoTests.System.Web.Services.AllTests, System.Web.Services.dll
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System.Web.Services {
|
||||
public class AllTests : TestCase {
|
||||
public AllTests (string name) : base (name) {}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
TestSuite suite = new TestSuite ();
|
||||
suite.AddTest (WebMethodAttributeTest.Suite);
|
||||
suite.AddTest (WebServiceAttributeTest.Suite);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
2003-02-22 Dave Bettin ([email protected])
|
||||
* Moved over to Nunit2 Tests
|
||||
* Removed AllTests.cs
|
||||
2002-08-07 Tim Coleman <[email protected]>
|
||||
* AllTests.cs:
|
||||
* ChangeLog:
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
// Dave Bettin ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
// Copyright (C) Dave Bettin, 2003
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
@@ -14,41 +16,21 @@ using System.EnterpriseServices;
|
||||
|
||||
namespace MonoTests.System.Web.Services {
|
||||
|
||||
public class WebMethodAttributeTest : TestCase {
|
||||
|
||||
public WebMethodAttributeTest () :
|
||||
base ("[MonoTests.System.Web.Services.WebMethodAttributeTest]")
|
||||
{
|
||||
}
|
||||
|
||||
public WebMethodAttributeTest (string name) :
|
||||
base (name)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void SetUp ()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void TearDown ()
|
||||
{
|
||||
}
|
||||
|
||||
public static ITest Suite {
|
||||
get { return new TestSuite (typeof (WebMethodAttributeTest)); }
|
||||
}
|
||||
[TestFixture]
|
||||
public class WebMethodAttributeTest {
|
||||
|
||||
[Test]
|
||||
public void TestConstructors ()
|
||||
{
|
||||
WebMethodAttribute attribute;
|
||||
|
||||
attribute = new WebMethodAttribute ();
|
||||
AssertEquals (true, attribute.BufferResponse);
|
||||
AssertEquals (0, attribute.CacheDuration);
|
||||
AssertEquals (String.Empty, attribute.Description);
|
||||
AssertEquals (false, attribute.EnableSession);
|
||||
AssertEquals (String.Empty, attribute.MessageName);
|
||||
AssertEquals (TransactionOption.Disabled, attribute.TransactionOption);
|
||||
Assertion.AssertEquals (true, attribute.BufferResponse);
|
||||
Assertion.AssertEquals (0, attribute.CacheDuration);
|
||||
Assertion.AssertEquals (String.Empty, attribute.Description);
|
||||
Assertion.AssertEquals (false, attribute.EnableSession);
|
||||
Assertion.AssertEquals (String.Empty, attribute.MessageName);
|
||||
Assertion.AssertEquals (TransactionOption.Disabled, attribute.TransactionOption);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,10 @@
|
||||
//
|
||||
// Author:
|
||||
// Tim Coleman ([email protected])
|
||||
// Dave Bettin ([email protected])
|
||||
//
|
||||
// Copyright (C) Tim Coleman, 2002
|
||||
// Copyright (C) Dave Bettin, 2003
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
@@ -13,38 +15,18 @@ using System.Web.Services;
|
||||
|
||||
namespace MonoTests.System.Web.Services {
|
||||
|
||||
public class WebServiceAttributeTest : TestCase {
|
||||
|
||||
public WebServiceAttributeTest () :
|
||||
base ("[MonoTests.System.Web.Services.WebServiceAttributeTest]")
|
||||
{
|
||||
}
|
||||
|
||||
public WebServiceAttributeTest (string name) :
|
||||
base (name)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void SetUp ()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void TearDown ()
|
||||
{
|
||||
}
|
||||
|
||||
public static ITest Suite {
|
||||
get { return new TestSuite (typeof (WebServiceAttributeTest)); }
|
||||
}
|
||||
[TestFixture]
|
||||
public class WebServiceAttributeTest {
|
||||
|
||||
[Test]
|
||||
public void TestConstructors ()
|
||||
{
|
||||
WebServiceAttribute attribute;
|
||||
|
||||
attribute = new WebServiceAttribute ();
|
||||
AssertEquals (String.Empty, attribute.Description);
|
||||
AssertEquals (String.Empty, attribute.Name);
|
||||
AssertEquals ("http://tempuri.org/", attribute.Namespace);
|
||||
Assertion.AssertEquals (String.Empty, attribute.Description);
|
||||
Assertion.AssertEquals (String.Empty, attribute.Name);
|
||||
Assertion.AssertEquals ("http://tempuri.org/", attribute.Namespace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
--target library
|
||||
-o System.Web.Services_test.dll
|
||||
--noconfig
|
||||
-r ../../lib/corlib.dll
|
||||
-r ../../lib/System.dll
|
||||
-r ../../lib/System.Web.Services.dll
|
||||
-r ../../lib/System.EnterpriseServices.dll
|
||||
-r ../../../nunit20/NUnit.Framework.dll
|
||||
System.Web.Services/WebMethodAttributeTest.cs
|
||||
System.Web.Services/WebServiceAttributeTest.cs
|
||||
System.Web.Services.Configuration/XmlFormatExtensionAttributeTest.cs
|
||||
System.Web.Services.Discovery/ContractReferenceTest.cs
|
||||
@@ -1,35 +1,35 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- NAnt build file for System.Web.Services_test.dll -->
|
||||
<!-- Target build (default) builds tests -->
|
||||
<!-- Target test runs tests -->
|
||||
|
||||
<project name="System.Web.Services_test" default="build">
|
||||
<property name="debug" value="false"/>
|
||||
<property name="nunit_home" value="..\..\..\nunit"/>
|
||||
|
||||
<target name="build">
|
||||
</target>
|
||||
|
||||
<target name="assemblies">
|
||||
<csc target="library" output="System.Web.Services_test.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
</sources>
|
||||
<references basedir="..\..\..\nunit">
|
||||
<includes name="NUnitCore.dll"/>
|
||||
</references>
|
||||
<arg value="/r:..\..\lib\System.Web.Services.dll"/>
|
||||
</csc>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="assemblies">
|
||||
<exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.System.Web.Services.AllTests,System.Web.Services_test.dll" failonerror="false"/>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete file="System.Web.Services.dll" failonerror="false"/>
|
||||
<delete file="System.Web.Services_test.dll" failonerror="false"/>
|
||||
</target>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- NAnt build file for System.Web.Services_test.dll -->
|
||||
<!-- Target build (default) builds tests -->
|
||||
<!-- Target test runs tests -->
|
||||
|
||||
<project name="System.Web.Services_test" default="build">
|
||||
<property name="debug" value="false"/>
|
||||
<property name="nunit_home" value="..\..\..\nunit"/>
|
||||
|
||||
<target name="build">
|
||||
</target>
|
||||
|
||||
<target name="assemblies">
|
||||
<csc target="library" output="System.Web.Services_test.dll" debug="${debug}">
|
||||
<arg value="/nowarn:1595"/>
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
</sources>
|
||||
<references basedir="..\..\..\nunit20">
|
||||
<includes name="NUnit.Framework.dll"/>
|
||||
</references>
|
||||
<arg value="/r:..\..\lib\System.Web.Services.dll"/>
|
||||
</csc>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="assemblies">
|
||||
<exec program="..\..\..\nunit20\nunit-console.exe" commandline="System.Web.Services_test.dll" failonerror="false"/>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete file="System.Web.Services.dll" failonerror="false"/>
|
||||
<delete file="System.Web.Services_test.dll" failonerror="false"/>
|
||||
</target>
|
||||
</project>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
topdir = ../../..
|
||||
|
||||
LIBRARY = System.Web.Services_test.dll
|
||||
|
||||
LIB_LIST = System.Web.Services_test.args
|
||||
LIB_FLAGS = \
|
||||
-r $(topdir)/class/lib/corlib.dll \
|
||||
-r $(topdir)/class/lib/System.dll \
|
||||
-r $(topdir)/class/lib/System.Web.Services.dll \
|
||||
-r $(topdir)/class/lib/System.EnterpriseServices.dll \
|
||||
-r $(topdir)/nunit20/NUnit.Framework.dll
|
||||
|
||||
ifdef SUBDIR
|
||||
USE_SOURCE_RULES=1
|
||||
SOURCES_INCLUDE=./$(SUBDIR)/*.cs
|
||||
SOURCES_EXCLUDE=_DUMMY_
|
||||
endif
|
||||
|
||||
include $(topdir)/class/library.make
|
||||
|
||||
NUNITCONSOLE=$(topdir)/nunit20/nunit-console.exe
|
||||
MONO_PATH = $(topdir)/nunit20:.
|
||||
|
||||
test: $(LIBRARY) run_test
|
||||
|
||||
.PHONY: run_test
|
||||
|
||||
run_test:
|
||||
-MONO_PATH=$(MONO_PATH) mono --debug $(NUNITCONSOLE) System.Web.Services_test.dll
|
||||
@@ -35,7 +35,7 @@ namespace System.Web.Configuration
|
||||
continue;
|
||||
|
||||
if (child.Name == "forms") {
|
||||
config.CookieName = AttValue ("name", child, false);
|
||||
config.CookieName = AttValue ("name", child);
|
||||
config.CookiePath = AttValue ("path", child);
|
||||
config.LoginUrl = AttValue ("loginUrl", child);
|
||||
config.SetProtection (AttValue ("protection", child));
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2003-02-27 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* AuthenticationConfigHandler.cs: 'name' is optional in <forms>.
|
||||
|
||||
2003-02-17 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HandlerFactoryConfiguration.cs: first search in the mappings of this
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
// System.Web.Mail.MailEncoder
|
||||
// author: Per Arneng <[email protected]>
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace System.Web.Mail {
|
||||
|
||||
internal class MailEncoder {
|
||||
|
||||
private delegate void EncodeStreamDelegate( Stream ins , Stream outs );
|
||||
private EncodeStreamDelegate RealEncodeStream;
|
||||
|
||||
public MailEncoder( MailEncoding enc ) {
|
||||
|
||||
if( enc == MailEncoding.Base64 ) {
|
||||
|
||||
RealEncodeStream = new EncodeStreamDelegate( Base64EncodeStream );
|
||||
|
||||
} else if( enc == MailEncoding.UUEncode ) {
|
||||
|
||||
throw new NotImplementedException();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void EncodeStream( Stream ins , Stream outs ) {
|
||||
RealEncodeStream( ins , outs );
|
||||
}
|
||||
|
||||
|
||||
// reads bytes from a stream and writes the encoded
|
||||
// as base64 encoded characters. ( 60 chars on each row)
|
||||
private void Base64EncodeStream( Stream ins , Stream outs ) {
|
||||
|
||||
if( ( ins == null ) || ( outs == null ) )
|
||||
throw new ArgumentNullException( "The input and output streams may not " +
|
||||
"be null.");
|
||||
|
||||
ICryptoTransform base64 = new ToBase64Transform();
|
||||
|
||||
// the buffers
|
||||
byte[] plainText = new byte[ base64.InputBlockSize ];
|
||||
byte[] cipherText = new byte[ base64.OutputBlockSize ];
|
||||
|
||||
int readLength = 0;
|
||||
int trLength = 0;
|
||||
int count = 0;
|
||||
byte[] newln = new byte[] { 13 , 10 }; //CR LF with mail
|
||||
|
||||
// read through the stream until there
|
||||
// are no more bytes left
|
||||
while( true ) {
|
||||
|
||||
// read some bytes
|
||||
readLength = ins.Read( plainText , 0 , plainText.Length );
|
||||
|
||||
// break when there is no more data
|
||||
if( readLength < 1 ) break;
|
||||
|
||||
// transfrom and write the blocks. If the block size
|
||||
// is less than the InputBlockSize then write the final block
|
||||
if( readLength == plainText.Length ) {
|
||||
|
||||
trLength = base64.TransformBlock( plainText , 0 ,
|
||||
plainText.Length ,
|
||||
cipherText , 0 );
|
||||
|
||||
// write the data
|
||||
outs.Write( cipherText , 0 , cipherText.Length );
|
||||
|
||||
|
||||
// do this to output lines that
|
||||
// are 60 chars long
|
||||
count += cipherText.Length;
|
||||
if( count == 60 ) {
|
||||
outs.Write( newln , 0 , newln.Length );
|
||||
count = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// convert the final blocks of bytes and write them
|
||||
cipherText = base64.TransformFinalBlock( plainText , 0 , readLength );
|
||||
outs.Write( cipherText , 0 , cipherText.Length );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
outs.Write( newln , 0 , newln.Length );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -48,6 +48,11 @@ namespace System.Web.Mail {
|
||||
if( ( ! HasData( msg.From ) ) || ( ! HasData( msg.To ) ) )
|
||||
throw new SmtpException( "From & To properties must be set." );
|
||||
|
||||
// if no encoding is set then set the system
|
||||
// default encoding
|
||||
if( msg.BodyEncoding == null )
|
||||
msg.BodyEncoding = Encoding.Default;
|
||||
|
||||
// start with a reset incase old data
|
||||
// is present at the server in this session
|
||||
smtp.WriteRset();
|
||||
@@ -86,8 +91,8 @@ namespace System.Web.Mail {
|
||||
|
||||
smtp.WriteHeaders( headers );
|
||||
|
||||
// send the mail body
|
||||
smtp.WriteLine( msg.Body );
|
||||
// send the mail body FIXME
|
||||
smtp.WriteBytes( msg.BodyEncoding.GetBytes( msg.Body ) );
|
||||
|
||||
}
|
||||
|
||||
@@ -97,7 +102,8 @@ namespace System.Web.Mail {
|
||||
// create the headers
|
||||
IDictionary headers = CreateHeaders( msg );
|
||||
|
||||
// set the part boundary
|
||||
// set the part boundary FIXME: THIS SHOULD NOT BE HARDCODED
|
||||
// look att Gaurav Vaish implementation
|
||||
string boundary = "NextPart_000_1113_1962_1fe8";
|
||||
|
||||
// set the Content-Type header to multipart/mixed
|
||||
@@ -116,22 +122,24 @@ namespace System.Web.Mail {
|
||||
partHeaders[ "Content-Type" ] = "text/plain";
|
||||
|
||||
smtp.WriteHeaders( partHeaders );
|
||||
|
||||
smtp.WriteLine( msg.Body );
|
||||
|
||||
|
||||
// FIXME: probably need to use QP or Base64 on everything higher
|
||||
// then 8-bit .. like utf-16
|
||||
smtp.WriteBytes( msg.BodyEncoding.GetBytes( msg.Body ) );
|
||||
|
||||
smtp.WriteBoundary( boundary );
|
||||
|
||||
// now start to write the attachments
|
||||
|
||||
|
||||
for( int i=0; i< msg.Attachments.Count ; i++ ) {
|
||||
MailAttachment a = (MailAttachment)msg.Attachments[ i ];
|
||||
FileStream file =
|
||||
new FileStream( a.Filename , FileMode.Open );
|
||||
|
||||
|
||||
Hashtable aHeaders = new Hashtable();
|
||||
|
||||
aHeaders[ "Content-Type" ] =
|
||||
String.Format( "unknown/unknown; name=\"{0}\"", a.Filename );
|
||||
String.Format( "application/octet-stream; name=\"{0}\"",
|
||||
a.Filename );
|
||||
|
||||
aHeaders[ "Content-Disposition" ] =
|
||||
String.Format( "attachment; filename=\"{0}\"" , a.Filename );
|
||||
@@ -139,8 +147,17 @@ namespace System.Web.Mail {
|
||||
aHeaders[ "Content-Transfer-Encoding" ] = "base64";
|
||||
|
||||
smtp.WriteHeaders( aHeaders );
|
||||
|
||||
smtp.WriteBase64( file );
|
||||
|
||||
// perform the actual writing of the file.
|
||||
// read from the file stream and write to the tcp stream
|
||||
FileStream ins = new FileStream( a.Filename , FileMode.Open );
|
||||
|
||||
// create an apropriate encoder
|
||||
MailEncoder encoder = new MailEncoder( a.Encoding );
|
||||
encoder.EncodeStream( ins , smtp.Stream );
|
||||
|
||||
ins.Close();
|
||||
|
||||
|
||||
smtp.WriteLine( "" );
|
||||
|
||||
@@ -153,16 +170,13 @@ namespace System.Web.Mail {
|
||||
smtp.WriteFinalBoundary( boundary );
|
||||
}
|
||||
|
||||
file.Close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// send the standard headers
|
||||
// and the custom in MailMessage
|
||||
// FIXME: more headers needs to be added so
|
||||
// that all properties from MailMessage are sent..
|
||||
// missing: Priority , UrlContentBase,UrlContentLocation
|
||||
private IDictionary CreateHeaders( MailMessage msg ) {
|
||||
Hashtable headers = new Hashtable();
|
||||
|
||||
@@ -173,27 +187,48 @@ namespace System.Web.Mail {
|
||||
|
||||
if( HasData( msg.Bcc ) ) headers[ "Bcc" ] = msg.Bcc;
|
||||
|
||||
if( HasData( msg.Subject ) ) headers[ "Subject" ] = msg.Subject;
|
||||
if( HasData( msg.Subject ) ) {
|
||||
|
||||
// if the BodyEncoding is not 7bit us-ascii then
|
||||
// convert using base64
|
||||
if( msg.BodyEncoding is ASCIIEncoding ) {
|
||||
|
||||
headers[ "Subject" ] = msg.Subject;
|
||||
|
||||
} else {
|
||||
|
||||
byte[] subjectBytes = msg.BodyEncoding.GetBytes( msg.Subject );
|
||||
// encode the subject with Base64
|
||||
headers[ "Subject" ] =
|
||||
String.Format( "=?{0}?{1}?{2}?=" ,
|
||||
msg.BodyEncoding.BodyName , "B",
|
||||
Convert.ToBase64String( subjectBytes ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( HasData( msg.UrlContentBase ) )
|
||||
headers[ "Content-Base" ] = msg.UrlContentBase;
|
||||
|
||||
if( HasData( msg.UrlContentLocation ) )
|
||||
headers[ "Content-Location" ] = msg.UrlContentLocation;
|
||||
|
||||
|
||||
string charset = String.Format( "charset=\"{0}\"" , msg.BodyEncoding.BodyName );
|
||||
|
||||
// set body the content type
|
||||
switch( msg.BodyFormat ) {
|
||||
|
||||
case MailFormat.Html:
|
||||
headers[ "Content-Type" ] = "text/html";
|
||||
headers[ "Content-Type" ] = "text/html; " + charset;
|
||||
break;
|
||||
|
||||
case MailFormat.Text:
|
||||
headers[ "Content-Type" ] = "text/plain";
|
||||
headers[ "Content-Type" ] = "text/plain; " + charset;
|
||||
break;
|
||||
|
||||
default:
|
||||
headers[ "Content-Type" ] = "text/plain";
|
||||
headers[ "Content-Type" ] = "text/plain; " + charset;
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -229,6 +264,15 @@ namespace System.Web.Mail {
|
||||
// set the mailer -- should probably be changed
|
||||
headers[ "X-Mailer" ] = "Mono (System.Web.Mail.SmtpMail.Send)";
|
||||
|
||||
// Set the transfer encoding.. it seems like only sends 7bit
|
||||
// if it is ASCII
|
||||
if( msg.BodyEncoding is ASCIIEncoding ) {
|
||||
headers[ "Content-Transfer-Encoding" ] = "7bit";
|
||||
} else {
|
||||
headers[ "Content-Transfer-Encoding" ] = "8bit";
|
||||
}
|
||||
|
||||
|
||||
// add the custom headers they will overwrite
|
||||
// the earlier ones if they are the same
|
||||
foreach( string key in msg.Headers.Keys )
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace System.Web.Mail
|
||||
/// </remarks>
|
||||
public class SmtpMail
|
||||
{
|
||||
private static string smtpServer;
|
||||
private static string smtpServer = "localhost";
|
||||
|
||||
// Constructor
|
||||
private SmtpMail ()
|
||||
|
||||
@@ -20,6 +20,10 @@ namespace System.Web.Mail {
|
||||
encoding = new ASCIIEncoding();
|
||||
}
|
||||
|
||||
public Stream Stream {
|
||||
get { return stream; }
|
||||
}
|
||||
|
||||
public SmtpResponse LastResponse {
|
||||
get { return lastResponse; }
|
||||
}
|
||||
@@ -75,18 +79,19 @@ namespace System.Web.Mail {
|
||||
|
||||
public void WriteBoundary( string boundary ) {
|
||||
|
||||
WriteLine( "--{0}" , boundary );
|
||||
WriteLine( "\r\n--{0}" , boundary );
|
||||
|
||||
}
|
||||
|
||||
public void WriteFinalBoundary( string boundary ) {
|
||||
|
||||
WriteLine( "--{0}--" , boundary );
|
||||
WriteLine( "\r\n--{0}--" , boundary );
|
||||
|
||||
}
|
||||
|
||||
// single dot by itself
|
||||
public void WriteDataEndTag() {
|
||||
command = ".";
|
||||
command = "\r\n.";
|
||||
WriteLine( command );
|
||||
ReadResponse();
|
||||
CheckForStatusCode( 250 );
|
||||
@@ -118,6 +123,12 @@ namespace System.Web.Mail {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// write buffer's bytes to the stream
|
||||
public void WriteBytes( byte[] buffer ) {
|
||||
stream.Write( buffer , 0 , buffer.Length );
|
||||
}
|
||||
|
||||
// writes a formatted line to the server
|
||||
public void WriteLine( string format , params object[] args ) {
|
||||
WriteLine( String.Format( format , args ) );
|
||||
@@ -157,73 +168,6 @@ namespace System.Web.Mail {
|
||||
DebugPrint( line );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// reads bytes from a stream and writes the encoded
|
||||
// as base64 encoded characters. ( 60 chars on each row)
|
||||
public void WriteBase64( Stream inStream ) {
|
||||
|
||||
ICryptoTransform base64 = new ToBase64Transform();
|
||||
ASCIIEncoding encoding = new ASCIIEncoding();
|
||||
|
||||
// the buffers
|
||||
byte[] plainText = new byte[ base64.InputBlockSize ];
|
||||
byte[] cipherText = new byte[ base64.OutputBlockSize ];
|
||||
|
||||
int readLength = 0;
|
||||
int trLength = 0;
|
||||
|
||||
StringBuilder row = new StringBuilder( 60 );
|
||||
|
||||
// read through the stream until there
|
||||
// are no more bytes left
|
||||
while( true ) {
|
||||
readLength = inStream.Read( plainText , 0 , plainText.Length );
|
||||
|
||||
// break when there is no more data
|
||||
if( readLength < 1 ) break;
|
||||
|
||||
// transfrom and write the blocks. If the block size
|
||||
// is less than the InputBlockSize then write the final block
|
||||
if( readLength == plainText.Length ) {
|
||||
|
||||
trLength = base64.TransformBlock( plainText , 0 ,
|
||||
plainText.Length ,
|
||||
cipherText , 0 );
|
||||
|
||||
// trLength must be the same size as the cipherText
|
||||
// length otherwise something is wrong
|
||||
if( trLength != cipherText.Length )
|
||||
throw new SmtpException( "Problems occured when " +
|
||||
"encoding to base64." );
|
||||
|
||||
// convert the bytes to a string and then add it to the
|
||||
// current row
|
||||
string cipherString = encoding.GetString( cipherText , 0 , trLength );
|
||||
row.Append( cipherString );
|
||||
|
||||
// when a row is full write it and begin
|
||||
// on the next row
|
||||
if( row.Length == 60 ) {
|
||||
WriteLine( row.ToString() );
|
||||
row.Remove( 0 , 60 );
|
||||
}
|
||||
|
||||
} else {
|
||||
// convert the final blocks of bytes
|
||||
cipherText = base64.TransformFinalBlock( plainText , 0 , readLength );
|
||||
|
||||
// convert the bytes to a string and then write it
|
||||
string cipherString = encoding.GetString( cipherText , 0 ,
|
||||
cipherText.Length );
|
||||
row.Append( cipherString );
|
||||
WriteLine( row.ToString() );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// debug printing
|
||||
private void DebugPrint( string line ) {
|
||||
|
||||
@@ -98,6 +98,7 @@ System.Web.Mail/SmtpClient.cs
|
||||
System.Web.Mail/SmtpStream.cs
|
||||
System.Web.Mail/SmtpException.cs
|
||||
System.Web.Mail/SmtpResponse.cs
|
||||
System.Web.Mail/MailEncoder.cs
|
||||
System.Web.UI/BuildMethod.cs
|
||||
System.Web.UI/BuildTemplateMethod.cs
|
||||
System.Web.UI/Control.cs
|
||||
|
||||
@@ -198,8 +198,7 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
|
||||
static private void ApplicationFormClosed (object o, EventArgs args)
|
||||
{
|
||||
Win32.PostQuitMessage (0);
|
||||
{␍ Win32.PostQuitMessage (0);
|
||||
}
|
||||
|
||||
//Compact Framework
|
||||
@@ -249,8 +248,9 @@ namespace System.Windows.Forms {
|
||||
{
|
||||
applicationContext = context;
|
||||
applicationContext.MainForm.Show ();
|
||||
applicationContext.MainForm.Closed +=
|
||||
new EventHandler (ApplicationFormClosed);
|
||||
applicationContext.ThreadExit += new EventHandler( ApplicationFormClosed );
|
||||
// applicationContext.MainForm.Closed += ␍//
|
||||
// new EventHandler (ApplicationFormClosed);
|
||||
Run();
|
||||
}
|
||||
|
||||
@@ -258,8 +258,7 @@ namespace System.Windows.Forms {
|
||||
public static void Run (Form form)
|
||||
// Documents say this parameter name should be mainform,
|
||||
// but the verifier says context.
|
||||
{
|
||||
form.CreateControl ();
|
||||
{␍ form.CreateControl ();
|
||||
ApplicationContext context = new ApplicationContext (
|
||||
form);
|
||||
Run (context);
|
||||
|
||||
@@ -22,7 +22,13 @@ namespace System.Windows.Forms {
|
||||
// --- (public) Properties ---
|
||||
public Form MainForm {
|
||||
get { return mainForm; }
|
||||
set { mainForm = value; }
|
||||
set
|
||||
{
|
||||
if (mainForm != null)
|
||||
mainForm.Closed -= new System.EventHandler( OnMainFormClosed );
|
||||
mainForm = value;
|
||||
mainForm.Closed += new System.EventHandler( OnMainFormClosed );
|
||||
}
|
||||
}
|
||||
|
||||
// --- Constructor ---
|
||||
@@ -33,7 +39,7 @@ namespace System.Windows.Forms {
|
||||
|
||||
public ApplicationContext(Form mainForm) : this()
|
||||
{
|
||||
this.mainForm = mainForm;
|
||||
this.MainForm = mainForm;
|
||||
}
|
||||
|
||||
// --- Methods ---
|
||||
@@ -53,19 +59,20 @@ namespace System.Windows.Forms {
|
||||
[MonoTODO]
|
||||
public void ExitThread()
|
||||
{
|
||||
//FIXME:
|
||||
if (ThreadExit != null)
|
||||
ThreadExit( this, null );
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected virtual void ExitThreadCore()
|
||||
{
|
||||
//FIXME:
|
||||
ExitThread();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected virtual void OnMainFormClosed(object sender,EventArgs e)
|
||||
{
|
||||
//FIXME:
|
||||
ExitThreadCore();
|
||||
}
|
||||
|
||||
// --- Methods: object ---
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
2003-02-19 Alexandre Pigolkine <[email protected]>
|
||||
2003-02-26 Reggie Burnett <[email protected]>␍ * Form.Close now actually destroys the Window␍ * Application now closes when launching form is closed␍␍ 2003-02-19 Alexandre Pigolkine <[email protected]>
|
||||
* Button.cs
|
||||
* CheckedListBox.cs
|
||||
* ComboBox.cs
|
||||
|
||||
@@ -494,9 +494,7 @@
|
||||
|
||||
//Compact Framework
|
||||
public void Close ()
|
||||
{
|
||||
Win32.CloseWindow (Handle);
|
||||
}
|
||||
{␍ Win32.DestroyWindow (Handle);␍ }
|
||||
|
||||
[MonoTODO]
|
||||
public void LayoutMdi (MdiLayout value)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2003-02-28 Alan Tam <[email protected]>
|
||||
|
||||
* XmlConvert.cs: fixed the most ToXXX(string) and ToString(XXX)
|
||||
methods to make them compatible with the XML Schema Spec from W3C
|
||||
ToString(TimeSpan) is still outstanding
|
||||
|
||||
2003-02-18 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* XmlDocument.cs:
|
||||
|
||||
@@ -1,329 +1,439 @@
|
||||
//
|
||||
// System.Xml.XmlConvert
|
||||
//
|
||||
// Authors:
|
||||
// Dwivedi, Ajay kumar ([email protected])
|
||||
// Gonzalo Paniagua Javier ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc (http://www.ximian.com)
|
||||
//
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Xml {
|
||||
|
||||
public class XmlConvert {
|
||||
|
||||
static string encodedColon = "_x003A_";
|
||||
|
||||
public XmlConvert()
|
||||
{}
|
||||
|
||||
private static string TryDecoding (string s)
|
||||
{
|
||||
if (s == null || s.Length < 6)
|
||||
return s;
|
||||
|
||||
char c = '\uFFFF';
|
||||
try {
|
||||
c = (char) Int32.Parse (s.Substring (1, 4), NumberStyles.HexNumber);
|
||||
} catch {
|
||||
return s [0] + DecodeName (s.Substring (1));
|
||||
}
|
||||
|
||||
if (s.Length == 6)
|
||||
return c.ToString ();
|
||||
return c + DecodeName (s.Substring (6));
|
||||
}
|
||||
|
||||
public static string DecodeName (string name)
|
||||
{
|
||||
if (name == null || name.Length == 0)
|
||||
return name;
|
||||
|
||||
int pos = name.IndexOf ('_');
|
||||
if (pos == -1 || pos + 6 >= name.Length)
|
||||
return name;
|
||||
|
||||
if (Char.ToUpper (name [pos + 1]) != 'X' || name [pos + 6] != '_')
|
||||
return name [0] + DecodeName (name.Substring (1));
|
||||
|
||||
return name.Substring (0, pos) + TryDecoding (name.Substring (pos + 1));
|
||||
}
|
||||
|
||||
public static string EncodeLocalName (string name)
|
||||
{
|
||||
string encoded = EncodeName (name);
|
||||
int pos = encoded.IndexOf (':');
|
||||
if (pos == -1)
|
||||
return encoded;
|
||||
return encoded.Replace (":", encodedColon);
|
||||
}
|
||||
|
||||
internal static bool IsInvalid (char c, bool firstOnlyLetter)
|
||||
{
|
||||
if (c == ':') // Special case. allowed in EncodeName, but encoded in EncodeLocalName
|
||||
return false;
|
||||
|
||||
if (firstOnlyLetter && !Char.IsLetter (c) && c != '_')
|
||||
return false;
|
||||
|
||||
return !Char.IsLetterOrDigit (c);
|
||||
}
|
||||
|
||||
private static string EncodeName (string name, bool nmtoken)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
int length = name.Length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
char c = name [i];
|
||||
if (c != '_' || i + 6 >= length) {
|
||||
bool firstOnlyLetter = (i == 0 && !nmtoken);
|
||||
if (IsInvalid (c, firstOnlyLetter)) {
|
||||
sb.AppendFormat ("_x{0:X4}_", (int) c);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (Char.ToUpper (name [i + 1]) == 'X' && name [i + 6] == '_') {
|
||||
string decoded = TryDecoding (name.Substring (i + 1, 6));
|
||||
if (decoded.Length == 1) {
|
||||
sb.AppendFormat ("_x{0:X4}_", (int) c);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.Append (c);
|
||||
}
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
public static string EncodeName (string name)
|
||||
{
|
||||
return EncodeName (name, false);
|
||||
}
|
||||
|
||||
public static string EncodeNmToken(string name)
|
||||
{
|
||||
return EncodeName (name, true);
|
||||
}
|
||||
|
||||
// {true, false, 1, 0}
|
||||
public static bool ToBoolean(string s)
|
||||
{
|
||||
s = s.Trim();
|
||||
switch(s)
|
||||
{
|
||||
case "1":
|
||||
return true;
|
||||
case "true":
|
||||
return true;
|
||||
case "0":
|
||||
return false;
|
||||
case "false":
|
||||
return false;
|
||||
default:
|
||||
throw new FormatException(s + " is not a valid boolean value");
|
||||
}
|
||||
}
|
||||
|
||||
public static byte ToByte(string s)
|
||||
{
|
||||
return Byte.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static char ToChar(string s)
|
||||
{
|
||||
return Char.Parse(s);
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(string s)
|
||||
{
|
||||
return DateTime.Parse(s);
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(string s, string format)
|
||||
{
|
||||
DateTimeFormatInfo d = new DateTimeFormatInfo();
|
||||
d.FullDateTimePattern = format;
|
||||
return DateTime.Parse(s, d);
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(string s, string[] formats)
|
||||
{
|
||||
DateTimeStyles style = DateTimeStyles.AllowLeadingWhite |
|
||||
DateTimeStyles.AllowTrailingWhite;
|
||||
return DateTime.ParseExact (s, formats, DateTimeFormatInfo.InvariantInfo, style);
|
||||
}
|
||||
|
||||
public static Decimal ToDecimal(string s)
|
||||
{
|
||||
return Decimal.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static double ToDouble(string s)
|
||||
{
|
||||
return Double.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static Guid ToGuid(string s)
|
||||
{
|
||||
return new Guid(s);
|
||||
}
|
||||
|
||||
public static short ToInt16(string s)
|
||||
{
|
||||
return Int16.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static int ToInt32(string s)
|
||||
{
|
||||
return Int32.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static long ToInt64(string s)
|
||||
{
|
||||
return Int64.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static SByte ToSByte(string s)
|
||||
{
|
||||
return SByte.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static float ToSingle(string s)
|
||||
{
|
||||
return Single.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(Guid value)
|
||||
{
|
||||
return value.ToString("D",CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(int value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(short value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(byte value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(long value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(char value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(bool value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static string ToString(SByte value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
public static string ToString(Decimal value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static string ToString(UInt64 value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
public static string ToString(TimeSpan value)
|
||||
{
|
||||
return value.ToString();
|
||||
}
|
||||
public static string ToString(double value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
public static string ToString(float value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static string ToString(UInt32 value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static string ToString(UInt16 value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
public static string ToString(DateTime value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
public static string ToString(DateTime value, string format)
|
||||
{
|
||||
return value.ToString(format, CultureInfo.InvariantCulture);
|
||||
}
|
||||
public static TimeSpan ToTimeSpan(string s)
|
||||
{
|
||||
return TimeSpan.Parse(s);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static UInt16 ToUInt16(string s)
|
||||
{
|
||||
return UInt16.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static UInt32 ToUInt32(string s)
|
||||
{
|
||||
return UInt32.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static UInt64 ToUInt64(string s)
|
||||
{
|
||||
return UInt64.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string VerifyName(string name)
|
||||
{
|
||||
Exception innerEx;
|
||||
if(name == null)
|
||||
throw new ArgumentNullException("name");
|
||||
|
||||
if(XmlConstructs.IsValidName(name, out innerEx))
|
||||
return name;
|
||||
|
||||
throw new XmlException("'"+name+"' is not a valid XML Name",null);
|
||||
}
|
||||
|
||||
public static string VerifyNCName(string ncname)
|
||||
{
|
||||
Exception innerEx;
|
||||
if(ncname == null)
|
||||
throw new ArgumentNullException("ncname");
|
||||
|
||||
if(XmlConstructs.IsValidName(ncname, out innerEx))
|
||||
return ncname;
|
||||
|
||||
throw new XmlException("'"+ncname+"' is not a valid XML NCName",innerEx);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// System.Xml.XmlConvert
|
||||
//
|
||||
// Authors:
|
||||
// Dwivedi, Ajay kumar ([email protected])
|
||||
// Gonzalo Paniagua Javier ([email protected])
|
||||
// Alan Tam Siu Lung ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc (http://www.ximian.com)
|
||||
//
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Xml {
|
||||
|
||||
public class XmlConvert {
|
||||
|
||||
static string encodedColon = "_x003A_";
|
||||
|
||||
public XmlConvert()
|
||||
{}
|
||||
|
||||
private static string TryDecoding (string s)
|
||||
{
|
||||
if (s == null || s.Length < 6)
|
||||
return s;
|
||||
|
||||
char c = '\uFFFF';
|
||||
try {
|
||||
c = (char) Int32.Parse (s.Substring (1, 4), NumberStyles.HexNumber);
|
||||
} catch {
|
||||
return s [0] + DecodeName (s.Substring (1));
|
||||
}
|
||||
|
||||
if (s.Length == 6)
|
||||
return c.ToString ();
|
||||
return c + DecodeName (s.Substring (6));
|
||||
}
|
||||
|
||||
public static string DecodeName (string name)
|
||||
{
|
||||
if (name == null || name.Length == 0)
|
||||
return name;
|
||||
|
||||
int pos = name.IndexOf ('_');
|
||||
if (pos == -1 || pos + 6 >= name.Length)
|
||||
return name;
|
||||
|
||||
if (Char.ToUpper (name [pos + 1]) != 'X' || name [pos + 6] != '_')
|
||||
return name [0] + DecodeName (name.Substring (1));
|
||||
|
||||
return name.Substring (0, pos) + TryDecoding (name.Substring (pos + 1));
|
||||
}
|
||||
|
||||
public static string EncodeLocalName (string name)
|
||||
{
|
||||
string encoded = EncodeName (name);
|
||||
int pos = encoded.IndexOf (':');
|
||||
if (pos == -1)
|
||||
return encoded;
|
||||
return encoded.Replace (":", encodedColon);
|
||||
}
|
||||
|
||||
internal static bool IsInvalid (char c, bool firstOnlyLetter)
|
||||
{
|
||||
if (c == ':') // Special case. allowed in EncodeName, but encoded in EncodeLocalName
|
||||
return false;
|
||||
|
||||
if (firstOnlyLetter && !Char.IsLetter (c) && c != '_')
|
||||
return false;
|
||||
|
||||
return !Char.IsLetterOrDigit (c);
|
||||
}
|
||||
|
||||
private static string EncodeName (string name, bool nmtoken)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
int length = name.Length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
char c = name [i];
|
||||
if (c != '_' || i + 6 >= length) {
|
||||
bool firstOnlyLetter = (i == 0 && !nmtoken);
|
||||
if (IsInvalid (c, firstOnlyLetter)) {
|
||||
sb.AppendFormat ("_x{0:X4}_", (int) c);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (Char.ToUpper (name [i + 1]) == 'X' && name [i + 6] == '_') {
|
||||
string decoded = TryDecoding (name.Substring (i + 1, 6));
|
||||
if (decoded.Length == 1) {
|
||||
sb.AppendFormat ("_x{0:X4}_", (int) c);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.Append (c);
|
||||
}
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
public static string EncodeName (string name)
|
||||
{
|
||||
return EncodeName (name, false);
|
||||
}
|
||||
|
||||
public static string EncodeNmToken(string name)
|
||||
{
|
||||
return EncodeName (name, true);
|
||||
}
|
||||
|
||||
// {true, false, 1, 0}
|
||||
public static bool ToBoolean(string s)
|
||||
{
|
||||
s = s.Trim();
|
||||
switch(s)
|
||||
{
|
||||
case "1":
|
||||
return true;
|
||||
case "true":
|
||||
return true;
|
||||
case "0":
|
||||
return false;
|
||||
case "false":
|
||||
return false;
|
||||
default:
|
||||
throw new FormatException(s + " is not a valid boolean value");
|
||||
}
|
||||
}
|
||||
|
||||
public static byte ToByte(string s)
|
||||
{
|
||||
return Byte.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static char ToChar(string s)
|
||||
{
|
||||
return Char.Parse(s);
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(string s)
|
||||
{
|
||||
return ToDateTime(s, new string[] {
|
||||
// dateTime
|
||||
"yyyy-MM-ddTHH:mm:ss",
|
||||
"yyyy-MM-ddTHH:mm:ss.f",
|
||||
"yyyy-MM-ddTHH:mm:ss.ff",
|
||||
"yyyy-MM-ddTHH:mm:ss.fff",
|
||||
"yyyy-MM-ddTHH:mm:ss.ffff",
|
||||
"yyyy-MM-ddTHH:mm:ss.fffff",
|
||||
"yyyy-MM-ddTHH:mm:ss.ffffff",
|
||||
"yyyy-MM-ddTHH:mm:ss.fffffff",
|
||||
"yyyy-MM-ddTHH:mm:sszzz",
|
||||
"yyyy-MM-ddTHH:mm:ss.fzzz",
|
||||
"yyyy-MM-ddTHH:mm:ss.ffzzz",
|
||||
"yyyy-MM-ddTHH:mm:ss.fffzzz",
|
||||
"yyyy-MM-ddTHH:mm:ss.ffffzzz",
|
||||
"yyyy-MM-ddTHH:mm:ss.fffffzzz",
|
||||
"yyyy-MM-ddTHH:mm:ss.ffffffzzz",
|
||||
"yyyy-MM-ddTHH:mm:ss.fffffffzzz",
|
||||
"yyyy-MM-ddTHH:mm:ssZ",
|
||||
"yyyy-MM-ddTHH:mm:ss.fZ",
|
||||
"yyyy-MM-ddTHH:mm:ss.ffZ",
|
||||
"yyyy-MM-ddTHH:mm:ss.fffZ",
|
||||
"yyyy-MM-ddTHH:mm:ss.ffffZ",
|
||||
"yyyy-MM-ddTHH:mm:ss.fffffZ",
|
||||
"yyyy-MM-ddTHH:mm:ss.ffffffZ",
|
||||
"yyyy-MM-ddTHH:mm:ss.fffffffZ",
|
||||
// time
|
||||
"HH:mm:ss",
|
||||
"HH:mm:ss.f",
|
||||
"HH:mm:ss.ff",
|
||||
"HH:mm:ss.fff",
|
||||
"HH:mm:ss.ffff",
|
||||
"HH:mm:ss.fffff",
|
||||
"HH:mm:ss.ffffff",
|
||||
"HH:mm:ss.fffffff",
|
||||
"HH:mm:sszzz",
|
||||
"HH:mm:ss.fzzz",
|
||||
"HH:mm:ss.ffzzz",
|
||||
"HH:mm:ss.fffzzz",
|
||||
"HH:mm:ss.ffffzzz",
|
||||
"HH:mm:ss.fffffzzz",
|
||||
"HH:mm:ss.ffffffzzz",
|
||||
"HH:mm:ss.fffffffzzz",
|
||||
"HH:mm:ssZ",
|
||||
"HH:mm:ss.fZ",
|
||||
"HH:mm:ss.ffZ",
|
||||
"HH:mm:ss.fffZ",
|
||||
"HH:mm:ss.ffffZ",
|
||||
"HH:mm:ss.fffffZ",
|
||||
"HH:mm:ss.ffffffZ",
|
||||
"HH:mm:ss.fffffffZ",
|
||||
// date
|
||||
"yyyy-MM-dd",
|
||||
"yyyy-MM-ddzzz",
|
||||
"yyyy-MM-ddZ",
|
||||
// gYearMonth
|
||||
"yyyy-MM",
|
||||
"yyyy-MMzzz",
|
||||
"yyyy-MMZ",
|
||||
// gYear
|
||||
"yyyy",
|
||||
"yyyyzzz",
|
||||
"yyyyZ",
|
||||
// gMonthDay
|
||||
"--MM-dd",
|
||||
"--MM-ddzzz",
|
||||
"--MM-ddZ",
|
||||
// gDay
|
||||
"---dd",
|
||||
"---ddzzz",
|
||||
"---ddZ",
|
||||
});
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(string s, string format)
|
||||
{
|
||||
DateTimeFormatInfo d = new DateTimeFormatInfo();
|
||||
d.FullDateTimePattern = format;
|
||||
return DateTime.Parse(s, d);
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(string s, string[] formats)
|
||||
{
|
||||
DateTimeStyles style = DateTimeStyles.AllowLeadingWhite |
|
||||
DateTimeStyles.AllowTrailingWhite;
|
||||
return DateTime.ParseExact (s, formats, DateTimeFormatInfo.InvariantInfo, style);
|
||||
}
|
||||
|
||||
public static Decimal ToDecimal(string s)
|
||||
{
|
||||
return Decimal.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static double ToDouble(string s)
|
||||
{
|
||||
if (s == "INF") return System.Double.PositiveInfinity;
|
||||
if (s == "-INF") return System.Double.NegativeInfinity;
|
||||
if (s == "NaN") return System.Double.NaN;
|
||||
return Double.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static Guid ToGuid(string s)
|
||||
{
|
||||
return new Guid(s);
|
||||
}
|
||||
|
||||
public static short ToInt16(string s)
|
||||
{
|
||||
return Int16.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static int ToInt32(string s)
|
||||
{
|
||||
return Int32.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static long ToInt64(string s)
|
||||
{
|
||||
return Int64.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static SByte ToSByte(string s)
|
||||
{
|
||||
return SByte.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static float ToSingle(string s)
|
||||
{
|
||||
if (s == "INF") return System.Single.PositiveInfinity;
|
||||
if (s == "-INF") return System.Single.NegativeInfinity;
|
||||
if (s == "NaN") return System.Single.NaN;
|
||||
return Single.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(Guid value)
|
||||
{
|
||||
return value.ToString("D",CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(int value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(short value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(byte value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(long value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(char value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(bool value)
|
||||
{
|
||||
if (value) return "true";
|
||||
return "false";
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static string ToString(SByte value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(Decimal value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static string ToString(UInt64 value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(TimeSpan value)
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (value.Ticks < 0) {
|
||||
builder.Append('-');
|
||||
value = value.Negate();
|
||||
}
|
||||
builder.Append('P');
|
||||
if (value.Days > 0) builder.Append(value.Days).Append('D');
|
||||
if (value.Days > 0 || value.Minutes > 0 || value.Seconds > 0 || value.Milliseconds > 0) {
|
||||
builder.Append('T');
|
||||
if (value.Hours > 0) builder.Append(value.Hours).Append('D');
|
||||
if (value.Minutes > 0) builder.Append(value.Minutes).Append('M');
|
||||
if (value.Seconds > 0 || value.Milliseconds > 0) {
|
||||
builder.Append(value.Seconds);
|
||||
if (value.Milliseconds > 0) builder.Append('.').Append(String.Format("{0:000}", value.Milliseconds));
|
||||
builder.Append('S');
|
||||
}
|
||||
}
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
public static string ToString(double value)
|
||||
{
|
||||
if (Double.IsNegativeInfinity(value)) return "-INF";
|
||||
if (Double.IsPositiveInfinity(value)) return "INF";
|
||||
if (Double.IsNaN(value)) return "INF";
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(float value)
|
||||
{
|
||||
if (Single.IsNegativeInfinity(value)) return "-INF";
|
||||
if (Single.IsPositiveInfinity(value)) return "INF";
|
||||
if (Single.IsNaN(value)) return "INF";
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static string ToString(UInt32 value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static string ToString(UInt16 value)
|
||||
{
|
||||
return value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(DateTime value)
|
||||
{
|
||||
return value.ToString("yyyy-MM-ddTHH:mm:sszzz", CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string ToString(DateTime value, string format)
|
||||
{
|
||||
return value.ToString(format, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static TimeSpan ToTimeSpan(string s)
|
||||
{
|
||||
return TimeSpan.Parse(s); // FIXME: Should Parse according to XML Schema spec
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static UInt16 ToUInt16(string s)
|
||||
{
|
||||
return UInt16.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static UInt32 ToUInt32(string s)
|
||||
{
|
||||
return UInt32.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static UInt64 ToUInt64(string s)
|
||||
{
|
||||
return UInt64.Parse(s, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static string VerifyName(string name)
|
||||
{
|
||||
Exception innerEx;
|
||||
if(name == null)
|
||||
throw new ArgumentNullException("name");
|
||||
|
||||
if(XmlConstructs.IsValidName(name, out innerEx))
|
||||
return name;
|
||||
|
||||
throw new XmlException("'"+name+"' is not a valid XML Name",null);
|
||||
}
|
||||
|
||||
public static string VerifyNCName(string ncname)
|
||||
{
|
||||
Exception innerEx;
|
||||
if(ncname == null)
|
||||
throw new ArgumentNullException("ncname");
|
||||
|
||||
if(XmlConstructs.IsValidName(ncname, out innerEx))
|
||||
return ncname;
|
||||
|
||||
throw new XmlException("'"+ncname+"' is not a valid XML NCName",innerEx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
2003-02-27 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* CultureInfo.cs:
|
||||
(NameToID): make it case insensitive and use a hashtable instead of
|
||||
comparing all the strings.
|
||||
|
||||
Mon Nov 18 13:02:09 CET 2002 Paolo Molaro <[email protected]>
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
// (C) 2001, 2002 Ximian, Inc. (http://www.ximian.com)
|
||||
//
|
||||
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Globalization
|
||||
@@ -15,6 +16,7 @@ namespace System.Globalization
|
||||
public class CultureInfo : ICloneable, IFormatProvider
|
||||
{
|
||||
static CultureInfo invariant_culture_info;
|
||||
static Hashtable nameToID;
|
||||
bool is_read_only;
|
||||
int lcid;
|
||||
bool use_user_override;
|
||||
@@ -256,418 +258,231 @@ namespace System.Globalization
|
||||
this.use_user_override = use_user_override;
|
||||
}
|
||||
|
||||
static void InitNameToID ()
|
||||
{
|
||||
nameToID = new Hashtable (CaseInsensitiveHashCodeProvider.Default,
|
||||
CaseInsensitiveComparer.Default);
|
||||
|
||||
nameToID.Add ("ar", 0x0001);
|
||||
nameToID.Add ("ar-SA", 0x0401);
|
||||
nameToID.Add ("ar-IQ", 0x0801);
|
||||
nameToID.Add ("ar-EG", 0x0C01);
|
||||
nameToID.Add ("ar-LY", 0x1001);
|
||||
nameToID.Add ("ar-DZ", 0x1401);
|
||||
nameToID.Add ("ar-MA", 0x1801);
|
||||
nameToID.Add ("ar-TN", 0x1C01);
|
||||
nameToID.Add ("ar-OM", 0x2001);
|
||||
nameToID.Add ("ar-YE", 0x2401);
|
||||
nameToID.Add ("ar-SY", 0x2801);
|
||||
nameToID.Add ("ar-JO", 0x2C01);
|
||||
nameToID.Add ("ar-LB", 0x3001);
|
||||
nameToID.Add ("ar-KW", 0x3401);
|
||||
nameToID.Add ("ar-AE", 0x3801);
|
||||
nameToID.Add ("ar-BH", 0x3C01);
|
||||
nameToID.Add ("ar-QA", 0x4001);
|
||||
nameToID.Add ("bg", 0x0002);
|
||||
nameToID.Add ("bg-BG", 0x0402);
|
||||
nameToID.Add ("ca", 0x0003);
|
||||
nameToID.Add ("ca-ES", 0x0403);
|
||||
nameToID.Add ("zh-CHS", 0x0004);
|
||||
nameToID.Add ("zh-TW", 0x0404);
|
||||
nameToID.Add ("zh-CN", 0x0804);
|
||||
nameToID.Add ("zh-HK", 0x0C04);
|
||||
nameToID.Add ("zh-SG", 0x1004);
|
||||
nameToID.Add ("zh-MO", 0x1404);
|
||||
nameToID.Add ("zh-CHT", 0x7C04);
|
||||
nameToID.Add ("cs", 0x0005);
|
||||
nameToID.Add ("cs-CZ", 0x0405);
|
||||
nameToID.Add ("da", 0x0006);
|
||||
nameToID.Add ("da-DK", 0x0406);
|
||||
nameToID.Add ("de", 0x0007);
|
||||
nameToID.Add ("de-DE", 0x0407);
|
||||
nameToID.Add ("de-CH", 0x0807);
|
||||
nameToID.Add ("de-AT", 0x0C07);
|
||||
nameToID.Add ("de-LU", 0x1007);
|
||||
nameToID.Add ("de-LI", 0x1407);
|
||||
nameToID.Add ("el", 0x0008);
|
||||
nameToID.Add ("el-GR", 0x0408);
|
||||
nameToID.Add ("en", 0x0009);
|
||||
nameToID.Add ("en-US", 0x0409);
|
||||
nameToID.Add ("en-GB", 0x0809);
|
||||
nameToID.Add ("en-AU", 0x0C09);
|
||||
nameToID.Add ("en-CA", 0x1009);
|
||||
nameToID.Add ("en-NZ", 0x1409);
|
||||
nameToID.Add ("en-IE", 0x1809);
|
||||
nameToID.Add ("en-ZA", 0x1C09);
|
||||
nameToID.Add ("en-JM", 0x2009);
|
||||
nameToID.Add ("en-CB", 0x2409);
|
||||
nameToID.Add ("en-BZ", 0x2809);
|
||||
nameToID.Add ("en-TT", 0x2C09);
|
||||
nameToID.Add ("en-ZW", 0x3009);
|
||||
nameToID.Add ("en-PH", 0x3409);
|
||||
nameToID.Add ("es", 0x000A);
|
||||
nameToID.Add ("es-MX", 0x080A);
|
||||
nameToID.Add ("es-ES", 0x0C0A);
|
||||
nameToID.Add ("es-GT", 0x100A);
|
||||
nameToID.Add ("es-CR", 0x140A);
|
||||
nameToID.Add ("es-PA", 0x180A);
|
||||
nameToID.Add ("es-DO", 0x1C0A);
|
||||
nameToID.Add ("es-VE", 0x200A);
|
||||
nameToID.Add ("es-CO", 0x240A);
|
||||
nameToID.Add ("es-PE", 0x280A);
|
||||
nameToID.Add ("es-AR", 0x2C0A);
|
||||
nameToID.Add ("es-EC", 0x300A);
|
||||
nameToID.Add ("es-CL", 0x340A);
|
||||
nameToID.Add ("es-UY", 0x380A);
|
||||
nameToID.Add ("es-PY", 0x3C0A);
|
||||
nameToID.Add ("es-BO", 0x400A);
|
||||
nameToID.Add ("es-SV", 0x440A);
|
||||
nameToID.Add ("es-HN", 0x480A);
|
||||
nameToID.Add ("es-NI", 0x4C0A);
|
||||
nameToID.Add ("es-PR", 0x500A);
|
||||
nameToID.Add ("fi", 0x000B);
|
||||
nameToID.Add ("fi-FI", 0x040B);
|
||||
nameToID.Add ("fr", 0x000C);
|
||||
nameToID.Add ("fr-FR", 0x040C);
|
||||
nameToID.Add ("fr-BE", 0x080C);
|
||||
nameToID.Add ("fr-CA", 0x0C0C);
|
||||
nameToID.Add ("fr-CH", 0x100C);
|
||||
nameToID.Add ("fr-LU", 0x140C);
|
||||
nameToID.Add ("fr-MC", 0x180C);
|
||||
nameToID.Add ("he", 0x000D);
|
||||
nameToID.Add ("he-IL", 0x040D);
|
||||
nameToID.Add ("hu", 0x000E);
|
||||
nameToID.Add ("hu-HU", 0x040E);
|
||||
nameToID.Add ("is", 0x000F);
|
||||
nameToID.Add ("is-IS", 0x040F);
|
||||
nameToID.Add ("it", 0x0010);
|
||||
nameToID.Add ("it-IT", 0x0410);
|
||||
nameToID.Add ("it-CH", 0x0810);
|
||||
nameToID.Add ("ja", 0x0011);
|
||||
nameToID.Add ("ja-JP", 0x0411);
|
||||
nameToID.Add ("ko", 0x0012);
|
||||
nameToID.Add ("ko-KR", 0x0412);
|
||||
nameToID.Add ("nl", 0x0013);
|
||||
nameToID.Add ("nl-NL", 0x0413);
|
||||
nameToID.Add ("nl-BE", 0x0813);
|
||||
nameToID.Add ("no", 0x0014);
|
||||
nameToID.Add ("nb-NO", 0x0414);
|
||||
nameToID.Add ("nn-NO", 0x0814);
|
||||
nameToID.Add ("pl", 0x0015);
|
||||
nameToID.Add ("pl-PL", 0x0415);
|
||||
nameToID.Add ("pt", 0x0016);
|
||||
nameToID.Add ("pt-BR", 0x0416);
|
||||
nameToID.Add ("pt-PT", 0x0816);
|
||||
nameToID.Add ("ro", 0x0018);
|
||||
nameToID.Add ("ro-RO", 0x0418);
|
||||
nameToID.Add ("ru", 0x0019);
|
||||
nameToID.Add ("ru-RU", 0x0419);
|
||||
nameToID.Add ("hr", 0x001A);
|
||||
nameToID.Add ("hr-HR", 0x041A);
|
||||
nameToID.Add ("Lt-sr-SP", 0x081A);
|
||||
nameToID.Add ("Cy-sr-SP", 0x0C1A);
|
||||
nameToID.Add ("sk", 0x001B);
|
||||
nameToID.Add ("sk-SK", 0x041B);
|
||||
nameToID.Add ("sq", 0x001C);
|
||||
nameToID.Add ("sq-AL", 0x041C);
|
||||
nameToID.Add ("sv", 0x001D);
|
||||
nameToID.Add ("sv-SE", 0x041D);
|
||||
nameToID.Add ("sv-FI", 0x081D);
|
||||
nameToID.Add ("th", 0x001E);
|
||||
nameToID.Add ("th-TH", 0x041E);
|
||||
nameToID.Add ("tr", 0x001F);
|
||||
nameToID.Add ("tr-TR", 0x041F);
|
||||
nameToID.Add ("ur", 0x0020);
|
||||
nameToID.Add ("ur-PK", 0x0420);
|
||||
nameToID.Add ("id", 0x0021);
|
||||
nameToID.Add ("id-ID", 0x0421);
|
||||
nameToID.Add ("uk", 0x0022);
|
||||
nameToID.Add ("uk-UA", 0x0422);
|
||||
nameToID.Add ("be", 0x0023);
|
||||
nameToID.Add ("be-BY", 0x0423);
|
||||
nameToID.Add ("sl", 0x0024);
|
||||
nameToID.Add ("sl-SI", 0x0424);
|
||||
nameToID.Add ("et", 0x0025);
|
||||
nameToID.Add ("et-EE", 0x0425);
|
||||
nameToID.Add ("lv", 0x0026);
|
||||
nameToID.Add ("lv-LV", 0x0426);
|
||||
nameToID.Add ("lt", 0x0027);
|
||||
nameToID.Add ("lt-LT", 0x0427);
|
||||
nameToID.Add ("fa", 0x0029);
|
||||
nameToID.Add ("fa-IR", 0x0429);
|
||||
nameToID.Add ("vi", 0x002A);
|
||||
nameToID.Add ("vi-VN", 0x042A);
|
||||
nameToID.Add ("hy", 0x002B);
|
||||
nameToID.Add ("hy-AM", 0x042B);
|
||||
nameToID.Add ("az", 0x002C);
|
||||
nameToID.Add ("Lt-az-AZ", 0x042C);
|
||||
nameToID.Add ("Cy-az-AZ", 0x082C);
|
||||
nameToID.Add ("eu", 0x002D);
|
||||
nameToID.Add ("eu-ES", 0x042D);
|
||||
nameToID.Add ("mk", 0x002F);
|
||||
nameToID.Add ("mk-MK", 0x042F);
|
||||
nameToID.Add ("af", 0x0036);
|
||||
nameToID.Add ("af-ZA", 0x0436);
|
||||
nameToID.Add ("ka", 0x0037);
|
||||
nameToID.Add ("ka-GE", 0x0437);
|
||||
nameToID.Add ("fo", 0x0038);
|
||||
nameToID.Add ("fo-FO", 0x0438);
|
||||
nameToID.Add ("hi", 0x0039);
|
||||
nameToID.Add ("hi-IN", 0x0439);
|
||||
nameToID.Add ("ms", 0x003E);
|
||||
nameToID.Add ("ms-MY", 0x043E);
|
||||
nameToID.Add ("ms-BN", 0x083E);
|
||||
nameToID.Add ("kk", 0x003F);
|
||||
nameToID.Add ("kk-KZ", 0x043F);
|
||||
nameToID.Add ("ky", 0x0040);
|
||||
nameToID.Add ("ky-KZ", 0x0440);
|
||||
nameToID.Add ("sw", 0x0041);
|
||||
nameToID.Add ("sw-KE", 0x0441);
|
||||
nameToID.Add ("uz", 0x0043);
|
||||
nameToID.Add ("Lt-uz-UZ", 0x0443);
|
||||
nameToID.Add ("Cy-uz-UZ", 0x0843);
|
||||
nameToID.Add ("tt", 0x0044);
|
||||
nameToID.Add ("tt-TA", 0x0444);
|
||||
nameToID.Add ("pa", 0x0046);
|
||||
nameToID.Add ("pa-IN", 0x0446);
|
||||
nameToID.Add ("gu", 0x0047);
|
||||
nameToID.Add ("gu-IN", 0x0447);
|
||||
nameToID.Add ("ta", 0x0049);
|
||||
nameToID.Add ("ta-IN", 0x0449);
|
||||
nameToID.Add ("te", 0x004A);
|
||||
nameToID.Add ("te-IN", 0x044A);
|
||||
nameToID.Add ("kn", 0x004B);
|
||||
nameToID.Add ("kn-IN", 0x044B);
|
||||
nameToID.Add ("mr", 0x004E);
|
||||
nameToID.Add ("mr-IN", 0x044E);
|
||||
nameToID.Add ("sa", 0x004F);
|
||||
nameToID.Add ("sa-IN", 0x044F);
|
||||
nameToID.Add ("mn", 0x0050);
|
||||
nameToID.Add ("mn-MN", 0x0450);
|
||||
nameToID.Add ("gl", 0x0056);
|
||||
nameToID.Add ("gl-ES", 0x0456);
|
||||
nameToID.Add ("kok", 0x0057);
|
||||
nameToID.Add ("kok-IN", 0x0457);
|
||||
nameToID.Add ("syr", 0x005A);
|
||||
nameToID.Add ("syr-SY", 0x045A);
|
||||
nameToID.Add ("div", 0x0065);
|
||||
nameToID.Add ("div-MV", 0x0465);
|
||||
nameToID.Add ("", 0x007F);
|
||||
}
|
||||
|
||||
//
|
||||
// Maps a name to a culture id
|
||||
//
|
||||
static int NameToID (string name)
|
||||
{
|
||||
switch (name){
|
||||
case "ar":
|
||||
return 0x0001;
|
||||
case "ar-SA":
|
||||
return 0x0401;
|
||||
case "ar-IQ":
|
||||
return 0x0801;
|
||||
case "ar-EG":
|
||||
return 0x0C01;
|
||||
case "ar-LY":
|
||||
return 0x1001;
|
||||
case "ar-DZ":
|
||||
return 0x1401;
|
||||
case "ar-MA":
|
||||
return 0x1801;
|
||||
case "ar-TN":
|
||||
return 0x1C01;
|
||||
case "ar-OM":
|
||||
return 0x2001;
|
||||
case "ar-YE":
|
||||
return 0x2401;
|
||||
case "ar-SY":
|
||||
return 0x2801;
|
||||
case "ar-JO":
|
||||
return 0x2C01;
|
||||
case "ar-LB":
|
||||
return 0x3001;
|
||||
case "ar-KW":
|
||||
return 0x3401;
|
||||
case "ar-AE":
|
||||
return 0x3801;
|
||||
case "ar-BH":
|
||||
return 0x3C01;
|
||||
case "ar-QA":
|
||||
return 0x4001;
|
||||
case "bg":
|
||||
return 0x0002;
|
||||
case "bg-BG":
|
||||
return 0x0402;
|
||||
case "ca":
|
||||
return 0x0003;
|
||||
case "ca-ES":
|
||||
return 0x0403;
|
||||
case "zh-CHS":
|
||||
return 0x0004;
|
||||
case "zh-TW":
|
||||
return 0x0404;
|
||||
case "zh-CN":
|
||||
return 0x0804;
|
||||
case "zh-HK":
|
||||
return 0x0C04;
|
||||
case "zh-SG":
|
||||
return 0x1004;
|
||||
case "zh-MO":
|
||||
return 0x1404;
|
||||
case "zh-CHT":
|
||||
return 0x7C04;
|
||||
case "cs":
|
||||
return 0x0005;
|
||||
case "cs-CZ":
|
||||
return 0x0405;
|
||||
case "da":
|
||||
return 0x0006;
|
||||
case "da-DK":
|
||||
return 0x0406;
|
||||
case "de":
|
||||
return 0x0007;
|
||||
case "de-DE":
|
||||
return 0x0407;
|
||||
case "de-CH":
|
||||
return 0x0807;
|
||||
case "de-AT":
|
||||
return 0x0C07;
|
||||
case "de-LU":
|
||||
return 0x1007;
|
||||
case "de-LI":
|
||||
return 0x1407;
|
||||
case "el":
|
||||
return 0x0008;
|
||||
case "el-GR":
|
||||
return 0x0408;
|
||||
case "en":
|
||||
return 0x0009;
|
||||
case "en-US":
|
||||
return 0x0409;
|
||||
case "en-GB":
|
||||
return 0x0809;
|
||||
case "en-AU":
|
||||
return 0x0C09;
|
||||
case "en-CA":
|
||||
return 0x1009;
|
||||
case "en-NZ":
|
||||
return 0x1409;
|
||||
case "en-IE":
|
||||
return 0x1809;
|
||||
case "en-ZA":
|
||||
return 0x1C09;
|
||||
case "en-JM":
|
||||
return 0x2009;
|
||||
case "en-CB":
|
||||
return 0x2409;
|
||||
case "en-BZ":
|
||||
return 0x2809;
|
||||
case "en-TT":
|
||||
return 0x2C09;
|
||||
case "en-ZW":
|
||||
return 0x3009;
|
||||
case "en-PH":
|
||||
return 0x3409;
|
||||
case "es":
|
||||
return 0x000A;
|
||||
case "es-MX":
|
||||
return 0x080A;
|
||||
case "es-ES":
|
||||
return 0x0C0A;
|
||||
case "es-GT":
|
||||
return 0x100A;
|
||||
case "es-CR":
|
||||
return 0x140A;
|
||||
case "es-PA":
|
||||
return 0x180A;
|
||||
case "es-DO":
|
||||
return 0x1C0A;
|
||||
case "es-VE":
|
||||
return 0x200A;
|
||||
case "es-CO":
|
||||
return 0x240A;
|
||||
case "es-PE":
|
||||
return 0x280A;
|
||||
case "es-AR":
|
||||
return 0x2C0A;
|
||||
case "es-EC":
|
||||
return 0x300A;
|
||||
case "es-CL":
|
||||
return 0x340A;
|
||||
case "es-UY":
|
||||
return 0x380A;
|
||||
case "es-PY":
|
||||
return 0x3C0A;
|
||||
case "es-BO":
|
||||
return 0x400A;
|
||||
case "es-SV":
|
||||
return 0x440A;
|
||||
case "es-HN":
|
||||
return 0x480A;
|
||||
case "es-NI":
|
||||
return 0x4C0A;
|
||||
case "es-PR":
|
||||
return 0x500A;
|
||||
case "fi":
|
||||
return 0x000B;
|
||||
case "fi-FI":
|
||||
return 0x040B;
|
||||
case "fr":
|
||||
return 0x000C;
|
||||
case "fr-FR":
|
||||
return 0x040C;
|
||||
case "fr-BE":
|
||||
return 0x080C;
|
||||
case "fr-CA":
|
||||
return 0x0C0C;
|
||||
case "fr-CH":
|
||||
return 0x100C;
|
||||
case "fr-LU":
|
||||
return 0x140C;
|
||||
case "fr-MC":
|
||||
return 0x180C;
|
||||
case "he":
|
||||
return 0x000D;
|
||||
case "he-IL":
|
||||
return 0x040D;
|
||||
case "hu":
|
||||
return 0x000E;
|
||||
case "hu-HU":
|
||||
return 0x040E;
|
||||
case "is":
|
||||
return 0x000F;
|
||||
case "is-IS":
|
||||
return 0x040F;
|
||||
case "it":
|
||||
return 0x0010;
|
||||
case "it-IT":
|
||||
return 0x0410;
|
||||
case "it-CH":
|
||||
return 0x0810;
|
||||
case "ja":
|
||||
return 0x0011;
|
||||
case "ja-JP":
|
||||
return 0x0411;
|
||||
case "ko":
|
||||
return 0x0012;
|
||||
case "ko-KR":
|
||||
return 0x0412;
|
||||
case "nl":
|
||||
return 0x0013;
|
||||
case "nl-NL":
|
||||
return 0x0413;
|
||||
case "nl-BE":
|
||||
return 0x0813;
|
||||
case "no":
|
||||
return 0x0014;
|
||||
case "nb-NO":
|
||||
return 0x0414;
|
||||
case "nn-NO":
|
||||
return 0x0814;
|
||||
case "pl":
|
||||
return 0x0015;
|
||||
case "pl-PL":
|
||||
return 0x0415;
|
||||
case "pt":
|
||||
return 0x0016;
|
||||
case "pt-BR":
|
||||
return 0x0416;
|
||||
case "pt-PT":
|
||||
return 0x0816;
|
||||
case "ro":
|
||||
return 0x0018;
|
||||
case "ro-RO":
|
||||
return 0x0418;
|
||||
case "ru":
|
||||
return 0x0019;
|
||||
case "ru-RU":
|
||||
return 0x0419;
|
||||
case "hr":
|
||||
return 0x001A;
|
||||
case "hr-HR":
|
||||
return 0x041A;
|
||||
case "Lt-sr-SP":
|
||||
return 0x081A;
|
||||
case "Cy-sr-SP":
|
||||
return 0x0C1A;
|
||||
case "sk":
|
||||
return 0x001B;
|
||||
case "sk-SK":
|
||||
return 0x041B;
|
||||
case "sq":
|
||||
return 0x001C;
|
||||
case "sq-AL":
|
||||
return 0x041C;
|
||||
case "sv":
|
||||
return 0x001D;
|
||||
case "sv-SE":
|
||||
return 0x041D;
|
||||
case "sv-FI":
|
||||
return 0x081D;
|
||||
case "th":
|
||||
return 0x001E;
|
||||
case "th-TH":
|
||||
return 0x041E;
|
||||
case "tr":
|
||||
return 0x001F;
|
||||
case "tr-TR":
|
||||
return 0x041F;
|
||||
case "ur":
|
||||
return 0x0020;
|
||||
case "ur-PK":
|
||||
return 0x0420;
|
||||
case "id":
|
||||
return 0x0021;
|
||||
case "id-ID":
|
||||
return 0x0421;
|
||||
case "uk":
|
||||
return 0x0022;
|
||||
case "uk-UA":
|
||||
return 0x0422;
|
||||
case "be":
|
||||
return 0x0023;
|
||||
case "be-BY":
|
||||
return 0x0423;
|
||||
case "sl":
|
||||
return 0x0024;
|
||||
case "sl-SI":
|
||||
return 0x0424;
|
||||
case "et":
|
||||
return 0x0025;
|
||||
case "et-EE":
|
||||
return 0x0425;
|
||||
case "lv":
|
||||
return 0x0026;
|
||||
case "lv-LV":
|
||||
return 0x0426;
|
||||
case "lt":
|
||||
return 0x0027;
|
||||
case "lt-LT":
|
||||
return 0x0427;
|
||||
case "fa":
|
||||
return 0x0029;
|
||||
case "fa-IR":
|
||||
return 0x0429;
|
||||
case "vi":
|
||||
return 0x002A;
|
||||
case "vi-VN":
|
||||
return 0x042A;
|
||||
case "hy":
|
||||
return 0x002B;
|
||||
case "hy-AM":
|
||||
return 0x042B;
|
||||
case "az":
|
||||
return 0x002C;
|
||||
case "Lt-az-AZ":
|
||||
return 0x042C;
|
||||
case "Cy-az-AZ":
|
||||
return 0x082C;
|
||||
case "eu":
|
||||
return 0x002D;
|
||||
case "eu-ES":
|
||||
return 0x042D;
|
||||
case "mk":
|
||||
return 0x002F;
|
||||
case "mk-MK":
|
||||
return 0x042F;
|
||||
case "af":
|
||||
return 0x0036;
|
||||
case "af-ZA":
|
||||
return 0x0436;
|
||||
case "ka":
|
||||
return 0x0037;
|
||||
case "ka-GE":
|
||||
return 0x0437;
|
||||
case "fo":
|
||||
return 0x0038;
|
||||
case "fo-FO":
|
||||
return 0x0438;
|
||||
case "hi":
|
||||
return 0x0039;
|
||||
case "hi-IN":
|
||||
return 0x0439;
|
||||
case "ms":
|
||||
return 0x003E;
|
||||
case "ms-MY":
|
||||
return 0x043E;
|
||||
case "ms-BN":
|
||||
return 0x083E;
|
||||
case "kk":
|
||||
return 0x003F;
|
||||
case "kk-KZ":
|
||||
return 0x043F;
|
||||
case "ky":
|
||||
return 0x0040;
|
||||
case "ky-KZ":
|
||||
return 0x0440;
|
||||
case "sw":
|
||||
return 0x0041;
|
||||
case "sw-KE":
|
||||
return 0x0441;
|
||||
case "uz":
|
||||
return 0x0043;
|
||||
case "Lt-uz-UZ":
|
||||
return 0x0443;
|
||||
case "Cy-uz-UZ":
|
||||
return 0x0843;
|
||||
case "tt":
|
||||
return 0x0044;
|
||||
case "tt-TA":
|
||||
return 0x0444;
|
||||
case "pa":
|
||||
return 0x0046;
|
||||
case "pa-IN":
|
||||
return 0x0446;
|
||||
case "gu":
|
||||
return 0x0047;
|
||||
case "gu-IN":
|
||||
return 0x0447;
|
||||
case "ta":
|
||||
return 0x0049;
|
||||
case "ta-IN":
|
||||
return 0x0449;
|
||||
case "te":
|
||||
return 0x004A;
|
||||
case "te-IN":
|
||||
return 0x044A;
|
||||
case "kn":
|
||||
return 0x004B;
|
||||
case "kn-IN":
|
||||
return 0x044B;
|
||||
case "mr":
|
||||
return 0x004E;
|
||||
case "mr-IN":
|
||||
return 0x044E;
|
||||
case "sa":
|
||||
return 0x004F;
|
||||
case "sa-IN":
|
||||
return 0x044F;
|
||||
case "mn":
|
||||
return 0x0050;
|
||||
case "mn-MN":
|
||||
return 0x0450;
|
||||
case "gl":
|
||||
return 0x0056;
|
||||
case "gl-ES":
|
||||
return 0x0456;
|
||||
case "kok":
|
||||
return 0x0057;
|
||||
case "kok-IN":
|
||||
return 0x0457;
|
||||
case "syr":
|
||||
return 0x005A;
|
||||
case "syr-SY":
|
||||
return 0x045A;
|
||||
case "div":
|
||||
return 0x0065;
|
||||
case "div-MV":
|
||||
return 0x0465;
|
||||
case "":
|
||||
return 0x007F;
|
||||
if (nameToID == null) {
|
||||
lock (typeof (CultureInfo)) {
|
||||
if (nameToID == null)
|
||||
InitNameToID ();
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
if (!nameToID.ContainsKey (name))
|
||||
return -1;
|
||||
|
||||
return (int) nameToID [name];
|
||||
}
|
||||
|
||||
// <summary>
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
2003-02-27 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* File.cs: fix by Elan Feingold <[email protected]> for
|
||||
SetCreationTime, SetLastAccessTime and SetLastWriteTime.
|
||||
|
||||
2003-02-26 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* MemoryStream.cs:
|
||||
(ToArray): return only the portion of the buffer that contains
|
||||
data, not the whole buffer. (note: this makes XmlDocument.Load work
|
||||
again with documents that have a <?xml without the 'encoding'
|
||||
attribute, which makes gtk-sharp generator work again).
|
||||
|
||||
2003-02-25 Nick Drochak <[email protected]>
|
||||
|
||||
* File.cs (GetCreationTime): Throw proper execption when path is not
|
||||
found.
|
||||
|
||||
Tue Feb 25 11:55:35 CET 2003 Paolo Molaro <[email protected]>
|
||||
|
||||
* MemoryStream.cs: make it behave sanely when the stream is
|
||||
incrementally expanded.
|
||||
|
||||
2003-02-21 Dick Porter <[email protected]>
|
||||
|
||||
* FileStream.cs: Use locks around buffer manipulations. Fixes bug
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace System.IO
|
||||
MonoIOError error;
|
||||
|
||||
if (!MonoIO.GetFileStat (path, out stat, out error))
|
||||
throw MonoIO.GetException (path, error);
|
||||
throw new IOException (path);
|
||||
return DateTime.FromFileTime (stat.CreationTime);
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace System.IO
|
||||
{
|
||||
MonoIOError error;
|
||||
|
||||
if (!MonoIO.SetFileTime (path, creation_time.Ticks,
|
||||
if (!MonoIO.SetFileTime (path, creation_time.ToFileTime(),
|
||||
-1, -1, out error)) {
|
||||
throw MonoIO.GetException (path, error);
|
||||
}
|
||||
@@ -279,7 +279,7 @@ namespace System.IO
|
||||
MonoIOError error;
|
||||
|
||||
if (!MonoIO.SetFileTime (path, -1,
|
||||
last_access_time.Ticks, -1,
|
||||
last_access_time.ToFileTime(), -1,
|
||||
out error)) {
|
||||
throw MonoIO.GetException (path, error);
|
||||
}
|
||||
@@ -291,7 +291,7 @@ namespace System.IO
|
||||
MonoIOError error;
|
||||
|
||||
if (!MonoIO.SetFileTime (path, -1, -1,
|
||||
last_write_time.Ticks,
|
||||
last_write_time.ToFileTime(),
|
||||
out error)) {
|
||||
throw MonoIO.GetException (path, error);
|
||||
}
|
||||
|
||||
@@ -332,9 +332,9 @@ namespace System.IO {
|
||||
|
||||
|
||||
public virtual byte[] ToArray() {
|
||||
byte[] outBuffer = new byte[capacity];
|
||||
byte[] outBuffer = new byte[(int)position];
|
||||
|
||||
Buffer.BlockCopyInternal (internalBuffer, 0, outBuffer, 0, capacity);
|
||||
Buffer.BlockCopyInternal (internalBuffer, 0, outBuffer, 0, (int)position);
|
||||
return outBuffer;
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ namespace System.IO {
|
||||
if( position + count > capacity ) {
|
||||
if( expandable ) {
|
||||
// expand the buffer
|
||||
SetLength( position + count );
|
||||
SetLength( (position + count) * 2 );
|
||||
} else {
|
||||
// only write as many bytes as will fit
|
||||
count = (int)((long)capacity - position);
|
||||
@@ -364,7 +364,7 @@ namespace System.IO {
|
||||
// internal buffer may not be allocated all the way up to capacity
|
||||
// count will already be limited to capacity above if non-expandable
|
||||
if( position + count >= internalBuffer.Length )
|
||||
SetLength( position + count );
|
||||
SetLength ((position + count) * 2);
|
||||
|
||||
Buffer.BlockCopyInternal (buffer, offset, internalBuffer, (int)position, count);
|
||||
position += count;
|
||||
@@ -378,7 +378,7 @@ namespace System.IO {
|
||||
throw new NotSupportedException();
|
||||
|
||||
if( position >= internalBuffer.Length )
|
||||
SetLength ( position + 1 );
|
||||
SetLength ((position + 1) * 2);
|
||||
|
||||
internalBuffer[ position++ ] = value;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2003-02-26 Zoltan Varga <[email protected]>
|
||||
|
||||
* TypeBuilder.cs (DefineInitializedData): Removed unnecessary assignments.
|
||||
|
||||
* ModuleBuilder.cs (DefineInitializedData): Do not call
|
||||
TypeBuilder::DefineInitializedData since that would mean defining a
|
||||
nested type of the global type, which is wrong. Instead define a
|
||||
new public type as MS does.
|
||||
|
||||
* ModuleBuilder.cs (DefineUninitializedData): Ditto.
|
||||
|
||||
Thu Feb 13 18:40:52 CET 2003 Paolo Molaro <[email protected]>
|
||||
|
||||
|
||||
@@ -95,6 +95,8 @@ namespace System.Reflection.Emit {
|
||||
global_type_created = global_type.CreateType ();
|
||||
}
|
||||
|
||||
// Same as under MS.NET
|
||||
static int GlobalDataCount = 10000;
|
||||
|
||||
public FieldBuilder DefineInitializedData( string name, byte[] data, FieldAttributes attributes) {
|
||||
if (name == null)
|
||||
@@ -104,7 +106,14 @@ namespace System.Reflection.Emit {
|
||||
if (global_type == null)
|
||||
global_type = new TypeBuilder (this, 0);
|
||||
|
||||
FieldBuilder fb = global_type.DefineInitializedData (name, data, attributes);
|
||||
TypeBuilder datablobtype = DefineType (
|
||||
"$ArrayType$" + GlobalDataCount.ToString(),
|
||||
TypeAttributes.Public|TypeAttributes.ExplicitLayout|TypeAttributes.Sealed,
|
||||
assemblyb.corlib_value_type, null, PackingSize.Size1, data.Length);
|
||||
datablobtype.CreateType ();
|
||||
GlobalDataCount ++;
|
||||
FieldBuilder fb = global_type.DefineField (name, datablobtype, attributes|FieldAttributes.Assembly|FieldAttributes.Static|FieldAttributes.HasFieldRVA);
|
||||
fb.SetRVAData (data);
|
||||
|
||||
if (global_fields != null) {
|
||||
FieldBuilder[] new_fields = new FieldBuilder [global_fields.Length+1];
|
||||
@@ -126,8 +135,16 @@ namespace System.Reflection.Emit {
|
||||
if (global_type == null)
|
||||
global_type = new TypeBuilder (this, 0);
|
||||
|
||||
FieldBuilder fb = global_type.DefineUninitializedData (name, size, attributes);
|
||||
TypeBuilder datablobtype = DefineType (
|
||||
"$ArrayType$" + GlobalDataCount.ToString(),
|
||||
TypeAttributes.Public|TypeAttributes.ExplicitLayout|TypeAttributes.Sealed,
|
||||
assemblyb.corlib_value_type, null, PackingSize.Size1, size);
|
||||
datablobtype.CreateType ();
|
||||
GlobalDataCount ++;
|
||||
|
||||
throw new NotImplementedException ();
|
||||
|
||||
/*
|
||||
if (global_fields != null) {
|
||||
FieldBuilder[] new_fields = new FieldBuilder [global_fields.Length+1];
|
||||
System.Array.Copy (global_fields, new_fields, global_fields.Length);
|
||||
@@ -138,6 +155,7 @@ namespace System.Reflection.Emit {
|
||||
global_fields [0] = fb;
|
||||
}
|
||||
return fb;
|
||||
*/
|
||||
}
|
||||
|
||||
public MethodBuilder DefineGlobalMethod (string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes)
|
||||
|
||||
@@ -816,8 +816,6 @@ namespace System.Reflection.Emit {
|
||||
TypeBuilder datablobtype = DefineNestedType ("$ArrayType$"+InitializedDataCount.ToString(),
|
||||
TypeAttributes.NestedPrivate|TypeAttributes.ExplicitLayout|TypeAttributes.Sealed,
|
||||
pmodule.assemblyb.corlib_value_type, null, PackingSize.Size1, data.Length);
|
||||
datablobtype.packing_size = PackingSize.Size1;
|
||||
datablobtype.class_size = data.Length;
|
||||
datablobtype.CreateType ();
|
||||
FieldBuilder res = DefineField (name, datablobtype, attributes|FieldAttributes.Assembly|FieldAttributes.Static|FieldAttributes.HasFieldRVA);
|
||||
res.SetRVAData (data);
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
AssemblyBuilder.cs
|
||||
AssemblyBuilderAccess.cs
|
||||
ConstructorBuilder.cs
|
||||
EventToken.cs
|
||||
FieldToken.cs
|
||||
FlowControl.cs
|
||||
ILGenerator.cs
|
||||
Label.cs
|
||||
MethodToken.cs
|
||||
ModuleBuilder.cs
|
||||
OpCode.cs
|
||||
OpCodes.cs
|
||||
OpCodeType.cs
|
||||
OperandType.cs
|
||||
PackingSize.cs
|
||||
ParameterToken.cs
|
||||
PEFileKinds.cs
|
||||
PropertyToken.cs
|
||||
SignatureToken.cs
|
||||
StackBehaviour.cs
|
||||
StringToken.cs
|
||||
TypeBuilder.cs
|
||||
TypeToken.cs
|
||||
@@ -0,0 +1,25 @@
|
||||
Assembly.cs
|
||||
AssemblyNameFlags.cs
|
||||
BindingFlags.cs
|
||||
CallingConventions.cs
|
||||
ConstructorInfo.cs
|
||||
DefaultMemberAttribute.cs
|
||||
EventAttributes.cs
|
||||
EventInfo.cs
|
||||
FieldAttributes.cs
|
||||
FieldInfo.cs
|
||||
ICustomAttributeProvider.cs
|
||||
MemberFilter.cs
|
||||
MemberInfo.cs
|
||||
MemberTypes.cs
|
||||
MethodAttributes.cs
|
||||
MethodBase.cs
|
||||
MethodImplAttributes.cs
|
||||
MethodInfo.cs
|
||||
Module.cs
|
||||
ParameterAttributes.cs
|
||||
PropertyAttributes.cs
|
||||
PropertyInfo.cs
|
||||
ResourceAttributes.cs
|
||||
ResourceLocation.cs
|
||||
TypeAttributes.cs
|
||||
@@ -16,11 +16,11 @@ using System.Runtime.Remoting.Messaging;
|
||||
namespace System.Runtime.Serialization.Formatters.Binary {
|
||||
public sealed class BinaryFormatter : IRemotingFormatter, IFormatter
|
||||
{
|
||||
private FormatterAssemblyStyle assembly_format;
|
||||
private FormatterAssemblyStyle assembly_format; // TODO: Do something with this
|
||||
private SerializationBinder binder;
|
||||
private StreamingContext context;
|
||||
private ISurrogateSelector surrogate_selector;
|
||||
private FormatterTypeStyle type_format;
|
||||
private FormatterTypeStyle type_format; // TODO: Do something with this
|
||||
|
||||
public BinaryFormatter()
|
||||
{
|
||||
@@ -112,13 +112,13 @@ namespace System.Runtime.Serialization.Formatters.Binary {
|
||||
BinaryElement elem = (BinaryElement) reader.PeekChar();
|
||||
|
||||
if (elem == BinaryElement.MethodCall) {
|
||||
return MessageFormatter.ReadMethodCall (reader, hasHeader, handler, surrogate_selector, context);
|
||||
return MessageFormatter.ReadMethodCall (reader, hasHeader, handler, surrogate_selector, context, binder);
|
||||
}
|
||||
else if (elem == BinaryElement.MethodResponse) {
|
||||
return MessageFormatter.ReadMethodResponse (reader, hasHeader, handler, null, surrogate_selector, context);
|
||||
return MessageFormatter.ReadMethodResponse (reader, hasHeader, handler, null, surrogate_selector, context, binder);
|
||||
}
|
||||
else {
|
||||
ObjectReader serializer = new ObjectReader (surrogate_selector, context);
|
||||
ObjectReader serializer = new ObjectReader (surrogate_selector, context, binder);
|
||||
return serializer.ReadObjectGraph (reader, hasHeader, handler);
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ namespace System.Runtime.Serialization.Formatters.Binary {
|
||||
|
||||
bool hasHeader;
|
||||
ReadBinaryHeader (reader, out hasHeader);
|
||||
return MessageFormatter.ReadMethodResponse (reader, hasHeader, handler, methodCallmessage, surrogate_selector, context);
|
||||
return MessageFormatter.ReadMethodResponse (reader, hasHeader, handler, methodCallmessage, surrogate_selector, context, binder);
|
||||
}
|
||||
|
||||
public void Serialize(Stream serializationStream, object graph)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2003-02-25 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* BinaryFormatter.cs: Implemented support for binders.
|
||||
* MessageFormatter.cs: Implemented support for binders.
|
||||
* ObjectReader.cs: Implemented support for binders.
|
||||
|
||||
2003-02-04 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* MessageFormatter.cs: Fixed bug in serialization of arguments.
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
writer.Write ((byte) BinaryElement.End);
|
||||
}
|
||||
|
||||
public static object ReadMethodCall (BinaryReader reader, bool hasHeaders, HeaderHandler headerHandler, ISurrogateSelector surrogateSelector, StreamingContext context)
|
||||
public static object ReadMethodCall (BinaryReader reader, bool hasHeaders, HeaderHandler headerHandler, ISurrogateSelector surrogateSelector, StreamingContext context, SerializationBinder binder)
|
||||
{
|
||||
BinaryElement elem = (BinaryElement)reader.ReadByte(); // The element code
|
||||
if (elem != BinaryElement.MethodCall) throw new SerializationException("Invalid format. Expected BinaryElement.MethodCall, found " + elem);
|
||||
@@ -283,7 +283,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
|
||||
if ((flags & MethodFlags.NeedsInfoArrayMask) > 0)
|
||||
{
|
||||
ObjectReader objectReader = new ObjectReader(surrogateSelector, context);
|
||||
ObjectReader objectReader = new ObjectReader(surrogateSelector, context, binder);
|
||||
object[] msgInfo = (object[]) objectReader.ReadObjectGraph (reader, hasHeaders, headerHandler);
|
||||
|
||||
if ((flags & MethodFlags.ArgumentsInSimpleArray) > 0) {
|
||||
@@ -330,7 +330,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
return call;
|
||||
}
|
||||
|
||||
public static object ReadMethodResponse (BinaryReader reader, bool hasHeaders, HeaderHandler headerHandler, IMethodCallMessage methodCallMessage, ISurrogateSelector surrogateSelector, StreamingContext context)
|
||||
public static object ReadMethodResponse (BinaryReader reader, bool hasHeaders, HeaderHandler headerHandler, IMethodCallMessage methodCallMessage, ISurrogateSelector surrogateSelector, StreamingContext context, SerializationBinder binder)
|
||||
{
|
||||
BinaryElement elem = (BinaryElement)reader.ReadByte(); // The element code
|
||||
if (elem != BinaryElement.MethodResponse) throw new SerializationException("Invalid format. Expected BinaryElement.MethodResponse, found " + elem);
|
||||
@@ -372,7 +372,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
{
|
||||
// There objects that need to be deserialized using an ObjectReader
|
||||
|
||||
ObjectReader objectReader = new ObjectReader(surrogateSelector, context);
|
||||
ObjectReader objectReader = new ObjectReader(surrogateSelector, context, binder);
|
||||
object[] msgInfo = (object[]) objectReader.ReadObjectGraph (reader, hasHeaders, headerHandler);
|
||||
|
||||
if ((typeTag & ReturnTypeTag.Exception) > 0) {
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
{
|
||||
ISurrogateSelector _surrogateSelector;
|
||||
StreamingContext _context;
|
||||
SerializationBinder _binder;
|
||||
|
||||
ObjectManager _manager;
|
||||
Hashtable _registeredAssemblies = new Hashtable();
|
||||
@@ -45,11 +46,12 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
public int NullCount;
|
||||
}
|
||||
|
||||
public ObjectReader(ISurrogateSelector surrogateSelector, StreamingContext context)
|
||||
public ObjectReader(ISurrogateSelector surrogateSelector, StreamingContext context, SerializationBinder binder)
|
||||
{
|
||||
_manager = new ObjectManager (surrogateSelector, context);
|
||||
_surrogateSelector = surrogateSelector;
|
||||
_context = context;
|
||||
_binder = binder;
|
||||
}
|
||||
|
||||
public object ReadObjectGraph (BinaryReader reader, bool readHeaders, HeaderHandler headerHandler)
|
||||
@@ -185,8 +187,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
{
|
||||
long id = (long) reader.ReadUInt32 ();
|
||||
string assemblyName = reader.ReadString ();
|
||||
Assembly assembly = Assembly.Load (assemblyName);
|
||||
_registeredAssemblies [id] = assembly;
|
||||
_registeredAssemblies [id] = assemblyName;
|
||||
}
|
||||
|
||||
private void ReadObjectInstance (BinaryReader reader, bool isRuntimeObject, out long objectId, out object value, out SerializationInfo info)
|
||||
@@ -365,8 +366,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
if (!isRuntimeObject)
|
||||
{
|
||||
long assemblyId = (long)reader.ReadUInt32();
|
||||
Assembly asm = (Assembly)_registeredAssemblies[assemblyId];
|
||||
metadata.Type = asm.GetType (className, true);
|
||||
metadata.Type = GetDeserializationType (assemblyId, className);
|
||||
}
|
||||
else
|
||||
metadata.Type = Type.GetType (className, true);
|
||||
@@ -525,6 +525,19 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
return members[0];
|
||||
}
|
||||
|
||||
private Type GetDeserializationType (long assemblyId, string className)
|
||||
{
|
||||
string assemblyName = (string)_registeredAssemblies[assemblyId];
|
||||
|
||||
if (_binder == null)
|
||||
{
|
||||
Assembly assembly = Assembly.Load (assemblyName);
|
||||
return assembly.GetType (className, true);
|
||||
}
|
||||
else
|
||||
return _binder.BindToType (assemblyName, className);
|
||||
}
|
||||
|
||||
public Type ReadType (BinaryReader reader, TypeTag code)
|
||||
{
|
||||
switch (code)
|
||||
@@ -548,8 +561,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
|
||||
{
|
||||
string name = reader.ReadString ();
|
||||
long asmid = (long) reader.ReadUInt32();
|
||||
Assembly asm = (Assembly)_registeredAssemblies[asmid];
|
||||
return asm.GetType (name, true);
|
||||
return GetDeserializationType (asmid, name);
|
||||
}
|
||||
|
||||
case TypeTag.ArrayOfObject:
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace System {
|
||||
CheckParameters (element, attribute_type);
|
||||
|
||||
// Assembly inheritance hierarchies CAN NOT be searched for attributes, so the second
|
||||
// parameter of GetCustomAttributes () is INGNORED.
|
||||
// parameter of GetCustomAttributes () is IGNORED.
|
||||
object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
|
||||
|
||||
return FindAttribute (attributes);
|
||||
@@ -128,10 +128,8 @@ namespace System {
|
||||
CheckParameters (element, attribute_type);
|
||||
|
||||
// MemberInfo inheritance hierarchies can be searched for attributes, so the second
|
||||
// parameter of GetCustomAttributes () is respected.
|
||||
object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
|
||||
|
||||
return FindAttribute (attributes);
|
||||
// parameter of GetCustomAttribute () is respected.
|
||||
return MonoCustomAttrs.GetCustomAttribute (element, attribute_type, inherit);
|
||||
}
|
||||
|
||||
public static Attribute[] GetCustomAttributes (Assembly element)
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
2003-02-28 Elan Feingold <[email protected]>
|
||||
|
||||
* DateTime.cs: FileTime is expressed in Universal time, and as such must
|
||||
be converted before subtracting the magic offset.
|
||||
* DateTime.cs: Strings in the format "2003-02-27T10:05:03-11:00" (note
|
||||
the timezone at the end) *must* be parsed by DateTime.Parse() for
|
||||
compatibility with Microsoft.
|
||||
|
||||
2003-02-24 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Attribute.cs:
|
||||
* MonoCustomAttrs.cs: fix for the regression test failure (see bug
|
||||
#38238).
|
||||
|
||||
* IntPtr.cs: added serialization .ctor
|
||||
|
||||
2003-02-19 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* AppDomain.cs: check for null in Unload and changed method name.
|
||||
|
||||
@@ -486,6 +486,11 @@ namespace System
|
||||
public static DateTime Parse (string s, IFormatProvider fp, DateTimeStyles styles)
|
||||
{
|
||||
string[] formats = {
|
||||
// For compatibility with MS's CLR, this format (which
|
||||
// doesn't have a one-letter equivalent) is parsed
|
||||
// too. It's important because it's used in XML
|
||||
// serialization.
|
||||
"yyyy-MM-ddTHH:mm:sszzz",
|
||||
// Full date and time
|
||||
"F", "G", "r", "s", "u", "U",
|
||||
// Full date and time, but no seconds
|
||||
@@ -987,11 +992,13 @@ namespace System
|
||||
|
||||
public long ToFileTime()
|
||||
{
|
||||
if(ticks.Ticks < w32file_epoch) {
|
||||
DateTime universalTime = ToUniversalTime();
|
||||
|
||||
if (universalTime.Ticks < w32file_epoch) {
|
||||
throw new ArgumentOutOfRangeException("file time is not valid");
|
||||
}
|
||||
|
||||
return(ticks.Ticks - w32file_epoch);
|
||||
return(universalTime.Ticks - w32file_epoch);
|
||||
}
|
||||
|
||||
public string ToLongDateString()
|
||||
|
||||
@@ -63,6 +63,12 @@ namespace System {
|
||||
value = ptr;
|
||||
}
|
||||
|
||||
private IntPtr (SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
long savedValue = info.GetInt64 ("value");
|
||||
value = (void *) savedValue;
|
||||
}
|
||||
|
||||
public static int Size {
|
||||
get {
|
||||
return sizeof (void *);
|
||||
|
||||
@@ -31,6 +31,39 @@ namespace System {
|
||||
return res;
|
||||
}
|
||||
|
||||
internal static Attribute GetCustomAttribute (ICustomAttributeProvider obj,
|
||||
Type attributeType,
|
||||
bool inherit)
|
||||
{
|
||||
if (obj == null)
|
||||
throw new ArgumentNullException ("attribute_type"); // argument name in the caller
|
||||
|
||||
object[] res = from_cache (obj);
|
||||
ICustomAttributeProvider btype = obj;
|
||||
Attribute result = null;
|
||||
|
||||
do {
|
||||
foreach (object attr in res) {
|
||||
if (!attributeType.IsAssignableFrom (attr.GetType ()))
|
||||
continue;
|
||||
|
||||
if (result != null) {
|
||||
string msg = "'{0}' has more than one attribute of type '{1}";
|
||||
msg = String.Format (msg, obj, attributeType);
|
||||
throw new AmbiguousMatchException (msg);
|
||||
}
|
||||
result = (Attribute) attr;
|
||||
}
|
||||
|
||||
if (inherit && (btype = GetBase (btype)) != null)
|
||||
res = from_cache (btype);
|
||||
|
||||
// Stop when encounters the first one for a given provider.
|
||||
} while (inherit && result == null && btype != null);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static object[] GetCustomAttributes (ICustomAttributeProvider obj, Type attributeType, bool inherit)
|
||||
{
|
||||
if (obj == null)
|
||||
|
||||
@@ -110,6 +110,8 @@ namespace MonoTests.System
|
||||
Assertion.Assert("#A07",objRem != null);
|
||||
COMTest remCOMTest = (COMTest) objRem;
|
||||
Assertion.AssertEquals("#A08", 8, remCOMTest.Id);
|
||||
|
||||
ChannelServices.UnregisterChannel(chnServer);
|
||||
// Todo: Implemente the test methods for
|
||||
// all the overriden function using activationAttribute
|
||||
}
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
2003/02/26 Nick Drochak <[email protected]>
|
||||
|
||||
* ActivatorTest.cs: Unregister the channel like it should.
|
||||
* MarshalByRefTest.cs: Take out my hack.
|
||||
Both from Jean-Marc Andr [[email protected]].
|
||||
|
||||
2003-02-25 Nick Drochak <[email protected]>
|
||||
|
||||
* TimeSpanTest.cs: Isolate test for Negate bug. Same as previous
|
||||
'checked' bug in ByteTest?
|
||||
|
||||
2003/02/21 Nick Drochak <[email protected]>
|
||||
|
||||
* EnumTest.cs: Add test for bug 38452 (Parsing numeric enum values).
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace MonoTests.System
|
||||
RemotingServices.SetObjectUriForMarshal(objMarshal, "MarshalByRefObjectTest.objMarshal3");
|
||||
RemotingServices.Marshal(objMarshal);
|
||||
|
||||
TcpChannel chn = new TcpChannel(1235);
|
||||
TcpChannel chn = new TcpChannel(1234);
|
||||
ChannelServices.RegisterChannel(chn);
|
||||
|
||||
object objRem = Activator.GetObject(typeof(MarshalObject), "tcp://localhost:1234/MarshalByRefObjectTest.objMarshal3");
|
||||
@@ -131,7 +131,7 @@ namespace MonoTests.System
|
||||
|
||||
// TODO: When implemented in the mono RemotingServices class
|
||||
//RemotingServices.Disconnect(objMarshal);
|
||||
chn.StopListening(null);
|
||||
// chn.StopListening(null);
|
||||
ChannelServices.UnregisterChannel(chn);
|
||||
|
||||
}
|
||||
|
||||
@@ -115,6 +115,12 @@ public class TimeSpanTest : TestCase
|
||||
AssertEquals ("A16", true, t1 <= t2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (OverflowException))]
|
||||
public void NoNegateMinValue() {
|
||||
TimeSpan t1 = TimeSpan.MinValue.Negate ();
|
||||
}
|
||||
|
||||
public void TestNegateAndDuration ()
|
||||
{
|
||||
TimeSpan t1;
|
||||
@@ -123,17 +129,6 @@ public class TimeSpanTest : TestCase
|
||||
AssertEquals ("A1", "-00:00:00.0012345", new TimeSpan (12345).Negate ().ToString ());
|
||||
AssertEquals ("A2", "00:00:00.0012345", new TimeSpan (-12345).Duration ().ToString ());
|
||||
|
||||
try
|
||||
{
|
||||
t1 = TimeSpan.MinValue.Negate ();
|
||||
exception = false;
|
||||
}
|
||||
catch (OverflowException)
|
||||
{
|
||||
exception = true;
|
||||
}
|
||||
Assert ("A3", exception);
|
||||
|
||||
try
|
||||
{
|
||||
t1 = TimeSpan.MinValue.Duration ();
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// cs0208.cs: Cannot take the address or size of a variable of a managed type ('cs208.Foo')
|
||||
// Line: 19
|
||||
|
||||
namespace cs208
|
||||
{
|
||||
public class Foo
|
||||
{
|
||||
}
|
||||
|
||||
public class Bar
|
||||
{
|
||||
unsafe static void Main ()
|
||||
{
|
||||
Foo f = new Foo ();
|
||||
Foo *s = &f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// cs1502.cs: The method has incorrect arguments, passing out to something expecting ref
|
||||
// Line: 8
|
||||
class X {
|
||||
public void foo (ref int blah) {}
|
||||
|
||||
public void bar (ref int baz)
|
||||
{
|
||||
foo(out baz);
|
||||
}
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
MCS =../mcs/mcs.exe
|
||||
MCS = mcs
|
||||
MCS_FLAGS = /target:exe $(MCS_DEFINES)
|
||||
INSTALL = /usr/bin/install
|
||||
prefix = /usr
|
||||
RUNTIME=mono
|
||||
zRUNTIME=mono
|
||||
|
||||
COMPILER_SOURCES = \
|
||||
AssemblyInfo.cs \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyVersion("0.19.1")]
|
||||
[assembly: AssemblyVersion("0.20.1")]
|
||||
[assembly: AssemblyTitle ("Mono C# Compiler")]
|
||||
[assembly: AssemblyDescription ("Mono C# Compiler")]
|
||||
[assembly: AssemblyCopyright ("2001, 2002 Ximian, Inc.")]
|
||||
|
||||
Executable
+10303
File diff suppressed because it is too large.
Load diff
+4
-4
@@ -468,14 +468,14 @@ namespace Mono.CSharp {
|
||||
|
||||
public override Expression DoResolve (EmitContext ec)
|
||||
{
|
||||
target = target.ResolveLValue (ec, source);
|
||||
if (target == null)
|
||||
return null;
|
||||
|
||||
original_source = original_source.Resolve (ec);
|
||||
if (original_source == null)
|
||||
return null;
|
||||
|
||||
target = target.Resolve (ec);
|
||||
if (target == null)
|
||||
return null;
|
||||
|
||||
//
|
||||
// Only now we can decouple the original source/target
|
||||
// into a tree, to guarantee that we do not have side
|
||||
|
||||
Executable
+4737
File diff suppressed because it is too large.
Load diff
@@ -993,7 +993,12 @@ namespace Mono.CSharp
|
||||
return true;
|
||||
}
|
||||
|
||||
case "/noconfig-":
|
||||
load_default_config = true;
|
||||
return true;
|
||||
|
||||
case "/noconfig":
|
||||
case "/noconfig+":
|
||||
load_default_config = false;
|
||||
return true;
|
||||
|
||||
|
||||
Loaded 100 of 127 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user