Compare commits

...
187 Commits
Author SHA1 Message Date
nobody d32321a6f9 This commit was manufactured by cvs2svn to create tag 'MONO_0_22'.
svn path=/tags/MONO_0_22/mono/; revision=12225
2003-03-05 20:01:31 +00:00
Miguel de Icaza 8ea6302fef Flush
svn path=/trunk/mono/; revision=12224
2003-03-05 20:01:31 +00:00
Alexandre Pigolkine c16696b4ac check in for Dennis Hayes, see ChangeLog
svn path=/trunk/mcs/; revision=12222
2003-03-05 19:18:52 +00:00
Dick Porter e2ec869918 2003-03-05 Dick Porter <[email protected]>
* MemoryStreamTest.cs: Some more tests

svn path=/trunk/mcs/; revision=12219
2003-03-05 15:25:18 +00:00
Dietmar Maurer b89e80ddd2 2003-03-05 Dietmar Maurer <[email protected]>
* monobitset.c (mono_bitset_set_all): impl.

svn path=/trunk/mono/; revision=12218
2003-03-05 14:47:51 +00:00
Martin Baulig 4f16b08e11 2003-03-05 Martin Baulig <[email protected]>
* debug-jit.c, debug-jit.h: New files.  Moved all JIT-specific
	stuff here.

	* debug.c (mono_debug_add_method): Moved to debug-jit.c.
	(mono_debug_handle, mono_debug_initialized): Made them global.
	(replace_suffix): Removed, this isn't used anymore.
	(record_line_number): Moved to debug-jit.c.
	(debug_generate_method_lines): Moved to debug-jit.c
	(generate_line_number): Renamed to
	_mono_debug_generate_line_number() and made it global.
	(debug_update_il_offsets): Moved to debug-jit.c
	(mono_debug_get_image): Renamed to _mono_debug_get_image() and made
	it global.
	(address_from_il_offset): Renamed to
	_mono_debug_address_from_il_offset() and made it global.
	(il_offset_from_position): Moved to debug-jit.c
	(lookup_method): Renamed to _mono_debug_lookup_method() and made
	it global.
	(mono_debug_add_method): Moved to debug-jit.c.
	(mono_debug_create_notification_function): Use two new functions
	mono_debug_codegen_breakpoint() and mono_debug_codegen_ret()
	instead of x86_breakpoint() and x86_ret().

svn path=/trunk/mono/; revision=12217
2003-03-05 13:08:39 +00:00
Gonzalo Paniagua Javier 8428d51a90 2003-03-05 Gonzalo Paniagua Javier <[email protected]>
* MemoryStream.cs: general fixes and reformatted. Passes all tests in
	the new MemoryStreamTest.

svn path=/trunk/mcs/; revision=12213
2003-03-05 11:12:52 +00:00
Gonzalo Paniagua Javier 1d71da917c 2003-03-05 Gonzalo Paniagua Javier <[email protected]>
* MemoryStreamTest.cs: some nunit2 love. Added a bunch of new tests.

svn path=/trunk/mcs/; revision=12212
2003-03-05 11:06:42 +00:00
Paolo Molaro 7b9054aa4f Wed Mar 5 11:35:54 CET 2003 Paolo Molaro <[email protected]>
* monoresgen.cs: patch from Ian MacLean <[email protected]>
	to add the /compile option.

svn path=/trunk/mcs/; revision=12211
2003-03-05 10:40:28 +00:00
Gonzalo Paniagua Javier b89975d19e 2003-03-05 Gonzalo Paniagua Javier <[email protected]>
* MemoryStream.cs: undo my bogus fix in ToArray. Allow GetBuffer and
	ToArray even after closing the stream.

svn path=/trunk/mcs/; revision=12204
2003-03-05 02:24:44 +00:00
Gonzalo Paniagua Javier 0cc2a5b351 2003-03-05 Gonzalo Paniagua Javier <[email protected]>
* Queue.cs: fixed bug #39046.

svn path=/trunk/mcs/; revision=12202
2003-03-05 00:17:19 +00:00
Sebastien Pouliot b837de481d 2003-03-04 Sebastien Pouliot <[email protected]>
* crypto: Updated crypto status and plan

svn path=/trunk/mono/; revision=12201
2003-03-04 23:39:06 +00:00
Sebastien Pouliot cf3674f046 2003-03-04 Sebastien Pouliot <[email protected]>
* System.Security.build: Added a new output System.Security_cmp.dll
	which links with mscorlib. This version is to be used to generate
	the class status web page (required for CorCompare).

svn path=/trunk/mcs/; revision=12200
2003-03-04 23:35:13 +00:00
Sebastien Pouliot bba3d6b99d 2003-03-04 Sebastien Pouliot <[email protected]>
* makefile: System.Security (corlib) class status now compared
	with System.Security_cmp.dll (mscorlib) as required for CorCompare.

svn path=/trunk/mono/; revision=12199
2003-03-04 23:33:56 +00:00
Gonzalo Paniagua Javier c5fad80d07 2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* SqlException.cs: implemented GetObjectData ().

svn path=/trunk/mcs/; revision=12195
2003-03-04 20:47:52 +00:00
Gonzalo Paniagua Javier fd91897a61 2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* Win32Exception.cs: implemented GetObjectData ().

svn path=/trunk/mcs/; revision=12194
2003-03-04 20:44:31 +00:00
Gonzalo Paniagua Javier a05736ef43 2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* list.unix: added RunInstallerAttribute.cs
	* System.ComponentModel/RunInstallerAttribute.cs: New file.

svn path=/trunk/mcs/; revision=12193
2003-03-04 20:27:43 +00:00
Gonzalo Paniagua Javier 44d61c55f9 Added missing file
svn path=/trunk/mcs/; revision=12192
2003-03-04 20:13:17 +00:00
Rafael Teixeira 442bf03103 2003/03/04 Rafael Teixeira <[email protected]>
* mb-parser.jay: added rule for Imports with alias
	* mb-parser.jay: Friend (internal) modifier was missing,
					 Shared modifier was expecting Static token erroneously
					 Modules must accept only a static constructor rule added
					 Constant declaration rule added
	* makefile & makefile.gnu : actually run the compiled program on test target

svn path=/trunk/mcs/; revision=12191
2003-03-04 19:58:58 +00:00
Tim Coleman 193d88d82e 2003-03-04 Tim Coleman <[email protected]>
* System.Data.OracleClient.Oci/OciEnvironmentHandle.cs:
		fix again

svn path=/trunk/mcs/; revision=12188
2003-03-04 19:29:38 +00:00
Tim Coleman ec3b48576b 2003-03-04 Tim Coleman <[email protected]>
* System.Data.OracleClient.Oci/OciDefineHandle.cs :
	* System.Data.OracleClient.Oci/OciEnvironmentHandle.cs :
	* System.Data.OracleClient.Oci/OciLobLocator.cs :
	* System.Data.OracleClient/OracleLob.cs :
		Fix win32 build

svn path=/trunk/mcs/; revision=12187
2003-03-04 19:27:36 +00:00
Atsushi Eno f6a5fc26b6 2003-03-05 Atsushi Enomoto <[email protected]>
* XmlDocumentFragment.cs, XmlElement.cs :
	  modified InnerXml (fragment type from Element to DocumentFragment).

	* XmlElement.cs : fixed WriteTo() ns check.
	* XmlNamespaceManager.cs : MS.NET allows Add() used two or more times.
	* XmlNode.cs : fixed ConstructNamespaceManager().

	* XmlConstructs.cs : added IsSpace, IsName, IsNameStart, IsNCName,
	  IsPubid with an int arg.
	* XmlReader.cs : changed to use XmlChar.cs (its role is as same as
	  XmlConstructs.cs).
	* XmlTextReader.cs :
	  improved error messages with line info.
	  / checking matching start and end tags.
	  / prevents the apperance of multiple root elements. (patch by Erik)
	  fixed and refactored ReadInnerXml() and ReadOuterXml()
	  changed to use XmlChar.cs.

	* XmlTextWriter.cs : changed to put element's xmlns at CloseStartTag ()
	  (It will help c14n implementation.)
	  / blocks multiple attribute output with element node.

svn path=/trunk/mcs/; revision=12186
2003-03-04 18:39:58 +00:00
Paolo Molaro 5b0dbd3c3f Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <[email protected]>
* socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
	(pointed out by Michael Adams).

svn path=/trunk/mono/; revision=12184
2003-03-04 17:08:50 +00:00
Gonzalo Paniagua Javier 307f7f0f90 use the freshly built mcs.exe
svn path=/trunk/mcs/; revision=12181
2003-03-04 15:31:23 +00:00
Tim Coleman 8c246fd3c7 2003-03-04 Tim Coleman <[email protected]>
* System.Data.OracleClient.Oci/IOciDescriptorHandle.cs:
	* System.Data.OracleClient.Oci/IOciHandle.cs:
	* System.Data.OracleClient.Oci/OciDescriptorType.cs:
		Removed. These are no longer used.
	* System.Data.OracleClient.Oci/OciParameterDescriptor.cs:
		Add new class
	* list:
		Add System.Data.OracleClient.Oci/OciParameterDescriptor.cs
		Rem System.Data.OracleClient.Oci/IOciDescriptorHandle.cs
		Rem System.Data.OracleClient.Oci/IOciHandle.cs
		Rem System.Data.OracleClient.Oci/OciDescriptorType.cs
	* System.Data.OracleClient/OciGlue.cs:
		Move the OCIAttrGet* methods into OciHandle
	* System.Data.OracleClient/OracleDataReader.cs:
	* System.Data.OracleClient/OracleParameter.cs:
		Change the way that columns are bound and described
	* System.Data.OracleClient.Oci/OciBindHandle.cs:
	* System.Data.OracleClient.Oci/OciDefineHandle.cs:
	* System.Data.OracleClient.Oci/OciDescriptorHandle.cs:
	* System.Data.OracleClient.Oci/OciEnvironmentHandle.cs:
	* System.Data.OracleClient.Oci/OciErrorHandle.cs:
	* System.Data.OracleClient.Oci/OciHandle.cs:
	* System.Data.OracleClient.Oci/OciLobLocator.cs:
	* System.Data.OracleClient.Oci/OciServerHandle.cs:
	* System.Data.OracleClient.Oci/OciServiceHandle.cs:
	* System.Data.OracleClient.Oci/OciSessionHandle.cs:
	* System.Data.OracleClient.Oci/OciStatementHandle.cs:
	* System.Data.OracleClient.Oci/OciTransactionHandle.cs:
		All handles now derive from OciHandle, and these classes
		have been rewritten as such.  Also attempted to implement
		the Dispose () methods for these classes.
	* System.Data.OracleClient.Oci/OciHandleType.cs:
		Add descriptor types into here because handles and
		descriptors are used in many of the same OCI functions.

svn path=/trunk/mcs/; revision=12176
2003-03-04 13:50:35 +00:00
Dick Porter 7efdf97a06 And the changelog
svn path=/trunk/mcs/; revision=12173
2003-03-04 12:56:00 +00:00
Dick Porter 24bb51445f 2003-03-04 Dick Porter <[email protected]>
* icall.c: Temporarily reverted the Double and Single ToString()
	change, because it broke nunit.

svn path=/trunk/mono/; revision=12172
2003-03-04 12:55:46 +00:00
Dick Porter 0230634cf9 2003-03-04 Dick Porter <[email protected]>
* Single.cs: Temporarily reverted the Double and Single ToString()
	change, because it broke nunit.

svn path=/trunk/mcs/; revision=12171
2003-03-04 12:52:51 +00:00
Paolo Molaro 3f3eaf781b Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <[email protected]>
* object.h, threads.h: make include files compatible with C++
	(patch by Jerome Laban <[email protected]>).

svn path=/trunk/mono/; revision=12168
2003-03-04 11:46:08 +00:00
Gonzalo Paniagua Javier a58d7e54e8 2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* makefile:
	* class/library.build:
	* class/makefile.gnu: added Mono.Posix and System.Management.

svn path=/trunk/mcs/; revision=12167
2003-03-04 01:28:55 +00:00
Gonzalo Paniagua Javier 4db56925dc 2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* HttpSessionState.cs: reworked to use SessionDictionary.
	* SessionDictionary.cs: implemented serialization/deserialization.

svn path=/trunk/mcs/; revision=12166
2003-03-04 01:23:51 +00:00
Tim Coleman a69be26d7d 2003-03-03 Tim Coleman <[email protected]>
* unix.args: Added
                System.Runtime.InteropServices/HandleRef.cs

svn path=/trunk/mcs/; revision=12165
2003-03-03 23:56:18 +00:00
Tim Coleman 78c4ae6e8e 2003-03-03 Tim Coleman <[email protected]>
* HandleRef.cs: Add this struct

svn path=/trunk/mcs/; revision=12164
2003-03-03 23:55:11 +00:00
Miguel de Icaza 77c3b5453b 2003-03-03 Miguel de Icaza <[email protected]>
* NameValueCollection.cs: Uncoment constructor, an old MCS bug
	prevented this from working.  Removed test for nullitude of col,
	as it would have aborted anyways on the dereference in the base
	constructor call.

svn path=/trunk/mcs/; revision=12163
2003-03-03 23:13:02 +00:00
Pedro Martínez Juliá 0e27d1f07a 2003-03-04 Pedro Mart�nez Juli� <[email protected]>
* Double.cs: Changed ToString method. Added NumberFormatInfo support
    with DoubleFormatter class.
    * Single.cs: Changed ToString method. Added NumberFormatInfo support
    with SingleFormatter class.
    * DoubleFormatter.cs: New class with Double formatting functions.
    * SingleFormatter.cs: New class with Single formatting functions.

svn path=/trunk/mono/; revision=12162
2003-03-03 23:02:31 +00:00
Pedro Martínez Juliá a11e947126 2003-03-04 Pedro Mart�nez Juli� <[email protected]>
* Double.cs: Changed ToString method. Added NumberFormatInfo support
    with DoubleFormatter class.
    * Single.cs: Changed ToString method. Added NumberFormatInfo support
    with SingleFormatter class.
    * DoubleFormatter.cs: New class with Double formatting functions.
    * SingleFormatter.cs: New class with Single formatting functions.

svn path=/trunk/mcs/; revision=12162
2003-03-03 23:02:31 +00:00
Sebastien Pouliot 1f51cf036a 2003-03-03 Sebastien Pouliot <[email protected]>
* RSACryptoServiceProvider.cs: Delay keypair generation event when
	keysize is a constructor parameter (major speed improvment when
	importing keys). Removed NotSupportedException when CspParameter is
	used in constructor (required for forthcoming security tools).

svn path=/trunk/mcs/; revision=12161
2003-03-03 22:55:21 +00:00
Sebastien Pouliot 96e4254985 2003-03-03 Sebastien Pouliot <[email protected]>
* XmlDsigBase64TransformTest.cs: Simplified some parts when fixing
	XPath test.

svn path=/trunk/mcs/; revision=12160
2003-03-03 22:46:24 +00:00
Sebastien Pouliot 15e8f4607c 2003-03-03 Sebastien Pouliot <[email protected]>
* System.Security_test.build: Updated build file to stop linking
	with MS assemblies (and like with Mono's corlib instead).

svn path=/trunk/mcs/; revision=12159
2003-03-03 22:44:33 +00:00
Sebastien Pouliot 8aeb1c2772 2003-03-03 Sebastien Pouliot <[email protected]>
* DSAKeyValue.cs: Added patch from Atsushi Eno (to remove string
	XML generation).
	* RSAKeyValue.cs: Added patch from Atsushi Eno (to remove string
	XML generation).
	* XmlDsigBase64Transform.cs: Fixed problem when using XPath.

svn path=/trunk/mcs/; revision=12158
2003-03-03 22:43:28 +00:00
Sebastien Pouliot ef46767f99 2003-03-03 Sebastien Pouliot <[email protected]>
* System.Security.build: Updated build file to stop linking with
	MS assemblies (and like with Mono's corlib instead).

svn path=/trunk/mcs/; revision=12157
2003-03-03 22:42:35 +00:00
Jean-Marc Andre 7f67f25643 2003-03-03 Jean-Marc Andre <[email protected]>
* RemotingServicesTest.cs: New unit test added

svn path=/trunk/mcs/; revision=12156
2003-03-03 21:24:31 +00:00
Miguel de Icaza 89a1c3131a 2003-03-03 Miguel de Icaza <[email protected]>
* interface.cs (Interface.DefineMembers): Avoid defining members
	twice.

svn path=/trunk/mcs/; revision=12152
2003-03-03 19:54:34 +00:00
Paolo Molaro 280ba73ac7 Speeling.
svn path=/trunk/mono/; revision=12151
2003-03-03 19:14:54 +00:00
Gonzalo Paniagua Javier 3a14f3caf3 New assembly and new class.
svn path=/trunk/mcs/; revision=12150
2003-03-03 19:10:00 +00:00
Paolo Molaro 14fdc4cc45 New entry.
svn path=/trunk/mono/; revision=12148
2003-03-03 17:51:20 +00:00
Lluis Sanchez 87e33fb506 Added IContributeDynamicSink.cs, IContributeEnvoySink.cs, IContributeObjectSink.cs
svn path=/trunk/mcs/; revision=12145
2003-03-03 17:16:13 +00:00
Lluis Sanchez 67f0439956 Added ContextAttribute.cs
svn path=/trunk/mcs/; revision=12144
2003-03-03 16:57:58 +00:00
Lluis Sanchez e84f2a9426 Added UrlAttribute.cs
svn path=/trunk/mcs/; revision=12143
2003-03-03 16:54:15 +00:00
Lluis Sanchez 07f0b96bc0 * unix.args: added ConstructionLevelActivator.cs, ContextLevelActivator.cs,
RemoteActivationAttribute.cs

svn path=/trunk/mcs/; revision=12142
2003-03-03 16:45:02 +00:00
Lluis Sanchez 21a8a1c413 * Thread.cs: Changed implementation of CurrentContext, adapted to the changes
in the runtime.

svn path=/trunk/mcs/; revision=12141
2003-03-03 16:44:10 +00:00
Lluis Sanchez 6f0ebcd9a5 * ProxyAttribute.cs: Implemented.
* RealProxy.cs: Added stubs for some missing methods.
	* RemotingProxy.cs: The activation constructor now creates the ConstructionCall
	  message and collects the context properties.
	  Activation of objects now use IActivator instances.

svn path=/trunk/mcs/; revision=12140
2003-03-03 16:42:50 +00:00
Lluis Sanchez ca2024d4b8 * ConstructionCall.cs: Added internal constructor. Added setter for activation attributes.
Some other minor corrections.
	* EnvoyTerminatorSink.cs: Message now redirected to current context's client sink chain.
	* MethodCall.cs: Added method for copying messages.

svn path=/trunk/mcs/; revision=12139
2003-03-03 16:42:17 +00:00
Lluis Sanchez d0ee41d86a * LeaseManager.cs: Added method for removing an object from the lease manager.
* LifetimeServices.cs: Added method for removing an object from the lease manager.

svn path=/trunk/mcs/; revision=12138
2003-03-03 16:41:36 +00:00
Lluis Sanchez ceb4b2a9b2 * Contexts.cs : Management of the default context moved to the runtime.
Implemented creation of the client context, server context, object and envoy sinks.
	  Added method for creating a new context.
	* CrossContextChannel.cs : Removed check for construction messages. Now construction
	  go through the IActivators.

svn path=/trunk/mcs/; revision=12137
2003-03-03 16:41:06 +00:00
Lluis Sanchez ae2aa396a8 * ChannelServices.cs: Minor corrections.
* CrossAppDomainChannel.cs: Context is now restored when exiting the domain.

svn path=/trunk/mcs/; revision=12136
2003-03-03 16:40:35 +00:00
Lluis Sanchez 42a1ccef13 * ActivationServices.cs: Added method for creating a proxy from a list
of activation attributes. This is used by System.Activator.
	  Added method for creating a ConstructionCall from a list of activation attributes.
	  This is used from RemotingProxy.
	* ConstructionLevelActivator.cs: Added. Implements an IActivator that constructs an object.
	* ContextLevelActivator.cs: Added. Implements an IActivator that constructs a context.
	* RemoteActivationAttribute.cs: Added.
	* RemoteActivator.cs: Used RemoteActivationAttribute in the creation of the server object.
	* UrlAttribute.cs: Removed some "throw new NotImplementedException ()".

svn path=/trunk/mcs/; revision=12135
2003-03-03 16:39:42 +00:00
Lluis Sanchez d521b3e35c * Identity.cs: Added property to check if an identity is connected (it is remotely accesible)
* ObjRef.cs: Added internal helper method for getting the server type of an ObjRef.
	* RemotingServices.cs: Implemented Disconnect method. Added support for custom proxy
	  creating using ProxyAttribute. Added support for activation attributes in creation
	  of proxies. Some other minor corrections.
	* ServerIdentity.cs: minor corrections.

svn path=/trunk/mcs/; revision=12134
2003-03-03 16:39:13 +00:00
Rafael Teixeira 5e05883f3a 2003/03/03 Rafael Teixeira <[email protected]>
* mb-tokenizer.cs : new semi-keywords: Compare, Explicit, Strict, On, Off, Binary, Text
	* mb-parser.jay: tokens for above semi-keywords, and rules for option directives
	* driver.cs: integrates command line options with parser flags for option directives
	* makefile & makefile.gnu : added 'verbose' target that uses --verbose switch to compile 
	  the test source and pipes it through 'less', also added a Extended Syntax source

svn path=/trunk/mcs/; revision=12133
2003-03-03 16:39:09 +00:00
Lluis Sanchez 638444081f * Activator.cs: Added support for activation using activation attributes.
* AppDomain.cs: Added internal method to get the default context from the runtime.

svn path=/trunk/mcs/; revision=12132
2003-03-03 16:38:21 +00:00
Lluis Sanchez fdda64a77a * appdomain.c: Added method for initializing the default context of
a domain. Added internal call for getting the default context.
	* appdomain.h: Added context variable in MonoDomain struct.
	* domain.c: mono_domain_set also sets the default context of the domain
	* icall.c: Mapped internal method InternalGetDefaultContext.
	* object.c: mono_object_get_virtual_method returns always a remoting
	wrapper if the object is a transparent proxy.
	mono_runtime_invoke_array: when creating an object by calling the
	constructor, if the created object is a proxy, then the constructor should
	be called using the a remoting wrapper.

svn path=/trunk/mono/; revision=12131
2003-03-03 16:35:22 +00:00
Dick Porter 3420a036b9 2003-03-03 Dick Porter <[email protected]>
* io.c (CreateFile): Try opening directories readonly, so that
	timestamps can be adjusted.  Patch by Elan Feingold
	<[email protected]>.

svn path=/trunk/mono/; revision=12121
2003-03-03 13:23:20 +00:00
Dick Porter 86593032da 2003-03-03 Dick Porter <[email protected]>
* socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
	variable so it compiles on solaris.  Problem spotted by
	Christopher Taylor <[email protected]>

svn path=/trunk/mono/; revision=12120
2003-03-03 13:19:26 +00:00
Gonzalo Paniagua Javier 054a3a3368 2003-02-13 Gonzalo Paniagua Javier <[email protected]>
* data/machine.config: added default sessionState section and handler.

svn path=/trunk/mono/; revision=12119
2003-03-03 12:23:11 +00:00
Gonzalo Paniagua Javier 2342462642 2003-03-03 Gonzalo Paniagua Javier <[email protected]>
* list: added SessionConfig.cs and SessionStateSectionHandler.cs

	* System.Web/HttpHelper.cs: store the values in an ArrayList to get
	them in correct order.

	* System.Web.Configuration/ModuleItem.cs: it's not public.
	* System.Web.Configuration/ModulesConfiguration.cs: it's not public.

	* System.Web.SessionState/SessionConfig.cs:
	* System.Web.SessionState/SessionStateSectionHandler.cs: new files to
	read <sessionState> configuration.

svn path=/trunk/mcs/; revision=12118
2003-03-03 12:21:34 +00:00
Gonzalo Paniagua Javier 1727ec736b 2003-03-03 Gonzalo Paniagua Javier <[email protected]>
* Directory.cs:
	(Move): don't use File.Move.

	* DirectoryInfo.cs: fixed Name property.

	Fixes bug #37755.

svn path=/trunk/mcs/; revision=12116
2003-03-03 10:33:05 +00:00
Nick Drochak 66b156e640 2003-03-03 Nick Drochak <[email protected]>
* StringTest.cs: Catch exception the .NET docs say should not be thrown

svn path=/trunk/mcs/; revision=12115
2003-03-03 09:25:57 +00:00
Jackson Harper f4575fd229 * PEAPI.cs: Add file
* README.txt: Add file

svn path=/trunk/mcs/; revision=12113
2003-03-03 00:29:47 +00:00
Jackson Harper 3eb9288a4c Add PEAPI directory
svn path=/trunk/mcs/; revision=12112
2003-03-03 00:27:40 +00:00
Gonzalo Paniagua Javier c6b2a68290 2003-03-03 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs:
	(SendTo): fix from Jerome Laban <[email protected]>.

svn path=/trunk/mcs/; revision=12111
2003-03-03 00:12:24 +00:00
Miguel de Icaza cc1640ad2a Fix typo
svn path=/trunk/mcs/; revision=12110
2003-03-02 23:00:30 +00:00
Miguel de Icaza c4c409cc20 flush
svn path=/trunk/mono/; revision=12109
2003-03-02 22:54:56 +00:00
Miguel de Icaza c15b0b5e01 Flushety flush
svn path=/trunk/mono/; revision=12108
2003-03-02 22:26:59 +00:00
Miguel de Icaza b459bf6d1e Flush Flush
svn path=/trunk/mono/; revision=12106
2003-03-02 21:15:44 +00:00
Gonzalo Paniagua Javier 875ad2454d 2003-03-02 Gonzalo Paniagua Javier <[email protected]>
* DirectoryInfo.cs: changed ToString to match MS behavior.
	* Path.cs: further fixes to GetDirectoryName to return null in the
	same cases that MS does.

	Fixes bug #38387.

svn path=/trunk/mcs/; revision=12105
2003-03-02 17:18:51 +00:00
Gonzalo Paniagua Javier d4182fdfac 2003-03-02 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: fixed a couple of bugs reported in #35906.

svn path=/trunk/mcs/; revision=12104
2003-03-02 16:42:52 +00:00
Sebastien Pouliot a89d081fef 2003-03-02 Sebastien Pouliot <[email protected]>
* list.unix: Added XmlSignature.cs.

svn path=/trunk/mcs/; revision=12103
2003-03-02 16:13:14 +00:00
Gonzalo Paniagua Javier 01a8a4e3cb 2003-03-02 Gonzalo Paniagua Javier <[email protected]>
* AppSettingsReader.cs: fixed bug #38755.

svn path=/trunk/mcs/; revision=12102
2003-03-02 16:12:55 +00:00
Sebastien Pouliot 18e37330b6 2003-03-02 Sebastien Pouliot <[email protected]>
* KeyInfoNameTest.cs: Better naming.
	* KeyInfoRetrievalMethodTest.cs: Splitted a test.

svn path=/trunk/mcs/; revision=12101
2003-03-02 16:12:33 +00:00
Sebastien Pouliot 2d91f6724f 2003-03-02 Sebastien Pouliot <[email protected]>
* DSAKeyValue.cs: New XML generation is commented. Old string technique
	did a better job to match MS implementation.
	* DataObject.cs: Replaced XML generation from StringBuilder to XmlElement.
	* KeyInfo.cs: Replaced XML generation from StringBuilder to XmlElement.
	* KeyInfoName.cs: Replaced XML generation from StringBuilder to XmlElement.
	* KeyInfoNode.cs: Replaced XML generation from StringBuilder to XmlElement.
	* KeyInfoRetrievalMethod.cs: Replaced XML generation from StringBuilder to XmlElement.
	* KeyInfoX509Data.cs: Replaced XML generation from StringBuilder to XmlElement.
	* RSAKeyValue.cs: New XML generation is commented. Old string technique
	did a better job to match MS implementation.
	* Reference.cs: Replaced XML generation from StringBuilder to XmlElement.
	* Signature.cs: Replaced XML generation from StringBuilder to XmlElement.
	* SignedInfo.cs: Replaced XML generation from StringBuilder to XmlElement.
	* SignedXml.cs: Replaced XML generation from StringBuilder to XmlElement.
	* Transform.cs: Replaced XML generation from StringBuilder to XmlElement.
	* XmlDsigEnvelopedSignatureTransform.cs: Added missing Algorithm URL.
	* XmlDsigXPathTransform.cs: Added missing Algorithm URL.
	* XmlSignature.cs: New. Private contants (construct similar to WSE).

svn path=/trunk/mcs/; revision=12100
2003-03-02 16:09:19 +00:00
Alexandre Pigolkine edde6cf456 checkin for Dennis Hayes, see changeLog for details
svn path=/trunk/mcs/; revision=12099
2003-03-02 09:12:37 +00:00
Sebastien Pouliot a2bdd1500f 2003-03-01 Sebastien Pouliot <[email protected]>
* PKCS1.cs: Fix for some (lame) PKCS1 v1.5 signatures done
	without specifying an OID.

svn path=/trunk/mcs/; revision=12097
2003-03-01 22:29:49 +00:00
Alexandre Pigolkine 9e7d9a15bd see ChangeLog for details
svn path=/trunk/mcs/; revision=12096
2003-03-01 22:24:20 +00:00
Alexandre Pigolkine ba55638ad6 see ChangeLog for details
svn path=/trunk/mcs/; revision=12092
2003-03-01 21:20:31 +00:00
Sebastien Pouliot 4926072584 2003-03-01 Sebastien Pouliot <[email protected]>
* X509CertificateCollection.cs: Fixed bugs in AddRange
	(added the collection not the certificates in the collection).

svn path=/trunk/mcs/; revision=12091
2003-03-01 21:16:05 +00:00
Alexandre Pigolkine 949c372713 added stubs to compile SWF
svn path=/trunk/mcs/; revision=12090
2003-03-01 20:49:10 +00:00
Gonzalo Paniagua Javier 37659d83e3 the cvsroot's been changed to 'mono'
svn path=/trunk/mono/; revision=12089
2003-03-01 19:41:41 +00:00
Miguel de Icaza 980892ae50 Fix from Gonz
svn path=/trunk/mcs/; revision=12088
2003-03-01 19:40:35 +00:00
Jackson Harper 00d6b70cf6 * Image.cs: Write Metadata root
svn path=/trunk/mcs/; revision=12087
2003-03-01 19:27:35 +00:00
Jackson Harper 5ea6e1b9fc * MDStream.cs: Add methods to write metadata streams
svn path=/trunk/mcs/; revision=12086
2003-03-01 19:21:03 +00:00
Gonzalo Paniagua Javier c8ed8a5d53 2003-03-01 Gonzalo Paniagua Javier <[email protected]>
* appdomain.c:
	(get_info_from_assembly_name): don't leak value.

	* icall.c:
	(ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
	result.

svn path=/trunk/mono/; revision=12085
2003-03-01 19:19:58 +00:00
Miguel de Icaza 946769ee24 Patch from Aleksey Ryabchuk <[email protected]>
svn path=/trunk/mcs/; revision=12084
2003-03-01 19:13:08 +00:00
Gonzalo Paniagua Javier 3472c164c3 2003-03-01 Gonzalo Paniagua Javier <[email protected]>
* unix.args: added ModuleResolveEventHandler.cs

	* System.Reflection/Assembly.cs: added missing stuff. Only ModuleResolve
	event is left out to avoid changing MonoReflectionAssembly by now.
	* System.Reflection/ModuleResolveEventHandler.cs: delegate.

svn path=/trunk/mcs/; revision=12083
2003-03-01 18:57:54 +00:00
Jackson Harper d036dd6f19 * MetaDataRoot.cs: Add method to write Metadata
svn path=/trunk/mcs/; revision=12082
2003-03-01 18:54:54 +00:00
Gonzalo Paniagua Javier 9b9cbe14c1 2003-03-01 Gonzalo Paniagua Javier <[email protected]>
* Directory.cs: fixed bugs #38939 and #38940. No need for separate
	unix/windows/unc shares code paths.

svn path=/trunk/mcs/; revision=12081
2003-03-01 17:32:30 +00:00
Gonzalo Paniagua Javier 065279f2be documented MONO_CFG_DIR environment variable
svn path=/trunk/mono/; revision=12080
2003-03-01 16:02:36 +00:00
Paolo Molaro aa392b5f39 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <[email protected]>
* assembly.c: export mono_image_load_references ().
	* class.c: handle function pointers. mono_class_from_name() now
	supports nested type names directly.

svn path=/trunk/mono/; revision=12079
2003-03-01 14:38:59 +00:00
Paolo Molaro 5fc61b3a3b Sat Mar 1 12:36:45 CET 2003 Paolo Molaro <[email protected]>
* jit.c: remove unnecessary assert when inlining.

svn path=/trunk/mono/; revision=12075
2003-03-01 11:40:46 +00:00
Miguel de Icaza fbcf51142f Flush
svn path=/trunk/mono/; revision=12069
2003-02-28 20:08:10 +00:00
Zoltan Varga 53f7fd7b57 2003-02-28 Zoltan Varga <[email protected]>
* ILGenerator.cs (Emit): Add fixup for already created methods and
	fields. Do not add fixup for types since their table index do not
	change any more.

svn path=/trunk/mcs/; revision=12067
2003-02-28 18:41:17 +00:00
Zoltan Varga eb4a498e41 2003-02-28 Zoltan Varga <[email protected]>
* reflection.h reflection.c: Encode already created dynamic methods
	and fields correctly as a DEF instead of a REF.

	* reflection.c: Get rid of the force_ref argument to
	mono_image_typedef_or_ref since it was wrong in the first place.

svn path=/trunk/mono/; revision=12066
2003-02-28 18:36:47 +00:00
Zoltan Varga fd41207b81 2003-02-28 Zoltan Varga <[email protected]>
* StringTest.cs: added String constructor tests.

svn path=/trunk/mcs/; revision=12064
2003-02-28 16:25:03 +00:00
Zoltan Varga 6e9001f1e2 2003-02-28 Zoltan Varga <[email protected]>
* string-icalls.c: add error checking to string constructors according
	to the MSDN docs.

svn path=/trunk/mono/; revision=12063
2003-02-28 16:24:03 +00:00
Zoltan Varga 14f6bf0594 2003-02-28 Zoltan Varga <[email protected]>
* reflection.c: Emit types in the order their TypeBuilders were
	created. Previously, a new table index was assigned to each type before
	the tables were emitted. This was wrong because the signature blob
	might already refer to a type by its original table index.

svn path=/trunk/mono/; revision=12062
2003-02-28 15:24:37 +00:00
Gonzalo Paniagua Javier 3ca2ba376e added 3 missing assemblies for windows install target
svn path=/trunk/mcs/; revision=12061
2003-02-28 14:51:49 +00:00
Per Arneng f4c01192b0 Updated with a change to the parsing code. some servers
send 200-xxxxx instead of 200 xxxxxx. Thnx Elan Feingold

svn path=/trunk/mcs/; revision=12059
2003-02-28 10:55:57 +00:00
Reggie Burnett dd52b9a794 * Added several external functions to Win32funcs.cs
* Added necessary LoadLibrary to RichTextEdit to load common control library

svn path=/trunk/mcs/; revision=12058
2003-02-28 08:43:13 +00:00
Aleksey Demakov 658b2bb4a2 *** empty log message ***
svn path=/trunk/mcs/; revision=12057
2003-02-28 08:39:18 +00:00
Gonzalo Paniagua Javier dcc8dfb3af 2003-02-28 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: patch from Elan Feingold <[email protected]>. Fixes
	NullReferenceException when the callback is null.

svn path=/trunk/mcs/; revision=12056
2003-02-28 08:00:46 +00:00
Christopher Bockner d670275678 Removed the unsafe dependencies from the driver.
svn path=/trunk/mcs/; revision=12049
2003-02-28 03:48:13 +00:00
Miguel de Icaza 0b975bbbb3 update release page
svn path=/trunk/mono/; revision=12048
2003-02-27 23:13:33 +00:00
Miguel de Icaza 8df3cb190c bump
svn path=/trunk/mcs/; revision=12046
2003-02-27 22:22:37 +00:00
Miguel de Icaza f74ec6eee5 Bump
svn path=/trunk/mono/; revision=12044
2003-02-27 22:22:27 +00:00
Zoltan Varga 308a67b9c3 2003-02-27 Zoltan Varga <[email protected]>
* metadata.c (mono_metadata_nesting_typedef): fix bug in previous
	change.

svn path=/trunk/mono/; revision=12042
2003-02-27 20:30:36 +00:00
Ville Palo aacbfb8210 2003-02-28 Ville Palo <[email protected]>
* DataColumnCollectionTest.cs: Added more tests.
	* DataRowCollectionTest.cs: Added more tests.

svn path=/trunk/mcs/; revision=12041
2003-02-27 20:29:14 +00:00
Gonzalo Paniagua Javier 3ec6689a51 oops. Thanks to danmorg for pointing this out.
svn path=/trunk/mono/; revision=12040
2003-02-27 20:21:04 +00:00
Ville Palo bb6ef3268f 2003-02-28 Ville Palo <[email protected]>
* ExpressionElement.cs: More implementation.

svn path=/trunk/mcs/; revision=12039
2003-02-27 20:14:36 +00:00
Alan Tam dc0812150d 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.

svn path=/trunk/mcs/; revision=12038
2003-02-27 20:01:32 +00:00
Miguel de Icaza ad4821f26a 2003-02-27 Miguel de Icaza <[email protected]>
* driver.cs: handle the +/- options for -noconfig

svn path=/trunk/mcs/; revision=12037
2003-02-27 19:48:17 +00:00
Gonzalo Paniagua Javier eaf0aa7fbe 2003-02-27 Gonzalo Paniagua Javier <[email protected]>
* Makefile.am: make assemblies dir have \ instead of / on windows.

svn path=/trunk/mono/; revision=12036
2003-02-27 19:46:51 +00:00
Zoltan Varga 89d747ea99 2003-02-27 Zoltan Varga <[email protected]>
* metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
	iterate over the NESTEDCLASS table using a linear search since the
	table is not guaranteed to be sorted by the secondary key.

	* class.c (mono_class_create_from_typedef): fixed up call to
	mono_metadata_nesting_typedef.

svn path=/trunk/mono/; revision=12035
2003-02-27 19:06:41 +00:00
Miguel de Icaza ca97f02e5c 2003-02-27 Miguel de Icaza <[email protected]>
* statement.cs (Unchecked.Resolve): Also track the state in the Resolve phase.

svn path=/trunk/mcs/; revision=12034
2003-02-27 18:59:06 +00:00
Miguel de Icaza af43004774 Flush
svn path=/trunk/mono/; revision=12033
2003-02-27 17:41:42 +00:00
Alan Tam 6d9d8d4224 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.

svn path=/trunk/mcs/; revision=12032
2003-02-27 17:18:05 +00:00
Alan Tam f8abecbb7f 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

svn path=/trunk/mcs/; revision=12031
2003-02-27 17:11:41 +00:00
Gonzalo Paniagua Javier 3786083fc6 2003-02-27 Gonzalo Paniagua Javier <[email protected]>
* File.cs: fix by Elan Feingold <[email protected]> for
	SetCreationTime, SetLastAccessTime and SetLastWriteTime.

svn path=/trunk/mcs/; revision=12029
2003-02-27 16:20:24 +00:00
Martin Baulig a56a1a0f39 2003-02-27 Martin Baulig <[email protected]>
* ecore.cs (Expression.MemberLookup): Don't create a
	MethodGroupExpr for something which is not a method.  Fixes #38291.

svn path=/trunk/mcs/; revision=12027
2003-02-27 14:21:50 +00:00
Dietmar Maurer 5844cd840c added class init test from zoltan
svn path=/trunk/mono/; revision=12025
2003-02-27 11:56:34 +00:00
Dietmar Maurer 63f894376b new test
svn path=/trunk/mono/; revision=12024
2003-02-27 11:52:55 +00:00
Dietmar Maurer d808f4cd2c 2003-02-27 Dietmar Maurer <[email protected]>
* marshal.c (mono_string_to_byvalstr): clear the memory as
	suggested by Jerome Laban <[email protected]>

svn path=/trunk/mono/; revision=12023
2003-02-27 11:41:40 +00:00
Tim Coleman 47cbf3c66b 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.

svn path=/trunk/mcs/; revision=12021
2003-02-27 05:20:06 +00:00
Gonzalo Paniagua Javier 6ff5c436a3 2003-02-27 Gonzalo Paniagua Javier <[email protected]>
* AuthenticationConfigHandler.cs: 'name' is optional in <forms>.

svn path=/trunk/mcs/; revision=12019
2003-02-27 03:48:36 +00:00
Gonzalo Paniagua Javier 029b4e1fce 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.

svn path=/trunk/mcs/; revision=12018
2003-02-27 02:08:56 +00:00
Gonzalo Paniagua Javier 047c999e9e Reverted last patch. It breaks configuration reading
svn path=/trunk/mcs/; revision=12017
2003-02-27 01:20:59 +00:00
Per Arneng 6c729d5040 Removed an old FIXME
svn path=/trunk/mcs/; revision=12016
2003-02-27 00:32:32 +00:00
Per Arneng c836c2b8e7 added author comment
svn path=/trunk/mcs/; revision=12015
2003-02-26 23:47:19 +00:00
Per Arneng e9adfe4a34 Added the MailEncdoder class to be responsible for base64,UU encoding
The base64 method is now diff tested against uuencode

svn path=/trunk/mcs/; revision=12014
2003-02-26 22:50:45 +00:00
Per Arneng 83591627cb Fixed subject encoding.. does like ms now
svn path=/trunk/mcs/; revision=12006
2003-02-26 19:21:26 +00:00
Atsushi Eno b4d47f5448 2003-02-27 Atsushi Enomoto <[email protected]>
* XmlDocument.cs: modified Load().
	  Uri.Parse might not allow non-uri string.
	* XmlInputStream.cs: patch by Gonzalo (CanSeek).
	  added some constructors for convenience.
	* XmlTextReader.cs: modified some constructors.

svn path=/trunk/mcs/; revision=12005
2003-02-26 19:11:46 +00:00
Dick Porter 7132e98736 2003-02-26 Dick Porter <[email protected]>
* process.c: Cope with padding in .rsrc blocks

svn path=/trunk/mono/; revision=12001
2003-02-26 16:03:29 +00:00
Zoltan Varga 260fcb6b93 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.

svn path=/trunk/mcs/; revision=11999
2003-02-26 14:40:21 +00:00
Dietmar Maurer 191a65c1ec 2003-02-26 Dietmar Maurer <[email protected]>
* metadata.h: reverted the filter_len change, it breaks reflection

svn path=/trunk/mono/; revision=11997
2003-02-26 11:29:53 +00:00
Dietmar Maurer efb4caccc5 2003-02-26 Dietmar Maurer <[email protected]>
* metadata.h: added a new field to store the filter_len

svn path=/trunk/mono/; revision=11996
2003-02-26 10:21:22 +00:00
Nick Drochak 43d6c847f4 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]].

svn path=/trunk/mcs/; revision=11995
2003-02-26 09:37:18 +00:00
Reggie Burnett 31f33f23a3 * Form.Close now actually destroys the Window
* Application now closes when launching form is closed

svn path=/trunk/mcs/; revision=11992
2003-02-26 07:53:25 +00:00
Per Arneng 2dddb5bd02 Added myself :)
svn path=/trunk/mcs/; revision=11991
2003-02-26 06:23:13 +00:00
Per Arneng a771ee1188 Added a FIXME comment on boundaries
svn path=/trunk/mcs/; revision=11990
2003-02-26 06:04:11 +00:00
Per Arneng b2c2697cf8 SmtpServer now defaults to localhost
svn path=/trunk/mcs/; revision=11989
2003-02-26 05:57:18 +00:00
Per Arneng bd922647f4 application/octet-stream for attatchment mimetypes
svn path=/trunk/mcs/; revision=11988
2003-02-26 05:35:44 +00:00
Dave Bettin b80347938e o Modified WebService to house a HttpContext member instead of HttpApplication
svn path=/trunk/mcs/; revision=11987
2003-02-26 04:58:37 +00:00
Per Arneng a3df14a694 Body is now encoded with BodyEncoding.GetBytes
svn path=/trunk/mcs/; revision=11986
2003-02-26 04:58:25 +00:00
Dave Bettin a3fda2d3f8 o Moved tests to nunit2 guidelines
o Added build for linux test(s)

svn path=/trunk/mcs/; revision=11985
2003-02-26 04:51:32 +00:00
Per Arneng 9984280aca Set the Content-Transfet-Encoding based on contents ASCII 7bit other 8bit
svn path=/trunk/mcs/; revision=11984
2003-02-26 04:36:00 +00:00
Miguel de Icaza b7f52847d5 2003-02-25 Miguel de Icaza <[email protected]>
* class.cs (MemberBase.CheckParameters): Also check that the type
	is unmanaged if it is a pointer.

	* expression.cs (SizeOf.Resolve): Add location information.

	* statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
	a managed type is declared.

svn path=/trunk/mcs/; revision=11983
2003-02-26 04:25:47 +00:00
Miguel de Icaza 12f5301d37 Add new test
svn path=/trunk/mcs/; revision=11982
2003-02-26 04:10:34 +00:00
Per Arneng 832b6c0b5e Content-Type:..; charset= is now set to the correct value
svn path=/trunk/mcs/; revision=11981
2003-02-26 04:09:55 +00:00
Gonzalo Paniagua Javier 6d7b6e68dd 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).

svn path=/trunk/mcs/; revision=11979
2003-02-26 03:40:35 +00:00
Miguel de Icaza 99d0fb74a3 Add new error
svn path=/trunk/mcs/; revision=11978
2003-02-26 03:37:58 +00:00
Miguel de Icaza e97d71bc98 2003-02-25 Miguel de Icaza <[email protected]>
* class.cs: Very sad.  Am backing out the speed up changes
	introduced by the ArrayList -> Array in the TypeContainer, as they
	were not actually that much faster, and introduced a bug (no error
	reports on duplicated methods).

svn path=/trunk/mcs/; revision=11977
2003-02-26 03:13:08 +00:00
Miguel de Icaza a74e0bd2c6 Improve test
svn path=/trunk/mcs/; revision=11975
2003-02-26 02:13:30 +00:00
Miguel de Icaza cbe579519f Test the right variable, avoid a crash
svn path=/trunk/mcs/; revision=11974
2003-02-26 02:13:07 +00:00
Miguel de Icaza 2ae1fd351e Another change. Use target.Resolve instead of LValueResolve.
Although we are resolving for LValues, we will let the Assign code
	take care of that (it will be called again from Resolve).  This
	basically allows code like this:

	class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
	class Y { void A (X x) { x [0] += o; }

	The problem was that the indexer was trying to resolve for
	set_Item (idx, object o) and never finding one.  The real set_Item
	was set_Item (idx, X).  By delaying the process we get the right
	semantics.

	Fixes bug: 36505

svn path=/trunk/mcs/; revision=11973
2003-02-26 02:06:46 +00:00
Miguel de Icaza eba56b9643 2003-02-25 Miguel de Icaza <[email protected]>
* assign.cs (CompoundAssign.DoLResolve): Resolve the original
	source first, this will guarantee that we have a valid expression
	before calling in lower levels functions that will require a
	resolved object.  Then use this original_source in the
	target.ResolveLValue instead of the original source that was
	passed to us.

svn path=/trunk/mcs/; revision=11972
2003-02-25 22:46:33 +00:00
Miguel de Icaza 1af72c5084 Add new test
svn path=/trunk/mcs/; revision=11971
2003-02-25 22:45:04 +00:00
Miguel de Icaza 9f7b2c132a Fix
svn path=/trunk/mcs/; revision=11970
2003-02-25 22:29:35 +00:00
Miguel de Icaza 2fbf90ef01 2003-02-25 Miguel de Icaza <[email protected]>
* makefile (all): Make it so that doing `make' will run the
	default tests depending on Windows/Linux.

svn path=/trunk/mcs/; revision=11969
2003-02-25 22:25:38 +00:00
Lluis Sanchez 3accd72948 * BinaryFormatter.cs: Implemented support for binders.
* MessageFormatter.cs: Implemented support for binders.
    * ObjectReader.cs: Implemented support for binders.

svn path=/trunk/mcs/; revision=11968
2003-02-25 20:31:53 +00:00
Miguel de Icaza d783a927f4 update man page
svn path=/trunk/mono/; revision=11967
2003-02-25 17:34:19 +00:00
Dick Porter 7217ade08e 2003-02-25 Dick Porter <[email protected]>
* shared.c (_wapi_shm_attach): Return a failure code on system
	call errors, rather than exiting.

svn path=/trunk/mono/; revision=11966
2003-02-25 17:26:54 +00:00
Miguel de Icaza 2ed502499e Flush
svn path=/trunk/mono/; revision=11965
2003-02-25 17:00:08 +00:00
Alan Tam 8b911be307 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

svn path=/trunk/mcs/; revision=11963
2003-02-25 16:19:29 +00:00
Rafael Teixeira 61b1685675 bits
svn path=/trunk/mcs/; revision=11962
2003-02-25 15:52:06 +00:00
Nick Drochak 2352aa0cf1 2003-02-25 Nick Drochak <[email protected]>
* File.cs (GetCreationTime): Throw proper execption when path is not
	found.

svn path=/trunk/mcs/; revision=11960
2003-02-25 14:40:10 +00:00
Nick Drochak f55ca996ab 2003-02-25 Nick Drochak <[email protected]>
* TimeSpanTest.cs: Isolate test for Negate bug. Same as previous
	'checked' bug in ByteTest?

svn path=/trunk/mcs/; revision=11956
2003-02-25 14:02:33 +00:00
Paolo Molaro 2c5bcddb86 Tue Feb 25 11:55:35 CET 2003 Paolo Molaro <[email protected]>
* MemoryStream.cs: make it behave sanely when the stream is
	incrementally expanded.

svn path=/trunk/mcs/; revision=11953
2003-02-25 11:00:02 +00:00
Paolo Molaro f80ac8be85 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <[email protected]>
* reflection.c: handle custom attributes for types and members
	created with Reflection.Emit (bug#38422).

svn path=/trunk/mono/; revision=11947
2003-02-25 10:00:58 +00:00
Alan Tam db03364a32 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.

svn path=/trunk/mcs/; revision=11945
2003-02-25 08:48:29 +00:00
Alan Tam 5f12cfc8d7 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.

svn path=/trunk/mcs/; revision=11943
2003-02-25 07:25:05 +00:00
Miguel de Icaza 07feaea8d0 Add
svn path=/trunk/mono/; revision=11939
2003-02-24 22:13:22 +00:00
Gonzalo Paniagua Javier 6ca7b36d86 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

svn path=/trunk/mcs/; revision=11937
2003-02-24 21:38:45 +00:00
Alan Tam d4a29fe97a 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.

svn path=/trunk/mcs/; revision=11930
2003-02-24 17:47:28 +00:00
Gonzalo Paniagua Javier bf9ad10d34 2003-02-24 Gonzalo Paniagua Javier <[email protected]>
* OracleMonthSpan.cs: fixed compilation.

svn path=/trunk/mcs/; revision=11929
2003-02-24 16:51:17 +00:00
Peter Williams f4ad42ac18 2003-02-23 Peter Williams <[email protected]>
* makefile.gnu (all): Take two.

svn path=/trunk/mcs/; revision=11915
2003-02-24 04:38:04 +00:00
Miguel de Icaza 67ff9f4b28 Patches from Daniel Campos
svn path=/trunk/mcs/; revision=11914
2003-02-24 03:39:13 +00:00
Miguel de Icaza e11a99439c too late
svn path=/trunk/mcs/; revision=11912
2003-02-24 01:07:26 +00:00
Miguel de Icaza e6522fa2d6 Add NEWS file
svn path=/trunk/mono/; revision=11911
2003-02-24 01:07:08 +00:00
Miguel de Icaza 5694aa2301 Update update
svn path=/trunk/mono/; revision=11910
2003-02-24 01:06:27 +00:00
387 changed files with 22602 additions and 7293 deletions

No files matched your search

+4
View File
@@ -1,3 +1,7 @@
2003-02-13 Gonzalo Paniagua Javier <[email protected]>
* data/machine.config: added default sessionState section and handler.
2003-02-17 Daniel Morgan <[email protected]>
* doc/provider-factory: add new web page
+341
View File
@@ -1,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
View File
@@ -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
View File
@@ -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
#
+3
View File
@@ -19,6 +19,8 @@
type="System.Web.Configuration.AuthorizationConfigHandler, System.Web" />
<section name="globalization"
type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web" />
<section name="sessionState"
type="System.Web.SessionState.SessionStateSectionHandler, System.Web" />
</sectionGroup>
</configSections>
<system.web>
@@ -49,6 +51,7 @@
culture="en-US"
uiculture="en-US" />
-->
<sessionState mode="InProc" />
</system.web>
<appSettings>
+69 -45
View File
@@ -27,14 +27,14 @@
* RNGCryptoServiceProvider is currently only working on Linux.
The current implementation reside in Mono's runtime and use
the <code>/dev/[u]random</code> device (which do not exists
under Windows). A Windows alternative is in the work (see
Mono.Security.Win32 assembly section).
under Windows). A Windows specific alternative is available
using the Mono.Security.Win32 assembly.
* Keypair persistance for RSA and DSA. This persistance must
somehow be linked with X509 certificate stores (in planning).
* <code>PasswordDeriveBytes.CryptDeriveKey</code> is included
in the BCL to provide compatibility with existing Windows
in MS BCL to provide compatibility with existing Windows
applications. The main problem is that the key derivation
algorithm can be different for every CSP (Crypto Service
Provider). However for compatibility we should provide an
@@ -54,6 +54,9 @@
classes named <code>*CryptoServiceProvider</code>, with the
exception of <code>RNGCryptoServiceProvider</code> (which
resides in the runtime).
* Look at assembly Mono.Security.Win32 if you require more
compatiblity with the Microsoft implementation (like accessing
a particuliar keypair container in a CSP).
</ul>
@@ -62,17 +65,17 @@
**** Status
<ul>
* X.509 certificates are parsed using 100% managed code
(using an internal ASN.1 class).
(using the Mono.Security.ASN1 class).
* Software Publisher Certificates (SPC) used by Authenticode
(tm) to sign assemblies are supported (extraction from PE
files) but <b>not</b> validated.
* Tests are generated from a set of existing certificates
* Unit tests are generated from a set of existing certificates
(about a dozen) each having different properties. Another
set of certificates (more than 300) are used for a more
complete test (but isn't part of the test suite for size
and time consideration).
complete test (but isn't part of the standard test suite for
size and time consideration).
</ul>
**** TODO
@@ -89,18 +92,20 @@
**** Notes
<ul>
* <b>There's no validation of the certificates</b> done in this
class (this isn't a restriction of Mono!). This means that
certificate signatures and validity dates are <b>never</b>
checked (except when used for Authenticode, i.e.
* Except for their structure <b>there are no validation of the
certificates</b> done by this class (this is by design and
isn't a restriction of Mono!). This means that certificate
signatures and validity dates are <b>never</b> checked
(except when used for Authenticode, i.e.
<code>CreateFromSignedFile</code>).
* The newer X509Certificate class included in Microsoft's Web
Service Enhancement (WSE) is a little better (as it includes
CryptoAPI's validation) when <code>IsCurrent</code> is called.
See assembly <b>Microsoft.Web.Services</b> for more details.
* Microsoft implementation of <code>X509Certificate</code> is
done by using CryptoAPI (unmanaged). From the exceptions
done by using CryptoAPI (unmanaged code). From the exceptions
thrown Authenticode(tm) support is done via COM.
</ul>
@@ -115,13 +120,10 @@
**** Status
<ul>
* All classes are present but some (Transforms) are only
* All classes are present but some (most Transforms) are only
stubbed.
* Most classes have their unit tests.
* This assembly is present in CVS but only available when
building using NAnt (i.e. makefile are missing).
</ul>
**** TODO
@@ -132,8 +134,30 @@
signing (not because the transforms works). In the short
term <code>libxml2</code> could be used to provide C14N, but
in the long term a fully managed class would be much better.
</ul>
* Makefile for building under non-Windows operating systems.
<hr>
** Assembly: Mono.Security
This assembly provides the missing pieces to .NET security. On Windows
CryptoAPI is often used to provide much needed functionalities (like
some cryptographic algorithms, code signing, X.509 certificates).
*** Namespace: Mono.Security
*** Namespace: Mono.Security.Authenticode
*** Namespace: Mono.Security.Cryptography
*** Namespace: Mono.Security.X509
*** Namespace: Mono.Security.X509.Extensions
**** Status
<ul>
* Work has been under way for quite some time - and should
start hitting CVS soon.
* A big part of this assembly is also included inside Mono's
corlib. The class are duplicated in this assembly so the
functionalities can be used with a dependency on Mono's
corlib (which depends on Mono's runtime).
</ul>
<hr>
@@ -152,7 +176,9 @@
**** Status
<ul>
* A RNGCryptoServiceProvider built on top of CryptoAPI.
* A RNGCryptoServiceProvider built on top of CryptoAPI. This
allows Windows users to get around the limitation of the
runtime RNG (which requires <code>/dev/[u]random/</code>).
* Wrapper classes for unmanaged versions of hash algorithms:
MD2, MD4, MD5 and SHA1 are supported. <b>note</b>: some
@@ -179,30 +205,34 @@
Development Kit (WSDK) in it's beta days, is an add-on the .NET
framework that implements WS-Security (and other WS-* specifications).
It also includes improved support for XML Signature (replacing and/or
extending <code>System.Security.Cryptography.Xml</code>) and X509
certificates.
extending <code>System.Security.Cryptography.Xml</code>) and X.509
certificates classes.
Note: WSE is distributed as an add-on because the WS-Security
specification isn't yet completed by
<a href="http://www.oasis-open.org/committees/wss/">OASIS</a>.
Note: WSE is distributed as an add-on because some specifications,
like WS-Security, aren't yet completed by
<a href="http://www.oasis-open.org/committees/wss/">OASIS</a> or
other committees.
<b>There are some licensing issues to consider before stating to
<b>[*] There are some licensing issues to consider before stating to
implement WS-Security. All contributors must sign an agreement with
Microsoft before commiting anything related to WS-Security into CVS.
</b>
*** Namespace: Microsoft.Web.Services.Security
*** Namespace: Microsoft.Web.Services.Timestamp
**** Status
<ul>
* Nothing (yet) commited in CVS.
* Nothing (yet) commited in CVS <b>[*]</b>.
</ul>
*** Namespace: Microsoft.Web.Services.Security.X509
**** Status
<ul>
* Nothing (yet) commited in CVS.
* Nothing (yet) commited in CVS. However the classes in this
namespace are outside WS-Security scope. So development
could be done without signing any agreements.
</ul>
**** TODO
@@ -213,21 +243,7 @@
</ul>
<hr>
** Other stuff
There are other, not so visible, uses of cryptography both inside and
outside the class library - such as:
<ul>
* SSL/TLS for secure communication (investigation under way).
* Assembly signing (and verification) using StrongNames.
* Assembly signing (and verification) using Authenticode(tm).
</ul>
*** Tools
** Tools
There are many tools in the .NET framework that indirectly interacts
with some cryptographic classes. Mono will eventually need these tools.
@@ -267,6 +283,14 @@
Note that many of the tools requires the class library and/or the
runtime to be ready for them.
<hr>
** Other stuff
<ul>
* SSL/TLS for secure communication (a prototype is under way).
</ul>
<hr>
** How to Help
@@ -274,9 +298,9 @@
Add missing unit tests to classes or methods.
Write some documentation on the cryptographic classes for MonkeyGuide
(as I'm not a good writer, at least in English, but you must be a good
reader if you got to this part).
Write some documentation on the cryptographic classes for the
<a href="http://go-mono.com/tutorial/html/en/index.html">Mono
Handbook</a> as I'm not a good writer (at least in English).
Optimization can also be done on algorithms as crypto is never fast
enough. Just be sure to test every optimization (using the unit test)
@@ -287,4 +311,4 @@
informations about the status of the cryptographic classes.
<hr>
Last reviewed: February 5, 2003 (post mono 0.19)
Last reviewed: March 4, 2003 (post mono 0.21)
+147 -33
View File
@@ -17,9 +17,9 @@
<tbody>
<tr bgcolor="#DDDDDD">
<td>
<b>Release 0.19</b><br>
<a href="archive/mono-0.19">Release notes</a><br>
Jan 20th, 2003
<b>Release 0.21</b><br>
<a href="archive/mono-0.21">Release notes</a><br>
Jan 21th, 2003
</td>
<td>
<table cellspacing="1" cellpadding="3">
@@ -29,11 +29,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.21.tar.gz">Mono Class Libraries and C# Compiler.</a>
<li><a href="archive/mono-0.21.tar.gz">Mono Runtime</a>
<li><a href="archive/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/mono-debugger-0.2.0.tar.gz">Mono Debugger 0.2.0</a> <b><font color="#dd0000">New!</font></b>
<li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
</ul>
</td>
</tr>
@@ -45,7 +44,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.21-1.src.rpm">mono-0.21-1.src.rpm</a>
</ul>
</td>
</tr>
@@ -58,8 +57,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.21-1.i386.rpm">mono-0.21-1.i386.rpm</a>
<li><a href="archive/redhat-73-i386/mono-devel-0.21-1.i386.rpm">mono-devel-0.21-1.i386.rpm</a>
</ul>
</td>
<td bgcolor="#999999">
@@ -67,8 +66,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.21-1.i386.rpm">mono-0.21-1.i386.rpm</a>
<li><a href="archive/redhat-72-i386/mono-devel-0.21-1.i386.rpm">mono-devel-0.21-1.i386.rpm</a>
</ul>
</td>
</tr>
@@ -78,8 +77,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.21-1.i386.rpm">mono-0.21-1.i386.rpm</a>
<li><a href="archive/redhat-71-i386/mono-devel-0.21-1.i386.rpm">mono-devel-0.21-1.i386.rpm</a>
</ul>
</td>
<td bgcolor="#999999">
@@ -87,8 +86,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.21-1.i586.rpm">mono-0.21-1.i586.rpm</a>
<li><a href="archive/mandrake-82-i386/mono-devel-0.21-1.i586.rpm">mono-devel-0.21-1.i586.rpm</a>
</ul>
</td>
</tr>
@@ -98,34 +97,27 @@
<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.21-1.i386.rpm">mono-0.21-1.i386.rpm</a>
<li><a href="archive/suse-80-i386/mono-devel-0.21-1.i386.rpm">mono-devel-0.21-1.i386.rpm</a>
</ul>
</td>
<td bgcolor="#999999">
<b>Red Hat 8.0/x86</b>
<ul>
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/mono-0.19-1.i386.rpm">mono-0.19-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/mono-devel-0.19-1.i386.rpm">mono-devel-0.19-1.i386.rpm</a>
</ul>
</td>
</tr>
<tr>
<td bgcolor="#999999">
<!-- <b>Windows Setup Wizard (NT/2000/XP)</b>␍ -->
<!-- <ul>␍ -->
<!-- <li><a href="archive/mono-0.19-stable.exe">Mono-Setup</a>␍ -->
<!-- </ul>␍ -->
<!-- </td>␍ -->
<td bgcolor="#999999">
<b>Debian packages</b>
<ul>
<li><a href="http://www.atoker.com/mono/">Alp's web site</a>
</ul>
</td>
</tr>
<tr>
<td bgcolor="#999999">
<b>Windows Setup Wizard (NT/2000/XP)</b>
<ul>
<li><a href="archive/mono-0.21-win32-1.exe">Mono-Setup</a>
</ul>
</td>
</tr>
</table>
</td>
</tr>
@@ -149,6 +141,128 @@
We provide binaries for older releases until we have packages for the new release.
<table>
<tbody>
<tr bgcolor="#DDDDDD">
<td>
<b>Release 0.20</b><br>
<a href="archive/mono-0.20">Release notes</a><br>
Jan 20th, 2003
</td>
<td>
<table cellspacing="1" cellpadding="3">
<tr bgcolor="#BBBBBB">
<td>
<b>Source Code</b>
</td>
<td>
<ul>
<li><a href="archive/mcs-0.20.tar.gz">Mono Class Libraries and C# Compiler.</a>
<li><a href="archive/mono-0.20.tar.gz">Mono Runtime</a>
<li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
<li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
</ul>
</td>
</tr>
<tr bgcolor="#BBBBBB">
<td>
<b>Source RPMs</b><br>
(No RPMS for XSP).
</td>
<td>
<ul>
<li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
<li><a href="archive/mono-0.20-1.src.rpm">mono-0.20-1.src.rpm</a>
</ul>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td bgcolor="#999999">
<b>Red Hat 8.0/x86</b>
<ul>
<li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/mono-0.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
<li><a href="archive/redhat-80-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-1.i386.rpm</a>
</ul>
</td>
<td bgcolor="#999999">
<b>Debian packages</b>
<ul>
<li><a href="http://www.atoker.com/mono/">Alp's web site</a>
</ul>
</td>
</tr>
<tr>
<td bgcolor="#999999">
<b>Windows Setup Wizard (NT/2000/XP)</b>
<ul>
<li><a href="archive/mono-0.20-stable-win32-2.exe">Mono-Setup</a>
</ul>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<tr bgcolor="#CCCCC">
<td>
<b>Regression Tests</b><br>
</td>
<td>
You can get binaries for the Mono Regression Test
Suite <a href="archive/mono-tests.tar.gz">here</a>
</td>
</tr>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr bgcolor="#DDDDDD">
<td>
<b>Release 0.19</b><br>
<a href="archive/mono-0.19">Release notes</a><br>
Jan 20th, 2003
</td>
<td>
<table cellspacing="1" cellpadding="3">
<tr bgcolor="#BBBBBB">
<td>
<b>Source Code</b>
</td>
<td>
<ul>
<li><a href="archive/mcs-0.19.tar.gz">Mono Class Libraries and C# Compiler.</a>
<li><a href="archive/mono-0.19.tar.gz">Mono Runtime</a>
</ul>
</td>
</tr>
<tr bgcolor="#BBBBBB">
<td>
<b>Source RPMs</b><br>
(No RPMS for XSP).
</td>
<td>
<ul>
<li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
<li><a href="archive/mono-0.19-1.src.rpm">mono-0.19-1.src.rpm</a>
</ul>
</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr bgcolor="#DDDDDD">
+29 -11
View File
@@ -721,26 +721,44 @@ A: Replace the __stdcall attribute with the STDCALL macro, and include this
<a name="asp">
** Mono and ASP.NET
Q: Is Mono supporting ASP.NET?
Q: Does Mono support ASP.NET?
A: Yes. The development of the support for ASP.NET comes in various stages,
here is what Gonzalo has been working on: 1. The Parser. 2. Getting the
parser to generate output compatible with ASP.NET. 3. Running the sample
output with the real Microsoft runtime but using our generated page. 4.
Running the sample with our classes with the .NET runtime. 5. Running
our sample code with our classes with our runtime. This is the process
we are following. Currently Gonzalo has reached point 5.
A: Yes.
Mono supports ASP.NET, we have shown an unmodified IBuySpy
installation running on Mono as well as various other programs. You can
try it yourself downloading the XSP server.
Q: Do I need install cygwin to work on ASP.NET in mono or Linux is enough since
it is self host right now.
A: Linux is enough.
Q: How can I run ASP.NET-based applications with Mono?
A: You need the Mono runtime and a hosting web server. Currently we distribute a
small web server called `xsp' which is used to debug applications, or you can choose
to use Daniel's Apache 2 module.
Q: Any plan to make ASP.NET in mono works with Apache in Linux?.
A: Yes, we have plans to do so, but we need to wait for Patrik's patches to
HttpRuntime. Once that is there, writing a mod_mono should be trivial
(look at mono/samples/embed for a sample embedded application).
A: Daniel has authored an Apache2 Module for Mono that hosts the ASP.NET runtime
and is available here: <a
href="http://apacheworld.org/modmono/">http://apacheworld.org/modmono/</a>
Q: Will you support Apache 1?
A: Modules developed for Apache 2 are not compatible with Apache 1.3
Daniel plans to support Apache 1.3 in the future but the current focus is on
Apache 2, because of the better support for threading and Windows.
Q: Can I run Apache 1 and Apache 2 on the same machine?
You can always keep a copy of Apache 2 running in paralell with your Apache
1.3 (either different port or using a reverse proxy).
You can also bind the two servers to different IP addresses on the
same physical machine.
<a name="ado">
** Mono and ADO.NET
+8
View File
@@ -13,6 +13,14 @@ Some of them may start contributing because they want a mention in the
* Mono Hackers
** Zoltan Varga
Zoltan has contributed significantly to Mono, with bug reports and bug
fixes as well as pushing the envelope of the things that can be done in
and with the mono runtime: the gcc-based ngen compiler, code coverage
and more recently his work with Reflection.Emit that got mono to the
point of running the IKVM Java virtual machine.
** Sergey Chaban
Sergey has been a long time contributor to the project, from the early
+54 -8
View File
@@ -102,16 +102,62 @@
</tr>
</table>
<b>Upcoming presentations</b>
@item Mar 3rd, 2003: The Mono Hackers Hall Of Fame welcomes Zoltan Varga
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.
The <a href="hackers.html">Mono Hackers Hall Of Fame</a>
continues to show our appreciation to the excellent
contributors that make <b>mono::</b> a successful free
software project.
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>
Zoltan has contributed significantly to Mono, with bug reports and bug
fixes as well as pushing the envelope of the things that can be done in
and with the mono runtime: the gcc-based ngen compiler, code coverage
and more recently his work with Reflection.Emit that got mono to the
point of running the <a href="http://www.ikvm.net">IKVM</a> Java virtual
machine.
@item Mar 2nd, 2003: New Mono mailing list.
A new mailing list for <a
href="http://lists.ximian.com/mailman/listinfo/mono-devel-list">Mono
Development</a> has been created.
@item Feb 27th, 2003: Mono 0.21 released
Mono 0.21 has been released. This is only a bug fix release.
The <a href="archive/mono-0.21">release notes</a> are available.
@item Feb 25th, 2003: Mono 0.20 for Windows released; New Apache module released.
Packages of Mono for Windows have been <a
href="archive/mono-0.20-stable-win32-2.exe">released</a>.
Thanks to Daniel, Johannes and Paolo for setting this up.
Daniel has released a new version of his Mono Apache module that
handles ASP.NET. The code is available at <a
href="http://apacheworld.org/modmono/">here</a>
Nick has posted an update on the progress on our <a
href="http://lists.ximian.com/archives/public/mono-list/2003-February/012467.html">regression
tests</a>. We are looking for more tests, and more volunteers to write them.
Also, remember to contribute to the Gtk# documentation effort,
momentum is picking up! See the entry for Feb 18th for more details.
@item Feb, 23rd, 2003: Mono 0.20 released; Gtk# 0.8 released.
Mono 0.20 has been released. Check out the <a
href="archive/mono-0.20">release notes</a> for an overview of
the changes. You can get it <a href="download.html">here</a>.
There are no major features in this release, mostly bug fixes
and performance improvements.
Gtk# 0.8 has been <a
href="http://lists.ximian.com/archives/public/gtk-sharp-list/2003-February/001114.html">released</a>
<b>Important</b>: The contributed binaries for Windows
binaries of Mono 0.20 contain a virus. Please read <a
href="virus.html">this</a> if you installed the binary.
@item Feb 18th, 2003: Volunteers to document Gtk#
+52 -6
View File
@@ -6,7 +6,16 @@
There are a number of mailing lists for Mono in English:
<table>
<table border=1>
<tr>
<td>
<b><a
href="http://lists.ximian.com/mailman/listinfo/mono-announce-list">mono-announce-list</a></b>
</td>
<td>
Announcements of Mono developments.
</td>
</tr>
<tr>
<td>
<b><a
@@ -19,11 +28,39 @@
<tr>
<td>
<b><a
href="http://lists.ximian.com/mailman/listinfo/mono-announce-list">mono-announce-list</a></b>
href="http://lists.ximian.com/mailman/listinfo/mono-devel-list">mono-devel-list</a></b>
</td>
<td>
A mailing list specifically dedicated to discussions
about developing Mono and programming *with* Mono.
Programmers that work on Mono are _strongly_ encouraged
to join this list. Third-party programmers interested
in running or compiling their managed applications with
Mono or that are interested in using mono-specific
technologies should join the list as well.
<p>
Examples of on-topic arguments are:
<ul>
<li>proposals and patches for new features for the mono runtime and programs
<li>discussions about bugs in the mono runtime and programs
<li>discussions about future directions
<li>embedding API, scripting language bridges
<li>mono/mcs build issues
<li>programming with mono-specific assemblies
<li>discussions about third-party compilers that target and/or use directly the CLR
<li>discussions about getting a managed application run with mono
</ul>
<p>Topics that are better discussed on other mailing lists:
<ul>
<li> general C# questions (use the specific lists at develop.com)
<li> issues that are already covered by a more specific mono
mailing list (like System.Windows.Forms or Gtk#)
<li> success reports about new apps running on mono, including
runtime/buildtime support for new programming languages (use
mono-list to reach a wider audience)
</ul>
</td>
<td>
Announcements of Mono developments.
</td>
</tr>
<tr>
<td>
@@ -40,7 +77,7 @@
href="http://lists.ximian.com/mailman/listinfo/mono-patches">mono-patches</a></b>
</td>
<td>
Track the CVS activity of Mono on this mailing list (patches are sent to recipients).
Track the CVS activity of Mono on this mailing list (patches are sent to recipients). <p>
You can get <a href="http://www.go-mono.com/snapshots">daily snapshots</a> as well.
</td>
</tr>
@@ -80,6 +117,15 @@
Used to discuss the Windows.Forms implementatation for Mono using Wine.
</td>
</tr>
<tr>
<td>
<b><a
href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">gtk-sharp-list</a></b>
</td>
<td>
Used to discuss the Gtk bindings for Mono (<a href="http://gtk-sharp.sf.net">Gtk#</a>).
</td>
</tr>
</table>
Other mailing lists of interest:
+2 -2
View File
@@ -190,8 +190,8 @@
dbcmd.CommandText = sql;
IDataReader reader = dbcmd.ExecuteReader();
while(reader.Read()) {
string FirstName = reader["firstname"];
string LastName = reader["lastname"];
string FirstName = (string) reader["firstname"];
string LastName = (string) reader["lastname"];
Console.WriteLine("Name: " +
FirstName + " " + LastName);
}
-246
View File
@@ -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
+1 -1
View File
@@ -212,7 +212,7 @@ function clickHandler (evt)
if (evt.ctrlKey)
{
var strRoot = 'http://cvs.hispalinux.es/cgi-bin/cvsweb/mcs/class/';
var strExtra = '?cvsroot=Mono';
var strExtra = '?cvsroot=mono';
if (strAssembly)
{
+4 -1
View File
@@ -1,4 +1,5 @@
CSCRIPT = $(SYSTEMROOT)/system32/cscript.exe
ROOT=C:/WINNT
CSCRIPT = $(ROOT)/system32/cscript.exe
CSC=csc
CORCOMPARE=../../../mcs/tools/corcompare
@@ -148,6 +149,8 @@ src/%.xml: ../../../mcs/class/lib/%.dll $(CORCOMPARE)/CorCompare.exe
src/corlib.xml: ../../../mcs/class/lib/corlib_cmp.dll $(CORCOMPARE)/CorCompare.exe
$(CORCOMPARE)/CorCompare.exe -f corlib -ms mscorlib -x $@ $<
src/System.Security.xml: ../../../mcs/class/lib/System.Security_cmp.dll $(CORCOMPARE)/CorCompare.exe
$(CORCOMPARE)/CorCompare.exe -f System.Security -ms System.Security -x $@ $<
../class-status: ../class-status.in
cp -f $< $@
+9
View File
@@ -136,6 +136,15 @@ Provides a search path to mono and mint where to look for library files.
Directories are separated by the platform path separator (colons on unix). Example:
.B /home/username/lib:/usr/local/mono/lib
.PP
.TP
.I "MONO_DISABLE_SHM"
If this variable is set, it disables the Windows I/O Emulation layer,
and handles (files, events, mutexes, pipes) will not be shared across
processes. This option is only available on Unix.
.TP
.I "MONO_CFG_DIR"
If set, this variable overrides the default system configuration directory
($PREFIX/etc). It's used to locate machine.config file.
.SH FILES
On Unix assemblies are loaded from the installation lib directory. If you set
`prefix' to /usr, the assemblies will be located in /usr/lib. On
+1
View File
@@ -16,3 +16,4 @@ Class Libraries:
John Barnette ([email protected])
Daniel Morgan <[email protected]>
Sebastien Pouliot <[email protected]>
Per Arneng <[email protected]>
+4
View File
@@ -1,3 +1,7 @@
2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* makefile: added Mono.Posix and System.Management.
2003-02-16 Martin Baulig <[email protected]>
* docs/compiler: Added a few works about the new `Location' code.
+9
View File
@@ -1,3 +1,12 @@
2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* class/library.build:
* class/makefile.gnu: added Mono.Posix and System.Management.
2003-03-02 Jackson Harper <[email protected]>
* mcs/class: Add PEAPI directory
2003-02-22 Martin Baulig <[email protected]>
* library.make: Pass `MCS_FLAGS' to MCS.
File diff suppressed because it is too large. Load diff
@@ -299,7 +299,6 @@ namespace DB2ClientCS
}
#endregion
#region Prepare ()
///
/// Prepare a statement against the database
@@ -18,7 +18,7 @@ namespace DB2ClientCS
/// Summary description for DB2ClientDataReader.
/// DB2ClientDataReader.
/// </summary>
unsafe public class DB2ClientDataReader : IDataReader
public class DB2ClientDataReader : IDataReader
{
internal DataTable rs; //Our result set is a datatable
internal DB2ClientConnection db2Conn; //The connection we're working with
@@ -45,7 +45,7 @@ namespace DB2ClientCS
sqlRet = DB2ClientPrototypes.SQLNumResultCols(hwndStmt, ref numCols);
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols");
IntPtr[] dbVals = new IntPtr[numCols];
byte[][] dbVals = new byte[(int)numCols][];
IntPtr[] sqlLen_or_IndPtr = new IntPtr[numCols];
PrepareResults(dbVals, sqlLen_or_IndPtr);
@@ -69,9 +69,10 @@ namespace DB2ClientCS
sqlRet = DB2ClientPrototypes.SQLNumResultCols(hwndStmt, ref numCols);
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols");
IntPtr[] dbVals = new IntPtr[numCols];
byte[][] dbVals = new byte[(int)numCols][];
IntPtr[] sqlLen_or_IndPtr = new IntPtr[numCols];
PrepareResults(dbVals, sqlLen_or_IndPtr);
FetchResults(dbVals, sqlLen_or_IndPtr, rs);
isClosed = false;
@@ -184,7 +185,7 @@ namespace DB2ClientCS
/// <summary>
/// Does the describe and bind steps for the query result set. Called for both immediate and prepared queries.
/// </summary>
private void PrepareResults(IntPtr[] dbVals, IntPtr[] sqlLen_or_IndPtr)
private void PrepareResults(byte[][] dbVals, IntPtr[] sqlLen_or_IndPtr)
{
short sqlRet;
StringBuilder colName = new StringBuilder(18);
@@ -205,7 +206,8 @@ namespace DB2ClientCS
rs.Columns.Add(colName.ToString());
sqlLen_or_IndPtr[i-1] = new IntPtr();
dbVals[i-1] = Marshal.AllocHGlobal((int)colSize+1);
dbVals[i-1] = new byte[(int)colSize];
try
{
@@ -216,10 +218,10 @@ namespace DB2ClientCS
case DB2ClientConstants.SQL_TYPE_TIME:
case DB2ClientConstants.SQL_TYPE_TIMESTAMP:
case DB2ClientConstants.SQL_VARCHAR:
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, DB2ClientConstants.SQL_C_CHAR, dbVals[i-1],(short)colSize+1, ref sqlLen_or_IndPtr[i-1]);
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, DB2ClientConstants.SQL_C_CHAR, dbVals[i-1],(short)colSize+1, (int)sqlLen_or_IndPtr[i-1]);
break;
default:
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, (short)sqlDataType, dbVals[i-1],(short)colSize+1, ref sqlLen_or_IndPtr[i-1]);
sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, (short)sqlDataType, dbVals[i-1],(short)colSize+1, (int)sqlLen_or_IndPtr[i-1]);
break;
}
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLBindCol");
@@ -228,8 +230,8 @@ namespace DB2ClientCS
{
System.Console.Write(e.Message);
}
isClosed = false;
}
isClosed = false;
}
/// <summary>
/// FetchResults does what it says.
@@ -237,7 +239,7 @@ namespace DB2ClientCS
/// <param name="dbVals"></param>
/// <param name="sqlLen_or_IndPtr"></param>
/// <param name="rs"></param>
private void FetchResults(IntPtr[] dbVals, IntPtr[] sqlLen_or_IndPtr, DataTable rs)
private void FetchResults(byte[][] dbVals, IntPtr[] sqlLen_or_IndPtr, DataTable rs)
{
short sqlRet = 0;
DB2ClientUtils util = new DB2ClientUtils();
@@ -249,14 +251,12 @@ namespace DB2ClientCS
{
DataRow newRow = rs.NewRow();
for (short y=1;y<=numCols;y++)
newRow[y-1] = Marshal.PtrToStringAnsi(dbVals[y-1]);
newRow[y-1] = System.Text.Encoding.Default.GetString(dbVals[y-1]);
rs.Rows.Add(newRow);
sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);
util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 2");
}
for (int n=0;n<numCols;n++)
Marshal.FreeHGlobal(dbVals[n]);
}
#endregion
@@ -369,6 +369,10 @@ namespace DB2ClientCS
///
/// GetDateTime method
///
public string NewGetDateTime(int col)
{
return Convert.ToString(this[col]);
}
public DateTime GetDateTime(int col)
{
return Convert.ToDateTime(this[col]);
@@ -23,7 +23,7 @@ namespace DB2ClientCS
{
this.message = Message;
}
unsafe public DB2ClientException(short sqlHandleType, IntPtr sqlHandle, string Message)
public DB2ClientException(short sqlHandleType, IntPtr sqlHandle, string Message)
{
StringBuilder sqlState = new StringBuilder(50);
StringBuilder errorMessage = new StringBuilder(1025);
@@ -20,47 +20,47 @@ namespace DB2ClientCS
internal class DB2ClientPrototypes
{
[DllImport("db2cli.dll", EntryPoint = "SQLAllocHandle")]
unsafe public static extern short SQLAllocHandle(short handleType, IntPtr inputHandle, ref IntPtr outputHandle);
internal static extern short SQLAllocHandle(short handleType, IntPtr inputHandle, ref IntPtr outputHandle);
[DllImport("db2cli.Dll", EntryPoint = "SQLConnect")]
unsafe public static extern short SQLConnect(IntPtr sqlHdbc, string serverName, short serverNameLength, string userName, short userNameLength, string authentication, short authenticationLength);
internal static extern short SQLConnect(IntPtr sqlHdbc, string serverName, short serverNameLength, string userName, short userNameLength, string authentication, short authenticationLength);
[DllImport("db2cli.Dll", CharSet = CharSet.Auto, EntryPoint = "SQLDisconnect")]
unsafe public static extern short SQLDisconnect(IntPtr sqlHdbc);
internal static extern short SQLDisconnect(IntPtr sqlHdbc);
[DllImport("db2cli.dll", EntryPoint = "SQLGetDiagRec")]
unsafe public static extern short SQLGetDiagRec( short handleType, IntPtr handle, short recNum, [Out] StringBuilder sqlState, ref IntPtr nativeErrorPtr, [Out] StringBuilder errorMessage, short bufferLength, ref IntPtr shortTextLengthPtr);
internal static extern short SQLGetDiagRec( short handleType, IntPtr handle, short recNum, [Out] StringBuilder sqlState, ref IntPtr nativeErrorPtr, [Out] StringBuilder errorMessage, short bufferLength, ref IntPtr shortTextLengthPtr);
[DllImport("db2cli.Dll", EntryPoint = "SQLSetConnectAttr")]
unsafe public static extern short SQLSetConnectAttr(IntPtr sqlHdbc, long sqlAttr, [In] IntPtr sqlValuePtr, long sqlValueLength);
internal static extern short SQLSetConnectAttr(IntPtr sqlHdbc, long sqlAttr, [In] IntPtr sqlValuePtr, long sqlValueLength);
[DllImport("db2cli.Dll", EntryPoint = "SQLEndTran")]
unsafe public static extern short SQLEndTran (short handleType, IntPtr handle, short fType);
internal static extern short SQLEndTran (short handleType, IntPtr handle, short fType);
[DllImport("db2cli.Dll", EntryPoint = "SQLCancel")]
unsafe public static extern short SQLCancel(IntPtr handle);
internal static extern short SQLCancel(IntPtr handle);
[DllImport("db2cli.dll", EntryPoint = "SQLNumResultCols")]
unsafe public static extern short SQLNumResultCols(IntPtr handle, ref int numCols);
internal static extern short SQLNumResultCols(IntPtr handle, ref int numCols);
[DllImport("db2cli.Dll", EntryPoint = "SQLFetch")]
unsafe public static extern short SQLFetch(IntPtr handle);
internal static extern short SQLFetch(IntPtr handle);
[DllImport("db2cli.dll", EntryPoint = "SQLRowCount")]
unsafe public static extern short SQLRowCount(IntPtr stmtHandle, ref int numRows);
internal static extern short SQLRowCount(IntPtr stmtHandle, ref int numRows);
[DllImport("db2cli.dll", EntryPoint = "SQLExecute")]
unsafe public static extern short SQLExecute(IntPtr handle);
internal static extern short SQLExecute(IntPtr handle);
[DllImport ("db2cli.dll", EntryPoint = "SQLExecDirect")]
unsafe public static extern short SQLExecDirect(IntPtr stmtHandle, string stmt, int length);
internal static extern short SQLExecDirect(IntPtr stmtHandle, string stmt, int length);
[DllImport("db2cli.Dll", EntryPoint = "SQLDescribeCol")]
unsafe public static extern short SQLDescribeCol(IntPtr stmtHandle, ushort colNum, [Out] StringBuilder colName, short colNameMaxLength, IntPtr colNameLength, ref IntPtr dataType, ref IntPtr colSizePtr, ref IntPtr scalePtr, ref IntPtr nullablePtr );
internal static extern short SQLDescribeCol(IntPtr stmtHandle, ushort colNum, [Out] StringBuilder colName, short colNameMaxLength, IntPtr colNameLength, ref IntPtr dataType, ref IntPtr colSizePtr, ref IntPtr scalePtr, ref IntPtr nullablePtr );
[DllImport("db2cli.dll", EntryPoint = "SQLBindCol")]
unsafe public static extern short SQLBindCol(IntPtr stmtHandle, ushort colNum, int dataType,[In][Out] IntPtr dataBufferPtr, int dataBufferLength, ref IntPtr StrLen_or_IndPtr);
internal static extern short SQLBindCol(IntPtr stmtHandle, ushort colNum, int dataType, [Out] byte[] dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
[DllImport("db2cli.dll", EntryPoint = "SQLDriverConnect")]
unsafe public static extern short SQLDriverConnect(IntPtr hdbc, int centered, [In] string inConnectStr, [In] int inStrLength, [Out] StringBuilder outConnectStr, [Out] int outStrCapacity, [Out] IntPtr outStrLengthReturned, [In] int completion);
internal static extern short SQLDriverConnect(IntPtr hdbc, int centered, [In] string inConnectStr, [In] int inStrLength, [Out] StringBuilder outConnectStr, [Out] int outStrCapacity, [Out] IntPtr outStrLengthReturned, [In] int completion);
[DllImport("db2cli.dll", EntryPoint = "SQLPrepare")]
unsafe public static extern short SQLPrepare(IntPtr stmtHandle, string stmt, int length);
internal static extern short SQLPrepare(IntPtr stmtHandle, string stmt, int length);
[DllImport("db2cli.dll", EntryPoint = "SQLDescribeParam")]
unsafe public static extern short SQLDescribeParam(IntPtr stmtHandle, short paramNumber,ref IntPtr dataType, ref IntPtr paramSize, ref IntPtr decimalDigits, ref IntPtr nullable);
internal static extern short SQLDescribeParam(IntPtr stmtHandle, short paramNumber,ref IntPtr dataType, ref IntPtr paramSize, ref IntPtr decimalDigits, ref IntPtr nullable);
[DllImport("db2cli.dll", EntryPoint = "SQLNumParams")]
unsafe public static extern short SQLNumParams(IntPtr stmtHandle, ref IntPtr numParams);
internal static extern short SQLNumParams(IntPtr stmtHandle, ref IntPtr numParams);
[DllImport("db2cli.dll")]
internal static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
short dataType, short valueType, short paramType, uint colSize, short decDigits,
byte[] dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
[DllImport("db2cli.dll", EntryPoint = "SQLBindParameter")]
unsafe public static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
internal static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber,
short dataType, short valueType, short paramType, uint colSize, short decDigits,
ref int dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);
@@ -18,7 +18,7 @@ namespace DB2ClientCS
/// at the statement level, but I haven't worked that in here yet.
/// NOTE: AT THE MOMENT, SETTING OF THE ISOLATION LEVEL IS NOT WORKING
/// </summary>
unsafe public class DB2ClientTransaction : IDbTransaction
public class DB2ClientTransaction : IDbTransaction
{
DB2ClientUtils util = new DB2ClientUtils();
IsolationLevel IL = IsolationLevel.Unspecified;
+5
View File
@@ -1,7 +1,12 @@
2003-03-01 Jackson Harper <[email protected]>
* Image.cs: Write Metadata root
2003-02-23 Peter Williams <[email protected]>
* makefile.gnu (all): Give this dependencies
so that we don't rebuild every time.
(all): Take two.
2003-02-22 Jackson Harper <[email protected]>
+5 -6
View File
@@ -149,18 +149,17 @@ namespace Mono.PEToolkit {
coffHdr.Write (writer);
peHdr.Write (writer);
WriteSections (writer);
if (this.IsCLI) {
writer.BaseStream.Position = RVAToVA (peHdr.CLIHdrDir.virtAddr);
corHdr.Write (writer);
/*
mdRoot = new MetaDataRoot(this);
reader.BaseStream.Position = RVAToVA(corHdr.MetaData.virtAddr);
mdRoot.Read(reader);
*/
long pos = RVAToVA (corHdr.MetaData.virtAddr);
writer.BaseStream.Position = pos;
mdRoot.Write (writer);
}
}
+4 -2
View File
@@ -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,11 @@
2003-03-01 Jackson Harper <[email protected]>
* MDStream.cs: Add methods to write metadata streams
2003-03-01 Jackson Harper <[email protected]>
* MetaDataRoot.cs: Add method to write Metadata
2003-02-20 Jackson Harper <[email protected]>
* MDStream.cs: Make Header a class and use a Read method to load it. Because it is no longer
+33 -1
View File
@@ -50,10 +50,33 @@ namespace Mono.PEToolkit.Metadata {
pos &= ~3;
if (stream != null)
pos += stream.Root.filePos;
// Advance file pointer.
reader.BaseStream.Position = pos;
}
public void Write (BinaryWriter writer, MDStream stream)
{
writer.Write (offs);
writer.Write (size);
for (int i=0; i<name.Length; i++)
writer.Write ((sbyte)name[i]);
writer.Write ((sbyte) '\0');
// Round up to dword boundary.
long pos = writer.BaseStream.Position;
if (stream != null)
pos -= stream.Root.filePos;
pos += 3;
pos &= ~3;
if (stream != null)
pos += stream.Root.filePos;
// Advance file pointer.
writer.BaseStream.Position = pos;
}
} // header
@@ -152,6 +175,15 @@ namespace Mono.PEToolkit.Metadata {
}
public void Write (BinaryWriter writer)
{
hdr.Write (writer, this);
long old_pos = writer.BaseStream.Position;
writer.BaseStream.Position = root.filePos + hdr.offs;
writer.Write (data);
writer.BaseStream.Position = old_pos;
}
/// <summary>
/// Initializes heap for this stream.
/// </summary>
@@ -101,7 +101,7 @@ namespace Mono.PEToolkit.Metadata {
unsafe public void Read(BinaryReader reader)
{
filePos = reader.BaseStream.Position;
sig = reader.ReadUInt32();
if (sig != Sig) {
throw new BadImageException("Invalid MetaData Signature.");
@@ -110,10 +110,10 @@ namespace Mono.PEToolkit.Metadata {
majVer = reader.ReadInt16();
minVer = reader.ReadInt16();
reserved = reader.ReadUInt32();
// Length of version string.
len = reader.ReadInt32();
// Read version string.
if (len != 0) {
sbyte* pVer = stackalloc sbyte [len];
@@ -141,10 +141,9 @@ namespace Mono.PEToolkit.Metadata {
} else {
VersionString = String.Empty;
}
flags = reader.ReadInt16();
nStreams = reader.ReadInt16();
streams = new Hashtable(nStreams);
// load all streams into memory
@@ -168,6 +167,44 @@ namespace Mono.PEToolkit.Metadata {
blobIdx = tabsHeap.BlobIndexSize;
}
public void Write (BinaryWriter writer)
{
filePos = writer.BaseStream.Position;
writer.Write (Sig);
writer.Write (majVer);
writer.Write (minVer);
writer.Write (reserved);
// Length of version string
writer.Write (verStr.Length);
if (verStr.Length > 0) {
long pos = writer.BaseStream.Position;
for (int i=0; i<verStr.Length; i++)
writer.Write ((sbyte) verStr[i]);
// Round up to dword boundary, relative to header start.
pos += verStr.Length;
pos -= filePos;
pos += 3;
pos &= ~3;
pos += filePos;
// Advance file pointer
writer.BaseStream.Position = pos;
}
writer.Write (flags);
writer.Write (nStreams);
// load all streams into memory
foreach (MDStream stream in streams.Values)
stream.Write (writer);
}
public TablesHeap TablesHeap {
get {
MDStream tabs = Streams["#~"] as MDStream;
+4
View File
@@ -0,0 +1,4 @@
2003-03-02 Jackson Harper <[email protected]>
* PEAPI.cs: Add file
* README.txt: Add file
File diff suppressed because it is too large. Load diff
+31
View File
@@ -0,0 +1,31 @@
PEAPI
-----
This is a preliminary version of our PE writer component. It is a managed
component which presents on the client side an API and constructs program
executable files.
We have tested this component as an alternative backend for Gardens Point
Component Pascal .NET. Our previous versions of gpcp produced textual CIL and
invoked ilasm. The new backend can create a program executable file in almost
exactly the same length of time as it takes to write the equivalent CIL text
file.
PEAPI is written in C# and is released as open source under a FreeBSD-like
licence. Included in this release is pdf documentation and both html and
chm documentation. The main documentation is written as if it was a new
Appendix to John Gough's book Compiling for the .NET Common Language Runtime,
Prentice-Hall 2002.
The current release implements most of the facilities of the API however,
some final features not required for component pascal have yet to be added.
We expect to update the component incrementally as additional features are
added. Currently the component does not produce debugger information (pdb
files). We are considering possible ways of doing this or alternatively
producing rotor-format debugging information.
The team has a committment to maintain and update the component into the
foreseeable future, as several other projects here depend on it. Users are
encouraged to send feedback on missing features, bug reports etc. to assist
in this quest.
@@ -1,3 +1,63 @@
2003-03-04 Tim Coleman <[email protected]>
* System.Data.OracleClient.Oci/IOciDescriptorHandle.cs:
* System.Data.OracleClient.Oci/IOciHandle.cs:
* System.Data.OracleClient.Oci/OciDescriptorType.cs:
Removed. These are no longer used.
* System.Data.OracleClient.Oci/OciParameterDescriptor.cs:
Add new class
* list:
Add System.Data.OracleClient.Oci/OciParameterDescriptor.cs
Rem System.Data.OracleClient.Oci/IOciDescriptorHandle.cs
Rem System.Data.OracleClient.Oci/IOciHandle.cs
Rem System.Data.OracleClient.Oci/OciDescriptorType.cs
* System.Data.OracleClient/OciGlue.cs:
Move the OCIAttrGet* methods into OciHandle
* System.Data.OracleClient/OracleDataReader.cs:
* System.Data.OracleClient/OracleParameter.cs:
Change the way that columns are bound and described
* System.Data.OracleClient.Oci/OciBindHandle.cs:
* System.Data.OracleClient.Oci/OciDefineHandle.cs:
* System.Data.OracleClient.Oci/OciDescriptorHandle.cs:
* System.Data.OracleClient.Oci/OciEnvironmentHandle.cs:
* System.Data.OracleClient.Oci/OciErrorHandle.cs:
* System.Data.OracleClient.Oci/OciHandle.cs:
* System.Data.OracleClient.Oci/OciLobLocator.cs:
* System.Data.OracleClient.Oci/OciServerHandle.cs:
* System.Data.OracleClient.Oci/OciServiceHandle.cs:
* System.Data.OracleClient.Oci/OciSessionHandle.cs:
* System.Data.OracleClient.Oci/OciStatementHandle.cs:
* System.Data.OracleClient.Oci/OciTransactionHandle.cs:
All handles now derive from OciHandle, and these classes
have been rewritten as such. Also attempted to implement
the Dispose () methods for these classes.
* System.Data.OracleClient.Oci/OciHandleType.cs:
Add descriptor types into here because handles and
descriptors are used in many of the same OCI functions.
2003-02-26 Tim Coleman <[email protected]>
* System.Data.OracleClient/OracleConnection.cs:
Rollback transactions when connection closes if they
are open.
* System.Data.OracleClient/OracleDataReader.cs:
Implement GetOracleLob ()
* System.Data.OracleClient/OracleLob.cs:
Implement some of the details, like Read/Write/Seek
* System.Data.OracleClient.Oci/OciBindHandle.cs:
Remove debug message.
* System.Data.OracleClient.Oci/OciDefineHandle.cs:
Add LOB support.
* System.Data.OracleClient.Oci/OciEnvironmentHandle.cs:
Minor formatting changes
* System.Data.OracleClient.Oci/OciLobLocator.cs:
Huge amounts of code to make it work. Lots of ugly
OCI P/Invoke code.
* Test/TestOracleClient.cs:
Improve the LOBTest.
2003-02-24 Gonzalo Paniagua Javier <[email protected]>
* System.Data.OracleClient/OracleMonthSpan.cs: fixed compilation.
2003-02-21 Tim Coleman <[email protected]>
* System.Data.OracleClient/OracleDateTime.cs:
* System.Data.OracleClient/OracleInfoMessageEventArgs.cs:
@@ -1,30 +0,0 @@
//
// IOciDescriptorHandle.cs
//
// Part of managed C#/.NET library System.Data.OracleClient.dll
//
// Part of the Mono class libraries at
// mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
//
// Assembly: System.Data.OracleClient.dll
// Namespace: System.Data.OracleClient.Oci
//
// Author:
// Tim Coleman <[email protected]>
//
// Copyright (C) Tim Coleman, 2003
//
using System;
namespace System.Data.OracleClient.Oci {
internal interface IOciDescriptorHandle
{
#region Properties
IntPtr Handle { get; set; }
OciDescriptorType HandleType { get; }
#endregion // Properties
}
}
@@ -1,30 +0,0 @@
//
// IOciHandle.cs
//
// Part of managed C#/.NET library System.Data.OracleClient.dll
//
// Part of the Mono class libraries at
// mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
//
// Assembly: System.Data.OracleClient.dll
// Namespace: System.Data.OracleClient.Oci
//
// Author:
// Tim Coleman <[email protected]>
//
// Copyright (C) Tim Coleman, 2003
//
using System;
namespace System.Data.OracleClient.Oci {
internal interface IOciHandle
{
#region Properties
IntPtr Handle { get; set; }
OciHandleType HandleType { get; }
#endregion // Properties
}
}
@@ -20,143 +20,45 @@ using System.Runtime.InteropServices;
using System.Text;
namespace System.Data.OracleClient.Oci {
internal sealed class OciBindHandle : IOciHandle, IDisposable
internal sealed class OciBindHandle : OciHandle, IDisposable
{
#region Fields
IntPtr handle;
string name;
bool disposed = false;
IntPtr value;
OciStatementHandle statement;
OciDataType type;
int size;
int indicator;
#endregion // Fields
#region Constructors
public OciBindHandle (string name)
public OciBindHandle (OciHandle parent, IntPtr newHandle)
: base (OciHandleType.Bind, parent, newHandle)
{
this.name = name;
this.value = IntPtr.Zero;
this.indicator = 0;
}
#endregion // Constructors
#region Properties
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
public OciHandleType HandleType {
get { return OciHandleType.Bind; }
}
public string Name {
get { return name; }
set { name = value; }
}
public int Size {
get { return size; }
set { size = value; }
}
public OciDataType Type {
get { return type; }
set { type = value; }
}
public IntPtr Value {
get { return value; }
set { this.value = value; }
}
#endregion
#endregion // Properties
#region Methods
[DllImport ("oci", EntryPoint = "OCIBindByName")]
public static extern int OCIBindByName (IntPtr stmtp,
out IntPtr bindpp,
IntPtr errhp,
string placeholder,
int placeh_len,
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
ref int indp,
IntPtr alenp,
ushort rcodep,
uint maxarr_len,
IntPtr curelp,
uint mode);
public void Bind (OciStatementHandle statement, object val)
protected override void Dispose (bool disposing)
{
Console.WriteLine ("IN BIND");
handle = IntPtr.Zero;
this.statement = statement;
int indp = 0;
ushort alenp = 0;
IntPtr rcodep = IntPtr.Zero;
int status = 0;
OciDataType bindType = Type;
int definedSize = 0;
string stringValue = val.ToString ();
if (val == DBNull.Value)
indicator = -1;
else {
switch (Type) {
case OciDataType.Number:
case OciDataType.Integer:
case OciDataType.Float:
case OciDataType.VarNum:
bindType = OciDataType.Char;
definedSize = stringValue.Length;
value = Marshal.StringToHGlobalAnsi (stringValue);
break;
case OciDataType.Date:
break;
default:
bindType = OciDataType.Char;
definedSize = stringValue.Length;
value = Marshal.StringToHGlobalAnsi (stringValue);
break;
if (!disposed) {
try {
Marshal.FreeHGlobal (value);
disposed = true;
} finally {
base.Dispose (disposing);
}
}
status = OCIBindByName (statement.Handle,
out handle,
statement.ErrorHandle.Handle,
name,
name.Length,
value,
definedSize,
bindType,
ref indicator,
IntPtr.Zero,
0,
0,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public void Dispose ()
{
Marshal.FreeHGlobal (value);
}
#endregion // Methods
@@ -21,10 +21,12 @@ using System.Runtime.InteropServices;
using System.Text;
namespace System.Data.OracleClient.Oci {
internal sealed class OciDefineHandle : IOciHandle, IDisposable
internal sealed class OciDefineHandle : OciHandle, IDisposable
{
#region Fields
bool disposed = false;
IntPtr handle;
IntPtr value;
short indicator;
@@ -33,93 +35,30 @@ namespace System.Data.OracleClient.Oci {
OciDataType definedType;
int definedSize;
int rlenp;
sbyte scale;
short scale;
OciErrorHandle errorHandle;
OciLobLocator lobLocator;
byte[] date;
#endregion // Fields
#region Constructors
public OciDefineHandle (OciStatementHandle statement, int position)
public OciDefineHandle (OciHandle parent, IntPtr newHandle)
: base (OciHandleType.Define, parent, newHandle)
{
int ociTypeInt;
int status = 0;
}
IntPtr parameterHandle = statement.CreateParameterHandle (position);
status = OciGlue.OCIAttrGetInt32 (parameterHandle,
(uint) OciDescriptorType.Parameter,
out definedSize,
IntPtr.Zero,
OciAttributeType.DataSize,
statement.ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
status = OciGlue.OCIAttrGetSByte (parameterHandle,
(uint) OciDescriptorType.Parameter,
out scale,
IntPtr.Zero,
OciAttributeType.DataSize,
statement.ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
status = OciGlue.OCIAttrGetInt32 (parameterHandle,
(uint) OciDescriptorType.Parameter,
out ociTypeInt,
IntPtr.Zero,
OciAttributeType.DataType,
statement.ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
definedType = (OciDataType) ociTypeInt;
switch (definedType) {
case OciDataType.Number:
ociType = OciDataType.Char;
break;
case OciDataType.Date:
ociType = OciDataType.Char;
definedSize = 20;
break;
case OciDataType.Clob:
lobLocator = (OciLobLocator) statement.Environment.AllocateDescriptor (OciDescriptorType.LobLocator);
value = lobLocator.Handle;
ociType = definedType;
break;
default:
ociType = definedType;
break;
}
value = Marshal.AllocHGlobal (definedSize);
status = OCIDefineByPos (statement.Handle,
out handle,
statement.ErrorHandle.Handle,
position,
value,
definedSize,
ociType,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = statement.ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
statement.FreeParameterHandle (parameterHandle);
public void DefineByPosition (int position)
{
OciParameterDescriptor parameter = ((OciStatementHandle) Parent).GetParameter (position);
definedSize = parameter.GetDataSize ();
scale = parameter.GetScale ();
definedType = parameter.GetDataType ();
Define (position);
parameter.Dispose ();
}
#endregion // Constructors
@@ -134,20 +73,16 @@ namespace System.Data.OracleClient.Oci {
get { return definedSize; }
}
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
public OciHandleType HandleType {
get { return OciHandleType.Define; }
public OciErrorHandle ErrorHandle {
get { return errorHandle; }
set { errorHandle = value; }
}
public bool IsNull {
get { return (indicator == -1); }
}
public sbyte Scale {
public short Scale {
get { return scale; }
}
@@ -176,14 +111,148 @@ namespace System.Data.OracleClient.Oci {
IntPtr rcodep,
uint mode);
public void Dispose ()
[DllImport ("oci", EntryPoint="OCIDefineByPos")]
public static extern int OCIDefineByPosPtr (IntPtr stmtp,
out IntPtr defnpp,
IntPtr errhp,
[MarshalAs (UnmanagedType.U4)] int position,
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
ref short indp,
ref int rlenp,
IntPtr rcodep,
uint mode);
[DllImport ("oci")]
static extern int OCIDateTimeGetDate (IntPtr hndl,
IntPtr err,
byte[] datetime,
out short year,
out byte month,
out byte day);
void Define (int position)
{
Marshal.FreeHGlobal (value);
switch (definedType) {
case OciDataType.Date:
definedSize = 7;
DefineDate (position);
return;
case OciDataType.Clob:
case OciDataType.Blob:
definedSize = -1;
DefineLob (position, definedType);
return;
default:
DefineChar (position); // HANDLE ALL OTHERS AS CHAR FOR NOW
return;
}
}
void DefineDate (int position)
{
ociType = OciDataType.Date;
value = Marshal.AllocHGlobal (definedSize);
int status = 0;
status = OCIDefineByPos (Parent,
out handle,
ErrorHandle,
position + 1,
value,
definedSize,
ociType,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
void DefineChar (int position)
{
ociType = OciDataType.Char;
value = Marshal.AllocHGlobal (definedSize);
int status = 0;
status = OCIDefineByPos (Parent,
out handle,
ErrorHandle,
position + 1,
value,
definedSize,
ociType,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
void DefineLob (int position, OciDataType type)
{
ociType = type;
int status = 0;
definedSize = -1;
lobLocator = (OciLobLocator) Parent.Parent.Allocate (OciHandleType.LobLocator);
if (lobLocator == null) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
value = lobLocator.Handle;
lobLocator.ErrorHandle = ErrorHandle;
lobLocator.Service = ((OciStatementHandle) Parent).Service;
status = OCIDefineByPosPtr (Parent,
out handle,
ErrorHandle,
position + 1,
ref value,
definedSize,
ociType,
ref indicator,
ref rlenp,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
[MonoTODO ("This will be an override when this is properly derived from OciHandle.")]
protected override void Dispose (bool disposing)
{
if (!disposed) {
try {
Marshal.FreeHGlobal (value);
disposed = true;
} finally {
base.Dispose (disposing);
}
}
}
public OracleLob GetOracleLob ()
{
return new OracleLob (lobLocator);
return new OracleLob (lobLocator, ociType);
}
public object GetValue ()
@@ -221,15 +290,31 @@ namespace System.Data.OracleClient.Oci {
return Double.Parse (String.Copy ((string) tmp));
break;
case OciDataType.Date:
tmp = Marshal.PtrToStringAnsi (Value, Size);
if (tmp != null)
return DateTime.Parse ((string) tmp);
break;
return UnpackDate ();
}
return DBNull.Value;
}
[MonoTODO ("Be able to handle negative dates... i.e. BCE.")]
public DateTime UnpackDate ()
{
byte century = Marshal.ReadByte (value, 0);
byte year = Marshal.ReadByte (value, 1);
byte month = Marshal.ReadByte (value, 2);
byte day = Marshal.ReadByte (value, 3);
byte hour = Marshal.ReadByte (value, 4);
byte minute = Marshal.ReadByte (value, 5);
byte second = Marshal.ReadByte (value, 6);
return new DateTime ((century - 100) * 100 + (year - 100),
month,
day,
hour - 1,
minute - 1,
second - 1);
}
#endregion // Methods
}
}
@@ -16,44 +16,32 @@
//
using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal abstract class OciDescriptorHandle : IOciDescriptorHandle
internal abstract class OciDescriptorHandle : OciHandle
{
#region Fields
IntPtr handle;
OciEnvironmentHandle environment;
OciDescriptorType type;
#endregion // Fields
#region Constructors
public OciDescriptorHandle (OciDescriptorType type, OciEnvironmentHandle environment, IntPtr newHandle)
public OciDescriptorHandle (OciHandleType type, OciHandle parent, IntPtr newHandle)
: base (type, parent, newHandle)
{
this.type = type;
this.environment = environment;
this.handle = newHandle;
}
#endregion // Constructors
#region Properties
#region Methods
public OciEnvironmentHandle Environment {
get { return environment; }
[DllImport ("oci")]
static extern int OCIDescriptorFree (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type);
protected override void FreeHandle ()
{
int status = 0;
status = OCIDescriptorFree (Handle, HandleType);
}
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
public OciDescriptorType HandleType {
get { return type; }
}
#endregion // Properties
#endregion // Methods
}
}
@@ -1,45 +0,0 @@
//
// OciDescriptorType.cs
//
// Part of managed C#/.NET library System.Data.OracleClient.dll
//
// Part of the Mono class libraries at
// mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
//
// Assembly: System.Data.OracleClient.dll
// Namespace: System.Data.OracleClient.Oci
//
// Author:
// Tim Coleman <[email protected]>
//
// Copyright (C) Tim Coleman, 2003
//
using System;
namespace System.Data.OracleClient.Oci {
internal enum OciDescriptorType {
LobLocator = 0x32,
Snapshot = 0x33,
ResultSet = 0x34,
Parameter = 0x35,
RowId = 0x36,
ComplexObject = 0x37,
FileLobLocator = 0x38,
EnqueueOptions = 0x39,
DequeueOptions = 0x3a,
MessageProperties = 0x3b,
Agent = 0x3c,
Locator = 0x3d,
IntervalYearToMonth = 0x3e,
IntervalDayToSecond = 0x3f,
Notify = 0x40,
Date = 0x41,
Time = 0x42,
TimeWithTZ = 0x43,
TimeStamp = 0x44,
TimeStampWithTZ = 0x45,
TimeStampLocal = 0x46,
UserCallback = 0x47
}
}
@@ -19,14 +19,8 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal class OciEnvironmentHandle : IOciHandle, IDisposable
internal class OciEnvironmentHandle : OciHandle, IDisposable
{
#region Fields
IntPtr handle;
#endregion // Fields
#region Constructors
public OciEnvironmentHandle ()
@@ -35,140 +29,35 @@ namespace System.Data.OracleClient.Oci {
}
public OciEnvironmentHandle (OciEnvironmentMode mode)
: base (OciHandleType.Environment, null, IntPtr.Zero)
{
int status = 0;
this.handle = IntPtr.Zero;
IntPtr newHandle = IntPtr.Zero;
status = OCIEnvCreate (out newHandle,
mode,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
0,
IntPtr.Zero);
status = OCIEnvCreate (out handle, mode,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
0,
IntPtr.Zero);
SetHandle (newHandle);
}
#endregion // Constructors
#region Properties
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
public OciHandleType HandleType {
get { return OciHandleType.Environment; }
}
#endregion // Properties
#region Methods
[DllImport ("oci")]
public static extern int OCIEnvCreate (out IntPtr envhpp,
[MarshalAs (UnmanagedType.U4)] OciEnvironmentMode mode,
IntPtr ctxp,
IntPtr malocfp,
IntPtr ralocfp,
IntPtr mfreep,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
public static extern int OCIHandleAlloc (IntPtr parenth,
out IntPtr hndlpp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
public static extern int OCIDescriptorAlloc (IntPtr parenth,
out IntPtr descpp,
[MarshalAs (UnmanagedType.U4)] OciDescriptorType type,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
public static extern int OCIHandleFree (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type);
[DllImport ("oci")]
public static extern int OCIDescriptorFree (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciDescriptorType type);
public IOciHandle Allocate (OciHandleType type)
{
IntPtr newHandle = IntPtr.Zero;
int status = 0;
status = OCIHandleAlloc (Handle,
out newHandle,
type,
0,
IntPtr.Zero);
if (status != 0 && status != 1)
return null;
switch (type) {
case OciHandleType.Service:
return new OciServiceHandle (this, newHandle);
case OciHandleType.Error:
return new OciErrorHandle (this, newHandle);
case OciHandleType.Server:
return new OciServerHandle (this, newHandle);
case OciHandleType.Session:
return new OciSessionHandle (this, newHandle);
case OciHandleType.Statement:
return new OciStatementHandle (this, newHandle);
case OciHandleType.Transaction:
return new OciTransactionHandle (this, newHandle);
default:
OCIHandleFree (newHandle, type);
newHandle = IntPtr.Zero;
throw new ArgumentException ("Invalid handle type.");
}
}
public IOciDescriptorHandle AllocateDescriptor (OciDescriptorType type)
{
IntPtr newHandle = IntPtr.Zero;
int status = 0;
status = OCIDescriptorAlloc (Handle,
out newHandle,
type,
0,
IntPtr.Zero);
if (status != 0 && status != 1)
return null;
switch (type) {
case OciDescriptorType.LobLocator:
return new OciLobLocator (this, newHandle);
default:
OCIDescriptorFree (newHandle, type);
newHandle = IntPtr.Zero;
throw new ArgumentException ("Invalid handle type.");
}
}
public void Dispose ()
{
FreeHandle (this);
}
public void FreeHandle (IOciHandle toBeDisposed)
{
OCIHandleFree (toBeDisposed.Handle, toBeDisposed.HandleType);
toBeDisposed.Handle = IntPtr.Zero;
}
public void FreeDescriptor (IOciDescriptorHandle toBeDisposed)
{
OCIDescriptorFree (toBeDisposed.Handle, toBeDisposed.HandleType);
toBeDisposed.Handle = IntPtr.Zero;
}
static extern int OCIEnvCreate (out IntPtr envhpp,
[MarshalAs (UnmanagedType.U4)] OciEnvironmentMode mode,
IntPtr ctxp,
IntPtr malocfp,
IntPtr ralocfp,
IntPtr mfreep,
int xtramem_sz,
IntPtr usrmempp);
public OciErrorInfo HandleError ()
{
@@ -179,7 +68,7 @@ namespace System.Data.OracleClient.Oci {
info.ErrorCode = 0;
info.ErrorMessage = String.Empty;
OciGlue.OCIErrorGet (handle,
OciGlue.OCIErrorGet (Handle,
1,
IntPtr.Zero,
out info.ErrorCode,
@@ -19,12 +19,18 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciErrorHandle : OciHandle, IOciHandle, IDisposable
internal sealed class OciErrorHandle : OciHandle, IDisposable
{
#region Fields
bool disposed = false;
#endregion // Fields
#region Constructors
public OciErrorHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Error, environment, handle)
public OciErrorHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Error, parent, handle)
{
}
@@ -32,9 +38,12 @@ namespace System.Data.OracleClient.Oci {
#region Methods
public void Dispose ()
protected override void Dispose (bool disposing)
{
Environment.FreeHandle (this);
if (!disposed) {
disposed = true;
base.Dispose (disposing);
}
}
public OciErrorInfo HandleError ()
@@ -16,38 +16,53 @@
//
using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal abstract class OciHandle : IOciHandle
internal abstract class OciHandle : IDisposable
{
#region Fields
bool disposed = false;
IntPtr handle;
OciEnvironmentHandle environment;
OciHandle parent;
OciHandleType type;
#endregion // Fields
#region Constructors
public OciHandle (OciHandleType type, OciEnvironmentHandle environment, IntPtr newHandle)
public OciHandle (OciHandleType type, OciHandle parent, IntPtr newHandle)
{
this.type = type;
this.environment = environment;
this.parent = parent;
this.handle = newHandle;
}
~OciHandle ()
{
Dispose (false);
}
#endregion // Constructors
#region Properties
public OciEnvironmentHandle Environment {
get { return environment; }
public OciHandle Parent {
get { return parent; }
}
/*
public HandleRef Handle {
get {
HandleRef hr = new HandleRef (this, handle);
GC.KeepAlive (this);
return hr;
}
}
*/
public IntPtr Handle {
get { return handle; }
set { handle = value; }
}
public OciHandleType HandleType {
@@ -55,5 +70,257 @@ namespace System.Data.OracleClient.Oci {
}
#endregion // Properties
#region Methods
[DllImport ("oci")]
static extern int OCIAttrGet (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out IntPtr attributep,
out int sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
static extern int OCIAttrGetSByte (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out sbyte attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
static extern int OCIAttrGetByte (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out byte attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
static extern int OCIAttrGetUInt16 (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out ushort attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
static extern int OCIAttrGetInt32 (IntPtr trgthndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
out int attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci")]
static extern int OCIDescriptorAlloc (IntPtr parenth,
out IntPtr hndlpp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
static extern int OCIHandleAlloc (IntPtr parenth,
out IntPtr descpp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type,
int xtramem_sz,
IntPtr usrmempp);
[DllImport ("oci")]
static extern int OCIHandleFree (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type);
public OciHandle Allocate (OciHandleType type)
{
int status = 0;
IntPtr newHandle = IntPtr.Zero;
if (type < OciHandleType.LobLocator)
status = OCIHandleAlloc (this,
out newHandle,
type,
0,
IntPtr.Zero);
else
status = OCIDescriptorAlloc (this,
out newHandle,
type,
0,
IntPtr.Zero);
if (status != 0 && status != 1)
throw new Exception (String.Format ("Could not allocate new OCI Handle of type {0}", type));
switch (type) {
case OciHandleType.Service:
return new OciServiceHandle (this, newHandle);
case OciHandleType.Error:
return new OciErrorHandle (this, newHandle);
case OciHandleType.Server:
return new OciServerHandle (this, newHandle);
case OciHandleType.Session:
return new OciSessionHandle (this, newHandle);
case OciHandleType.Statement:
return new OciStatementHandle (this, newHandle);
case OciHandleType.Transaction:
return new OciTransactionHandle (this, newHandle);
case OciHandleType.LobLocator:
return new OciLobLocator (this, newHandle);
}
return null;
}
protected virtual void Dispose (bool disposing)
{
if (!disposed) {
if (disposing) {
parent = null;
}
FreeHandle ();
disposed = true;
}
}
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void FreeHandle ()
{
OCIHandleFree (Handle, HandleType);
handle = IntPtr.Zero;
}
public bool GetAttributeBool (OciAttributeType attrType, OciErrorHandle errorHandle)
{
return (GetAttributeInt32 (attrType, errorHandle) != 0);
}
public sbyte GetAttributeSByte (OciAttributeType attrType, OciErrorHandle errorHandle)
{
int status = 0;
sbyte output;
status = OCIAttrGetSByte (Handle,
HandleType,
out output,
IntPtr.Zero,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public byte GetAttributeByte (OciAttributeType attrType, OciErrorHandle errorHandle)
{
int status = 0;
byte output;
status = OCIAttrGetByte (Handle,
HandleType,
out output,
IntPtr.Zero,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public ushort GetAttributeUInt16 (OciAttributeType attrType, OciErrorHandle errorHandle)
{
int status = 0;
ushort output;
status = OCIAttrGetUInt16 (Handle,
HandleType,
out output,
IntPtr.Zero,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public int GetAttributeInt32 (OciAttributeType attrType, OciErrorHandle errorHandle)
{
int status = 0;
int output;
status = OCIAttrGetInt32 (Handle,
HandleType,
out output,
IntPtr.Zero,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public string GetAttributeString (OciAttributeType attrType, OciErrorHandle errorHandle)
{
string output = String.Empty;
IntPtr outputPtr = IntPtr.Zero;
int outSize;
int status = 0;
status = OCIAttrGet (Handle,
HandleType,
out outputPtr,
out outSize,
attrType,
errorHandle);
if (status != 0) {
OciErrorInfo info = errorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
if (outputPtr != IntPtr.Zero && outSize > 0) {
object str = Marshal.PtrToStringAnsi (outputPtr, outSize);
if (str != null)
output = String.Copy ((string) str);
}
return output;
}
public void SetHandle (IntPtr h)
{
handle = h;
}
#endregion // Methods
#region Operators and Type Conversions
public static implicit operator IntPtr (OciHandle h)
{
return h.Handle;
}
#endregion // Operators and Type Conversions
}
}
@@ -35,6 +35,31 @@ namespace System.Data.OracleClient.Oci {
DirectPathContext = 0x0e,
DirectPathColumnArray = 0x0f,
DirectPathStream = 0x10,
Process = 0x11
Process = 0x11,
// Descriptor handles
LobLocator = 0x32,
Snapshot = 0x33,
ResultSet = 0x34,
Parameter = 0x35,
RowId = 0x36,
//ComplexObject = 0x37,
FileLobLocator = 0x38,
EnqueueOptions = 0x39,
DequeueOptions = 0x3a,
MessageProperties = 0x3b,
Agent = 0x3c,
Locator = 0x3d,
IntervalYearToMonth = 0x3e,
IntervalDayToSecond = 0x3f,
Notify = 0x40,
Date = 0x41,
Time = 0x42,
TimeWithTZ = 0x43,
TimeStamp = 0x44,
TimeStampWithTZ = 0x45,
TimeStampLocal = 0x46,
UserCallback = 0x47
}
}
@@ -16,25 +16,297 @@
//
using System;
using System.Data.OracleClient;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciLobLocator : OciDescriptorHandle, IOciDescriptorHandle, IDisposable
internal sealed class OciLobLocator : OciDescriptorHandle, IDisposable
{
#region Fields
bool disposed = false;
OciErrorHandle errorHandle;
OciServiceHandle service;
OciDataType type;
#endregion // Fields
#region Constructors
public OciLobLocator (OciEnvironmentHandle environment, IntPtr handle)
: base (OciDescriptorType.LobLocator, environment, handle)
public OciLobLocator (OciHandle parent, IntPtr handle)
: base (OciHandleType.LobLocator, parent, handle)
{
}
#endregion // Constructors
#region Properties
public OciErrorHandle ErrorHandle {
get { return errorHandle; }
set { errorHandle = value; }
}
public OciServiceHandle Service {
get { return service; }
set { service = value; }
}
public OciDataType LobType {
get { return type; }
set { type = value; }
}
#endregion // Properties
#region Methods
public void Dispose ()
[DllImport ("oci")]
static extern int OCILobClose (IntPtr svchp,
IntPtr errhp,
IntPtr locp);
[DllImport ("oci")]
static extern int OCILobCopy (IntPtr svchp,
IntPtr errhp,
IntPtr dst_locp,
IntPtr src_locp,
uint amount,
uint dst_offset,
uint src_offset);
[DllImport ("oci")]
static extern int OCILobErase (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
ref uint amount,
uint offset);
[DllImport ("oci")]
static extern int OCILobGetChunkSize (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
out uint chunk_size);
[DllImport ("oci")]
static extern int OCILobGetLength (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
out uint lenp);
[DllImport ("oci")]
static extern int OCILobOpen (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
byte mode);
[DllImport ("oci")]
static extern int OCILobRead (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
ref uint amtp,
uint offset,
byte[] bufp,
uint bufl,
IntPtr ctxp,
IntPtr cbfp,
ushort csid,
byte csfrm);
[DllImport ("oci")]
static extern int OCILobTrim (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
uint newlen);
[DllImport ("oci")]
static extern int OCILobWrite (IntPtr svchp,
IntPtr errhp,
IntPtr locp,
ref uint amtp,
uint offset,
byte[] bufp,
uint bufl,
byte piece,
IntPtr ctxp,
IntPtr cbfp,
ushort csid,
byte csfrm);
public void BeginBatch (OracleLobOpenMode mode)
{
Environment.FreeDescriptor (this);
int status = 0;
status = OCILobOpen (service.Handle,
errorHandle.Handle,
Handle,
(byte) mode);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public uint Copy (OciLobLocator destination, uint amount, uint destinationOffset, uint sourceOffset)
{
OCILobCopy (Service,
ErrorHandle,
destination,
Handle,
amount,
destinationOffset,
sourceOffset);
return amount;
}
protected override void Dispose (bool disposing)
{
if (!disposed) {
disposed = true;
base.Dispose ();
}
}
public void EndBatch ()
{
int status = 0;
status = OCILobClose (service.Handle,
errorHandle.Handle,
Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public uint Erase (uint offset, uint amount)
{
int status = 0;
uint output = amount;
status = OCILobErase (service.Handle,
errorHandle.Handle,
Handle,
ref output,
(uint) offset);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public int GetChunkSize ()
{
int status = 0;
uint output;
status = OCILobGetChunkSize (service.Handle,
errorHandle.Handle,
Handle,
out output);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return (int) output;
}
public long GetLength (bool binary)
{
int status = 0;
uint output;
status = OCILobGetLength (service.Handle,
errorHandle.Handle,
Handle,
out output);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
if (!binary)
output *= 2;
return (long) output;
}
public int Read (byte[] buffer, uint offset, uint count, bool binary)
{
int status = 0;
uint amount = count;
// Character types are UTF-16, so amount of characters is 1/2
// the amount of bytes
if (!binary)
amount /= 2;
status = OCILobRead (service.Handle,
errorHandle.Handle,
Handle,
ref amount,
offset,
buffer,
count,
IntPtr.Zero,
IntPtr.Zero,
1000, // OCI_UCS2ID
0); // Ignored if csid is specified as above
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return (int) amount;
}
public void Trim (uint newlen)
{
int status = 0;
status = OCILobTrim (service.Handle,
errorHandle.Handle,
Handle,
newlen);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public int Write (byte[] buffer, uint offset, uint count, OracleType type)
{
int status = 0;
uint amount = count;
if (type == OracleType.Clob)
amount /= 2;
status = OCILobWrite (service.Handle,
errorHandle.Handle,
Handle,
ref amount,
offset,
buffer,
count,
0, // OCI_ONE_PIECE
IntPtr.Zero,
IntPtr.Zero,
1000, // OCI_UCS2ID
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return (int) amount;
}
#endregion // Methods
@@ -0,0 +1,85 @@
//
// OciLobLocator.cs
//
// Part of managed C#/.NET library System.Data.OracleClient.dll
//
// Part of the Mono class libraries at
// mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
//
// Assembly: System.Data.OracleClient.dll
// Namespace: System.Data.OracleClient.Oci
//
// Author:
// Tim Coleman <[email protected]>
//
// Copyright (C) Tim Coleman, 2003
//
using System;
using System.Data.OracleClient;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciParameterDescriptor : OciDescriptorHandle
{
#region Fields
OciErrorHandle errorHandle;
OciServiceHandle service;
OciDataType type;
#endregion // Fields
#region Constructors
public OciParameterDescriptor (OciHandle parent, IntPtr handle)
: base (OciHandleType.Parameter, parent, handle)
{
}
#endregion // Constructors
#region Properties
public OciErrorHandle ErrorHandle {
get { return errorHandle; }
set { errorHandle = value; }
}
#endregion // Properties
#region Methods
public string GetName ()
{
return GetAttributeString (OciAttributeType.Name, ErrorHandle);
}
public int GetDataSize ()
{
return (int) GetAttributeUInt16 (OciAttributeType.DataSize, ErrorHandle);
}
public OciDataType GetDataType ()
{
return (OciDataType) GetAttributeInt32 (OciAttributeType.DataType, ErrorHandle);
}
public short GetPrecision ()
{
return (short) GetAttributeByte (OciAttributeType.Precision, ErrorHandle);
}
public short GetScale ()
{
return (short) GetAttributeSByte (OciAttributeType.Scale, ErrorHandle);
}
public bool GetIsNull ()
{
return GetAttributeBool (OciAttributeType.IsNull, ErrorHandle);
}
#endregion // Methods
}
}
@@ -19,11 +19,12 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciServerHandle : OciHandle, IOciHandle, IDisposable
internal sealed class OciServerHandle : OciHandle, IDisposable
{
#region Fields
bool attached;
bool disposed = false;
bool attached = false;
OciErrorHandle errorHandle;
string tnsname;
@@ -31,10 +32,9 @@ namespace System.Data.OracleClient.Oci {
#region Constructors
public OciServerHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Server, environment, handle)
public OciServerHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Server, parent, handle)
{
attached = false;
}
#endregion // Constructors
@@ -79,14 +79,17 @@ namespace System.Data.OracleClient.Oci {
return attached;
}
public void Dispose ()
protected override void Dispose (bool disposing)
{
if (attached) {
OCIServerDetach (Handle,
errorHandle.Handle,
0);
if (!disposed) {
try {
if (attached)
OCIServerDetach (Handle, errorHandle, 0);
disposed = true;
} finally {
base.Dispose (disposing);
}
}
Environment.FreeHandle (this);
}
#endregion // Methods
@@ -19,20 +19,22 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciServiceHandle : OciHandle, IOciHandle, IDisposable
internal sealed class OciServiceHandle : OciHandle
{
#region Fields
OciSessionHandle sessionHandle;
OciServerHandle serverHandle;
bool disposed = false;
OciSessionHandle session;
OciServerHandle server;
OciErrorHandle errorHandle;
#endregion // Fields
#region Constructors
public OciServiceHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Service, environment, handle)
public OciServiceHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Service, parent, handle)
{
}
@@ -49,34 +51,46 @@ namespace System.Data.OracleClient.Oci {
#region Methods
public void Dispose ()
protected override void Dispose (bool disposing)
{
Environment.FreeHandle (this);
if (!disposed) {
try {
if (disposing) {
if (server != null)
server.Dispose ();
if (session != null)
session.Dispose ();
}
disposed = true;
} finally {
base.Dispose (disposing);
}
}
}
public bool SetServer (OciServerHandle handle)
{
serverHandle = handle;
server = handle;
int status = 0;
status = OciGlue.OCIAttrSet (Handle,
HandleType,
serverHandle.Handle,
server,
0,
OciAttributeType.Server,
errorHandle.Handle);
errorHandle);
return (status == 0);
}
public bool SetSession (OciSessionHandle handle)
{
sessionHandle = handle;
session = handle;
int status = 0;
status = OciGlue.OCIAttrSet (Handle,
HandleType,
sessionHandle.Handle,
session,
0,
OciAttributeType.Session,
errorHandle.Handle);
errorHandle);
return (status == 0);
}
@@ -19,13 +19,14 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciSessionHandle : OciHandle, IOciHandle, IDisposable
internal sealed class OciSessionHandle : OciHandle, IDisposable
{
#region Fields
OciErrorHandle errorHandle;
OciServiceHandle serviceHandle;
bool begun;
bool begun = false;
bool disposed = false;
string username;
string password;
@@ -33,10 +34,9 @@ namespace System.Data.OracleClient.Oci {
#region Constructors
public OciSessionHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Session, environment, handle)
public OciSessionHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Session, parent, handle)
{
begun = false;
}
#endregion // Constructors
@@ -118,15 +118,21 @@ namespace System.Data.OracleClient.Oci {
return true;
}
public void Dispose ()
protected override void Dispose (bool disposing)
{
if (begun) {
OCISessionEnd (Service.Handle,
errorHandle.Handle,
Handle,
0);
if (!disposed) {
try {
if (begun) {
OCISessionEnd (Service.Handle,
errorHandle.Handle,
Handle,
0);
}
disposed = false;
} finally {
base.Dispose (disposing);
}
}
Environment.FreeHandle (this);
}
#endregion // Methods
@@ -20,7 +20,7 @@ using System.Collections;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciStatementHandle : OciHandle, IOciHandle, IDisposable
internal sealed class OciStatementHandle : OciHandle, IDisposable
{
#region Fields
@@ -32,6 +32,7 @@ namespace System.Data.OracleClient.Oci {
ArrayList values;
ArrayList parameters;
bool disposed = false;
bool moreResults;
int columnCount;
@@ -39,8 +40,8 @@ namespace System.Data.OracleClient.Oci {
#region Constructors
public OciStatementHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Statement, environment, handle)
public OciStatementHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Statement, parent, handle)
{
parameters = new ArrayList ();
language = OciStatementLanguage.NTV;
@@ -80,25 +81,41 @@ namespace System.Data.OracleClient.Oci {
#region Methods
[DllImport ("oci")]
public static extern int OCIDescriptorFree (IntPtr descp,
[MarshalAs (UnmanagedType.U4)] OciDescriptorType type);
static extern int OCIBindByName (IntPtr stmtp,
out IntPtr bindpp,
IntPtr errhp,
string placeholder,
int placeh_len,
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U4)] OciDataType dty,
ref int indp,
IntPtr alenp,
ushort rcodep,
uint maxarr_len,
IntPtr curelp,
uint mode);
[DllImport ("oci")]
public static extern int OCIParamGet (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType htype,
IntPtr errhp,
out IntPtr parmdpp,
[MarshalAs (UnmanagedType.U4)] int pos);
static extern int OCIDescriptorFree (IntPtr descp,
[MarshalAs (UnmanagedType.U4)] OciHandleType type);
[DllImport ("oci")]
public static extern int OCIStmtExecute (IntPtr svchp,
IntPtr stmthp,
IntPtr errhp,
[MarshalAs (UnmanagedType.U4)] bool iters,
uint rowoff,
IntPtr snap_in,
IntPtr snap_out,
[MarshalAs (UnmanagedType.U4)] OciExecuteMode mode);
static extern int OCIParamGet (IntPtr hndlp,
[MarshalAs (UnmanagedType.U4)] OciHandleType htype,
IntPtr errhp,
out IntPtr parmdpp,
[MarshalAs (UnmanagedType.U4)] int pos);
[DllImport ("oci")]
static extern int OCIStmtExecute (IntPtr svchp,
IntPtr stmthp,
IntPtr errhp,
[MarshalAs (UnmanagedType.U4)] bool iters,
uint rowoff,
IntPtr snap_in,
IntPtr snap_out,
[MarshalAs (UnmanagedType.U4)] OciExecuteMode mode);
[DllImport ("oci")]
public static extern int OCIStmtFetch (IntPtr stmtp,
@@ -116,7 +133,15 @@ namespace System.Data.OracleClient.Oci {
[MarshalAs (UnmanagedType.U4)] OciStatementLanguage language,
[MarshalAs (UnmanagedType.U4)] OciStatementMode mode);
public IntPtr CreateParameterHandle (int position)
protected override void Dispose (bool disposing)
{
if (!disposed) {
disposed = true;
base.Dispose (disposing);
}
}
public OciParameterDescriptor GetParameter (int position)
{
IntPtr handle = IntPtr.Zero;
int status = 0;
@@ -125,47 +150,88 @@ namespace System.Data.OracleClient.Oci {
OciHandleType.Statement,
ErrorHandle.Handle,
out handle,
position);
position + 1);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return handle;
OciParameterDescriptor output = new OciParameterDescriptor (this, handle);
output.ErrorHandle = ErrorHandle;
return output;
}
public void FreeBindHandle (IntPtr handle)
public OciDefineHandle GetDefineHandle (int position)
{
int status = 0;
OciDefineHandle defineHandle = new OciDefineHandle (this, IntPtr.Zero);
defineHandle.ErrorHandle = ErrorHandle;
defineHandle.DefineByPosition (position);
//status = OCIDescriptorFree (handle, OciDescriptorType.Parameter);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return defineHandle;
}
public void FreeParameterHandle (IntPtr handle)
public OciBindHandle GetBindHandle (string name, object val, OciDataType type)
{
IntPtr handle = IntPtr.Zero;
IntPtr value = IntPtr.Zero;
int indicator = 0;
string stringValue = val.ToString ();
int definedSize = 0;
int status = 0;
status = OCIDescriptorFree (handle, OciDescriptorType.Parameter);
if (val == DBNull.Value)
indicator = -1;
else
switch (type) {
case OciDataType.Number:
case OciDataType.Integer:
case OciDataType.Float:
case OciDataType.VarNum:
type = OciDataType.Char;
definedSize = stringValue.Length;
value = Marshal.StringToHGlobalAnsi (stringValue);
break;
case OciDataType.Date:
break;
default:
type = OciDataType.Char;
definedSize = stringValue.Length;
value = Marshal.StringToHGlobalAnsi (stringValue);
break;
}
status = OCIBindByName (Handle,
out handle,
ErrorHandle,
name,
name.Length,
value,
definedSize,
type,
ref indicator,
IntPtr.Zero,
0,
0,
IntPtr.Zero,
0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
OciBindHandle output = new OciBindHandle (this, handle);
output.Value = value;
return output;
}
void Define ()
{
values = new ArrayList ();
for (int i = 0; i < columnCount; i += 1)
values.Add (new OciDefineHandle (this, i + 1));
}
public void Dispose ()
{
Environment.FreeHandle (this);
values.Add (GetDefineHandle (i));
}
public bool ExecuteQuery ()
@@ -213,192 +279,12 @@ namespace System.Data.OracleClient.Oci {
void GetColumnCount ()
{
int status = 0;
status = OciGlue.OCIAttrGetInt32 ( Handle,
(uint) OciHandleType.Statement,
out columnCount,
IntPtr.Zero,
OciAttributeType.ParameterCount,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
}
public bool GetAttributeBool (IntPtr handle, OciAttributeType type)
{
bool output;
int status = 0;
status = OciGlue.OCIAttrGetBool (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public sbyte GetAttributeSByte (IntPtr handle, OciAttributeType type) {
sbyte output;
int status = 0;
status = OciGlue.OCIAttrGetSByte (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public byte GetAttributeByte (IntPtr handle, OciAttributeType type)
{
byte output;
int status = 0;
status = OciGlue.OCIAttrGetByte (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public ushort GetAttributeUInt16 (IntPtr handle, OciAttributeType type) {
int status = 0;
ushort output;
status = OciGlue.OCIAttrGetUInt16 (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
public int GetAttributeInt32 (IntPtr handle, OciAttributeType type)
{
int status = 0;
int output;
status = OciGlue.OCIAttrGetInt32 (handle,
(uint) OciDescriptorType.Parameter,
out output,
IntPtr.Zero,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return output;
}
[MonoTODO]
public string GetAttributeString (IntPtr handle, OciAttributeType type)
{
string output = String.Empty;
IntPtr outputPtr = IntPtr.Zero;
int outSize;
int status = 0;
status = OciGlue.OCIAttrGet (handle,
(uint) OciDescriptorType.Parameter,
out outputPtr,
out outSize,
type,
ErrorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
if (outputPtr != IntPtr.Zero && outSize > 0) {
object name = Marshal.PtrToStringAnsi (outputPtr, outSize);
if (name != null) {
output = String.Copy ((string) name);
/* TRWC
* We shouldn't really free this, but how can we make Oracle
* do it?
*/
// Marshal.FreeHGlobal (outputPtr); -- this *may* leak memory
}
}
return output;
}
[MonoTODO]
public OciColumnInfo DescribeColumn (int ordinal)
{
int status = 0;
OciColumnInfo columnInfo;
string schemaName;
IntPtr parameterHandle = CreateParameterHandle (ordinal + 1);
columnInfo.ColumnName = GetAttributeString (parameterHandle, OciAttributeType.Name);
columnInfo.ColumnOrdinal = ordinal + 1;
columnInfo.ColumnSize = GetAttributeUInt16 (parameterHandle, OciAttributeType.DataSize);
columnInfo.Precision = GetAttributeByte (parameterHandle, OciAttributeType.Precision);
columnInfo.Scale = GetAttributeSByte (parameterHandle, OciAttributeType.Scale);
columnInfo.DataType = (OciDataType) GetAttributeInt32 (parameterHandle, OciAttributeType.DataType);
columnInfo.AllowDBNull = GetAttributeBool (parameterHandle, OciAttributeType.IsNull);
columnInfo.BaseColumnName = GetAttributeString (parameterHandle, OciAttributeType.Name);
// TRWC not sure what to do with this yet.
schemaName = GetAttributeString (parameterHandle, OciAttributeType.SchemaName);
FreeParameterHandle (parameterHandle);
return columnInfo;
columnCount = GetAttributeInt32 (OciAttributeType.ParameterCount, ErrorHandle);
}
public OciStatementType GetStatementType ()
{
int status = 0;
int statementType;
status = OciGlue.OCIAttrGetInt32 (Handle,
(uint) OciHandleType.Statement,
out statementType,
IntPtr.Zero,
OciAttributeType.StatementType,
errorHandle.Handle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
}
return (OciStatementType) statementType;
return (OciStatementType) GetAttributeInt32 (OciAttributeType.StatementType, ErrorHandle);
}
public bool Fetch ()
@@ -19,10 +19,11 @@ using System;
using System.Runtime.InteropServices;
namespace System.Data.OracleClient.Oci {
internal sealed class OciTransactionHandle : OciHandle, IOciHandle, IDisposable
internal sealed class OciTransactionHandle : OciHandle, IDisposable
{
#region Fields
bool disposed = false;
OciErrorHandle errorHandle;
OciServiceHandle serviceHandle;
@@ -30,8 +31,8 @@ namespace System.Data.OracleClient.Oci {
#region Constructors
public OciTransactionHandle (OciEnvironmentHandle environment, IntPtr handle)
: base (OciHandleType.Transaction, environment, handle)
public OciTransactionHandle (OciHandle parent, IntPtr handle)
: base (OciHandleType.Transaction, parent, handle)
{
}
@@ -72,12 +73,12 @@ namespace System.Data.OracleClient.Oci {
public void AttachToServiceContext ()
{
int status = 0;
status = OciGlue.OCIAttrSet (Service.Handle,
status = OciGlue.OCIAttrSet (Service,
OciHandleType.Service,
Handle,
this,
0,
OciAttributeType.Transaction,
ErrorHandle.Handle);
ErrorHandle);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
@@ -90,10 +91,10 @@ namespace System.Data.OracleClient.Oci {
AttachToServiceContext ();
status = OCITransStart (Service.Handle,
ErrorHandle.Handle,
60,
OciTransactionFlags.New);
status = OCITransStart (Service,
ErrorHandle,
60,
OciTransactionFlags.New);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
@@ -105,9 +106,7 @@ namespace System.Data.OracleClient.Oci {
{
int status = 0;
AttachToServiceContext ();
status = OCITransCommit (Service.Handle,
ErrorHandle.Handle,
0);
status = OCITransCommit (Service, ErrorHandle, 0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
@@ -115,18 +114,19 @@ namespace System.Data.OracleClient.Oci {
}
}
public void Dispose ()
protected override void Dispose (bool disposing)
{
Environment.FreeHandle (this);
if (!disposed) {
disposed = true;
base.Dispose (disposing);
}
}
public void Rollback ()
{
int status = 0;
AttachToServiceContext ();
status = OCITransRollback (Service.Handle,
ErrorHandle.Handle,
0);
status = OCITransRollback (Service, ErrorHandle, 0);
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
@@ -67,54 +67,6 @@ namespace System.Data.OracleClient.Oci {
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci")]
public static extern int OCIAttrGet (IntPtr trgthndlp,
uint trghndltyp,
out IntPtr attributep,
out int sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetBool (IntPtr trgthndlp,
uint trghndltyp,
out bool attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetSByte (IntPtr trgthndlp,
uint trghndltyp,
out sbyte attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetByte (IntPtr trgthndlp,
uint trghndltyp,
out byte attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetUInt16 (IntPtr trgthndlp,
uint trghndltyp,
out ushort attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci", EntryPoint = "OCIAttrGet")]
public static extern int OCIAttrGetInt32 (IntPtr trgthndlp,
uint trghndltyp,
out int attributep,
IntPtr sizep,
[MarshalAs (UnmanagedType.U4)] OciAttributeType attrtype,
IntPtr errhp);
[DllImport ("oci")]
public static extern int OCIErrorGet (IntPtr hndlp,
uint recordno,
@@ -178,7 +178,10 @@ namespace System.Data.OracleClient
public void Close ()
{
oci.Disconnect();
if (transaction != null)
transaction.Rollback ();
oci.Disconnect ();
state = ConnectionState.Closed;
}
@@ -267,8 +267,7 @@ namespace System.Data.OracleClient {
public string GetName (int i)
{
OciColumnInfo columnInfo = statement.DescribeColumn (i);
return columnInfo.ColumnName;
return statement.GetParameter (i).GetName ();
}
[MonoTODO]
@@ -283,10 +282,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)
@@ -314,18 +314,19 @@ namespace System.Data.OracleClient {
for (int i = 0; i < statement.ColumnCount; i += 1) {
DataRow row = schemaTable.NewRow ();
OciColumnInfo columnInfo = statement.DescribeColumn (i);
row ["ColumnName"] = columnInfo.ColumnName;
row ["ColumnOrdinal"] = i + 1;
row ["ColumnSize"] = (int) columnInfo.ColumnSize;
row ["NumericPrecision"] = (short) columnInfo.Precision;
row ["NumericScale"] = (short) columnInfo.Scale;
OciParameterDescriptor parameter = statement.GetParameter (i);
row ["ColumnName"] = parameter.GetName ();
row ["ColumnOrdinal"] = i + 1;
row ["ColumnSize"] = parameter.GetDataSize ();
row ["NumericPrecision"] = parameter.GetPrecision ();
row ["NumericScale"] = parameter.GetScale ();
// FIXME: "DataType" need to implement
//row ["DataType"] = OciGlue.OciDataTypeToDbType (columnInfo.DataType);
row ["DataType"] = typeof(string);
row ["AllowDBNull"] = columnInfo.AllowDBNull;
row ["BaseColumnName"] = columnInfo.BaseColumnName;
row ["DataType"] = typeof(string);
row ["AllowDBNull"] = parameter.GetIsNull ();
row ["BaseColumnName"] = parameter.GetName ();
schemaTable.Rows.Add (row);
}
@@ -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
@@ -65,11 +79,9 @@ namespace System.Data.OracleClient {
public int ChunkSize {
[MonoTODO]
get {
if (Connection.State == ConnectionState.Closed)
throw new InvalidOperationException ();
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
throw new InvalidOperationException ();
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
return locator.GetChunkSize ();
}
}
@@ -87,60 +99,55 @@ namespace System.Data.OracleClient {
public bool IsTemporary {
get {
if (Connection.State == ConnectionState.Closed)
throw new InvalidOperationException ();
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
throw new NotImplementedException ();
}
}
public override long Length {
[MonoTODO]
get {
if (Connection.State == ConnectionState.Closed)
throw new InvalidOperationException ();
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
throw new NotImplementedException ();
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
if (length >= 0)
return length;
return locator.GetLength (LobType == OracleType.Blob);
}
}
public OracleType LobType {
[MonoTODO]
get {
throw new NotImplementedException ();
}
get { return type; }
}
internal OciLobLocator Locator {
get { return locator; }
}
public override long Position {
[MonoTODO]
get {
if (Connection.State == ConnectionState.Closed)
throw new InvalidOperationException ();
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
throw new NotImplementedException ();
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
return position;
}
[MonoTODO]
set {
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
if (value > Length)
throw new ArgumentOutOfRangeException ();
throw new NotImplementedException ();
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
position = value;
}
}
public object Value {
[MonoTODO]
get {
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
AssertObjectNotDisposed ();
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;
}
}
@@ -158,14 +165,49 @@ namespace System.Data.OracleClient {
throw new NotImplementedException ();
}
void AssertAmountIsEven (long amount, string argName)
{
if (amount % 2 == 1)
throw new ArgumentOutOfRangeException ("CLOB and NCLOB parameters require even number of bytes for this argument.");
}
void AssertAmountIsValid (long amount, string argName)
{
if (amount > UInt32.MaxValue)
throw new ArgumentOutOfRangeException ("Argument too big.");
if (LobType == OracleType.Clob || LobType == OracleType.NClob)
AssertAmountIsEven (amount, argName);
}
void AssertConnectionIsOpen ()
{
if (connection.State == ConnectionState.Closed)
throw new InvalidOperationException ("Invalid operation. The connection is closed.");
}
void AssertObjectNotDisposed ()
{
if (!isOpen)
throw new ObjectDisposedException ("OracleLob");
}
void AssertTransactionExists ()
{
if (connection.Transaction == null)
throw new InvalidOperationException ("Modifying a LOB requires that the connection be transacted.");
}
public void BeginBatch ()
{
BeginBatch (OracleLobOpenMode.ReadOnly);
}
[MonoTODO]
public void BeginBatch (OracleLobOpenMode mode)
{
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
locator.BeginBatch (mode);
isBatched = true;
}
@@ -178,25 +220,32 @@ namespace System.Data.OracleClient {
[MonoTODO]
public override void Close ()
{
throw new NotImplementedException ();
locator.Dispose ();
isOpen = false;
}
[MonoTODO]
public long CopyTo (OracleLob destination)
{
throw new NotImplementedException ();
return CopyTo (0, destination, 0, Length);
}
[MonoTODO]
public long CopyTo (OracleLob destination, long destinationOffset)
{
throw new NotImplementedException ();
return CopyTo (0, destination, destinationOffset, Length);
}
[MonoTODO]
public long CopyTo (long sourceOffset, OracleLob destination, long destinationOffset, long amount)
{
throw new NotImplementedException ();
if (destination.IsNull)
throw new ArgumentNullException ();
AssertAmountIsValid (sourceOffset, "sourceOffset");
AssertAmountIsValid (destinationOffset, "destinationOffset");
AssertAmountIsValid (amount, "amount");
AssertTransactionExists ();
AssertConnectionIsOpen ();
return (long) locator.Copy (destination.Locator, (uint) amount, (uint) destinationOffset + 1, (uint) sourceOffset + 1);
}
[MonoTODO]
@@ -205,51 +254,116 @@ namespace System.Data.OracleClient {
throw new NotImplementedException ();
}
[MonoTODO]
public void EndBatch ()
{
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
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 || amount < 0)
throw new ArgumentOutOfRangeException ("Must be a positive value.");
if (offset + amount > Length)
throw new ArgumentOutOfRangeException ();
AssertAmountIsValid (offset, "offset");
AssertAmountIsValid (amount, "amount");
return (long) locator.Erase ((uint) offset + 1, (uint) amount);
}
[MonoTODO]
public override void Flush ()
{
throw new NotImplementedException ();
// No-op
}
[MonoTODO]
public override int Read (byte[] buffer, int offset, int count)
{
throw new NotImplementedException ();
if (buffer == null)
throw new ArgumentNullException ();
AssertAmountIsValid (offset, "offset");
AssertAmountIsValid (count, "count");
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
int bytesRead;
byte[] output = new byte[count];
bytesRead = locator.Read (output, (uint) Position, (uint) count, LobType == OracleType.Blob);
output.CopyTo (buffer, offset);
position += bytesRead;
return bytesRead;
}
[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 ();
AssertAmountIsValid (value, "value");
AssertTransactionExists ();
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
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 || count < 0)
throw new ArgumentOutOfRangeException ("Must be a positive value.");
if (offset + count > buffer.Length)
throw new ArgumentOutOfRangeException ("The offset and count values specified exceed the buffer provided.");
AssertAmountIsValid (offset, "offset");
AssertAmountIsValid (count, "count");
AssertTransactionExists ();
AssertConnectionIsOpen ();
AssertObjectNotDisposed ();
byte[] value = null;
if (offset + count == buffer.Length && offset == 0)
value = buffer;
else {
value = new byte[count];
Array.Copy (buffer, offset, value, 0, count);
}
position += locator.Write (value, (uint) offset, (uint) value.Length, LobType);
}
#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)
@@ -28,6 +28,7 @@ namespace System.Data.OracleClient {
string name;
OracleType oracleType = OracleType.VarChar;
OciDataType ociType;
int size;
ParameterDirection direction;
bool isNullable;
@@ -54,7 +55,6 @@ namespace System.Data.OracleClient {
public OracleParameter (string name, object value)
{
bindHandle = new OciBindHandle (name);
this.name = name;
this.value = value;
SourceVersion = DataRowVersion.Current;
@@ -78,7 +78,6 @@ namespace System.Data.OracleClient {
public OracleParameter (string name, OracleType dataType, int size, ParameterDirection direction, bool isNullable, byte precision, byte scale, string srcColumn, DataRowVersion srcVersion, object value)
{
bindHandle = new OciBindHandle (name);
this.name = name;
this.size = size;
this.value = value;
@@ -124,8 +123,8 @@ namespace System.Data.OracleClient {
}
public string ParameterName {
get { return bindHandle.Name; }
set { bindHandle.Name = value; }
get { return name; }
set { name = value; }
}
public byte Precision {
@@ -167,7 +166,7 @@ namespace System.Data.OracleClient {
internal void Bind (OciStatementHandle handle)
{
bindHandle.Bind (handle, value);
bindHandle = handle.GetBindHandle (ParameterName, value, ociType);
}
[MonoTODO]
@@ -225,61 +224,61 @@ namespace System.Data.OracleClient {
switch (type) {
case DbType.AnsiString:
oracleType = OracleType.VarChar;
bindHandle.Type = OciDataType.VarChar;
ociType = OciDataType.VarChar;
break;
case DbType.AnsiStringFixedLength:
oracleType = OracleType.Char;
bindHandle.Type = OciDataType.Char;
ociType = OciDataType.Char;
break;
case DbType.Binary:
case DbType.Guid:
oracleType = OracleType.Raw;
bindHandle.Type = OciDataType.Raw;
ociType = OciDataType.Raw;
break;
case DbType.Boolean:
case DbType.Byte:
oracleType = OracleType.Byte;
bindHandle.Type = OciDataType.Integer;
ociType = OciDataType.Integer;
break;
case DbType.Currency:
case DbType.Decimal:
case DbType.Int64:
oracleType = OracleType.Number;
bindHandle.Type = OciDataType.Number;
ociType = OciDataType.Number;
break;
case DbType.Date:
case DbType.DateTime:
case DbType.Time:
oracleType = OracleType.DateTime;
bindHandle.Type = OciDataType.Char;
ociType = OciDataType.Char;
break;
case DbType.Double:
oracleType = OracleType.Double;
bindHandle.Type = OciDataType.Float;
ociType = OciDataType.Float;
break;
case DbType.Int16:
oracleType = OracleType.Int16;
bindHandle.Type = OciDataType.Integer;
ociType = OciDataType.Integer;
break;
case DbType.Int32:
oracleType = OracleType.Int32;
bindHandle.Type = OciDataType.Integer;
ociType = OciDataType.Integer;
break;
case DbType.Object:
oracleType = OracleType.Blob;
bindHandle.Type = OciDataType.Blob;
ociType = OciDataType.Blob;
break;
case DbType.Single:
oracleType = OracleType.Float;
bindHandle.Type = OciDataType.Float;
ociType = OciDataType.Float;
break;
case DbType.String:
oracleType = OracleType.NVarChar;
bindHandle.Type = OciDataType.VarChar;
ociType = OciDataType.VarChar;
break;
case DbType.StringFixedLength:
oracleType = OracleType.NChar;
bindHandle.Type = OciDataType.Char;
ociType = OciDataType.Char;
break;
default:
throw new ArgumentException (exception);
@@ -297,76 +296,76 @@ namespace System.Data.OracleClient {
case OracleType.LongRaw:
case OracleType.Raw:
dbType = DbType.Binary;
bindHandle.Type = OciDataType.Raw;
ociType = OciDataType.Raw;
break;
case OracleType.Byte:
dbType = DbType.Byte;
bindHandle.Type = OciDataType.Integer;
ociType = OciDataType.Integer;
break;
case OracleType.Char:
dbType = DbType.AnsiStringFixedLength;
bindHandle.Type = OciDataType.Char;
ociType = OciDataType.Char;
break;
case OracleType.Clob:
case OracleType.LongVarChar:
case OracleType.RowId:
case OracleType.VarChar:
dbType = DbType.AnsiString;
bindHandle.Type = OciDataType.VarChar;
ociType = OciDataType.VarChar;
break;
case OracleType.Cursor:
case OracleType.IntervalDayToSecond:
dbType = DbType.Object;
bindHandle.Type = OciDataType.Blob;
ociType = OciDataType.Blob;
break;
case OracleType.DateTime:
case OracleType.Timestamp:
case OracleType.TimestampLocal:
case OracleType.TimestampWithTZ:
dbType = DbType.DateTime;
bindHandle.Type = OciDataType.Char;
ociType = OciDataType.Char;
break;
case OracleType.Double:
dbType = DbType.Double;
bindHandle.Type = OciDataType.Float;
ociType = OciDataType.Float;
break;
case OracleType.Float:
dbType = DbType.Single;
bindHandle.Type = OciDataType.Float;
ociType = OciDataType.Float;
break;
case OracleType.Int16:
dbType = DbType.Int16;
bindHandle.Type = OciDataType.Integer;
ociType = OciDataType.Integer;
break;
case OracleType.Int32:
case OracleType.IntervalYearToMonth:
dbType = DbType.Int32;
bindHandle.Type = OciDataType.Integer;
ociType = OciDataType.Integer;
break;
case OracleType.NChar:
dbType = DbType.StringFixedLength;
bindHandle.Type = OciDataType.Char;
ociType = OciDataType.Char;
break;
case OracleType.NClob:
case OracleType.NVarChar:
dbType = DbType.String;
bindHandle.Type = OciDataType.VarChar;
ociType = OciDataType.VarChar;
break;
case OracleType.Number:
dbType = DbType.VarNumeric;
bindHandle.Type = OciDataType.Number;
ociType = OciDataType.Number;
break;
case OracleType.SByte:
dbType = DbType.SByte;
bindHandle.Type = OciDataType.Integer;
ociType = OciDataType.Integer;
break;
case OracleType.UInt16:
dbType = DbType.UInt16;
bindHandle.Type = OciDataType.Integer;
ociType = OciDataType.Integer;
break;
case OracleType.UInt32:
dbType = DbType.UInt32;
bindHandle.Type = OciDataType.Integer;
ociType = OciDataType.Integer;
break;
default:
throw new ArgumentException (exception);
@@ -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
View File
@@ -1,12 +1,9 @@
System.Data.OracleClient.Oci/IOciHandle.cs
System.Data.OracleClient.Oci/IOciDescriptorHandle.cs
System.Data.OracleClient.Oci/OciAttributeType.cs
System.Data.OracleClient.Oci/OciBindHandle.cs
System.Data.OracleClient.Oci/OciColumnInfo.cs
System.Data.OracleClient.Oci/OciCredentialType.cs
System.Data.OracleClient.Oci/OciDataType.cs
System.Data.OracleClient.Oci/OciDefineHandle.cs
System.Data.OracleClient.Oci/OciDescriptorType.cs
System.Data.OracleClient.Oci/OciDescriptorHandle.cs
System.Data.OracleClient.Oci/OciEnvironmentHandle.cs
System.Data.OracleClient.Oci/OciEnvironmentMode.cs
@@ -17,6 +14,7 @@ System.Data.OracleClient.Oci/OciHandle.cs
System.Data.OracleClient.Oci/OciHandleType.cs
System.Data.OracleClient.Oci/OciLobLocator.cs
System.Data.OracleClient.Oci/OciLobType.cs
System.Data.OracleClient.Oci/OciParameterDescriptor.cs
System.Data.OracleClient.Oci/OciPointerType.cs
System.Data.OracleClient.Oci/OciServerHandle.cs
System.Data.OracleClient.Oci/OciServiceHandle.cs
@@ -1,3 +1,26 @@
2003-02-28 Aleksey Demakov <[email protected]>
* DbDataAdapter.cs: Update (DataSet) updates the default
table only.
2003-02-25 Alan Tam <[email protected]>
* DbDataAdapter.cs: Added support for filling when schema is present.
Fixed incorrect behavior when ColumnMapping is present
when more than one fields have the same name. Implemented Dispose.
Fixed error when there is no ColumnMapping at all.
Still have some problems in finding the correct TableMapping
because the SourceTable name is not present in BuildSchema
2003-02-24 Aleksey Demakov <[email protected]>
* DbDataAdapter.cs: The original code might pass a null DataTableMapping
value which is then used to create a RowUpdatingEventArgs
instance. So RowUpdatingEvent handler (for instance
CommandBuilder) could get null DataTableMapping which
might be unexpected. The patch makes sure that a non-null
DataTableMapping is passed.
2003-01-26 Gonzalo Paniagua Javier <[email protected]>
* DbEnumerator.cs: why does the runtime throw an invalid cast here? The
@@ -74,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"]))
@@ -356,10 +362,7 @@ namespace System.Data.Common {
public override int Update (DataSet dataSet)
{
int result = 0;
foreach (DataTable table in dataSet.Tables)
result += Update (table);
return result;
return Update (dataSet, DefaultSourceTableName);
}
public int Update (DataTable dataTable)
@@ -427,7 +430,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 +452,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,7 @@
2003-03-04 Gonzalo Paniagua Javier <[email protected]>
* SqlException.cs: implemented GetObjectData ().
2003-02-16 Daniel Morgan <[email protected]>
* ChangeLog: added this file
@@ -99,10 +99,13 @@ namespace System.Data.SqlClient {
return new SqlException (e.Class, e.LineNumber, e.Message, e.Number, e.Procedure, e.Server, "Mono SqlClient Data Provider", e.State);
}
[MonoTODO ("Determine how to serialize this class.")]
public override void GetObjectData (SerializationInfo si, StreamingContext context)
{
throw new NotImplementedException ();
if (si == null)
throw new ArgumentNullException ("si");
si.AddValue ("errors", errors);
base.GetObjectData (si, context);
}
#endregion // Methods
@@ -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.")]
+38 -2
View File
@@ -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]);
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -13,13 +13,69 @@ namespace System.Drawing.Drawing2D
/// <summary>
/// Summary description for AdjustableArrowCap.
/// </summary>
public class AdjustableArrowCap
public sealed class AdjustableArrowCap : CustomLineCap
{
public AdjustableArrowCap()
{
//
// TODO: Add constructor logic here
//
private bool isFilled;
private float height;
private float width;
private float middleInset;
//Constructors
public AdjustableArrowCap(float width, float height, bool isFilled) {
this.isFilled = isFilled;
this.height = height;
this.width = width;
middleInset = 0;
}
public AdjustableArrowCap(float width, float height) {
isFilled = true;
this.height = height;
this.width = width;
middleInset = 0;
//AdjustableArrowCap(width, height, true);
}
//Public Properities
[MonoTODO] //redraw on set
public bool Filled {
get {
return isFilled;
}
set {
isFilled = value;
//Redraw!
}
}
[MonoTODO] //redraw on set
public float Width {
get {
return width;
}
set {
width = value;
//Redraw!
}
}
[MonoTODO] //redraw on set
public float Height {
get {
return height;
}
set {
height = value;
//Redraw!
}
}
[MonoTODO] //redraw on set
public float MiddleInset {
get {
return middleInset;
}
set {
middleInset = value;
//Redraw!
}
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -13,13 +13,71 @@ namespace System.Drawing.Drawing2D
/// <summary>
/// Summary description for Blend.
/// </summary>
public class Blend
public sealed class Blend
{
public Blend()
{
//
// TODO: Add constructor logic here
//
private int count;
private float [] positions;
private float [] factors;
public Blend(int count) {
this.count = count;
if(count < 2){
throw new ArgumentOutOfRangeException("Count", count, "Must be at least 2");
}
if(count == 2){
//FIXME: call Blend!
count = 2;
positions = new float [1];
factors = new float [1];
positions[0] = 0.0F;
positions[1] = 1.0F;
factors[0] = 0.0F;
factors[1] = 1.0F;
}
int i;
for(i = 0; i < count; i++){
positions[i] = (1.0F/count) * i;
factors[i] = (1.0F/count) * i;
}
//fix any rounding errors that would generate an invald list.
positions[0] = 0.0F;
positions[1] = 1.0F;
factors[0] = 0.0F;
factors[1] = 1.0F;
}
public Blend() {
count = 2;
positions = new float [1];
factors = new float [1];
positions[0] = 0.0F;
positions[1] = 1.0F;
factors[0] = 0.0F;
factors[1] = 1.0F;
}
public float [] Factors{
get {
return factors;
}
set{
count = value.GetUpperBound(0) + 1;
if((value[0] !=0) | (value[count-1] != 1.0F)){
throw new ArgumentException(" First value must be 0.0, last value must be 1.0","Factors");
}
factors = value;
}
}
public float [] Positions{
get {
return Positions;
}
set{
count = value.GetUpperBound(0) + 1;
if((value[0] !=0) | (value[count-1] != 1.0F)){
throw new ArgumentException(" First value must be 0.0, last value must be 1.0","Positon");
}
positions = value;
}
}
}
}
@@ -1,3 +1,15 @@
2003-3-5 DennisHayes <[email protected]>
* Added values for enums
* Stubbed and somewhat implmented Blend, ColorBlend, CustomLineCap
2003-3-2 DennisHayes <[email protected]>
* Created changelog
* updated copyrights to 2002/3
* changed namespace from System.Drawing, System.Drawing.Drawing2d to System.Drawing.Drawing2D
* cosmetic improvments
2002-10-13 DennisHayes <[email protected]>
* Changed namespace from *2d to *2D
* Changed comment header from system.Drawing to System.Drawing.Drawing2D
@@ -56,4 +68,4 @@
* Matrix.cs : MonoTODO everywhere.
* TODOAttribute.cs : Add here too.
* TODOAttribute.cs : Add here too.
@@ -4,22 +4,77 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
namespace System.Drawing.Drawing2D
{
/// <summary>
/// Summary description for ColorBlend.
/// </summary>
public class ColorBlend
{
public ColorBlend()
{
//
// TODO: Add constructor logic here
//
public sealed class ColorBlend {
private int count;
private float [] positions;
private Color [] colors;
public ColorBlend(int count) {
//FIXME:
if(count < 2){
throw new ArgumentOutOfRangeException("Count", count, "Must be at least 2");
}
if(count == 2){
//FIXME: call ColorBlend!
count = 2;
positions = new float [1];
colors = new Color [1];
positions[0] = 0.0F;
positions[1] = 1.0F;
colors[0] = Color.FromArgb(0,0,0);
colors[1] = Color.FromArgb(255,255,255);
}
this.count = count;
int i;
for(i = 0; i < count; i++){
positions[i] = (1.0F/count) * i;
//FIXME: Do real default color blend
//FIXME: I used 254 to prevent overflow, should use 255, if anyone cares?
colors[i] = Color.FromArgb((1/count) * i * 254,(1/count) * i * 254,(1/count) * i * 254);
}
//fix any rounding errors that would generate an invald list.
positions[0] = 0.0F;
positions[1] = 1.0F;
colors[0] = Color.FromArgb(0,0,0);
colors[1] = Color.FromArgb(255,255,255);
}
public ColorBlend() {
count = 2;
positions = new float [1];
colors = new Color [1];
positions[0] = 0.0F;
positions[1] = 1.0F;
colors[0] = Color.FromArgb(0,0,0);
colors[1] = Color.FromArgb(255,255,255);
}
public Color [] Colors{
get {
return colors;
}
set{
count = value.GetUpperBound(0) + 1;
colors = value;
}
}
public float [] Positions{
get {
return Positions;
}
set{
count = value.GetUpperBound(0) + 1;
positions = value;
}
}
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -17,9 +17,9 @@ namespace System.Drawing.Drawing2D {
{
Complement = 5,
Exclude = 4,
Intersect =4,
Intersect = 1,
Replace = 0,
Union = 2,
Xor =3
Xor = 3
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -13,9 +13,8 @@ namespace System.Drawing.Drawing2D {
/// <summary>
/// Summary description for CompostingMode.
/// </summary>
public enum CompositingMode {
SourceCopy,
SourceOver
}
public enum CompositingMode {
SourceCopy = 1,
SourceOver = 0
}
}
@@ -1,11 +1,11 @@
//
// System.Drawing.CompostingQuality.cs
// System.Drawing.Drawing2D.CompostingQuality.cs
//
// Author:
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,11 +14,11 @@ namespace System.Drawing.Drawing2D {
/// Summary description for CompostingQuality.
/// </summary>
public enum CompositingQuality {
AssumeLinear,
Default,
GammaCorrected,
HighQuality,
HighSpeed,
Invalid
AssumeLinear = 4,
Default = 0,
GammaCorrected = 3,
HighQuality = 2,
HighSpeed = 1,
Invalid = -1
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,8 +14,8 @@ namespace System.Drawing.Drawing2D {
/// Summary description for CoordinateSpace.
/// </summary>
public enum CoordinateSpace {
Device,
Page,
World
Device = 2,
Page = 1,
World = 0
}
}
@@ -4,22 +4,25 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
namespace System.Drawing.Drawing2D
{
namespace System.Drawing.Drawing2D {
/// <summary>
/// Summary description for CustomLineCap.
/// </summary>
public class CustomLineCap
{
public CustomLineCap()
{
//
// TODO: Add constructor logic here
//
public class CustomLineCap {// : MarshalByRefObject, ICloneable, IDisposable {
protected CustomLineCap() {
}
public CustomLineCap(GraphicsPath fillPAth, GraphicsPath strokePAth, LineCap baseCap, float baseInset) {
}
public CustomLineCap(GraphicsPath fillPAth, GraphicsPath strokePAth, LineCap baseCap) {
}
public CustomLineCap(GraphicsPath fillPAth, GraphicsPath strokePAth) {
}
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,11 +14,11 @@ namespace System.Drawing.Drawing2D
/// Summary description for DashStyle.
/// </summary>
public enum DashStyle {
Custom,
Dash,
DashDot,
DashDotDot,
Dot,
Solid
Custom = 5,
Dash = 1,
DashDot = 3,
DashDotDot = 4,
Dot = 2,
Solid = 0
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -15,7 +15,7 @@ namespace System.Drawing.Drawing2D {
/// Summary description for FillMode.
/// </summary>
public enum FillMode {
Alternate,
Winding
Alternate = 0,
Winding = 1
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,7 +14,7 @@ namespace System.Drawing.Drawing2D {
/// Summary description for FlushIntention.
/// </summary>
public enum FlushIntention {
Flush,
Sync
Flush = 0,
Sync = 1
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -17,9 +17,6 @@ namespace System.Drawing.Drawing2D
{
public GraphicsContainer()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
namespace System.Drawing.Drawing2D
@@ -15,8 +15,8 @@ namespace System.Drawing.Drawing2D
public sealed class GraphicsPath //: MarshalByRefObject, ICloneable, IDisposable
{
//[MonoTODO]
public GraphicsPath() {
}
//public GraphicsPath() {
//}
//[MonoTODO]
//public GraphicsPath(FillMode fillMode) : this() {
//}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -17,9 +17,6 @@ namespace System.Drawing.Drawing2D
{
public GraphicsPathIterator()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -17,9 +17,6 @@ namespace System.Drawing.Drawing2D
{
public GraphicsState()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -17,9 +17,6 @@ namespace System.Drawing.Drawing2D
{
public HatchBrush()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,62 +14,62 @@ namespace System.Drawing.Drawing2D {
/// <summary>
/// Summary description for HatchStyle.
/// </summary>
public enum HatchStyle {
BackwardDiagonal,
Cross,
DarkDownwardDiagonal,
DarkHorizontal,
DarkUpwardDiagonal,
DarkVertical,
DashedDownwardDiagonal,
DashedHorizontal,
DashedUpwardDiagonal,
DashedVertical,
DiagonalBrick,
DiagonalCross,
Divot,
DottedDiamond,
DottedGrid,
ForwardDiagonal,
Horizontal,
HorizontalBrick,
LargeCheckerBoard,
LargeConfetti,
LargeGrid,
LightDownwardDiagonal,
LightHorizontal,
LightUpwardDiagonal,
LightVertical,
Max,
Min,
NarrowHorizontal,
NarrowVertical,
OutlinedDiamond,
Percent05,
Percent10,
Percent20,
Percent25,
Percent30,
Percent40,
Percent50,
Percent60,
Percent70,
Percent75,
Percent80,
Percent90,
Plaid,
Shingle,
SmallCheckerBoard,
SmallConfetti,
SmallGrid,
SolidDiamond,
Sphere,
Trellis,
Vertical,
Wave,
Weave,
WideDownwardDiagonal,
WideUpwardDiagonal,
ZigZag
}
public enum HatchStyle {
BackwardDiagonal = 3,
Cross = 4,
DarkDownwardDiagonal = 20,
DarkHorizontal = 29,
DarkUpwardDiagonal = 21,
DarkVertical = 28,
DashedDownwardDiagonal = 30,
DashedHorizontal = 32,
DashedUpwardDiagonal = 31,
DashedVertical = 33,
DiagonalBrick = 38,
DiagonalCross = 5,
Divot = 42,
DottedDiamond = 44,
DottedGrid = 43,
ForwardDiagonal = 2,
Horizontal = 0,
HorizontalBrick = 39,
LargeCheckerBoard = 50,
LargeConfetti = 35,
LargeGrid = 4,
LightDownwardDiagonal = 18,
LightHorizontal = 25,
LightUpwardDiagonal = 19,
LightVertical = 24,
Max = 4,
Min = 0,
NarrowHorizontal = 27,
NarrowVertical = 26,
OutlinedDiamond = 51,
Percent05 = 6,
Percent10 = 7,
Percent20 = 8,
Percent25 = 9,
Percent30 = 10,
Percent40 = 11,
Percent50 = 12,
Percent60 = 13,
Percent70 = 14,
Percent75 = 15,
Percent80 = 16,
Percent90 = 17,
Plaid = 41,
Shingle = 45,
SmallCheckerBoard = 49,
SmallConfetti = 34,
SmallGrid = 48,
SolidDiamond = 52,
Sphere = 47,
Trellis = 46,
Vertical = 1,
Wave = 37,
Weave = 40,
WideDownwardDiagonal = 22,
WideUpwardDiagonal = 21,
ZigZag = 36
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,14 +14,14 @@ namespace System.Drawing.Drawing2D {
/// Summary description for InterpolationMode.
/// </summary>
public enum InterpolationMode {
Bicubic,
Bilinear,
Default,
High,
HighQualityBicubic,
HighQualityBilinear,
Invalid,
Low,
NearestNeighbour
Bicubic = 4,
Bilinear = 3,
Default = 0,
High = 2,
HighQualityBicubic = 7,
HighQualityBilinear = 6,
Invalid = -1,
Low = 1,
NearestNeighbour = 5
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,16 +14,16 @@ namespace System.Drawing.Drawing2D {
/// Summary description for LineCap.
/// </summary>
public enum LineCap {
AnchorMask,
ArrowAnchor,
Custom,
DiamondAnchor,
Flat,
NoAnchor,
Round,
RoundAnchor,
Square,
SquareAnchor,
Triangle
AnchorMask = 240,
ArrowAnchor = 20,
Custom = 255,
DiamondAnchor = 19,
Flat = 0,
NoAnchor = 16,
Round = 2,
RoundAnchor = 18,
Square = 1,
SquareAnchor = 17,
Triangle = 3
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,9 +14,9 @@ namespace System.Drawing.Drawing2D {
/// Summary description for LineJoin.
/// </summary>
public enum LineJoin {
Bevel,
Miter,
MiterClipped,
Round
Bevel = 1,
Miter = 0,
MiterClipped = 3,
Round = 2
}
}
@@ -4,11 +4,11 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
namespace System.Drawing.Drawing2D
namespace System.Drawing2D
{
/// <summary>
/// Summary description for LinearGradientBrush.
@@ -17,9 +17,6 @@ namespace System.Drawing.Drawing2D
{
public LinearGradientBrush()
{
//
// TODO: Add constructor logic here
//
}
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,9 +14,9 @@ namespace System.Drawing.Drawing2D {
/// Summary description for LinearGradientMode.
/// </summary>
public enum LinearGradientMode {
BackwardDiagonal,
ForwardDiagonal,
Horizontal,
Vertical
BackwardDiagonal = 3,
ForwardDiagonal = 2,
Horizontal = 0,
Vertical = 1
}
}
@@ -5,7 +5,7 @@
// Stefan Maierhofer <[email protected]>
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -14,7 +14,7 @@ namespace System.Drawing.Drawing2D {
/// Summary description for MatrixOrder.
/// </summary>
public enum MatrixOrder {
Append,
Prepend
Append = 1,
Prepend = 0
}
}
@@ -4,7 +4,7 @@
// Author:
// Dennis Hayes ([email protected])
//
// (C) 2002 Ximian, Inc
// (C) 2002/3 Ximian, Inc
//
using System;
@@ -17,9 +17,6 @@ namespace System.Drawing.Drawing2D
{
public PathData()
{
//
// TODO: Add constructor logic here
//
}
}
}
Loaded 100 of 387 files, more files were not shown because too many files have changed in this diff. Show more