Compare commits

...
301 Commits
Author SHA1 Message Date
Gonzalo Paniagua Javier 27589b59b9 2009-03-11 Gonzalo Paniagua Javier <[email protected]>
* InotifyWatcher.cs: don't send events when a directory is created
	unless it matches the pattern.  Fixes bug #484082.


svn path=/branches/mono-2-4-0/mcs/; revision=129114
2009-03-12 00:33:26 +00:00
Zoltan Varga 8f4c7c9e1a 2009-03-11 Zoltan Varga <[email protected]>
* mini-amd64.c (mono_arch_output_basic_block): Fix % 1. Fixes #484323.

	* basic.cs: Add a test.

svn path=/branches/mono-2-4/mono/; revision=129066
2009-03-11 14:29:38 +00:00
Mark Probst 950b5dc41b 2009-03-11 Mark Probst <[email protected]>
* mini-x86.c (mono_arch_output_basic_block): Use different
	registers in case the ones we want to overwrite are used by the
	other operand.  Fixes regression in #480807.

	Backport of r129058.

svn path=/branches/mono-2-4/mono/; revision=129064
2009-03-11 14:27:20 +00:00
Zoltan Varga 5901f1de17 2009-03-10 Zoltan Varga <[email protected]>
Backport of r129009.

	* reflection.c (ensure_complete_type): New helper function to call
	type resolve handlers for unfinished dynamic types.
	(resolve_object): Call it for MonoClassFields. Fixes #483852.

svn path=/branches/mono-2-4/mono/; revision=129010
2009-03-10 19:48:57 +00:00
Marek Habersack 84c1469a25 Backport of r128972
svn path=/branches/mono-2-4/mcs/; revision=128973
2009-03-10 14:23:03 +00:00
Zoltan Varga e08028625d 2009-03-10 Zoltan Varga <[email protected]>
Backport of r128924.
	
	* mini-s390x.c: Fix support for vtypes whose addresses are passed on the
	stack.

svn path=/branches/mono-2-4/mono/; revision=128926
2009-03-10 00:21:40 +00:00
Miguel de Icaza acbaa50498 Backport from 128830
svn path=/branches/mono-2-4/mcs/; revision=128925
2009-03-10 00:20:25 +00:00
Mark Probst b92652fb0c 2009-03-09 Mark Probst <[email protected]>
Contributed under the terms of the MIT/X11 license by Steven
        Munroe <[email protected]>.

        * mini-ppc.c: Correct handling of OP_LOADI4_MEMINDEX for ppc64.
        Fixes #483462.

        Backport of r128904.

svn path=/branches/mono-2-4/mono/; revision=128905
2009-03-09 20:03:44 +00:00
Mark Probst b400a612a4 2009-03-09 Mark Probst <[email protected]>
* mini-trampolines.c (mono_create_jump_trampoline): If the method
	is shared generic code, return the trampoline, even if the method
	has already been compiled.  Fixes #479763.

	* mini.c, mini.h: New function
	mono_jit_find_compiled_method_with_jit_info() which is the same as
	mono_jit_find_compiled_method() but also returns the jit info.

	Backport of r128723.

2009-03-09  Mark Probst  <[email protected]>

	* generic-sharing.c (instantiate_other_info): Always return a jump
	trampoline for method code.

	Backport of r128723.

2009-03-09  Mark Probst  <[email protected]>

	* bug-479763.2.cs: New test.

	* Makefile.am: Test added.

	Backport of r128723.

svn path=/branches/mono-2-4/mono/; revision=128903
2009-03-09 19:57:22 +00:00
Rodrigo Kumpera f75dddbe61 2009-03-08 Rodrigo Kumpera <[email protected]>
Backport of r128853.

	* appdomain.c (get_shadow_assembly_location): Fix memleak.


svn path=/branches/mono-2-4/mono/; revision=128882
2009-03-09 14:24:35 +00:00
Marek Safar ce5c0e651e 2009-03-08 Marek Safar <[email protected]>
* class.cs: Use correct common base type for unmanaged delayed
	check.

	* rootcontext.cs: Wrap unhandled exception.


svn path=/branches/mono-2-4/mcs/; revision=128854
2009-03-08 19:15:50 +00:00
Gonzalo Paniagua Javier 11cd4f09ed 2009-03-06 Gonzalo Paniagua Javier <[email protected]>
* ResourceSet.cs: for custom resource sets without a reader, pretende
	that's we've already read the stream.


svn path=/branches/mono-2-4/mcs/; revision=128815
2009-03-07 00:06:31 +00:00
Miguel de Icaza 15c1fae0ea 2009-03-05 Tom Hindle <[email protected]>
* Marshal.cs: Implemented GenerateGuidForType

svn path=/branches/mono-2-4/mcs/; revision=128809
2009-03-06 23:31:51 +00:00
Miguel de Icaza b712e0ae63 Backport
svn path=/branches/mono-2-4/mcs/; revision=128808
2009-03-06 23:30:19 +00:00
Marek Habersack 7304ee6ef0 Backport of r128801
svn path=/branches/mono-2-4/mcs/; revision=128802
2009-03-06 22:17:10 +00:00
Marek Habersack ef23c9aaeb Backport of r128799
svn path=/branches/mono-2-4/mcs/; revision=128800
2009-03-06 21:30:17 +00:00
Marek Habersack 5eecf6b197 Backport of r128796
svn path=/branches/mono-2-4/mcs/; revision=128797
2009-03-06 20:55:33 +00:00
Marek Habersack 74dcf0f4e7 Backport of r128793
svn path=/branches/mono-2-4/mcs/; revision=128794
2009-03-06 20:05:35 +00:00
Zoltan Varga 2a21dbb533 2009-03-06 Zoltan Varga <[email protected]>
* arm/tramp.c: Include a change from the debian patches. Avoid #include-ing
	a file in the middle of a function.

svn path=/branches/mono-2-4/mono/; revision=128784
2009-03-06 15:56:44 +00:00
Zoltan Varga fdf4913561 2009-03-06 Zoltan Varga <[email protected]>
Backport of r128749.
	
	* method-to-ir.c (mini_emit_memset): Fix the handling of size '3'. Fixes
	#481458.

	* iltests.il.in: Add a test.

svn path=/branches/mono-2-4/mono/; revision=128751
2009-03-06 02:43:14 +00:00
Mark Probst a1ea9b3ab8 2009-03-05 Mark Probst <[email protected]>
* method-to-ir.c (mono_method_to_ir): Only force the vtable var
	for methods which actually have one.  For all other methods, make
	sure the this argument var is live the whole method.

	* mini.c (mini_method_compile): Every shared method has a
	this/vtable/mrgctx info.  Fixes #480807.

	Backport of r128720.

svn path=/branches/mono-2-4/mono/; revision=128724
2009-03-05 21:17:28 +00:00
Marek Habersack d22d581784 Backport of r128714
svn path=/branches/mono-2-4/mono/; revision=128715
2009-03-05 18:06:35 +00:00
Bill Holmes 7ff68d17a2 2009-03-05 Bill Holmes <[email protected]>
* mono.def : Removing missing methods to remove link errors for
	  MSVC build.  

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-4/mono/; revision=128712
2009-03-05 17:50:48 +00:00
Mark Probst ebbca31e3c 2009-03-05 Mark Probst <[email protected]>
Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* mini-ppc.c, mini-ppc.h: Implement TLS for PPC64.

	Backport of r127060.

2009-03-05  Mark Probst  <[email protected]>

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* mono-compiler.h: MONO_THREAD_VAR_OFFSET for PPC(64).

	Backport of r127060.

svn path=/branches/mono-2-4/mono/; revision=128711
2009-03-05 17:49:49 +00:00
Marek Safar fbe5f68924 2009-03-05 Marek Safar <[email protected]>
A fix for bug #480100
	* parameter.cs: A parameter is not hoisted when used directly as ET.


svn path=/branches/mono-2-4/mcs/; revision=128680
2009-03-05 11:41:25 +00:00
Martin Baulig aca813ba8d ***** Backport of r128549 *****
svn path=/branches/mono-2-4/mono/; revision=128622
2009-03-04 20:46:47 +00:00
Martin Baulig d4955be897 ***** Backport of r128556 *****
2009-03-04  Martin Baulig  <[email protected]>

	* debug-mini.c: Clean up the exception API and add documentation.
	(mono_debugger_handle_exception): New public method; this is
	called when throwing an exception or encountering an unhandled one.
	(mono_debugger_call_exception_handler): Formerly known as
	mono_debugger_handle_exception(); this is used to tell the
	debugger that we're about to invoke an exception handler.


svn path=/branches/mono-2-4/mono/; revision=128614
2009-03-04 20:24:02 +00:00
Martin Baulig 84ada866ad ***** Backport of r128544 *****
2009-03-04  Martin Baulig  <[email protected]>

	* debug-mini.c (mono_debugger_runtime_invoke): Moved here from
	../metadata/mono-debug-debugger.c; save and reset exception state.

2009-03-02  Martin Baulig  <[email protected]>

	* debug-mini.c: Moved the debugger exception handling here from
	../metadata/mono-debug-debugger.c.

	* debug-mini.h
	(MonoDebuggerExceptionAction): New exception typedef.

	* debug-mini.c
	(MonoDebuggerThreadInfo): Added `MonoObject *last_exception'.

	* exceptions-amd64.c
	(mono_amd64_throw_exception): Use the new debugger exception
	handling code.

	* mini-exceptions.c
	(mono_handle_exception_internal): Don't call
	mono_debugger_unhandled_exception() here.

2009-03-04  Martin Baulig  <[email protected]>

	* mono-debug.h
	(mono_debugger_runtime_invoke): Removed.

	* mono-debug-debugger.c
	(mono_runtime_invoke): Moved into ../mini/debug-mini.c.

2009-03-02  Martin Baulig  <[email protected]>

	* mono-debug.h
	(mono_debugger_unhandled_exception): Removed.
	(mono_debugger_handle_exception): Removed.
	(mono_debugger_throw_exception): Removed.

	* mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 1.

	* mono-debug.c
	(mono_debug_debugger_version): Bump to 5.

	* mono-debug-debugger.c: Moved the exception handling code to
	../mini/debug-mini.c


svn path=/branches/mono-2-4/mono/; revision=128613
2009-03-04 20:19:14 +00:00
Marek Habersack d7e563dd87 Backport of r128602
svn path=/branches/mono-2-4/mcs/; revision=128603
2009-03-04 19:06:26 +00:00
Mark Probst 2085fa219c 2009-03-04 Mark Probst <[email protected]>
* method-to-ir.c: Don't inline methods that use JMP.  Fixes
	#481403.

	Backport of r128552.

2009-03-04  Mark Probst  <[email protected]>

	* bug-481403.il: New test.

	* Makefile.am: Test added.

	Backport of r128552.

svn path=/branches/mono-2-4/mono/; revision=128560
2009-03-04 15:58:15 +00:00
Marek Safar 8d34f01dfc 2009-03-03 Marek Safar <[email protected]>
A fix for bug #481258
	* class.cs: Set extension method flag in partial container.


svn path=/branches/mono-2-4/mcs/; revision=128434
2009-03-03 12:58:09 +00:00
Marek Habersack ac1aa9d309 Backport of r128407 and r128408
svn path=/branches/mono-2-4/mcs/; revision=128409
2009-03-03 01:34:29 +00:00
Gonzalo Paniagua Javier 97434a0a9b 2009-03-01 Gonzalo Paniagua Javier <[email protected]>
* WebEncoding.cs: another GetWebApplication here.


svn path=/branches/mono-2-4/mcs/; revision=128294
2009-03-01 07:43:09 +00:00
Gonzalo Paniagua Javier 1c03c661b4 patch from Marek in trunk
svn path=/branches/mono-2-4/mcs/; revision=128280
2009-02-28 23:45:29 +00:00
Gonzalo Paniagua Javier 7e204d02b5 2009-02-28 Gonzalo Paniagua Javier <[email protected]>
* AppResourcesAssemblyBuilder.cs:
	* AspComponentFoundry.cs:
	* AssemblyBuilder.cs:
	* CachingCompiler.cs:
	* AspGenerator.cs:
	* WsdlBuildProvider.cs:
	* BaseCompiler.cs:
	* BuildProvider.cs:
	* AppWebReferencesCompiler.cs:
	* TemplateControlCompiler.cs:
	* BuildManager.cs:
	* AppCodeCompiler.cs: settings that have to be in
	machine.config or the root level web.config now call
	GetWebApplicationSection.


svn path=/branches/mono-2-4/mcs/; revision=128277
2009-02-28 20:41:32 +00:00
Gonzalo Paniagua Javier 34d0ee8c95 2009-02-28 Gonzalo Paniagua Javier <[email protected]>
* BaseParser.cs:
	* PageParser.cs:
	* ControlBuilder.cs:
	* TemplateParser.cs:
	* Page.cs:
	* SimpleWebHandlerParser.cs: settings that have to be in
	machine.config or the root level web.config now call
	GetWebApplicationSection.


svn path=/branches/mono-2-4/mcs/; revision=128274
2009-02-28 20:05:24 +00:00
Gonzalo Paniagua Javier 05442e11d7 2009-02-28 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpResponseHeader.cs:
	* System.Web/HttpResponse.cs:
	* System.Web/QueueManager.cs:
	* System.Web/HttpRequest.cs:
	* System.Web/TraceManager.cs:
	* System.Web/HttpServerUtility.cs:
	* System.Web/HttpApplication.cs:
	* System.Web.UI/ObjectStateFormatter.cs:
	* System.Web.Security/FormsAuthentication.cs: use GetWebApplication
	instead of GetSection for application level configuration.


svn path=/branches/mono-2-4/mcs/; revision=128271
2009-02-28 19:00:51 +00:00
Zoltan Varga 42f06c7663 2009-02-28 Zoltan Varga <[email protected]>
* Enum.cs (FindName): Use a hash table for looking up names instead of
	a linear search for enums with a lot of values.

svn path=/branches/mono-2-4/mcs/; revision=128268
2009-02-28 16:23:19 +00:00
Rodrigo Kumpera 8c002790f7 2008-02-28 Rodrigo Kumpera <[email protected]>
* MonoProperty.cs (GetValue): Don't use the delegate optimization for valuetypes.


svn path=/branches/mono-2-4/mcs/; revision=128263
2009-02-28 06:26:39 +00:00
Gonzalo Paniagua Javier 7172bcccf8 2009-02-17 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: instead of clearing the sockets form the output and then
	adding them back, we just remove the ones that have not been signaled.
	Fixes bug #354090 and bug #476138.



svn path=/branches/mono-2-4/mcs/; revision=128260
2009-02-28 05:59:06 +00:00
Marek Habersack 4ff65f3ac1 Backport of r128249
svn path=/branches/mono-2-4/mcs/; revision=128250
2009-02-28 02:05:10 +00:00
Gonzalo Paniagua Javier de4d2ec78b 2009-02-27 Gonzalo Paniagua Javier <[email protected]>
* ResourceSet.cs: populating the resource should be locked because the
	resourceset could be shared.


svn path=/branches/mono-2-4/mcs/; revision=128216
2009-02-27 17:32:57 +00:00
Rodrigo Kumpera 6e6489d471 2008-02-26 Rodrigo Kumpera <[email protected]>
* MonoProperty.cs (GetValue): Optimize getters for properties without arguments.

2008-02-26  Rodrigo Kumpera  <[email protected]>

	* MonoProperty.cs (GetValue): Optimize getters for properties without arguments.
	The optimization is to create a pair of chained delegates that duplicate the workings
	on MethodBase::Invoke without all the aditional overhead and without doing two
	managed/native transitions.

	Simple Getter performance is up to 17x faster.

	This patch reduces contention on domain and domain jit code hash locks, which
	can be very hot on asp.net applications.


svn path=/branches/mono-2-4/mcs/; revision=128174
2009-02-27 01:53:16 +00:00
Zoltan Varga 986524c0bb 2009-02-27 Zoltan Varga <[email protected]>
* BaseMachine.cs (LTRReplace): Initialize the StringBuilder with an
	appropriate initial length.

svn path=/branches/mono-2-4/mcs/; revision=128159
2009-02-26 23:28:25 +00:00
Gonzalo Paniagua Javier ffe099d2fc 2009-02-26 Gonzalo Paniagua Javier <[email protected]>
* appdomain.c: make the check to avoid copying when the assembly is
	already shadow copied actually work.


svn path=/branches/mono-2-4/mono/; revision=128126
2009-02-26 17:42:12 +00:00
Gonzalo Paniagua Javier a317249bec 2009-02-26 Gonzalo Paniagua Javier <[email protected]>
* WebConfigurationManager.cs: generate a hash from the string hsah
	codes instead of concatenating them.


svn path=/branches/mono-2-4/mcs/; revision=128122
2009-02-26 17:24:40 +00:00
Jonathan Pryor fc98dcc51c * Makefile:
- s/TEST_FILES/MAN_TEST_FILES/g: $(TEST_FILES) is used by the normal
	    build process, so the local definition is lost (and thus ignored).
	    Result: Test/* isn't actually copied.  Oops.  Changing to
	    MAN_TEST_FILES allows things to be copied.
	  - Fix the filenames within $(MAN_TEST_FILES) so `make dist-local'
	    works without error.
	  - Fixes #479753.

svn path=/branches/mono-2-4/mcs/; revision=128120
2009-02-26 17:08:58 +00:00
Zoltan Varga 48ee1b70a0 2009-02-26 Zoltan Varga <[email protected]>
* String.cs (FormatHelper): If all the arguments are strings, compute an
	initial length for the stringbuilder to avoid reallocations.

svn path=/branches/mono-2-4/mcs/; revision=128116
2009-02-26 16:38:34 +00:00
Zoltan Varga ab154c2bdb 2009-02-26 Zoltan Varga <[email protected]>
* mini-x86.c (mono_arch_get_this_arg_from_call): Avoid expensive calls
	to  get_generic_context_from_code () + get_call_info () if possible.

svn path=/branches/mono-2-4/mono/; revision=128113
2009-02-26 16:26:23 +00:00
Zoltan Varga e2bde717f8 2009-02-25 Zoltan Varga <[email protected]>
* object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
	slower search in metadata.

svn path=/branches/mono-2-4/mono/; revision=128095
2009-02-26 14:20:50 +00:00
Marek Habersack e34e7f2de8 Backport of r128091
svn path=/branches/mono-2-4/mcs/; revision=128092
2009-02-26 14:16:55 +00:00
Gonzalo Paniagua Javier 1e30039a0a fix the build
svn path=/branches/mono-2-4/mono/; revision=128063
2009-02-26 07:30:06 +00:00
Marek Habersack 4881df3014 Backport of r128040
svn path=/branches/mono-2-4/mono/; revision=128041
2009-02-26 02:03:10 +00:00
Marek Safar 38af1d1400 2009-02-25 Marek Safar <[email protected]>
A fix for bug #479532
	* expression.cs: Implement NewInitialize::AddressOf.


svn path=/branches/mono-2-4/mcs/; revision=128016
2009-02-25 16:46:27 +00:00
Marek Habersack 6a50c9ec35 Backport of: r124779, r124780, r124783, r124784, r126769, r126855, r126856, r126891, r127259, r127333, r127334 and r127343
svn path=/branches/mono-2-4/mcs/; revision=128005
2009-02-25 14:16:21 +00:00
Marek Safar 5e0f8cda9a 2009-02-25 Marek Safar <[email protected]>
A fix for bug #413633
	* expression.cs: Iterate all base class-constraint types.


svn path=/branches/mono-2-4/mcs/; revision=127990
2009-02-25 11:39:30 +00:00
Marek Habersack a094e9a735 Backport of r127935
svn path=/branches/mono-2-4/mcs/; revision=127936
2009-02-25 02:50:15 +00:00
Zoltan Varga 816e0e8fdd 2009-02-25 Zoltan Varga <[email protected]>
Backport of r127929.
	
	* Enum.cs (GetInfo): Add a global cache in addition to the thread-local
	caches to accomodate short living threads like threadpool threads.

svn path=/branches/mono-2-4/mcs/; revision=127930
2009-02-25 02:16:00 +00:00
Gonzalo Paniagua Javier 47e1dbf970 2009-02-24 Gonzalo Paniagua Javier <[email protected]>
* StringReader.cs: LF followed by CR is 2 lines.


svn path=/branches/mono-2-4/mcs/; revision=127917
2009-02-24 23:51:00 +00:00
Gonzalo Paniagua Javier aa19449ebb 2009-02-24 Gonzalo Paniagua Javier <[email protected]>
* StringReaderTest.cs: new test for ReadLine.


svn path=/branches/mono-2-4/mcs/; revision=127916
2009-02-24 23:50:24 +00:00
Andrew Jorgensen 90041dc378 Backport of r127907, bnc#479237
svn path=/branches/mono-2-4/mcs/; revision=127908
2009-02-24 22:15:56 +00:00
Zoltan Varga 922912292b 2009-02-24 Zoltan Varga <[email protected]>
* CILCompiler.cs: Partially inline calls to Char.ToLower () to speed
	up ignorecase matching.

svn path=/branches/mono-2-4/mcs/; revision=127902
2009-02-24 20:51:30 +00:00
Ivan Zlatev c92fff7043 2009-02-24 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Invalidate the datagrid when the cell is selected
	or deselected.
	[Fixes bug #479124]

svn path=/branches/mono-2-4/mcs/; revision=127893
2009-02-24 20:10:30 +00:00
Jb Evain e3931f38b6 2009-02-24 Jb Evain <[email protected]>
backport of 127871.

	* Expression.cs (BinaryCoreCheck): fix comparison of enums.


svn path=/branches/mono-2-4/mcs/; revision=127872
2009-02-24 17:11:47 +00:00
Veerapuram Varadhan 493e003258 backport of r127849
svn path=/branches/mono-2-4/mcs/; revision=127850
2009-02-24 09:34:15 +00:00
Veerapuram Varadhan 32bf6cac04 * OracleException: 2.0 changes - patch submitted by
Jay Wren <[email protected]>


svn path=/branches/mono-2-4/mcs/; revision=127840
2009-02-24 05:21:40 +00:00
Veerapuram Varadhan 0c8aa2ee8b * Fixes #476523
* DbType.cs: Add DateTime2 and DateTimeOffset - 3.5 additions
        Patch by Jay Wren <[email protected]>


svn path=/branches/mono-2-4/mcs/; revision=127838
2009-02-24 05:10:23 +00:00
Jb Evain 0ee8a2414d 2009-02-23 Jb Evain <[email protected]>
backport of 127784.

	* XUtil.cs (ToString): properly stringify datetimes.

svn path=/branches/mono-2-4/mcs/; revision=127787
2009-02-23 19:20:54 +00:00
Jb Evain eb08b06215 2009-02-23 Jb Evain <[email protected]>
backport of 127772.

	* Enumerable.cs (IterateNullable): fix initial value
	for nullables.


svn path=/branches/mono-2-4/mcs/; revision=127774
2009-02-23 18:16:14 +00:00
Jb Evain 88b7acff98 2009-02-23 Jb Evain <[email protected]>
backport of 127755.

	* Expression.cs (IsNumber): actually decimal is rather a special
	case, and not a primitive number.


svn path=/branches/mono-2-4/mcs/; revision=127756
2009-02-23 17:06:08 +00:00
Jb Evain 84fd92865b 2009-02-23 Jb Evain <[email protected]>
backport of 127746.

	* Expression.cs (BinaryCoreCheck): add decimal operations
	are provided by custom operators.

svn path=/branches/mono-2-4/mcs/; revision=127748
2009-02-23 16:44:42 +00:00
Ivan Zlatev 400afe1a8f 2009-02-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Make the ScrollBars property work properly.

svn path=/branches/mono-2-4/mcs/; revision=127718
2009-02-23 09:43:23 +00:00
Gonzalo Paniagua Javier d9755b89e6 2009-02-23 Gonzalo Paniagua Javier <[email protected]>
* WebClient.cs: append the QueryString in DownloadData.
	Fixes bug #323788.


svn path=/branches/mono-2-4/mcs/; revision=127700
2009-02-23 05:10:24 +00:00
Gonzalo Paniagua Javier 8c8593fd96 2009-02-22 Gonzalo Paniagua Javier <[email protected]>
* HttpServerUtility.cs: allow Transfer to static files too.


svn path=/branches/mono-2-4/mcs/; revision=127678
2009-02-23 00:22:39 +00:00
Mark Probst 200118c485 2009-02-22 Mark Probst <[email protected]>
Backport of r127665.

	* tramp-ppc.c (mono_arch_create_trampoline_code): Store the
	correct frame pointer in the LMF.  Should fix #478394.

svn path=/branches/mono-2-4/mono/; revision=127666
2009-02-22 21:08:04 +00:00
Gonzalo Paniagua Javier 8575b3983a 2009-02-22 Gonzalo Paniagua Javier <[email protected]>
* socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
	SO_EXLUSIVEADDRUSE where available.


svn path=/branches/mono-2-4/mono/; revision=127651
2009-02-22 06:42:55 +00:00
Gonzalo Paniagua Javier d99e8f21af fix
svn path=/branches/mono-2-4/mcs/; revision=127646
2009-02-22 03:08:15 +00:00
Ivan Zlatev df53237ac6 2009-02-22 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix row removal in the data-bound scenario.

svn path=/branches/mono-2-4/mcs/; revision=127643
2009-02-22 00:54:39 +00:00
Gonzalo Paniagua Javier 24ad061817 2009-02-21 Gonzalo Paniagua Javier <[email protected]>
* FtpWebResponse.cs: return a Null stream when there's no response to
	be read.
	* FtpWebRequest.cs: provide the error returned by the server in the
	exception.
	* WebClient.cs: set the correct method when doing a FTP upload.
	Fixes bug #478451.


svn path=/branches/mono-2-4/mcs/; revision=127641
2009-02-21 23:30:33 +00:00
Zoltan Varga 76ffb82a48 2009-02-21 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
	runtime invoke wrappers, this time it is string ctor wrappers, which
	pass a dummy string as 'this' instead of their obj argument. Fixes
	#478473.

svn path=/branches/mono-2-4/mono/; revision=127638
2009-02-21 21:27:35 +00:00
Zoltan Varga 53cc1f8d6d 2009-02-21 Zoltan Varga <[email protected]>
* method-to-ir.c (mono_method_to_ir): Don't assert if string ctors
	are called from runtime invoke wrappers.

svn path=/branches/mono-2-4/mono/; revision=127636
2009-02-21 21:24:16 +00:00
Jb Evain 0489b56686 backport of r127631.
in System.Reflection:
2008-02-21  Jb Evain  <[email protected]>

	* Module.cs: add a new virtual GetModuleVersionId method,
	and make the properties .MvId and ModuleVersionId call it.
	This way, we can override it in ModuleBuilder.
	Part of the fix for #471302.

in System.Reflection.Emit:
2008-02-21  Jb Evain  <[email protected]>

	* ModuleBuilder.cs: override GetModuleVersionId
	so that we can get the module guid from Module.ModuleVersionId.
	Part of the fix for #471302.

svn path=/branches/mono-2-4/mcs/; revision=127632
2009-02-21 16:20:07 +00:00
Jb Evain 4f856e94a3 2009-02-21 Jb Evain <[email protected]>
backport of r127628.

	* MonoType.cs (InvokeMember): don't pass a null args to
	Binder.BindToMethod. Fix for #471275.

svn path=/branches/mono-2-4/mcs/; revision=127629
2009-02-21 15:36:47 +00:00
Jb Evain a927203608 2009-02-21 Jb Evain <[email protected]>
* EventHandlerList.cs: fix the 1.1 profile.


svn path=/branches/mono-2-4/mcs/; revision=127625
2009-02-21 12:51:59 +00:00
Gonzalo Paniagua Javier 4313c50b3d oops
svn path=/branches/mono-2-4/mcs/; revision=127618
2009-02-21 07:35:31 +00:00
Gonzalo Paniagua Javier 09a2a27d27 2009-02-21 Gonzalo Paniagua Javier <[email protected]>
* EventHandlerList.cs: there's no need for HandlerEntry here.
	Just store the delegate.


svn path=/branches/mono-2-4/mcs/; revision=127616
2009-02-21 07:33:08 +00:00
Gonzalo Paniagua Javier c6c5c7c8b6 this was checked in by mistake
svn path=/branches/mono-2-4/mcs/; revision=127598
2009-02-20 23:35:18 +00:00
Gonzalo Paniagua Javier 8a19ec3273 2009-02-20 Gonzalo Paniagua Javier <[email protected]>
* TemplateControl.cs: implement the other ReadStringResource method.
	Patch from Kornel Pal.


svn path=/branches/mono-2-4/mcs/; revision=127597
2009-02-20 23:34:35 +00:00
Gonzalo Paniagua Javier 32d603eda4 fix the 1.x build
svn path=/branches/mono-2-4/mcs/; revision=127589
2009-02-20 22:57:08 +00:00
Gonzalo Paniagua Javier 11b4aef454 2009-02-20 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpWriter.cs: new Response property and WriteUTF8Ptr
	method.
	* System.Web/HttpResponseStream.cs: added support for writing from an
	IntPtr. copied the memcpy method from String.cs.

	* System.Web.Compilation/BuildManager.cs: updated comment.

	* System.Web.UI/ResourceBasedLiteralControl.cs: new Control. It's just
	like a LiteralControl but will render itself from the bytes pointed to
	by an IntPtr and not create any string from the underlying data unless
	needed.

	* System.Web.UI/TemplateControl.cs: implemented a bunch of methods
	that are used from the precompiled assemblies for a web project. The
	most notable change needed is to be able to read a win32 resource from
	the dll of the control. The resource is a concatenation of literals
	with plain text for the control and a specialized LiteralControl is
	generated from different chunks of the resource.

	* System.Web.UI/HtmlTextWriter.cs: new method that returns the
	HttpWriter in use.

	* System.Web.dll.sources: added new file.

	* System.Web.Util/ICalls.cs: new internal call to get a pointer to the
	win32 resource associated with the control's assembly.


svn path=/branches/mono-2-4/mcs/; revision=127580
2009-02-20 21:32:50 +00:00
Gonzalo Paniagua Javier b1b4f52b34 2009-02-20 Gonzalo Paniagua Javier <[email protected]>
* cil-coff.h:
	* icall-def.h:
	* icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
	win32 resource loaded from a PE file.

	* image.c: fix mono_image_lookup_resource.


svn path=/branches/mono-2-4/mono/; revision=127575
2009-02-20 21:07:43 +00:00
Gonzalo Paniagua Javier bff28446a2 changelog
svn path=/branches/mono-2-4/mcs/; revision=127572
2009-02-20 20:46:03 +00:00
Gonzalo Paniagua Javier 08df38ca1b .
svn path=/branches/mono-2-4/mcs/; revision=127571
2009-02-20 20:37:44 +00:00
Gonzalo Paniagua Javier 21eef2e77e ChangeLog
svn path=/branches/mono-2-4/mcs/; revision=127570
2009-02-20 20:36:31 +00:00
Gonzalo Paniagua Javier cff463913d 2009-02-20 Gonzalo Paniagua Javier <[email protected]>
* WaitHandle.cs: implemented SignalAndWait.

svn path=/branches/mono-2-4/mcs/; revision=127568
2009-02-20 20:33:23 +00:00
Zoltan Varga e040c39674 2009-02-20 Zoltan Varga <[email protected]>
* cpu-ppc.md (store_memindex): Increase the size of this.

svn path=/branches/mono-2-4/mono/; revision=127567
2009-02-20 20:30:39 +00:00
Veerapuram Varadhan eeca83c94d Test for Bug#419224
svn path=/branches/mono-2-4/mcs/; revision=127543
2009-02-20 15:47:16 +00:00
Veerapuram Varadhan 1a66d85f3b backport of r127530
svn path=/branches/mono-2-4/mcs/; revision=127532
2009-02-20 11:50:35 +00:00
Marek Safar 8508387f81 2009-02-20 Marek Safar <[email protected]>
A fix for bug #477447
	* statement.cs: Add reference to correct parent storey when this
	is accessible from deep children storey (more than 1 level).


svn path=/branches/mono-2-4/mcs/; revision=127528
2009-02-20 11:16:43 +00:00
Veerapuram Varadhan cd41807bcb * TdsDataReader.cs: Access TdsDataColumn correctly for NET_2_0.
Fixes #466199. Patch by Tom Hindle <[email protected]>


svn path=/branches/mono-2-4/mcs/; revision=127493
2009-02-20 02:30:12 +00:00
Ivan Zlatev fff850ae00 2009-02-19 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Use strict equality comparison in order to
	prevent superfluous CellValueChanged events.

svn path=/branches/mono-2-4/mcs/; revision=127452
2009-02-19 20:16:25 +00:00
Gonzalo Paniagua Javier c4af40f5cf 2009-02-19 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: avoid errors when creating a temporary Uri to get
	the local path.
	* WebClient.cs: when setting up the request for downloading, use the
	default method. Fixes bug #477611.


svn path=/branches/mono-2-4/mcs/; revision=127451
2009-02-19 20:14:31 +00:00
Ivan Zlatev ace3196c2b 2009-02-19 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not reset the columns when the data list changes,
	but only the rows. Fixes multiple bugs related to sorting, custom
	column styles being reset and more.

svn path=/branches/mono-2-4/mcs/; revision=127435
2009-02-19 18:25:02 +00:00
Veerapuram Varadhan 890a4f46f5 backport of r127379
svn path=/branches/mono-2-4/mcs/; revision=127424
2009-02-19 17:11:14 +00:00
Gonzalo Paniagua Javier fd89397e70 2009-02-19 Gonzalo Paniagua Javier <[email protected]>
* OleDbFactory.cs: New file.


svn path=/branches/mono-2-4/mcs/; revision=127376
2009-02-19 06:50:42 +00:00
Gonzalo Paniagua Javier 50c7e593cb 2009-02-18 Gonzalo Paniagua Javier <[email protected]>
* TemplateControl.cs: ReadStringResource returns null now.


svn path=/branches/mono-2-4/mcs/; revision=127359
2009-02-19 02:43:33 +00:00
Gonzalo Paniagua Javier c06c09bd60 svn path=/branches/mono-2-4/mcs/; revision=127354 2009-02-18 23:52:50 +00:00
Gonzalo Paniagua Javier 4a3bf3d995 2009-02-18 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HttpApplicationFactory.cs: check of global.asax was precompiled.
	* System.Web.UI/MasterPage.cs: the items in ContentPlaceHolders are lowercase.
	* System.Web.Compilation/TemplateControlCompiler.cs: lowercase place holder names
	* System.Web.Compilation/BuildManager.cs: initial support for
	precompilation. No 'updatable', please.



svn path=/branches/mono-2-4/mcs/; revision=127353
2009-02-18 23:51:15 +00:00
Zoltan Varga f59cfce9df 2009-02-19 Zoltan Varga <[email protected]>
Backport of r127347.

	* marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
	delegate. Fixes #477396.

svn path=/branches/mono-2-4/mono/; revision=127349
2009-02-18 23:14:25 +00:00
Marek Safar b73876a464 Fixes build.
svn path=/branches/mono-2-4/mcs/; revision=127341
2009-02-18 23:02:17 +00:00
Bill Holmes 836e73df60 2009-02-18 Bill Holmes <[email protected]>
backport of r127338

	* mono.def : Adding mono_jit_set_trace_options

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-4/mono/; revision=127339
2009-02-18 23:01:08 +00:00
Marek Safar c524bc933b 2009-02-18 Marek Safar <[email protected]>
A fix for bug #472805
	* typemanager.cs, namespace.cs: Import only visible extension method
	types.


svn path=/branches/mono-2-4/mcs/; revision=127311
2009-02-18 19:54:14 +00:00
Marek Safar 9d136bfc7c 2009-02-18 Marek Safar <[email protected]>
A fix for bug #476266
	* anonymous.cs: Mutate multi-dimensional arrays.


svn path=/branches/mono-2-4/mcs/; revision=127294
2009-02-18 17:05:03 +00:00
Bill Holmes ac220e9c0e 2009-02-18 Bill Holmes <[email protected]>
backport of r127279.

	* marshal.c (cominterop_get_managed_wrapper_adjusted) :
	  Adding exception handling for all CCW calls.

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-4/mono/; revision=127280
2009-02-18 15:31:07 +00:00
Zoltan Varga ee8370eb8d 2009-02-18 Zoltan Varga <[email protected]>
Backport of r127232.
	
	* marshal.c (emit_marshal_boolean): Add null checks to the new 
	native->managed marshalling code. Fixes #476247.

svn path=/branches/mono-2-4/mono/; revision=127233
2009-02-17 23:51:25 +00:00
Zoltan Varga bdffeb6712 2009-02-02 Zoltan Varga <[email protected]>
Backport of r125348.

	* marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
	methods taking vtype/byref arguments, to fix yet another bug caused by
	the sharing of runtime invoke wrappers. Partly fixes #471259.

svn path=/branches/mono-2-4/mono/; revision=127080
2009-02-16 23:23:52 +00:00
Zoltan Varga eb24cb0d59 2009-02-15 Zoltan Varga <[email protected]>
Backport of r125349.

	* marshal.c (mono_marshal_free_dynamic_wrappers): New function for
	freeing wrappers of dynamic methods.

	* loader.c (mono_free_method): Call it. Fixes #463323.

svn path=/branches/mono-2-4/mono/; revision=127076
2009-02-16 22:08:08 +00:00
Zoltan Varga 034798235b 2009-02-15 Zoltan Varga <[email protected]>
Backport of r125349.

	* marshal.c (mono_marshal_free_dynamic_wrappers): New function for
	freeing wrappers of dynamic methods.

	* loader.c (mono_free_method): Call it. Fixes #463323.

svn path=/branches/mono-2-4/mono/; revision=127075
2009-02-16 22:07:04 +00:00
Zoltan Varga f049ca86f7 2009-02-15 Zoltan Varga <[email protected]>
Backport of r126958.
	
	* reflection.c (clear_cached_object): New helper function.
	(mono_method_clear_object): New function to clear the cached reflection
	objects for a dynamic method.

	* object.c (mono_runtime_free_method): Call mono_method_clear_object ().
	Partly fixes # 463323.

svn path=/branches/mono-2-4/mono/; revision=127074
2009-02-16 21:59:09 +00:00
Rodrigo Kumpera bcd05ee327 In .:
* loader.c (method_from_memberref): Properly fix #474271 and
	don't break the runtime bad.

2009-02-16 Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-4/mono/; revision=127073
2009-02-16 21:51:24 +00:00
Zoltan Varga 4ed001307d 2009-02-16 Zoltan Varga <[email protected]>
Backport of r126983 + r127069.

	* ssa.c (visit_inst): Fix a crash if the instruction following a switch
	was optimized away.

	Backport of r126980.

	* mini-x86.c (mono_arch_get_vcall_slot): Handle yet another
	code sequence which matches a non-virtual call. Fixes #472654.

	Backport of r124419.

	* mini-amd64.c (mono_arch_get_vcall_slot): Handle yet another
	code sequence which matches a non-virtual call.

svn path=/branches/mono-2-4/mono/; revision=127071
2009-02-16 21:49:34 +00:00
Rodrigo Kumpera 4b4f5466cd In .:
2009-02-16 Rodrigo Kumpera  <[email protected]>

	Backport of r127032.

	* loader.c (method_from_memberref): Don't abort if the array
	method is not found. A regular loader failure is more informative
	and correct.

	Fixes #474271.
	

svn path=/branches/mono-2-4/mono/; revision=127061
2009-02-16 18:12:54 +00:00
Mark Probst 914d38a33e 2009-02-16 Mark Probst <[email protected]>
Backport of r125679.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* mini-ppc.c (mono_arch_output_basic_block): Generate better code
	for LOADI4_MEMBASE.  Use addi instead of addic if it's not
	necessary.

svn path=/branches/mono-2-4/mono/; revision=127059
2009-02-16 17:12:39 +00:00
Mark Probst 8e677f9921 2009-02-16 Mark Probst <[email protected]>
Backport of r125676.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* exceptions-ppc.c (mono_arch_get_restore_context): Code size
	comparison fix.

	* tramp-ppc.c (mono_arch_create_generic_class_init_trampoline):
	The trampoline can be longer on PPC64.

svn path=/branches/mono-2-4/mono/; revision=127056
2009-02-16 17:07:03 +00:00
Mark Probst 12815c0c7e 2009-02-16 Mark Probst <[email protected]>
Backport of r125672.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* mini-ppc.c: Compiler warning fixes and trivial code
	simplifications.

svn path=/branches/mono-2-4/mono/; revision=127055
2009-02-16 17:06:12 +00:00
Mark Probst b535b7d4c0 2009-02-16 Mark Probst <[email protected]>
Backport of r125443.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* ppc/ppc-codegen.h: Make operand order and case consistent
	(assembler order) for ppc_load_reg_update, ppc_load_multiple_regs,
	ppc_store_multiple_regs, ppc_lwz, ppc_lhz, ppc_lbz,
	ppc_stw,ppc_sth, ppc_stb, ppc_stwu, ppc_lbzu, ppc_lfdu, ppc_lfsu,
	ppc_lfsux, ppc_lfsx, ppc_lha, ppc_lhau, ppc_lhzu, ppc_lmw,
	ppc_lwzu, ppc_stbu, ppc_stfdu, ppc_stfsu, ppc_sthu, ppc_stmw.  Use
	"i" or "ui" instead of "d" for immediated operands to immediate
	arthimetic and logical instructions in macros ppc_addi, ppc_addis,
	ppc_ori, ppc_addic, ppc_addicd, ppc_andid, ppc_andisd.
	[__mono_ppc64__]: Make operand order and case consistent
	(assembler order) for ppc_load_multiple_regs,
	ppc_store_multiple_regs.  Simplify the DS form and make them
	consistent with D forms for ppc_load_reg, ppc_load_reg_update,
	ppc_store_reg, ppc_store_reg_update. ppc_ld, ppc_lwa, ppc_ldu,
	ppc_std, ppc_stdu.  Define ppc_lwax and ppc_lwaux.

2009-02-16  Mark Probst  <[email protected]>

	Backport of r125443.

	Contributed under the terms of the MIT/X11 license by Steven
	Munroe <[email protected]>.

	* exceptions-ppc.c (restore_regs_from_context): Correct operand
	order (offset then base reg) for ppc_load_multiple_regs.
	(emit_save_saved_regs) Correct operand order for
	ppc_store_multiple_regs.
	(mono_arch_get_call_filter): Correct operand order for
	ppc_load_multiple_regs.

	* mini-ppc.c (emit_memcpy): Fix operand order for
	ppc_load_reg_update and ppc_store_reg_update.
	(mono_arch_output_basic_block): Correct operand order for ppc_lha.
	(mono_arch_emit_epilog): Correct operand order for
	ppc_load_multiple_regs.

	* tramp-ppc.c (mono_arch_create_trampoline_code): Correct operand
	order for ppc_store_multiple_regs and ppc_load_multiple_regs.

svn path=/branches/mono-2-4/mono/; revision=127054
2009-02-16 17:04:06 +00:00
Mark Probst 3f1a1dbdfe 2009-02-16 Mark Probst <[email protected]>
Backport of r125430.

	* cpu-ppc64.md: Fixed storer4_memindex length.

svn path=/branches/mono-2-4/mono/; revision=127053
2009-02-16 17:01:59 +00:00
Marek Safar eceec54500 2009-02-16 Marek Safar <[email protected]>
A fix for bug #475965
	* generics.cs: Check generic parameter type after extracting from
	Expression<T>.


svn path=/branches/mono-2-4/mcs/; revision=127041
2009-02-16 15:33:42 +00:00
Atsushi Eno c3335e6f62 branch is broken too.
svn path=/branches/mono-2-4/mcs/; revision=127000
2009-02-16 08:07:02 +00:00
Zoltan Varga d8feb83640 2009-02-14 Zoltan Varga <[email protected]>
Backport of r126897.
	
	* method-to-ir.c (mini_emit_ldelema_1_ins): If the array index is a long,
	convert it to an in32. Fixes #475859.

	* arrays.cs: Add a test.

svn path=/branches/mono-2-4/mono/; revision=126900
2009-02-14 00:07:00 +00:00
Gonzalo Paniagua Javier 3a520d36c4 2009-02-13 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: implemente (Read|Write)Timeout.
	Fixes bug #348159.


svn path=/branches/mono-2-4/mcs/; revision=126841
2009-02-13 15:08:53 +00:00
Marek Safar 3fe2bf4538 2009-02-13 Marek Safar <[email protected]>
A fix for bug #475327
	* expression.cs (ArrayCreation): Don't mutate values optimized away.


svn path=/branches/mono-2-4/mcs/; revision=126826
2009-02-13 12:08:57 +00:00
Zoltan Varga 00f2704267 2009-02-12 Zoltan Varga <[email protected]>
Backport of r126717.

	* mini-amd64.c (mono_arch_build_imt_thunk): Fix size calculation after
	the fail_tramp changes. Hopefully fixes #475132.

svn path=/branches/mono-2-4/mono/; revision=126811
2009-02-13 09:39:00 +00:00
Gonzalo Paniagua Javier 150b04b1b9 2009-02-05 Miguel De Icaza <[email protected]>
* sockets.c (_wapi_setsockopt): SO_REUSEPORT is needed also on
	MacOS X.  Fixes bug #471292


svn path=/branches/mono-2-4/mono/; revision=126772
2009-02-12 23:44:05 +00:00
Lluis Sanchez 098fc0b907 2009-02-12 Lluis Sanchez Gual <[email protected]>
* MarshalByRefObject.cs: Implemented MemberwiseClone(bool).


svn path=/branches/mono-2-4/mcs/; revision=126750
2009-02-12 19:46:11 +00:00
Zoltan Varga 1b5cea04fc 2009-02-12 Zoltan Varga <[email protected]>
Backport of r126737.

	* mini-s390x.c (mono_arch_output_basic_block): Fix the shift amounts in 
	OP_LCONV_TO_U2.

	* basic-long.cs: Add a test.

svn path=/branches/mono-2-4/mono/; revision=126742
2009-02-12 18:46:42 +00:00
Bill Holmes e61b2cd43d 2009-02-12 Bill Holmes <[email protected]>
Backport of r126738.  This is a safer variant of the
	  trunk for the 2.4 branch. The default in emit_marshal_boolean
	  for this version is I1.

	* object-internals.h : Fixing a typo in the
	  MonoReflectionComVisibleAttribute struct.

	* marshal.c (cominterop_com_visible): Check the implemented
	  interfaces for ComImport.

	* marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls
	  assume that bools should be treated as VARIANTBOOLs.

	* marshal.c (emit_marshal_boolean): Adding cases for
	  MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.

	* marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to
	  emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.

	* marshal.c (cominterop_get_ccw): For COM calls assume that bools
	  should be treated as VARIANTBOOLs.

	Code is contributed under MIT/X11 license.


svn path=/branches/mono-2-4/mono/; revision=126740
2009-02-12 18:40:22 +00:00
Zoltan Varga 69b329a4a5 2009-02-12 Zoltan Varga <[email protected]>
Backport of r126737.

	* mini-s390x.c (mono_arch_output_basic_block): Fix the shift amounts in 
	OP_LCONV_TO_U2.

	* basic-long.cs: Add a test.

svn path=/branches/mono-2-4/mono/; revision=126739
2009-02-12 18:40:13 +00:00
Marek Safar 8cc06e5e77 2009-02-12 Marek Safar <[email protected]>
A fix for bug ##475246
	* expression.cs: More broken flowanalysis hacking needed.


svn path=/branches/mono-2-4/mcs/; revision=126729
2009-02-12 17:47:59 +00:00
Mark Probst 4fd91bf1c0 2009-02-12 Mark Probst <[email protected]>
* generic-sharing.c: Fixed a locking bug: The loader lock has to
	be taken before the templates lock.  Fixes part of #473150.

svn path=/branches/mono-2-4/mono/; revision=126715
2009-02-12 14:08:07 +00:00
Gonzalo Paniagua Javier 6b9376a9bf 2009-02-12 Gonzalo Paniagua Javier <[email protected]>
* io.c: EXDEV when moving directories fails now without creating a
	file in the destination.
	Fixes bug #326983.


svn path=/branches/mono-2-4/mono/; revision=126691
2009-02-12 07:44:10 +00:00
Gonzalo Paniagua Javier c457bcfa42 2009-02-12 Gonzalo Paniagua Javier <[email protected]>
* MonoIO.cs:
	* MonoIOError.cs: enable ERROR_NOT_SAME_DEVICE.


svn path=/branches/mono-2-4/mcs/; revision=126689
2009-02-12 07:43:36 +00:00
Zoltan Varga 63d82ffc3c 2009-02-12 Zoltan Varga <[email protected]>
Backport of r126668.
	
	* ssa.c (fold_ins): Use MONO_IS_JUMP_TABLE () and MONO_JUMP_TABLE_FROM_INS ()
	for processing jump tables. Fixes #473787.

svn path=/branches/mono-2-4/mono/; revision=126669
2009-02-12 00:23:23 +00:00
Mark Probst 2bdd7e92d3 2009-02-11 Mark Probst <[email protected]>
Backport of r126631.

	* class.c, class-internals.h: mono_method_get_context_general()
	combines the functionality of mono_method_get_context() and
	mini_method_get_context().

	* generic-sharing.c, domain-internals.h:
	mono_method_construct_object_context() and
	mono_domain_lookup_shared_generic() moved from mini.

	* icall.c (ves_icall_InternalInvoke): Handle the case where the
	method doesn't have the correct instantiation because it's shared
	generic code.  Fixes #473999.

2009-02-11  Mark Probst  <[email protected]>

	Backport of r126631.

	* mini-generic-sharing.c: mini_method_get_context() just calls
	mono_method_get_context_general() now.

	* mini.c, mini.h: Moved get_object_generic_inst(),
	construct_object_context_for_method() and
	mono_domain_lookup_shared_generic() to metadata/generic-sharing.c.

2009-02-11  Mark Probst  <[email protected]>

	Backport of r126631.

	* bug-473999.2.cs: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=126635
2009-02-11 19:23:28 +00:00
Andrew Jorgensen 5bb5d1d407 Missed part of the merge (not sure how that happened... I used svn diff
and patch.  Oh well, easy enough to fix.

svn path=/branches/mono-2-4/mono/; revision=126624
2009-02-11 17:23:13 +00:00
Zoltan Varga ca426640a8 2009-02-11 Zoltan Varga <[email protected]>
Backport of 126604.

	* branch-opts.c (mono_if_conversion): Handle the case where the merged 
	basic block fell through to its successor bblock without a branch. Fixes
	#474718.

	* iltests.il.in: Add a test.

svn path=/branches/mono-2-4/mono/; revision=126606
2009-02-11 14:36:29 +00:00
Bill Holmes 718382bad7 2009-02-11 Bill Holmes <[email protected]>
Backport of r126596.

	* socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
	  For Win32, add additional break conditions for accept.

	Code is contributed under MIT/X11 license.


svn path=/branches/mono-2-4/mono/; revision=126598
2009-02-11 13:50:55 +00:00
Gonzalo Paniagua Javier 32bf4798e3 2009-02-10 Gonzalo Paniagua Javier <[email protected]>
* CookieContainer.cs: separate cookies with "; " instead of just ';'.
	Fixes bug #386727.


svn path=/branches/mono-2-4/mcs/; revision=126531
2009-02-10 23:35:16 +00:00
Gonzalo Paniagua Javier dcff2f2285 Fix the windows build in the branch too
svn path=/branches/mono-2-4/mono/; revision=126513
2009-02-10 21:04:58 +00:00
Marek Habersack 17c171a0f9 Backport of r126482
svn path=/branches/mono-2-4/mcs/; revision=126483
2009-02-10 18:12:48 +00:00
Mark Probst 2debaf6612 2009-02-10 Mark Probst <[email protected]>
Backport of r126467.

	* mini-x86.c (mono_arch_context_get_int_reg): Handle all registers
	individually.  Fixes #473482.

2009-02-10  Mark Probst  <[email protected]>

	Backport of r126467.

	* bug-473482.2.cs: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=126469
2009-02-10 15:22:00 +00:00
Gonzalo Paniagua Javier 42d8948ea3 2009-02-10 Gonzalo Paniagua Javier <[email protected]>
* AppDomain.cs: this fixes the remoting tests.
	Zoltan found out that there was a domain improperly using shadow
	copy.


svn path=/branches/mono-2-4/mcs/; revision=126431
2009-02-10 07:37:33 +00:00
Andrew Jorgensen 6b01c59030 Backport of r126400
svn path=/branches/mono-2-4/mono/; revision=126402
2009-02-10 00:38:41 +00:00
Marek Habersack 00acd5fd49 Backport of r126371.
svn path=/branches/mono-2-4/mcs/; revision=126372
2009-02-09 21:09:25 +00:00
Andrew Jorgensen f434ba459c Fix Bug 472021 - Windows installation sqlsharp.bat (etc) broken
svn path=/branches/mono-2-4/mono/; revision=126349
2009-02-09 16:52:28 +00:00
Gonzalo Paniagua Javier 34c5d71769 2009-02-08 Gert Driesen <[email protected]>
* Dns.cs: BeginGetHostAddresses - renamed argument to match MS,
	reject "any" IP addresses. BeginGetHostEntry - renamed argument
	to match MS, reject "any" IP addresses. GetHostEntry - reject
	"any" IP addresses. GetHostAddresses - reject "any" IP addresses.
	GetHostByName - use "hostName" as paramname in ANE.


svn path=/branches/mono-2-4/mcs/; revision=126295
2009-02-08 23:20:27 +00:00
Gonzalo Paniagua Javier 53acf05e01 2009-02-08 Gert Driesen <[email protected]>
* DnsTest.cs: Use Assert syntax, and spaces to tabs. Added tests
	for argument checks.

svn path=/branches/mono-2-4/mcs/; revision=126294
2009-02-08 23:18:43 +00:00
Gonzalo Paniagua Javier be859b75ff 2009-02-08 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: lock SetResponseError.


svn path=/branches/mono-2-4/mcs/; revision=126293
2009-02-08 23:11:33 +00:00
Zoltan Varga f958258d28 2009-02-09 Zoltan Varga <[email protected]>
Backport of r126290.

	* wait.c (WaitForMultipleObjectsEx): Initialize poll variable.

svn path=/branches/mono-2-4/mono/; revision=126291
2009-02-08 23:08:59 +00:00
Gonzalo Paniagua Javier a5d0787137 2009-02-08 Gonzalo Paniagua Javier <[email protected]>
* HttpClientTransportSink.cs: if we get an WebException that does not
	have a response, dispatch it to the sink.



svn path=/branches/mono-2-4/mcs/; revision=126289
2009-02-08 22:51:35 +00:00
Ivan Zlatev fc990b1fdc 2009-02-07 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: End or if end fails then cancel the current edit
	operation before clearing the data source.

svn path=/branches/mono-2-4/mcs/; revision=126215
2009-02-07 23:27:17 +00:00
Ivan Zlatev f97835553c 2009-02-07 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Data-bind only after the handle is created.
	[Fixes bug #473680]

svn path=/branches/mono-2-4/mcs/; revision=126214
2009-02-07 23:27:12 +00:00
Gonzalo Paniagua Javier 9dd4b35d13 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* socket-io.c: when requesting all the local ips, if there are no
	interfaces up and running, MS returns 127.0.0.1.


svn path=/branches/mono-2-4/mono/; revision=126204
2009-02-07 19:57:55 +00:00
Gonzalo Paniagua Javier 5a440ac217 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* mono-perfcounters-def.h: processor time is an inverse time.
	Fixes bug #468625.


svn path=/branches/mono-2-4/mono/; revision=126194
2009-02-07 18:57:36 +00:00
Gonzalo Paniagua Javier 67cbfb1f5c 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* configure.in: include stdio so that NULL is defined when checking
	for ifreq.


svn path=/branches/mono-2-4/mono/; revision=126165
2009-02-07 05:25:30 +00:00
Gonzalo Paniagua Javier 90a94a6b8b 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* Dns.cs: empty string for host (also 0.0.0.0) is just passed to the
	runtime, which will then retrieve the local IP addresses. Fixes bug
	#386637 part 2/2.


svn path=/branches/mono-2-4/mcs/; revision=126163
2009-02-07 05:22:36 +00:00
Gonzalo Paniagua Javier f6479e150f 2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* socket-io.c: an empty host name returns the list of local IPs.
	Fixes bug #386637 part 1/2.


svn path=/branches/mono-2-4/mono/; revision=126161
2009-02-07 05:21:42 +00:00
Gonzalo Paniagua Javier 1208b12f69 2009-02-06 Gonzalo Paniagua Javier <[email protected]>
* StreamReader.cs: when a LF ends a decoded buffer and is not followed
	by a CR in the next decoded buffer, we didn't flush the string.
	Fixes bug #445326.


svn path=/branches/mono-2-4/mcs/; revision=126132
2009-02-06 23:02:06 +00:00
Gonzalo Paniagua Javier d3d80927e1 2009-02-06 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: some servers have a comment after the directory
	name. Fixes bugs #471149 and #471216.


svn path=/branches/mono-2-4/mcs/; revision=126102
2009-02-06 20:19:30 +00:00
Gonzalo Paniagua Javier 73146ea69a 2009-02-06 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: set the content length to 0 when the
	response is not supposed to have any content.


svn path=/branches/mono-2-4/mcs/; revision=126091
2009-02-06 19:33:54 +00:00
Zoltan Varga f7d427a360 2009-02-06 Zoltan Varga <[email protected]>
Backport of r126054.

	* marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
	need to be boxed.

svn path=/branches/mono-2-4/mono/; revision=126055
2009-02-06 15:18:43 +00:00
Marek Habersack 2b8f2bd2eb Backport of r126051
svn path=/branches/mono-2-4/mcs/; revision=126052
2009-02-06 15:06:58 +00:00
Marek Habersack 11d0202305 Reverting 126038
svn path=/branches/mono-2-4/mcs/; revision=126046
2009-02-06 14:11:25 +00:00
Marek Habersack a755dfc8ab Backport of r126037
svn path=/branches/mono-2-4/mcs/; revision=126038
2009-02-06 13:09:51 +00:00
Marek Habersack 2c9a79735d Backport of r126025
svn path=/branches/mono-2-4/mcs/; revision=126030
2009-02-06 12:26:30 +00:00
Marek Habersack abc43192bf Backport of r125945
svn path=/branches/mono-2-4/mcs/; revision=125946
2009-02-05 22:09:11 +00:00
Mark Probst 791e158847 2009-02-05 Mark Probst <[email protected]>
Backport of r125887.

	* object.c (mono_object_get_virtual_method): Properly inflate
	generic methods.  Fixes #472692.

2009-02-05  Mark Probst  <[email protected]>

	Backport of r125887.

	* jit-icalls.c (mono_helper_compile_generic_method): Don't inflate
	the method we get from mono_object_get_virtual_method() because
	that function does it properly, now.

2009-02-05  Mark Probst  <[email protected]>

	Backport of r125887.

	* bug-472692.2.cs: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=125910
2009-02-05 18:46:12 +00:00
Ivan Zlatev 35022b4629 2009-02-05 Ivan N. Zlatev <[email protected]>
* DataGridViewRowCollection.cs, DataGridView.cs: Fix row insertation:
	   - Use ArrayList.Insert instead of the Item property so that the item
	   is actually inserted and not an existing item replaced.
	   - Call DataGridView.OnRowsAddedInternal and drop internal from
	   OnRowsAdded for binary compitability. This also fixes several
	   redrawing issues.
	[Fixes bug #472968]

svn path=/branches/mono-2-4/mcs/; revision=125901
2009-02-05 18:26:32 +00:00
Andrés G. Aragoneses 13e7da0b12 (Backport typo fix in r125894.)
System.Windows.Forms/ToolBarButton.cs: Doh, fire OnUIATextChanged
  *after* setting the value.

svn path=/branches/mono-2-4/mcs/; revision=125896
2009-02-05 18:07:46 +00:00
Marek Habersack 31d1906af8 Backport of r125885
svn path=/branches/mono-2-4/mcs/; revision=125888
2009-02-05 17:06:35 +00:00
Andrés G. Aragoneses e8030a1270 oops, fix build
svn path=/branches/mono-2-4/mcs/; revision=125877
2009-02-05 16:15:30 +00:00
Andrés G. Aragoneses 81732363f2 * ToolBarButton.cs: OnTextChanged added.
(Backport of r125802.) r: jpobst

svn path=/branches/mono-2-4/mcs/; revision=125876
2009-02-05 16:10:56 +00:00
Miguel de Icaza e47086ae2c Backport the fix for the nullref on WebConnectionStream
svn path=/branches/mono-2-4/mcs/; revision=125875
2009-02-05 16:09:10 +00:00
Marek Habersack adb5812097 Backport of r125857
svn path=/branches/mono-2-4/mcs/; revision=125858
2009-02-05 13:15:31 +00:00
Rodrigo Kumpera a629d14e14 2009-02-05 Rodrigo Kumpera <[email protected]>
Backport of r125849.

	* class.c (mono_class_create_from_typedef): The CLR supports SystemF
	recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
	for the parent type, the created type must be ready to be used on a generic
	instantiation.
	We fill this_arg/byval_arg if the parent is a generic instance to make sure
	we won't have duplicated entries in generic_inst_cache.

	Fixes #469553.



svn path=/branches/mono-2-4/mono/; revision=125851
2009-02-05 11:52:52 +00:00
Mark Probst 455afec78e 2009-02-05 Mark Probst <[email protected]>
Backport of r125839.

	* mini-exceptions.c (ves_icall_get_frame_info): Account for the
	fact that mono_find_jit_info() sometimes returns the context
	corresponding to the jit info in new_ctx.  Fixes #472600.

2009-02-05  Mark Probst  <[email protected]>

	Backport of r125839.

	* bug-472600.2.cs: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=125850
2009-02-05 11:45:58 +00:00
Marek Habersack cee2f48565 Backport of r125798
svn path=/branches/mono-2-4/mcs/; revision=125799
2009-02-05 00:58:02 +00:00
Gonzalo Paniagua Javier 3a1003365a new tests for empty string
svn path=/branches/mono-2-4/mcs/; revision=125796
2009-02-05 00:22:18 +00:00
Gonzalo Paniagua Javier d8f224fa77 2009-02-04 Gonzalo Paniagua Javier <[email protected]>
* DateTime.cs: check for null and empty strings before anything else
	in CoreParse.


svn path=/branches/mono-2-4/mcs/; revision=125794
2009-02-05 00:21:03 +00:00
Miguel de Icaza 22492c37cc Remove public
svn path=/branches/mono-2-4/mcs/; revision=125749
2009-02-04 20:58:29 +00:00
Zoltan Varga a9e7fb0abd 2009-02-04 Zoltan Varga <[email protected]>
Backport of 125697.

	* mini-exceptions.c (mono_setup_altstack): Use a more reasonable altstack
	size on systems with 64k pages. Fixes #471389.

svn path=/branches/mono-2-4/mono/; revision=125698
2009-02-04 16:34:19 +00:00
Marek Safar 02284d8008 Fixed typo.
svn path=/branches/mono-2-4/mcs/; revision=125684
2009-02-04 14:08:30 +00:00
Marek Habersack 0b4c366520 Backport of r125663
svn path=/branches/mono-2-4/mcs/; revision=125664
2009-02-04 10:45:22 +00:00
Marek Habersack f5c7491d79 Backport of r125659
svn path=/branches/mono-2-4/mcs/; revision=125660
2009-02-04 09:04:05 +00:00
Zoltan Varga 4dd31c484d 2009-02-04 Zoltan Varga <[email protected]>
Backport of 125637.
	
	* Regex.cs: Disable the new regex engine for now.

svn path=/branches/mono-2-4/mcs/; revision=125638
2009-02-04 02:21:16 +00:00
Gonzalo Paniagua Javier 48c4359548 2009-02-03 Gonzalo Paniagua Javier <[email protected]>
* WebConnection.cs:
	* HttpWebRequest.cs: calling Abort is safe now if the request has been
	read entirely.


svn path=/branches/mono-2-4/mcs/; revision=125635
2009-02-04 01:50:26 +00:00
Rodrigo Kumpera 3d48548a24 In metadata:
Backport of r125603.

	* verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
	valuetype is compatible with target type, check by inheritance as a
	VT is not really compatible with System.ValueType, for example.

	* verify.c (do_invoke_method): Improve error message.

	* verify.c (do_box_value): If boxing a nullable, use the type argument
	on stack instead.

	* verify.c (do_newobj): Improve error message.	

	Fixes #469549.

2009-02-03 Rodrigo Kumpera  <[email protected]>

In tests/verifier:
	Backport of r125604.

	* valid_boxed_vt_compatible_with_sys_vt_or_sys_enum.il:
	Regression test for #469549.

2009-02-03 Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-4/mono/; revision=125606
2009-02-03 22:05:30 +00:00
Ivan Zlatev bfb47f0422 2009-02-03 Ivan N. Zlatev <[email protected]>
* DataGridViewRowCollection.cs, DataGridView.cs: Move row completion
	code in the row collection code, so that the completion happens before
	the CollectionChanged event, also better encapsulation.
	[Fixes bug #471987]

svn path=/branches/mono-2-4/mcs/; revision=125587
2009-02-03 19:43:40 +00:00
Rodrigo Kumpera c5e9df9a7d In metadata:
2009-02-03 Rodrigo Kumpera  <[email protected]>

	Backport of r125581.

	* verify.c (mono_delegate_signature_equal): Make it possible to check
	first-arg-bound delegates to static method.

	* verify.c (verify_delegate_compatibility): Correctly verify delegates to
	static methods with the first arg bound.

	Fixes #469529.


In tests/verifier:
	Backport of r125582.

	* unverifiable_delegate_with_bad_bound_first_arg_to_static_method.il:
	* mono/tests/verifier/valid_ldfnt_delegates_of_static_methods.il:
	Regression test for #469529.

2009-02-03 Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-4/mono/; revision=125586
2009-02-03 19:41:23 +00:00
Mark Probst 4bfa3b8cb4 2009-02-03 Mark Probst <[email protected]>
Backport of r125565.

	* generic-sharing.c: Don't hold domain lock when calling
	instantiate_other_info().  Fixes #471958.

	* domain-internals.h, loader.c: Describe locking policy of domain
	lock vs loader lock.

svn path=/branches/mono-2-4/mono/; revision=125570
2009-02-03 18:41:15 +00:00
Rodrigo Kumpera d0cfd383a1 In metadata:
Backport of r125539.

	* verify.c: Added stack_slot_full_name to provide decent and more meanfull
	errors.

	* verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
	under strict mode. Any type, when boxed can be seen as a reference type.

	Fixes #469528.

2009-02-03 Rodrigo Kumpera  <[email protected]>

In tests/verifier:
2009-02-03 Rodrigo Kumpera  <[email protected]>

	Backport of r125540.

	* valid_valuetype_boxed_types_are_merge_compatible.il:
	Regression test for #469528.


svn path=/branches/mono-2-4/mono/; revision=125561
2009-02-03 17:54:42 +00:00
Marek Safar 236f5b982c Fixes build.
svn path=/branches/mono-2-4/mcs/; revision=125550
2009-02-03 16:50:46 +00:00
Marek Safar 082abf401a 2009-02-03 Marek Safar <[email protected]>
* class.cs, generic.cs: Emit type parameter constraints for nested
	types.


svn path=/branches/mono-2-4/mcs/; revision=125508
2009-02-03 12:08:02 +00:00
Gonzalo Paniagua Javier bc2585699c 2009-02-03 Gonzalo Paniagua Javier <[email protected]>
* WebProxy.cs: use TryParse when checking for a localhost IP.


svn path=/branches/mono-2-4/mcs/; revision=125500
2009-02-03 10:08:56 +00:00
Gonzalo Paniagua Javier 6dad7702ea 2009-01-26 Gonzalo Paniagua Javier <[email protected]>
* HttpWebResponse.cs: avoid throwing an exception when
	Content-Length is not present.

svn path=/branches/mono-2-4/mcs/; revision=125493
2009-02-03 08:18:25 +00:00
Raja R Harinath 84031f8584 Fix #463999
* CommittableTransaction.cs (CommitCallback): Handle the case
where the callback is invoked before BeginCommit ends due to the
async call ending synchronously.

svn path=/branches/mono-2-4/mcs/; revision=125490
2009-02-03 07:20:32 +00:00
Rodrigo Kumpera 243a027520 In metadata:
2009-02-03 Rodrigo Kumpera  <[email protected]>

	Backport of r125458.

	* object.h: The lower bound of an array is a signed integer value.
	Introduce mono_array_lower_bound_t typedef. It should be used instead of
	gint32 as under MONO_BIG_ARRAYS it will be a gint64.

	* icall.c: Cast MonoArrayBounds::length to a signed value so correctly
	calculate the upper bound.
	
	Fixes #471252.

In mini:
2009-02-03  Rodrigo Kumpera  <[email protected]>

	Backport of r125459.

	* arrays.cs: Test for Get/SetValue of array with negate lower bounds.
	

svn path=/branches/mono-2-4/mono/; revision=125461
2009-02-03 03:06:01 +00:00
Rodrigo Kumpera 5b78093eef 2008-02-03 Rodrigo Kumpera <[email protected]>
* MonoMethod.cs (ToString): Fix the 1.1 build.


svn path=/branches/mono-2-4/mcs/; revision=125457
2009-02-03 02:53:00 +00:00
Ivan Zlatev 4b6d5edc78 2009-02-02 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: When editing is finished do not remove the editing
	row, because it has already become a real one. Instead add a new one.
	[Fixes bug #471754]

svn path=/branches/mono-2-4/mcs/; revision=125445
2009-02-02 23:36:15 +00:00
Rodrigo Kumpera b9d3e3262c Backport of r125415.
* MonoMethod.cs (ToString): Fix the representation of non primitive structs.

2008-02-02  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-4/mcs/; revision=125417
2009-02-02 22:01:46 +00:00
Rodrigo Kumpera 77c4302bdf In Test/System.Reflection:
2008-02-02  Rodrigo Kumpera  <[email protected]>

	Backport of r125410.

	* MethodInfoTest.cs: Test for #409583.

In System.Reflection:
2008-02-02  Rodrigo Kumpera  <[email protected]>

	Backport of r125409.

	* MonoMethod.cs (ToString): Fix representation of pointer types.

	Fixes #409583.


svn path=/branches/mono-2-4/mcs/; revision=125411
2009-02-02 21:11:19 +00:00
Rodrigo Kumpera 7f13ce00ce 2009-02-02 Rodrigo Kumpera <[email protected]>
Backport of r125402.

	* icall.c (type_from_name): Ignore reflection frames to find out the real caller.

	Fixes #471255.


svn path=/branches/mono-2-4/mono/; revision=125404
2009-02-02 20:40:08 +00:00
Mark Probst 643a83b9a0 2009-02-02 Mark Probst <[email protected]>
Backport of r125388.

	* generic-sharing.c (lookup_or_register_other_info): Make sure the
	loader lock is not taken while the templates lock is held.  Fixes
	#471089.

svn path=/branches/mono-2-4/mono/; revision=125391
2009-02-02 18:48:15 +00:00
Mark Probst 25b50b1c80 2009-02-02 Mark Probst <[email protected]>
Backport or r125371.

	* metadata.c (type_in_image): Added a check to fix a monodis
	crash.

svn path=/branches/mono-2-4/mono/; revision=125377
2009-02-02 17:07:07 +00:00
Andrés G. Aragoneses 2e3f003f5f 2009-02-02 Andrés G. Aragoneses <[email protected]>
* ToolBar.cs: Add new UIAPerformClick method to be called by
        UIAutomationWinforms when someone calls Invoke() on the
        ToolBarButtonProvider. (Backport of r125354.) r: jpobst


svn path=/branches/mono-2-4/mcs/; revision=125358
2009-02-02 16:02:09 +00:00
Marek Safar b8a1e12c73 2009-02-02 Marek Safar <[email protected]>
A fix for bug #471213
	* class.cs: Avoid emitting backing field for abstract event fields.


svn path=/branches/mono-2-4/mcs/; revision=125335
2009-02-02 11:33:07 +00:00
Ivan Zlatev 95ca868476 2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Complete incomplete rows when they are added to
	the grid.
	[Fixes bug #471068]

svn path=/branches/mono-2-4/mcs/; revision=125278
2009-02-01 20:00:30 +00:00
Ivan Zlatev 58c2baf6a6 2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewColumnCollection.cs: Ensure that the
	binding is cleared prior to setting it to null. Fixes a regression
	causing exceptions when the DataSource is set to null and then set
	again to a data source.

svn path=/branches/mono-2-4/mcs/; revision=125272
2009-02-01 18:33:43 +00:00
Marek Safar 3fc405788c 2009-02-01 Marek Safar <[email protected]>
A fix for bug #359731
	* cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
	expressions.


svn path=/branches/mono-2-4/mcs/; revision=125270
2009-02-01 18:23:45 +00:00
Ivan Zlatev 79d7ad5921 2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewImageColumn.cs, DataGridViewCell.cs:
	   - Make Image/Bitmap cells work.
	   - Handle images with size greater than the cell.
	   - Default to MiddleCenter alignment for image cells.
	[Fixes bug #471101]

svn path=/branches/mono-2-4/mcs/; revision=125260
2009-02-01 16:31:21 +00:00
Rodrigo Kumpera 4809f77419 2009-01-31 Rodrigo Kumpera <[email protected]>
Backport of r125172, r125205 and r125206 

	* basic-calls.cs: Test for the weird crash found on arm.
	
	* cpu-arm.md: Increase the size of storer8_membase_reg and
	loadr8_membase_reg to 24 bytes to accomodate the extra add.

	* mini-arm.c (mono_arch_output_basic_block): Under FPA, when emitting
	OP_STORER8_MEMBASE_REG and OP_LOADR8_MEMBASE_REG, add the original
	reg to LR otherwise we'll be loading/storing from just the offset.

	* cpu-arm.md: Increase the size of storer8_membase_reg to 20 bytes
	as it might use decomposed ops.


svn path=/branches/mono-2-4/mono/; revision=125207
2009-01-31 03:55:25 +00:00
Rodrigo Kumpera 71b8786ee9 2009-01-30 Rodrigo Kumpera <[email protected]>
Backport of r125077-79
	* exceptions-arm.c (mono_arch_find_jit_info): The frame layout on arm have
	separate frame and stack pointers, so we must use FP to find the register
	spill area.
	The FP reg is retrieved from the MonoContext::regs array.


	* mini-arm.c (mono_arch_output_basic_block): Emit two cond ops for OP_FBGE
	as FPA requires it.

	* mini-arm.c (mono_arch_emit_setret): Emit OP_FMOVE for methods that
	return R4 and R8 when not running under softfloat.

	Fixes basic-calls.exe


svn path=/branches/mono-2-4/mono/; revision=125116
2009-01-30 17:12:46 +00:00
Marek Habersack 0c0fa5ec89 Backport of r125111.
svn path=/branches/mono-2-4/mcs/; revision=125112
2009-01-30 16:53:05 +00:00
Marek Safar 57e29afeaf 2009-01-30 Marek Safar <[email protected]>
A fix for bug #470767
	* statement.cs: Introduced BlockScopeExpression, needed when 
	expression tree conversion has to emit scope variables.


svn path=/branches/mono-2-4/mcs/; revision=125096
2009-01-30 14:51:17 +00:00
Gonzalo Paniagua Javier c1577730af revert changes that should not be here yet
svn path=/branches/mono-2-4/mcs/; revision=124989
2009-01-29 19:00:13 +00:00
Gonzalo Paniagua Javier e22310c6b8 fix the 1.x build. Patch from Marek Safar
svn path=/branches/mono-2-4/mcs/; revision=124986
2009-01-29 18:57:41 +00:00
Gonzalo Paniagua Javier dc34921ff7 fix changelog
svn path=/branches/mono-2-4/mcs/; revision=124960
2009-01-29 17:18:54 +00:00
Gonzalo Paniagua Javier c4c2071766 2009-01-29 Gonzalo Paniagua Javier <[email protected]>
* Tds70.cs: fix for output parameters and '@'.
	Fixes bug #470120.


svn path=/branches/mono-2-4/mcs/; revision=124959
2009-01-29 17:16:46 +00:00
Gonzalo Paniagua Javier 16e7814ee4 2009-01-29 Gonzalo Paniagua Javier <[email protected]>
* HttpApplicationFactory.cs: fix check that avoids lock. Keep one
	HttpApplication instance ready to be returned in an instance variable
	to avoid a few locks.


svn path=/branches/mono-2-4/mcs/; revision=124949
2009-01-29 16:41:12 +00:00
Carlos Alberto Cortez 568d44fd06 2009-01-29 Carlos Alberto Cortez <[email protected]>
* XplatUIX11.cs: We should use utf8 handling clipboard transference
        with other x11 applications, and use utf16 when handling clipboard
        data in the class library. Update the related points as well.
        Fixes #468683.


svn path=/branches/mono-2-4/mcs/; revision=124920
2009-01-29 14:15:30 +00:00
Ivan Zlatev bcdc624995 2009-01-28 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Format strings according to the supplied
	CellStyle.Format.
	[Fixes bug #470384]

svn path=/branches/mono-2-4/mcs/; revision=124878
2009-01-28 23:34:19 +00:00
Marek Habersack f2b360fc5d Backport of r124872
svn path=/branches/mono-2-4/mcs/; revision=124874
2009-01-28 23:29:31 +00:00
Bill Holmes f913aabf5c 2009-01-28 Bill Holmes <[email protected]>
Backport of r124869.

	* Uri.cs (IsWellFormedUriString):  Changing IsWellFormedUriString
	  to not throw an exception but return false instead.

	Contributed under MIT/X11 license.


svn path=/branches/mono-2-4/mcs/; revision=124870
2009-01-28 23:24:09 +00:00
Ivan Zlatev 3cd16ddbdb 2009-01-28 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Reset the hover cell if it gets moved due to row(s)
	addition or removal. Fixes multiple crashes in OnMouseMove.

svn path=/branches/mono-2-4/mcs/; revision=124868
2009-01-28 22:48:56 +00:00
Carlos Alberto Cortez 8edff05440 2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeNode.cs: NextVisibleNode and PrevVisibleNode properties don't
	take into account the fact that OpenTreeNodeEnumerator needs to call
	MoveNext/MovePrevious to actually put the passed node as the one
	retrieved in Current. This way this property should work as really
	expected in .net.
	Fixes part of #467225.


svn path=/branches/mono-2-4/mcs/; revision=124802
2009-01-28 17:14:50 +00:00
Carlos Alberto Cortez bd3a3e1ec5 2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: When calculating the scrollbars, don't use
	TreeNode.Bounds, since it still can have the values of the previous
	-and now invalid- layout -which depends on TreeView.skipped_nodes, and
	could not have been updated as well-, and use the actual number of
	visible number of nodes to compute the height needed to contain all
	the nodes. Also reset the value of vbar to 0 when disabled - this way
	we make sure that, when re-enabled, it will update the visible area of
	the treeview, even if the previous value before disabling it is the
	same as now. Finally don't do anything for the vbar.ValueChanged
	handler - for the case wheer we manually set the value but don't the
	vbar is disabled already.
	Fixes part of #467225.


svn path=/branches/mono-2-4/mcs/; revision=124801
2009-01-28 17:12:51 +00:00
Carlos Alberto Cortez 330dee9522 2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: In CollapseAll, set vbar to the maximum value, instead 
	of trying to set as top node the highest parent of the previous
	top node. Moving to the bottom of the TreeView after a call
	to CollapseAll is exactly what .net does. This should avoid some
	nasty issue when CollapseAll is called and we don't need the
	vertical scroll bar.
	

svn path=/branches/mono-2-4/mcs/; revision=124800
2009-01-28 17:09:34 +00:00
Marek Safar e65b5f396b 2009-01-28 Marek Safar <[email protected]>
A fix for bug #470227
	* cs-tokenizer.cs: Remove too agressive parser optimization.


svn path=/branches/mono-2-4/mcs/; revision=124787
2009-01-28 16:13:16 +00:00
Marek Safar 5c4721c3d5 2009-01-28 Marek Safar <[email protected]>
A fix for bug #324319
	* class.cs: Remove too early base type resolve.


svn path=/branches/mono-2-4/mcs/; revision=124770
2009-01-28 12:29:20 +00:00
Mark Probst 3f7fdcc82d 2009-01-27 Mark Probst <[email protected]>
Backport of r124712.

	* method-to-ir.c (emit_stloc_ir): Only apply the reg-reg move
	optimization if the top of stack is the last instruction in the
	bblock.  Otherwise it might have been used after its definition.
	Fixes #469742.

2009-01-27  Mark Probst  <[email protected]>

	Backport of r124712.

	* bug469742.2.il: New test.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=124715
2009-01-27 21:49:44 +00:00
Zoltan Varga a3d384dbbf 2009-01-27 Zoltan Varga <[email protected]>
* Backport of r123987.

	* method-to-ir.c (method-to-ir.c): Add support for the constrained prefix
	on type variables in AOTed code.

svn path=/branches/mono-2-4/mono/; revision=124691
2009-01-27 18:31:49 +00:00
Ivan Zlatev 699f408478 2009-01-27 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix a NRE when setting the CurrentCell to null.

svn path=/branches/mono-2-4/mcs/; revision=124671
2009-01-27 16:48:12 +00:00
Ivan Zlatev 332943e496 2009-01-27 Ivan N. Zlatev <[email protected]>
* XplatUIX11.cs: Fire Timer.Tick even if there is no MainForm for the
	current context.
	[Fixes bug #469239]

svn path=/branches/mono-2-4/mcs/; revision=124669
2009-01-27 16:41:05 +00:00
Marek Habersack 204dc4ea04 Backport of r124659
svn path=/branches/mono-2-4/mcs/; revision=124660
2009-01-27 14:25:33 +00:00
Gonzalo Paniagua Javier 49bbf1f4c3 2009-01-26 Christian Prochnow <[email protected]>
* Ping.cs: ignore ICMP echo request packet in case we ping
	  localhost.


svn path=/branches/mono-2-4/mcs/; revision=124625
2009-01-27 04:23:18 +00:00
Andreia Gaita 401cabfc6a 2009-01-26 Andreia Gaita <[email protected]>
* WebBrowser.cs: fix initial value of ScrollbarsEnabled, so they
	won't be disabled by default.
	[Backported from r124596, fixes #468690]

svn path=/branches/mono-2-4/mcs/; revision=124615
2009-01-27 00:44:14 +00:00
Marek Safar a2e8d38fa6 2009-01-27 Marek Safar <[email protected]>
* anonymous.cs: Fixed recent regression when initializing captured 
	this.


svn path=/branches/mono-2-4/mcs/; revision=124608
2009-01-27 00:01:40 +00:00
Zoltan Varga 099b6e3c26 2009-01-26 Zoltan Varga <[email protected]>
Backport of r124582.

	* mini-s390x.c: Remove a stray declaration of emit_sig_cookie () to fix
	the s390x build.

svn path=/branches/mono-2-4/mono/; revision=124583
2009-01-26 22:12:45 +00:00
Ivan Zlatev 9979ab1f91 2009-01-26 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not clear the rows if we are not databound.

svn path=/branches/mono-2-4/mcs/; revision=124570
2009-01-26 21:58:17 +00:00
Ivan Zlatev f11abca644 2009-01-26 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not be too smart about selecting the first cell
	when the first row is added as this is not what MS does. Fixes the
	failing unit tests.

svn path=/branches/mono-2-4/mcs/; revision=124566
2009-01-26 21:45:47 +00:00
Marek Habersack c12233306a Backport of r124547
svn path=/branches/mono-2-4/mcs/; revision=124548
2009-01-26 18:58:39 +00:00
Marek Safar 5995136419 2009-01-26 Marek Safar <[email protected]>
A fix for bug #469019
	* anonymous.cs: Use all parent type parameters when instantiating
	nested generic storey.


svn path=/branches/mono-2-4/mcs/; revision=124533
2009-01-26 16:49:46 +00:00
Marek Safar 2441d1f521 2009-01-26 Marek Safar <[email protected]>
* expression.cs: Check for null instance methodgroup expression.


svn path=/branches/mono-2-4/mcs/; revision=124506
2009-01-26 15:28:26 +00:00
Marek Habersack 410a27b2bf Backport of r124491
svn path=/branches/mono-2-4/mcs/; revision=124492
2009-01-26 13:27:30 +00:00
Marek Safar a05f9f8b5e 2009-01-26 Marek Safar <[email protected]>
A fix for bug #469244
	* cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
	instance inside a conditional expression.


svn path=/branches/mono-2-4/mcs/; revision=124489
2009-01-26 13:20:16 +00:00
Marek Habersack 6e5c11cd30 Backport of r124479
svn path=/branches/mono-2-4/mcs/; revision=124481
2009-01-26 11:39:43 +00:00
Marek Habersack b1c0dfa135 Backport of r124475
svn path=/branches/mono-2-4/mcs/; revision=124476
2009-01-26 10:47:02 +00:00
Gonzalo Paniagua Javier 3653a83b39 2009-01-26 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs:
	(TestSelect1) avoid RST by reading the bytes from the client.

svn path=/branches/mono-2-4/mcs/; revision=124464
2009-01-26 07:02:18 +00:00
Zoltan Varga cb0c6ba813 2009-01-26 Zoltan Varga <[email protected]>
Backport of r124456.

	* exceptions-amd64.c (mono_arch_exceptions_init): Call 
	get_throw_pending_exception () to avoid initialization races.

	* mini-exceptions.c (mono_exceptions_init): Call an arch specific
	mono_arch_exceptions_init () function.

svn path=/branches/mono-2-4/mono/; revision=124462
2009-01-26 06:52:10 +00:00
Gonzalo Paniagua Javier 16eaf2a641 2009-01-26 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: added locking in SetResponseData for the case
	when we get an error response before BeginGetResponse has been
	called.


svn path=/branches/mono-2-4/mcs/; revision=124453
2009-01-26 05:03:35 +00:00
Gonzalo Paniagua Javier 516a0835f0 fix ChangeLog
svn path=/branches/mono-2-4/mcs/; revision=124413
2009-01-24 08:16:23 +00:00
Gonzalo Paniagua Javier 7ff67aa81a Improved TDS connection pooling and synched with HEAD
svn path=/branches/mono-2-4/mcs/; revision=124409
2009-01-24 05:56:39 +00:00
Gonzalo Paniagua Javier 6f0d5440ce Do not throw exceptions when attempting to load satellite assemblies
svn path=/branches/mono-2-4/mcs/; revision=124407
2009-01-24 05:35:35 +00:00
Gonzalo Paniagua Javier 06c1a5f74c 2009-01-24 Gonzalo Paniagua Javier <[email protected]>
* appdomain.c: return NULL instead of throwing FileNotFoundException
	when LoadAssembly() fails.


svn path=/branches/mono-2-4/mono/; revision=124406
2009-01-24 05:35:23 +00:00
Gonzalo Paniagua Javier 572fa90350 2009-01-23 Gonzalo Paniagua Javier <[email protected]>
* AspComponentFoundry.cs: no need to throw. Caller handles a null
	return value.


svn path=/branches/mono-2-4/mcs/; revision=124398
2009-01-24 03:28:19 +00:00
Gonzalo Paniagua Javier 9a7ac8152c 2009-01-23 Gonzalo Paniagua Javier <[email protected]>
* HttpResponse.cs: make sure config is not null here.
	* HttpApplication.cs: add a timer (-d:PIPELINE_TIMER) for the pipeline.
	Handle timeouts for OutputPage() too.


svn path=/branches/mono-2-4/mcs/; revision=124396
2009-01-24 03:20:13 +00:00
Gonzalo Paniagua Javier 9468c9429f 2009-01-23 Gonzalo Paniagua Javier <[email protected]>
* HttpApplicationFactory.cs: set/reset the context for the application
	when creating/disposing. Dispose() out of the lock.


svn path=/branches/mono-2-4/mcs/; revision=124394
2009-01-24 03:04:12 +00:00
Marek Habersack 0c702ece52 Backport of r124385
svn path=/branches/mono-2-4/mcs/; revision=124386
2009-01-24 00:38:33 +00:00
Marek Habersack 8b2e70be67 Backport of r124377
svn path=/branches/mono-2-4/mcs/; revision=124378
2009-01-23 21:50:04 +00:00
Mark Probst 8ee63bd04a 2009-01-23 Mark Probst <[email protected]>
Backport of r124339.

	* mini-ppc.c (mono_arch_context_get_int_reg): Allow access to the
	stack pointer (r1).

svn path=/branches/mono-2-4/mono/; revision=124340
2009-01-23 16:48:19 +00:00
Marek Habersack 30f6ae193f 2009-01-23 Marek Habersack <[email protected]>
* BuildManager.cs: if dependencyCache already contains the virtual
	path, replace its corresponding file set (in AddToCache). This can
	happen only if the requested virtual path compilation resulted in
	errors and the compilation has been retried. Fixes bug #46268


svn path=/branches/mono-2-4/mcs/; revision=124326
2009-01-23 14:07:17 +00:00
Mark Probst 6d52bd6446 2009-01-23 Mark Probst <[email protected]>
Backport of r124022 and r124301.

	* metadata.c (mono_metadata_generic_param_equal): Owner as well as
	image must match.  Only compare the image if the owner is NULL.
	Fixes the AOT failures.

svn path=/branches/mono-2-4/mono/; revision=124305
2009-01-23 09:40:04 +00:00
Ivan Zlatev 85b4874919 2009-01-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewCell.cs: Fix crashes when there is no
	editing control.

svn path=/branches/mono-2-4/mcs/; revision=124281
2009-01-23 01:35:31 +00:00
Ivan Zlatev ab52d70383 2009-01-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix new row adding/editing in the non-databound
	scenario.

svn path=/branches/mono-2-4/mcs/; revision=124280
2009-01-23 01:35:26 +00:00
Zoltan Varga 64d093c92a 2009-01-23 Zoltan Varga <[email protected]>
Backport of r124266.
	
	* metadata.c (mono_metadata_load_generic_params): Initialize the 
	MonoGenericParam structure using memset so the image field is initialized
	as well.

svn path=/branches/mono-2-4/mono/; revision=124268
2009-01-22 23:43:26 +00:00
Zoltan Varga b0af86bfc2 2009-01-22 Zoltan Varga <[email protected]>
Backport of r124260.
	
	* Stopwatch.cs: Reorder the calculations in Elapsed and ElapsedMilliseconds
	to avoid overflow. Fixes #468570. Patch by Yoni Shalom <[email protected]>.

svn path=/branches/mono-2-4/mcs/; revision=124262
2009-01-22 22:19:55 +00:00
Mark Probst 655579cbb1 2009-01-22 Mark Probst <[email protected]>
Backport of r124246.

	* mini-exceptions.c (ves_icall_get_frame_info): Fetch the generic
	info from the (correct) context.

2009-01-22  Mark Probst  <[email protected]>

	Backport of r124246.

	* generic-stack-traces2.2.cs: Another generic sharing test for
	stack traces.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=124249
2009-01-22 21:15:17 +00:00
Jb Evain 2809fe1936 idiotic test NotWorking
svn path=/branches/mono-2-4/mcs/; revision=124242
2009-01-22 20:10:33 +00:00
Jb Evain e5590d4ff5 backport the linq fixes that happened in 124200:124231
svn path=/branches/mono-2-4/mcs/; revision=124232
2009-01-22 17:43:38 +00:00
Neville Gao 4d259921aa Backported r124045: Control enabled to support accessibility. Added
UIACollectionChangedEvent.

svn path=/branches/mono-2-4/mcs/; revision=124172
2009-01-22 06:01:24 +00:00
Mike Gorse 0043b1fd2b * TrackBar.cs: Backported R124116: Make LargeIncrement/Decrement
internal so that UIA can use them.
  Added UIAValueParamChangedEvent.

svn path=/branches/mono-2-4/mcs/; revision=124129
2009-01-21 23:32:53 +00:00
Atsushi Eno 8b50ed4dbb backport r124126.
svn path=/branches/mono-2-4/mcs/; revision=124127
2009-01-21 23:21:22 +00:00
Marek Habersack 7727921d34 Backport of r124121 and r124122
svn path=/branches/mono-2-4/mcs/; revision=124123
2009-01-21 22:53:22 +00:00
Zoltan Varga 56c1d33ae4 Revert r124022 as it is breaking AOT.
svn path=/branches/mono-2-4/mono/; revision=124102
2009-01-21 20:16:59 +00:00
Zoltan Varga cad348bcb2 2009-01-21 Zoltan Varga <[email protected]>
Backport of r124092.
	
	* method-to-ir.c (handle_alloc): Avoid generic instances in the
	out_of_line optimization.

svn path=/branches/mono-2-4/mono/; revision=124095
2009-01-21 19:34:51 +00:00
Mario Carrion c643703e79 2009-01-21 Mario Carrion <[email protected]>
* Form.cs: Backported r124064: UIA Support: Internal events
        added: UIAWindowStateChanged and UIATopMostChanged.

svn path=/branches/mono-2-4/mcs/; revision=124082
2009-01-21 18:54:38 +00:00
Zoltan Varga 9c234e78b1 Fix the 1.1 build.
svn path=/branches/mono-2-4/mcs/; revision=124077
2009-01-21 18:13:20 +00:00
Rodrigo Kumpera 85c63ecffe 2009-01-21 Rodrigo Kumpera <[email protected]>
Backport of r124059.

	* appdomain-unload-callback.cs: New test for the AppDomain::DomainUnload
	deadlock.

	* Makefile.am: Test added.


svn path=/branches/mono-2-4/mono/; revision=124072
2009-01-21 18:00:02 +00:00
Rodrigo Kumpera 86877ecd25 2009-01-21 Rodrigo Kumpera <[email protected]>
Backport of r124068.

	* appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
	a plain store.

2009-01-21 Rodrigo Kumpera  <[email protected]>

	Backport of r124058.

	* domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
	which signals that the unloading has started but all appdomain services must
	remain operational.

	* appdomain.c (mono_domain_unload): The initial state for unloading now
	is unloading_start and we switch to unloading after the managed call to
	AppDomain::DomainUnload has finished.

	The new unloading state has to be created because managed code in the
	DomainUnload event can depend on things like the threadpool still working.
	The domain must remain fully functional while the event executes.

	This shown as an issue due to Process::WaitForExit, which waits for
	async reads of stdout and stderr to complete. Since those are processed
	in the threadpool the code deadlocks because the DomainUnload callback 
	waits for the async read finished event, which should have been set by a
	threadpool job but has been discarded due to the domain been in unload
	state.


svn path=/branches/mono-2-4/mono/; revision=124071
2009-01-21 17:58:36 +00:00
Zoltan Varga a228d05aec 2009-01-21 Zoltan Varga <[email protected]>
Backport of r124065.
	
	* class.c (mono_class_setup_vtable_general): In the generic instance
	optimization, set method->slot for abstract virtual methods. Fixes part of
	#467834.

svn path=/branches/mono-2-4/mono/; revision=124067
2009-01-21 17:42:11 +00:00
Martin Baulig 19503869ca 2009-01-21 Martin Baulig <[email protected]>
Backport or r124060.

	* mini.h
	(MonoCompile): Added `disable_deadce_vars' to disable removing
	unused variables.

	* mini.c
	(mini_method_compile): Set `cfg->disable_deadce_vars' when running
	inside the debugger.

	* liveness.c (mono_analyze_liveness): Don't remove any unused
	variables if `cfg->disable_deadce_vars' is set.


svn path=/branches/mono-2-4/mono/; revision=124061
2009-01-21 17:00:39 +00:00
Sandy Armstrong 9e91c826fd * Managed.Windows.Forms/System.Windows.Forms/MenuItem.cs: Add
UIACheckChanged, UIARadioCheckChanged, UIAEnabledChanged, and
  UIATextChanged events.

* Managed.Windows.Forms/System.Windows.Forms/Form.cs: Add UIAMenuChanged
  event.

* Managed.Windows.Forms/System.Windows.Forms/Menu.cs:
* Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs: Note which
  internal APIs are being used by UIA.

svn path=/branches/mono-2-4/mcs/; revision=124055
2009-01-21 16:31:22 +00:00
Mark Probst ebb82987f6 2009-01-21 Mark Probst <[email protected]>
Backport of r124028.

	* method-to-ir.c: Only apply exception constructor optimization if
	the the method actually belongs to an exception class.  Fixes
	#467456.

2009-01-21  Mark Probst  <[email protected]>

	Backport of r124028.

	* bug-467456.cs: New test case.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=124031
2009-01-21 12:36:49 +00:00
Mark Probst e311191ef7 2009-01-21 Mark Probst <[email protected]>
Backport of r124022.

	* metadata.c (mono_metadata_generic_param_equal): Owner as well as
	image must match.

2009-01-21  Mark Probst  <[email protected]>

	Backport of r124022.

	* generic-unloading.2.cs, generic-unloading-sub.2.cs: Test case
	for unloading images whose MonoGenericInst's are still in use.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=124025
2009-01-21 11:11:54 +00:00
Zoltan Varga ab819e4118 2009-01-21 Zoltan Varga <[email protected]>
Backport of r123989.
	
	* mini-trampolines.c (mono_delegate_trampoline): Put back the previous
	change inside a #ifdef __mono_ppc64__.

svn path=/branches/mono-2-4/mono/; revision=123990
2009-01-21 04:33:07 +00:00
Zoltan Varga dc3f9d3f6d Fix the windows build.
svn path=/branches/mono-2-4/mono/; revision=123981
2009-01-21 01:55:25 +00:00
Mark Probst 451bc2a8a8 2009-01-21 Mark Probst <[email protected]>
Backport of r123959.

	* TypeBuilderTest.cs: Add test for fields in dynamic generic
	classes.

svn path=/branches/mono-2-4/mcs/; revision=123965
2009-01-21 00:03:59 +00:00
Mark Probst 84b2d6bfec 2009-01-21 Mark Probst <[email protected]>
Backport of r123958.

	* reflection.c (resolve_object): For fields, inflate the class and
	then get the field in the inflated class.

svn path=/branches/mono-2-4/mono/; revision=123964
2009-01-21 00:03:38 +00:00
Mark Probst a498cddad7 2009-01-20 Mark Probst <[email protected]>
Backport of r123917.

	* method-to-ir.c: Force the vtable variable in shared generic code
	for the case that they might show up on a stack trace where they
	are needed.

	* mini-exceptions.c: Save and use generic sharing info as well as
	IP in stack traces to resolve shared generic instantiations.

2009-01-20  Mark Probst  <[email protected]>

	Backport of r123917.

	* object-internals.h (struct _MonoException): Added a comment
	explaining the new use of trace_ips.

2009-01-20  Mark Probst  <[email protected]>

	Backport of r123917.

	* generic-stack-traces.2.cs: Generic sharing test for stack
	traces.

	* Makefile.am: Test added.

svn path=/branches/mono-2-4/mono/; revision=123946
2009-01-20 22:14:33 +00:00
Zoltan Varga 03c6b6918b 2009-01-20 Zoltan Varga <[email protected]>
Backport of r123914.
	
	* mini-trampolines.c (mono_delegate_trampoline): Revert the change which
	added a mono_get_addr_from_ftnptr () as it breaks the ia64 build.

svn path=/branches/mono-2-4/mono/; revision=123927
2009-01-20 21:22:20 +00:00
Andrew Jorgensen dc279e74dc update version numbers to 2.4
svn path=/branches/mono-2-4/mono/; revision=123902
2009-01-20 18:21:18 +00:00
376 changed files with 14665 additions and 3239 deletions

No files matched your search

+11
View File
@@ -1,3 +1,14 @@
2009-02-26 Marek Habersack <[email protected]>
* data/mono.web.pc.in: added. Fixes bug #479760
* data/Makefile.am: added mono.pc{.in} wherever necessary
2009-02-07 Gonzalo Paniagua Javier <[email protected]>
* configure.in: include stdio so that NULL is defined when checking
for ifreq.
2009-01-17 Zoltan Varga <[email protected]>
* configure.in: Complete the OPROFILE checks.
+3 -1
View File
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,2.3)
AM_INIT_AUTOMAKE(mono,2.4)
AM_MAINTAINER_MODE
API_VER=1.0
@@ -1361,6 +1361,7 @@ if test x$platform_win32 = xno; then
AC_CHECK_HEADERS(net/if.h)
AC_MSG_CHECKING(for ifreq)
AC_TRY_COMPILE([
#include <stdio.h>
#include <sys/ioctl.h>
#include <net/if.h>
], [
@@ -2367,6 +2368,7 @@ data/mono-nunit.pc
data/mono-options.pc
data/mono-lineeditor.pc
data/monodoc.pc
data/mono.web.pc
data/dotnet.pc
data/dotnet35.pc
data/wcf.pc
+4 -4
View File
@@ -8,24 +8,24 @@ EXTRA_DIST = \
mono.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in smcs.pc.in \
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
dtrace-prelink.sh
dtrace-prelink.sh mono.web.pc.in
pkgconfigdir = $(libdir)/pkgconfig
if JIT_SUPPORTED
if INTERP_SUPPORTED
pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
system.web.extensions.design_1.0.pc mono.web.pc
else
pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
system.web.extensions.design_1.0.pc mono.web.pc
endif
else
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
endif
DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc
system.web.extensions.design_1.0.pc mono.web.pc
mono_DATA = config \
browscap.ini
+4
View File
@@ -0,0 +1,4 @@
Name: Mono.Web
Description: Mono ASP.NET extension classes
Version: 2.0.0.0
Libs: -r:@prefix@/lib/mono/gac/Mono.Web/2.0.0.0__0738eb9f132ed756/Mono.Web.dll
+8
View File
@@ -1,3 +1,11 @@
2009-02-24 Jonathan Pryor <[email protected]>
* docs/Makefile: Remove and don't install nunit-docs.source. As
Atsushi Enomoto said on 2008-11-26, Mono's NUnit is for internal use
only, and installing nunit-docs.source causes an warning message
during monodoc startup.
* docs/nunit-docs.source: Remove.
2008-12-10 Atsushi Enomoto <[email protected]>
* Makefile : remove sys.messaging from CENTUM_TESTS. It has never
@@ -1,3 +1,207 @@
2009-02-24 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Invalidate the datagrid when the cell is selected
or deselected.
[Fixes bug #479124]
2009-02-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Make the ScrollBars property work properly.
2009-02-22 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix row removal in the data-bound scenario.
2009-02-19 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Use strict equality comparison in order to
prevent superfluous CellValueChanged events.
2009-02-19 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not reset the columns when the data list changes,
but only the rows. Fixes multiple bugs related to sorting, custom
column styles being reset and more.
2009-02-07 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: End or if end fails then cancel the current edit
operation before clearing the data source.
2009-02-07 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Data-bind only after the handle is created.
[Fixes bug #473680]
2009-02-05 Ivan N. Zlatev <[email protected]>
* DataGridViewRowCollection.cs, DataGridView.cs: Fix row insertation:
- Use ArrayList.Insert instead of the Item property so that the item
is actually inserted and not an existing item replaced.
- Call DataGridView.OnRowsAddedInternal and drop internal from
OnRowsAdded for binary compitability. This also fixes several
redrawing issues.
[Fixes bug #472968]
2009-02-05 Andrés G. Aragoneses <[email protected]>
* ToolBarButton.cs: OnTextChanged added.
(Backport of r125802.) r: jpobst
2009-02-03 Ivan N. Zlatev <[email protected]>
* DataGridViewRowCollection.cs, DataGridView.cs: Move row completion
code in the row collection code, so that the completion happens before
the CollectionChanged event, also better encapsulation.
[Fixes bug #471987]
2009-02-02 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: When editing is finished do not remove the editing
row, because it has already become a real one. Instead add a new one.
[Fixes bug #471754]
2009-02-02 Andrés G. Aragoneses <[email protected]>
* ToolBar.cs: Add new UIAPerformClick method to be called by
UIAutomationWinforms when someone calls Invoke() on the
ToolBarButtonProvider. (Backport of r125354.) r: jpobst
2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Complete incomplete rows when they are added to
the grid.
[Fixes bug #471068]
2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewColumnCollection.cs: Ensure that the
binding is cleared prior to setting it to null. Fixes a regression
causing exceptions when the DataSource is set to null and then set
again to a data source.
2009-02-01 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewImageColumn.cs, DataGridViewCell.cs:
- Make Image/Bitmap cells work.
- Handle images with size greater than the cell.
- Default to MiddleCenter alignment for image cells.
[Fixes bug #471101]
2009-01-29 Carlos Alberto Cortez <[email protected]>
* XplatUIX11.cs: We should use utf8 handling clipboard transference
with other x11 applications, and use utf16 when handling clipboard
data in the class library. Update the related points as well.
Fixes #468683.
2009-01-28 Ivan N. Zlatev <[email protected]>
* DataGridViewCell.cs: Format strings according to the supplied
CellStyle.Format.
[Fixes bug #470384]
2009-01-28 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Reset the hover cell if it gets moved due to row(s)
addition or removal. Fixes multiple crashes in OnMouseMove.
2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeNode.cs: NextVisibleNode and PrevVisibleNode properties don't
take into account the fact that OpenTreeNodeEnumerator needs to call
MoveNext/MovePrevious to actually put the passed node as the one
retrieved in Current. This way this property should work as really
expected in .net.
Fixes part of #467225.
2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: When calculating the scrollbars, don't use
TreeNode.Bounds, since it still can have the values of the previous
-and now invalid- layout -which depends on TreeView.skipped_nodes, and
could not have been updated as well-, and use the actual number of
visible number of nodes to compute the height needed to contain all
the nodes. Also reset the value of vbar to 0 when disabled - this way
we make sure that, when re-enabled, it will update the visible area of
the treeview, even if the previous value before disabling it is the
same as now. Finally don't do anything for the vbar.ValueChanged
handler - for the case wheer we manually set the value but don't the
vbar is disabled already.
Fixes part of #467225.
2009-01-28 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: In CollapseAll, set vbar to the maximum value, instead
of trying to set as top node the highest parent of the previous
top node. Moving to the bottom of the TreeView after a call
to CollapseAll is exactly what .net does. This should avoid some
nasty issue when CollapseAll is called and we don't need the
vertical scroll bar.
2009-01-27 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix a NRE when setting the CurrentCell to null.
2009-01-27 Ivan N. Zlatev <[email protected]>
* XplatUIX11.cs: Fire Timer.Tick even if there is no MainForm for the
current context.
[Fixes bug #469239]
2009-01-26 Andreia Gaita <[email protected]>
* WebBrowser.cs: fix initial value of ScrollbarsEnabled, so they
won't be disabled by default.
Fixes #468690
2009-01-26 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not clear the rows if we are not databound.
2009-01-26 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Do not be too smart about selecting the first cell
when the first row is added as this is not what MS does. Fixes the
failing unit tests.
2009-01-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs, DataGridViewCell.cs: Fix crashes when there is no
editing control.
2009-01-23 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Fix new row adding/editing in the non-databound
scenario.
2009-01-21 Neville Gao <[email protected]>
* ToolBar.cs: Backported r124045: Control enabled to support
accessibility. Added UIACollectionChangedEvent.
[Fixes Bug #455950]
2009-01-21 Mike Gorse <[email protected]>
* TrackBar.cs: Backported R124116: Make LargeIncrement/Decrement
internal so that UIA can use them.
Added UIAValueParamChangedEvent.
2009-01-21 Mario Carrion <[email protected]>
* Form.cs: Backported r124064: UIA Support: Internal events
added: UIAWindowStateChanged and UIATopMostChanged.
2009-01-21 Sandy Armstrong <[email protected]>
* MenuItem.cs: Add UIACheckChanged, UIARadioCheckChanged,
UIAEnabledChanged, and UIATextChanged events.
* Form.cs: Add UIAMenuChanged event.
* Menu.cs:
* MenuAPI.cs: Note which internal APIs are being used by UIA.
2009-01-19 Carlos Alberto Cortez <[email protected]>
* TreeView.cs: When handling mouse up event, check whether
@@ -215,6 +215,7 @@ namespace System.Windows.Forms {
selectionMode = DataGridViewSelectionMode.RowHeaderSelect;
showCellErrors = true;
showEditingIcon = true;
scrollBars = ScrollBars.Both;
userSetCursor = Cursor.Current;
virtualMode = false;
@@ -680,13 +681,12 @@ namespace System.Windows.Forms {
/// to the data cache, or the new cell is in a hidden
/// row.
/////////////////////////////////////////////////////
if (value.DataGridView != this)
throw new ArgumentException("The cell is not in this DataGridView.");
if (value != null)
MoveCurrentCell (value.OwningColumn.Index, value.OwningRow.Index, true, false, false, true);
else
if (value == null)
MoveCurrentCell (-1, -1, true, false, false, true);
else if (value.DataGridView != this)
throw new ArgumentException("The cell is not in this DataGridView.");
else
MoveCurrentCell (value.OwningColumn.Index, value.OwningRow.Index, true, false, false, true);
}
}
@@ -711,7 +711,8 @@ namespace System.Windows.Forms {
set {
if (dataMember != value) {
dataMember = value;
ReBind ();
if (IsHandleCreated)
ReBind ();
OnDataMemberChanged(EventArgs.Empty);
}
}
@@ -732,8 +733,10 @@ namespace System.Windows.Forms {
if (!(value == null || value is IList || value is IListSource || value is IBindingList || value is IBindingListView))
throw new NotSupportedException ("Type cannot be bound.");
ClearBinding ();
dataSource = value;
ReBind ();
if (IsHandleCreated)
ReBind ();
OnDataSourceChanged (EventArgs.Empty);
}
}
@@ -1166,6 +1169,8 @@ namespace System.Windows.Forms {
/// or canceled.
///////////////////////////////////////////////////////////
scrollBars = value;
PerformLayout ();
Invalidate ();
}
}
@@ -2295,7 +2300,8 @@ namespace System.Windows.Forms {
cell.PositionEditingControl (true, true, this.GetCellDisplayRectangle (cell.ColumnIndex, cell.RowIndex, false), bounds, style, false, false, (columns [cell.ColumnIndex].DisplayIndex == 0), (cell.RowIndex == 0));
// Show the editing control
EditingControlInternal.Visible = true;
if (EditingControlInternal != null)
EditingControlInternal.Visible = true;
IDataGridViewEditingControl dgvEditingControl = (IDataGridViewEditingControl) EditingControlInternal;
if (dgvEditingControl != null) {
@@ -2328,7 +2334,8 @@ namespace System.Windows.Forms {
DataManager.CancelCurrentEdit ();
new_row_editing = false;
PrepareEditingRow (true, false);
PrepareEditingRow (false, false);
MoveCurrentCell (currentCell.ColumnIndex, NewRowIndex, true, false, false, true);
OnUserDeletedRow (new DataGridViewRowEventArgs (EditingRow));
}
}
@@ -2427,7 +2434,9 @@ namespace System.Windows.Forms {
Focus ();
if (currentCell.RowIndex == NewRowIndex) {
new_row_editing = false;
PrepareEditingRow (false, false);
editing_row = null; // editing row becomes a real row
PrepareEditingRow (true, false); // add a new editing row
MoveCurrentCell (currentCell.ColumnIndex, NewRowIndex, true, false, false, true);
}
return true;
}
@@ -3662,7 +3671,6 @@ namespace System.Windows.Forms {
//
if (!is_autogenerating_columns && columns.Count == 1)
ReBind ();
foreach (DataGridViewRow row in Rows)
row.Cells.Add ((DataGridViewCell)e.Column.CellTemplate.Clone ());
}
@@ -3963,6 +3971,7 @@ namespace System.Windows.Forms {
protected override void OnHandleCreated (EventArgs e)
{
base.OnHandleCreated(e);
ReBind ();
if (CurrentCell == null && Rows.Count > 0 && Columns.Count > 0)
MoveCurrentCell (ColumnDisplayIndexToIndex (0), 0, true, false, false, false);
@@ -4609,23 +4618,25 @@ namespace System.Windows.Forms {
bool verticalVisible = false;
if (AutoSize) {
if (gridWidth > Size.Width || gridHeight > Size.Height) {
if (gridWidth > Size.Width || gridHeight > Size.Height)
Size = new Size(gridWidth, gridHeight);
}
}
else {
if (gridWidth > Size.Width) {
if (gridWidth > Size.Width)
horizontalVisible = true;
}
if (gridHeight > Size.Height) {
if (gridHeight > Size.Height)
verticalVisible = true;
}
if (horizontalScrollBar.Visible && (gridHeight + horizontalScrollBar.Height) > Size.Height) {
if (horizontalScrollBar.Visible && (gridHeight + horizontalScrollBar.Height) > Size.Height)
verticalVisible = true;
}
if (verticalScrollBar.Visible && (gridWidth + verticalScrollBar.Width) > Size.Width) {
if (verticalScrollBar.Visible && (gridWidth + verticalScrollBar.Width) > Size.Width)
horizontalVisible = true;
}
if (scrollBars != ScrollBars.Vertical && scrollBars != ScrollBars.Both)
verticalVisible = false;
if (scrollBars != ScrollBars.Horizontal && scrollBars != ScrollBars.Both)
horizontalVisible = false;
if (horizontalVisible) {
horizontalScrollBar.Minimum = 0;
horizontalScrollBar.Maximum = gridWidth;
@@ -4825,12 +4836,15 @@ namespace System.Windows.Forms {
internal void OnRowsAddedInternal (DataGridViewRowsAddedEventArgs e)
{
if (hover_cell != null && hover_cell.RowIndex >= e.RowIndex)
hover_cell = null;
AutoResizeColumnsInternal ();
Invalidate ();
OnRowsAdded (e);
}
protected internal virtual void OnRowsAdded (DataGridViewRowsAddedEventArgs e)
protected virtual void OnRowsAdded (DataGridViewRowsAddedEventArgs e)
{
DataGridViewRowsAddedEventHandler eh = (DataGridViewRowsAddedEventHandler)(Events [RowsAddedEvent]);
if (eh != null) eh (this, e);
@@ -4851,14 +4865,18 @@ namespace System.Windows.Forms {
if (Rows.Count == 0) {
MoveCurrentCell (-1, -1, true, false, false, true);
hover_cell = null;
} else if (Columns.Count == 0) {
MoveCurrentCell (-1, -1, true, false, false, true);
hover_cell = null;
} else {
int nextRowIndex = e.RowIndex;
if (nextRowIndex >= Rows.Count)
nextRowIndex = Rows.Count - 1;
MoveCurrentCell (currentCell != null ? currentCell.ColumnIndex : 0, nextRowIndex,
true, false, false, true);
if (hover_cell != null && hover_cell.RowIndex >= e.RowIndex)
hover_cell = null;
}
Invalidate ();
@@ -4920,15 +4938,17 @@ namespace System.Windows.Forms {
protected virtual void OnUserAddedRow (DataGridViewRowEventArgs e)
{
// Switch the current editing row with a real
int newRowIndex = NewRowIndex;
int currentColumnIndex = currentCell != null ? currentCell.ColumnIndex : 0;
new_row_editing = true;
PrepareEditingRow (false, false);
if (DataManager != null)
new_row_editing = true;
if (DataManager != null) {
// Switch the current editing row with a real one
if (editing_row != null) {
Rows.RemoveInternal (editing_row);
editing_row = null;
}
DataManager.AddNew (); // will raise OnListPositionChanged
else
MoveCurrentCell (currentColumnIndex, NewRowIndex, true, false, false, true);
}
e = new DataGridViewRowEventArgs (Rows[NewRowIndex]);
DataGridViewRowEventHandler eh = (DataGridViewRowEventHandler)(Events [UserAddedRowEvent]);
@@ -5018,7 +5038,7 @@ namespace System.Windows.Forms {
protected bool ProcessDeleteKey (Keys keyData)
{
if (!allowUserToDeleteRows || SelectedRows.Count == 0)
if (!AllowUserToDeleteRows || SelectedRows.Count == 0)
return false;
int index = Math.Max (selected_row - SelectedRows.Count + 1, 0);
@@ -5032,8 +5052,8 @@ namespace System.Windows.Forms {
if (hover_cell != null && hover_cell.OwningRow == row)
hover_cell = null;
if (DataSource != null && DataSource is DataSet)
(DataSource as DataSet).Tables[dataMember].Rows.RemoveAt (row.Index);
if (DataManager != null)
DataManager.RemoveAt (row.Index);
else
Rows.RemoveAt (row.Index);
}
@@ -5172,7 +5192,7 @@ namespace System.Windows.Forms {
if (cell != null) {
if (cell.KeyEntersEditMode (new KeyEventArgs ((Keys)m.WParam.ToInt32 ())))
BeginEdit (true);
if (EditingControl != null && (Msg)m.Msg == Msg.WM_KEYDOWN || (Msg)m.Msg == Msg.WM_CHAR)
if (EditingControl != null && ((Msg)m.Msg == Msg.WM_KEYDOWN || (Msg)m.Msg == Msg.WM_CHAR))
XplatUI.SendMessage (EditingControl.Handle, (Msg)m.Msg, m.WParam, m.LParam);
}
@@ -5412,10 +5432,12 @@ namespace System.Windows.Forms {
if (cell != currentCell) {
if (currentCell != null) {
if (currentCell.IsInEditMode && !EndEdit ())
return false;
else if (currentCell.RowIndex == NewRowIndex && new_row_editing)
CancelEdit ();
if (currentCell.IsInEditMode) {
if (!EndEdit ())
return false;
else if (currentCell.RowIndex == NewRowIndex && new_row_editing)
CancelEdit ();
}
OnCellLeave (new DataGridViewCellEventArgs(currentCell.ColumnIndex, currentCell.RowIndex));
OnRowLeave (new DataGridViewCellEventArgs (currentCell.ColumnIndex, currentCell.RowIndex));
}
@@ -5774,30 +5796,23 @@ namespace System.Windows.Forms {
return bounds;
}
internal void PrepareEditingRow (bool cell_changed, bool column_changed)
private void PrepareEditingRow (bool cell_changed, bool column_changed)
{
if (new_row_editing) {
if (editing_row != null) {
Rows.RemoveInternal (editing_row);
editing_row = null;
}
if (new_row_editing)
return;
}
bool show = false;
show = ColumnCount > 0 && AllowUserToAddRows;
if (!show && editing_row != null) {
Rows.RemoveInternal (editing_row);
editing_row = null;
if (!show) {
RemoveEditingRow ();
} else if (show) {
if (editing_row != null && (cell_changed || column_changed)) {
// The row changed, it's no longer an editing row.
// or
// The number of columns has changed, we need a new editing row.
Rows.RemoveInternal (editing_row);
editing_row = null;
RemoveEditingRow ();
}
if (editing_row == null) {
editing_row = RowTemplateFull;
@@ -5806,6 +5821,15 @@ namespace System.Windows.Forms {
}
}
internal void RemoveEditingRow ()
{
if (editing_row != null) {
if (Rows.Contains (editing_row))
Rows.RemoveInternal (editing_row);
editing_row = null;
}
}
internal DataGridViewRow EditingRow {
get { return editing_row; }
}
@@ -5850,20 +5874,38 @@ namespace System.Windows.Forms {
{
if (type == typeof (bool))
return new DataGridViewCheckBoxColumn ();
else if (typeof(Bitmap).IsAssignableFrom (type))
return new DataGridViewImageColumn ();
return new DataGridViewTextBoxColumn ();
}
private void ClearBinding ()
{
columns.ClearAutoGeneratedColumns ();
rows.Clear ();
PrepareEditingRow (false, true);
if (IsCurrentCellInEditMode && !EndEdit ())
CancelEdit ();
MoveCurrentCell (-1, -1, false, false, false, true);
if (DataManager != null) {
DataManager.ListChanged -= OnListChanged;
DataManager.PositionChanged -= OnListPositionChanged;
columns.ClearAutoGeneratedColumns ();
rows.Clear ();
RemoveEditingRow ();
}
}
private void ResetRows ()
{
rows.Clear ();
RemoveEditingRow ();
if (DataManager != null) {
foreach (object element in DataManager.List)
AddBoundRow (element);
}
PrepareEditingRow (false, true);
OnListPositionChanged (this, EventArgs.Empty);
}
private void DoBinding ()
{
@@ -5919,6 +5961,7 @@ namespace System.Windows.Forms {
MoveCurrentCell (0, 0, true, false, false, false);
}
PrepareEditingRow (false, true);
PerformLayout();
Invalidate ();
}
@@ -6043,7 +6086,7 @@ namespace System.Windows.Forms {
case ListChangedType.ItemChanged:
break;
default:
ReBind ();
ResetRows ();
break;
}
@@ -316,11 +316,11 @@ namespace System.Windows.Forms {
return false;
}
set {
bool changed = selected != value;
selected = value;
if (value != ((State & DataGridViewElementStates.Selected) != 0)) {
if (value != ((State & DataGridViewElementStates.Selected) != 0))
SetState(State ^ DataGridViewElementStates.Selected);
}
// If our row is selected, unselect it and select
// the first cell in it that isn't us
@@ -332,6 +332,9 @@ namespace System.Windows.Forms {
else if (OwningRow.Cells.Count > 1)
OwningRow.Cells[1].Selected = true;
}
if (changed && DataGridView != null && DataGridView.IsHandleCreated)
DataGridView.Invalidate ();
}
}
@@ -697,12 +700,14 @@ namespace System.Windows.Forms {
[EditorBrowsable (EditorBrowsableState.Advanced)]
public virtual void PositionEditingControl (bool setLocation, bool setSize, Rectangle cellBounds, Rectangle cellClip, DataGridViewCellStyle cellStyle, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow)
{
if (setLocation && setSize)
DataGridView.EditingControl.Bounds = cellBounds;
else if (setLocation)
DataGridView.EditingControl.Location = cellBounds.Location;
else if (setSize)
DataGridView.EditingControl.Size = cellBounds.Size;
if (DataGridView.EditingControl != null) {
if (setLocation && setSize)
DataGridView.EditingControl.Bounds = cellBounds;
else if (setLocation)
DataGridView.EditingControl.Location = cellBounds.Location;
else if (setSize)
DataGridView.EditingControl.Size = cellBounds.Size;
}
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
@@ -873,6 +878,11 @@ namespace System.Windows.Forms {
value = e.Value;
}
if (FormattedValueType == typeof(string) && value is IFormattable && !String.IsNullOrEmpty (cellStyle.Format))
return ((IFormattable) value).ToString (cellStyle.Format, cellStyle.FormatProvider);
if (value != null && FormattedValueType.IsAssignableFrom (value.GetType()))
return value;
if (formattedValueTypeConverter == null)
formattedValueTypeConverter = FormattedValueTypeConverter;
if (valueTypeConverter == null)
@@ -1293,7 +1303,7 @@ namespace System.Windows.Forms {
else
valuex = value;
if (oldValue != value) {
if (!Object.ReferenceEquals (oldValue, value) || !Object.Equals (oldValue, value)) {
RaiseCellValueChanged (new DataGridViewCellEventArgs (ColumnIndex, RowIndex));
// Set this dirty flag back to false
@@ -1397,13 +1407,13 @@ namespace System.Windows.Forms {
else if (align == DataGridViewContentAlignment.BottomCenter || align == DataGridViewContentAlignment.MiddleCenter || align == DataGridViewContentAlignment.TopCenter)
x = Math.Max (outer.X + ((outer.Width - inner.Width) / 2), outer.Left);
else if (align == DataGridViewContentAlignment.BottomRight || align == DataGridViewContentAlignment.MiddleRight || align == DataGridViewContentAlignment.TopRight)
x = outer.Right - inner.Width;
x = Math.Max (outer.Right - inner.Width, outer.X);
if (align == DataGridViewContentAlignment.TopCenter || align == DataGridViewContentAlignment.TopLeft || align == DataGridViewContentAlignment.TopRight)
y = outer.Y;
else if (align == DataGridViewContentAlignment.MiddleCenter || align == DataGridViewContentAlignment.MiddleLeft || align == DataGridViewContentAlignment.MiddleRight)
y = outer.Y + (outer.Height - inner.Height) / 2;
y = Math.Max (outer.Y + (outer.Height - inner.Height) / 2, outer.Y);
else if (align == DataGridViewContentAlignment.BottomCenter || align == DataGridViewContentAlignment.BottomRight || align == DataGridViewContentAlignment.BottomLeft)
y = outer.Bottom - inner.Height;
y = Math.Max (outer.Bottom - inner.Height, outer.Y);
return new Rectangle (x, y, Math.Min (inner.Width, outer.Width), Math.Min (inner.Height, outer.Height));
}
@@ -105,7 +105,7 @@ namespace System.Windows.Forms
// When we clear the column collection, all rows get deleted
dataGridView.Rows.Clear ();
dataGridView.PrepareEditingRow (false, true);
dataGridView.RemoveEditingRow ();
RegenerateSortedList ();
}
@@ -47,6 +47,7 @@ namespace System.Windows.Forms {
this.valuesAreIcons = valuesAreIcons;
base.CellTemplate = new DataGridViewImageCell(valuesAreIcons);
(base.CellTemplate as DataGridViewImageCell).ImageLayout = DataGridViewImageCellLayout.Normal;
DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
icon = null;
image = null;
}
@@ -135,7 +135,7 @@ namespace System.Windows.Forms
dataGridViewRow.SetIndex (result);
}
dataGridViewRow.SetDataGridView (dataGridView);
CompleteRowCells (dataGridViewRow);
for (int i = 0; i < dataGridViewRow.Cells.Count; i++) {
dataGridViewRow.Cells [i].SetOwningColumn (dataGridView.Columns [i]);
}
@@ -147,6 +147,18 @@ namespace System.Windows.Forms
return result;
}
// Complete the rows if they are incomplete.
private void CompleteRowCells (DataGridViewRow row)
{
if (row == null || DataGridView == null)
return;
if (row.Cells.Count < DataGridView.ColumnCount) {
for (int i = row.Cells.Count; i < DataGridView.ColumnCount; i++)
row.Cells.Add ((DataGridViewCell) DataGridView.Columns[i].CellTemplate.Clone ());
}
}
public virtual int Add (DataGridViewRow dataGridViewRow)
{
if (dataGridView.DataSource != null)
@@ -186,7 +198,7 @@ namespace System.Windows.Forms
int result = 0;
for (int i = 0; i < count; i++)
result = Add (dataGridView.RowTemplateFull as DataGridViewRow);
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (result - count + 1, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (result - count + 1, count));
raiseEvent = true;
return result;
}
@@ -211,7 +223,7 @@ namespace System.Windows.Forms
int lastIndex = 0;
for (int i = 0; i < count; i++)
lastIndex = AddCopy(indexSource);
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
raiseEvent = true;
return lastIndex;
}
@@ -234,7 +246,7 @@ namespace System.Windows.Forms
lastIndex = Add (row);
count++;
}
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
raiseEvent = true;
}
@@ -391,10 +403,12 @@ namespace System.Windows.Forms
{
dataGridViewRow.SetIndex (rowIndex);
dataGridViewRow.SetDataGridView (dataGridView);
list[rowIndex] = dataGridViewRow;
CompleteRowCells (dataGridViewRow);
list.Insert (rowIndex, dataGridViewRow);
ReIndex ();
OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, dataGridViewRow));
if (raiseEvent)
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (rowIndex, 1));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (rowIndex, 1));
}
public virtual void Insert (int rowIndex, int count)
@@ -403,7 +417,7 @@ namespace System.Windows.Forms
raiseEvent = false;
for (int i = 0; i < count; i++)
Insert (index++, dataGridView.RowTemplateFull);
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (rowIndex, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (rowIndex, count));
raiseEvent = true;
}
@@ -424,7 +438,7 @@ namespace System.Windows.Forms
int index = indexDestination;
for (int i = 0; i < count; i++)
InsertCopy (indexSource, index++);
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (indexDestination, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (indexDestination, count));
raiseEvent = true;
}
@@ -442,7 +456,7 @@ namespace System.Windows.Forms
Insert (index++, row);
count++;
}
DataGridView.OnRowsAdded (new DataGridViewRowsAddedEventArgs (rowIndex, count));
DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (rowIndex, count));
raiseEvent = true;
}
@@ -999,6 +999,10 @@ namespace System.Windows.Forms {
}
} else
UpdateBounds ();
#if NET_2_0
// UIA Framework Event: Menu Changed
OnUIAMenuChanged (EventArgs.Empty);
#endif
}
}
}
@@ -1311,6 +1315,11 @@ namespace System.Windows.Forms {
topmost = value;
if (IsHandleCreated)
XplatUI.SetTopmost(window.Handle, value);
#if NET_2_0
// UIA Framework: Raises internal event
OnUIATopMostChanged ();
#endif
}
}
}
@@ -1366,6 +1375,12 @@ namespace System.Windows.Forms {
XplatUI.SetWindowState(Handle, value);
}
#if NET_2_0
// UIA Framework: Raises internal event
if (old_state != window_state)
OnUIAWindowStateChanged ();
#endif
}
}
@@ -3284,6 +3299,50 @@ namespace System.Windows.Forms {
eh (this, e);
}
#endif
#region UIA Framework Events
#if NET_2_0
static object UIAMenuChangedEvent = new object ();
static object UIATopMostChangedEvent = new object ();
static object UIAWindowStateChangedEvent = new object ();
internal event EventHandler UIAMenuChanged {
add { Events.AddHandler (UIAMenuChangedEvent, value); }
remove { Events.RemoveHandler (UIAMenuChangedEvent, value); }
}
internal event EventHandler UIATopMostChanged {
add { Events.AddHandler (UIATopMostChangedEvent, value); }
remove { Events.RemoveHandler (UIATopMostChangedEvent, value); }
}
internal event EventHandler UIAWindowStateChanged {
add { Events.AddHandler (UIAWindowStateChangedEvent, value); }
remove { Events.RemoveHandler (UIAWindowStateChangedEvent, value); }
}
internal void OnUIAMenuChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIAMenuChangedEvent];
if (eh != null)
eh (this, e);
}
internal void OnUIATopMostChanged ()
{
EventHandler eh = (EventHandler) Events [UIATopMostChangedEvent];
if (eh != null)
eh (this, EventArgs.Empty);
}
internal void OnUIAWindowStateChanged ()
{
EventHandler eh = (EventHandler) Events [UIAWindowStateChangedEvent];
if (eh != null)
eh (this, EventArgs.Empty);
}
#endif
#endregion // UIA Framework Events
#endregion // Events
}
}
@@ -49,6 +49,7 @@ namespace System.Windows.Forms
internal IntPtr menu_handle = IntPtr.Zero;
internal Menu parent_menu = null;
System.Drawing.Rectangle rect;
// UIA Framework Note: Used to keep track of expanded menus
internal Control Wnd;
internal MenuTracker tracker;
@@ -134,6 +135,7 @@ namespace System.Windows.Forms
#region Private Properties
// UIA Framework Note: Used to obtain menu bounds
internal System.Drawing.Rectangle Rect {
get { return rect; }
}
@@ -331,6 +333,7 @@ namespace System.Windows.Forms
#endregion Public Methods
static object MenuChangedEvent = new object ();
// UIA Framework Note: Used to track changes in MenuItemCollection
internal event EventHandler MenuChanged {
add { Events.AddHandler (MenuChangedEvent, value); }
remove { Events.RemoveHandler (MenuChangedEvent, value); }
@@ -35,6 +35,7 @@ namespace System.Windows.Forms {
When writing this code the Wine project was of great help to
understand the logic behind some Win32 issues. Thanks to them. Jordi,
*/
// UIA Framework Note: This class used by UIA for its mouse action methods.
internal class MenuTracker {
internal bool active;
@@ -136,6 +137,7 @@ namespace System.Windows.Forms {
return item;
}
// UIA Framework Note: Used to expand/collapse MenuItems
public bool OnMouseDown (MouseEventArgs args)
{
MenuItem item = GetItemAtXY (args.X, args.Y);
@@ -167,6 +169,7 @@ namespace System.Windows.Forms {
return true;
}
// UIA Framework Note: Used to select MenuItems
public void OnMotion (MouseEventArgs args)
{
// Windows helpfully sends us MOUSEMOVE messages when any key is pressed.
@@ -214,6 +217,7 @@ namespace System.Windows.Forms {
}
}
// UIA Framework Note: Used to expand/collapse MenuItems
public void OnMouseUp (MouseEventArgs args)
{
/* mouse down dont comes from menu */
@@ -65,6 +65,7 @@ namespace System.Windows.Forms
private int menuheight;
private bool menubar;
private MenuMerge mergetype;
// UIA Framework Note: Used to obtain item bounds
internal Rectangle bounds;
public MenuItem (): base (null)
@@ -167,6 +168,66 @@ namespace System.Windows.Forms
add { Events.AddHandler (SelectEvent, value); }
remove { Events.RemoveHandler (SelectEvent, value); }
}
#region UIA Framework Events
#if NET_2_0
static object UIACheckedChangedEvent = new object ();
internal event EventHandler UIACheckedChanged {
add { Events.AddHandler (UIACheckedChangedEvent, value); }
remove { Events.RemoveHandler (UIACheckedChangedEvent, value); }
}
internal void OnUIACheckedChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIACheckedChangedEvent];
if (eh != null)
eh (this, e);
}
static object UIARadioCheckChangedEvent = new object ();
internal event EventHandler UIARadioCheckChanged {
add { Events.AddHandler (UIARadioCheckChangedEvent, value); }
remove { Events.RemoveHandler (UIARadioCheckChangedEvent, value); }
}
internal void OnUIARadioCheckChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIARadioCheckChangedEvent];
if (eh != null)
eh (this, e);
}
static object UIAEnabledChangedEvent = new object ();
internal event EventHandler UIAEnabledChanged {
add { Events.AddHandler (UIAEnabledChangedEvent, value); }
remove { Events.RemoveHandler (UIAEnabledChangedEvent, value); }
}
internal void OnUIAEnabledChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIAEnabledChangedEvent];
if (eh != null)
eh (this, e);
}
static object UIATextChangedEvent = new object ();
internal event EventHandler UIATextChanged {
add { Events.AddHandler (UIATextChangedEvent, value); }
remove { Events.RemoveHandler (UIATextChangedEvent, value); }
}
internal void OnUIATextChanged (EventArgs e)
{
EventHandler eh = (EventHandler) Events [UIATextChangedEvent];
if (eh != null)
eh (this, e);
}
#endif
#endregion
#endregion // Events
#region Public Properties
@@ -188,7 +249,16 @@ namespace System.Windows.Forms
[DefaultValue(false)]
public bool Checked {
get { return checked_; }
set { checked_ = value; }
set {
if (checked_ == value)
return;
checked_ = value;
#if NET_2_0
// UIA Framework Event: Checked Changed
OnUIACheckedChanged (EventArgs.Empty);
#endif
}
}
[DefaultValue(false)]
@@ -206,6 +276,10 @@ namespace System.Windows.Forms
return;
enabled = value;
#if NET_2_0
// UIA Framework Event: Enabled Changed
OnUIAEnabledChanged (EventArgs.Empty);
#endif
Invalidate ();
}
}
@@ -283,7 +357,16 @@ namespace System.Windows.Forms
[DefaultValue(false)]
public bool RadioCheck {
get { return radiocheck; }
set { radiocheck = value; }
set {
if (radiocheck == value)
return;
radiocheck = value;
#if NET_2_0
// UIA Framework Event: Checked Changed
OnUIARadioCheckChanged (EventArgs.Empty);
#endif
}
}
[DefaultValue(Shortcut.None)]
@@ -316,6 +399,10 @@ namespace System.Windows.Forms
separator = true;
else
separator = false;
#if NET_2_0
// UIA Framework Event: Text Changed
OnUIATextChanged (EventArgs.Empty);
#endif
ProcessMnemonic ();
Invalidate ();
@@ -524,6 +524,28 @@ namespace System.Windows.Forms
base.Dispose (disposing);
}
#if NET_2_0
internal void UIAPerformClick (ToolBarButton button)
{
ToolBarItem previous_item = current_item;
current_item = null;
foreach (ToolBarItem item in items)
if (item.Button == button) {
current_item = item;
break;
}
try {
if (current_item == null)
throw new ArgumentException ("button", "The button specified is not part of this toolbar");
OnButtonClick (new ToolBarButtonClickEventArgs (button));
} finally {
current_item = previous_item;
}
}
#endif
protected virtual void OnButtonClick (ToolBarButtonClickEventArgs e)
{
if (e.Button.Style == ToolBarButtonStyle.ToggleButton) {
@@ -1110,6 +1132,25 @@ namespace System.Windows.Forms
private bool redraw; // Flag if needs to redraw after add/remove operations
#endregion
#region UIA Framework Events
#if NET_2_0
static object UIACollectionChangedEvent = new object ();
internal event CollectionChangeEventHandler UIACollectionChanged {
add { owner.Events.AddHandler (UIACollectionChangedEvent, value); }
remove { owner.Events.RemoveHandler (UIACollectionChangedEvent, value); }
}
internal void OnUIACollectionChanged (CollectionChangeEventArgs e)
{
CollectionChangeEventHandler eh
= (CollectionChangeEventHandler) owner.Events [UIACollectionChangedEvent];
if (eh != null)
eh (owner, e);
}
#endif
#endregion
#region constructors
public ToolBarButtonCollection (ToolBar owner)
{
@@ -1132,9 +1173,20 @@ namespace System.Windows.Forms
public virtual ToolBarButton this [int index] {
get { return (ToolBarButton) list [index]; }
set {
#if NET_2_0
// UIA Framework Event: Button Removed
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
#endif
value.SetParent (owner);
list [index] = value;
owner.Redraw (true);
#if NET_2_0
// UIA Framework Event: Button Added
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
#endif
}
}
@@ -1189,6 +1241,12 @@ namespace System.Windows.Forms
result = list.Add (button);
if (redraw)
owner.Redraw (true);
#if NET_2_0
// UIA Framework Event: Button Added
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, result));
#endif
return result;
}
@@ -1209,6 +1267,11 @@ namespace System.Windows.Forms
{
list.Clear ();
owner.Redraw (false);
#if NET_2_0
// UIA Framework Event: Button Cleared
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, -1));
#endif
}
public bool Contains (ToolBarButton button)
@@ -1294,6 +1357,11 @@ namespace System.Windows.Forms
{
list.Insert (index, button);
owner.Redraw (true);
#if NET_2_0
// UIA Framework Event: Button Added
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
#endif
}
public void Remove (ToolBarButton button)
@@ -1306,6 +1374,11 @@ namespace System.Windows.Forms
{
list.RemoveAt (index);
owner.Redraw (true);
#if NET_2_0
// UIA Framework Event: Button Removed
OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
#endif
}
#if NET_2_0
@@ -262,6 +262,11 @@ namespace System.Windows.Forms
return;
text = value;
#if NET_2_0
OnUIATextChanged (EventArgs.Empty);
#endif
if (Parent != null)
Parent.Redraw (true);
}
@@ -311,9 +316,25 @@ namespace System.Windows.Forms
if (Parent != null)
Parent.Invalidate (Rectangle);
}
#if NET_2_0
static object UIATextChangedEvent = new object ();
internal event EventHandler UIATextChanged {
add { Events.AddHandler (UIATextChangedEvent, value); }
remove { Events.RemoveHandler (UIATextChangedEvent, value); }
}
protected virtual void OnUIATextChanged (EventArgs e)
{
EventHandler eh = (EventHandler)(Events [UIATextChangedEvent]);
if (eh != null)
eh (this, e);
}
#endif
#endregion Internal Methods
#region methods
protected override void Dispose (bool disposing)
@@ -205,6 +205,24 @@ namespace System.Windows.Forms
#endregion // Events
#region UIA FrameWork Events
#if NET_2_0
static object UIAValueParamChangedEvent = new object ();
internal event EventHandler UIAValueParamChanged {
add { Events.AddHandler (UIAValueParamChangedEvent, value); }
remove { Events.RemoveHandler (UIAValueParamChangedEvent, value); }
}
internal void OnUIAValueParamChanged ()
{
EventHandler eh = (EventHandler) Events [UIAValueParamChangedEvent];
if (eh != null)
eh (this, EventArgs.Empty);
}
#endif
#endregion
public TrackBar ()
{
orientation = Orientation.Horizontal;
@@ -364,6 +382,10 @@ namespace System.Windows.Forms
#endif
largeChange = value;
#if NET_2_0
OnUIAValueParamChanged ();
#endif
}
}
@@ -379,6 +401,10 @@ namespace System.Windows.Forms
minimum = maximum;
Refresh ();
#if NET_2_0
OnUIAValueParamChanged ();
#endif
}
}
}
@@ -396,6 +422,10 @@ namespace System.Windows.Forms
maximum = minimum;
Refresh ();
#if NET_2_0
OnUIAValueParamChanged ();
#endif
}
}
}
@@ -461,6 +491,10 @@ namespace System.Windows.Forms
#endif
if (smallChange != value) {
smallChange = value;
#if NET_2_0
OnUIAValueParamChanged ();
#endif
}
}
}
@@ -673,14 +707,16 @@ namespace System.Windows.Forms
}
}
private void LargeIncrement ()
// Used by UIA implementation, so making internal
internal void LargeIncrement ()
{
UpdatePos (position + LargeChange, true);
Invalidate (thumb_area);
OnScroll (new EventArgs ());
}
private void LargeDecrement ()
// Used by UIA implementation, so making internal
internal void LargeDecrement ()
{
UpdatePos (position - LargeChange, true);
Invalidate (thumb_area);
@@ -534,6 +534,8 @@ namespace System.Windows.Forms
public TreeNode NextVisibleNode {
get {
OpenTreeNodeEnumerator o = new OpenTreeNodeEnumerator (this);
o.MoveNext (); // move to the node itself
if (!o.MoveNext ())
return null;
TreeNode c = o.CurrentNode;
@@ -607,6 +609,8 @@ namespace System.Windows.Forms
public TreeNode PrevVisibleNode {
get {
OpenTreeNodeEnumerator o = new OpenTreeNodeEnumerator (this);
o.MovePrevious (); // move to the node itself
if (!o.MovePrevious ())
return null;
TreeNode c = o.CurrentNode;
@@ -806,19 +806,12 @@ namespace System.Windows.Forms {
public void CollapseAll ()
{
TreeNode walk = TopNode;
if (walk == null)
return;
while (walk.parent != root_node)
walk = walk.parent;
BeginUpdate ();
root_node.CollapseAll ();
EndUpdate ();
SetTop (walk);
if (IsHandleCreated && vbar.VisibleInternal)
vbar.Value = vbar.Maximum - VisibleCount + 1;
}
public TreeNode GetNodeAt (Point pt) {
@@ -1835,25 +1828,22 @@ namespace System.Windows.Forms {
bool vert = false;
bool horz = false;
int height = -1;
int height = 0;
int width = -1;
int item_height = ActualItemHeight;
if (scrollable) {
OpenTreeNodeEnumerator walk = new OpenTreeNodeEnumerator (root_node);
while (walk.MoveNext ()) {
int r = walk.CurrentNode.Bounds.Right;
int b = walk.CurrentNode.Bounds.Bottom;
if (r > width)
width = r;
if (b > height)
height = b;
height += item_height;
}
// Remove scroll adjustments
if (nodes.Count > 0)
height -= nodes [0].Bounds.Top;
height -= item_height; // root_node adjustment
width += hbar_offset;
if (height > ClientRectangle.Height) {
@@ -1899,6 +1889,7 @@ namespace System.Windows.Forms {
skipped_nodes = 0;
RecalculateVisibleOrder (root_node);
vbar.Visible = false;
vbar.Value = 0;
vbar_bounds_set = false;
}
@@ -1951,6 +1942,9 @@ namespace System.Windows.Forms {
private void SetVScrollPos (int pos, TreeNode new_top)
{
if (!vbar.VisibleInternal)
return;
if (pos < 0)
pos = 0;
@@ -48,7 +48,7 @@ namespace System.Windows.Forms
bool isWebBrowserContextMenuEnabled;
object objectForScripting;
bool webBrowserShortcutsEnabled;
bool scrollbarsEnabled;
bool scrollbarsEnabled = true;
WebBrowserReadyState readyState;
@@ -205,7 +205,8 @@ namespace System.Windows.Forms {
private static IntPtr PRIMARY;
//private static IntPtr DIB;
private static IntPtr OEMTEXT;
private static IntPtr UNICODETEXT;
private static IntPtr UTF8_STRING;
private static IntPtr UTF16_STRING;
private static IntPtr RICHTEXTFORMAT;
private static IntPtr TARGETS;
@@ -619,6 +620,7 @@ namespace System.Windows.Forms {
"PRIMARY",
"COMPOUND_TEXT",
"UTF8_STRING",
"UTF16_STRING",
"RICHTEXTFORMAT",
"TARGETS",
"_SWF_AsyncAtom",
@@ -693,7 +695,8 @@ namespace System.Windows.Forms {
CLIPBOARD = atoms [off++];
PRIMARY = atoms [off++];
OEMTEXT = atoms [off++];
UNICODETEXT = atoms [off++];
UTF8_STRING = atoms [off++];
UTF16_STRING = atoms [off++];
RICHTEXTFORMAT = atoms [off++];
TARGETS = atoms [off++];
AsyncAtom = atoms [off++];
@@ -1248,7 +1251,12 @@ namespace System.Windows.Forms {
// FIXME - convert pixmap to image
} else if (property == OEMTEXT) {
Clipboard.Item = Marshal.PtrToStringAnsi(prop);
} else if (property == UNICODETEXT) {
} else if (property == UTF8_STRING) {
byte [] buffer = new byte [(int)nitems];
for (int i = 0; i < (int)nitems; i++)
buffer [i] = Marshal.ReadByte (prop, i);
Clipboard.Item = Encoding.UTF8.GetString (buffer);
} else if (property == UTF16_STRING) {
Clipboard.Item = Marshal.PtrToStringUni (prop, Encoding.Unicode.GetMaxCharCount ((int)nitems));
} else if (property == RICHTEXTFORMAT)
Clipboard.Item = Marshal.PtrToStringAnsi(prop);
@@ -1422,8 +1430,8 @@ namespace System.Windows.Forms {
//
if (in_doevents ||
(Application.MWFThread.Current.Context != null &&
Application.MWFThread.Current.Context.MainForm != null &&
Application.MWFThread.Current.Context.MainForm.IsLoaded)) {
(Application.MWFThread.Current.Context.MainForm == null ||
Application.MWFThread.Current.Context.MainForm.IsLoaded))) {
timer.Busy = true;
timer.Update (now);
timer.FireTick ();
@@ -1703,7 +1711,8 @@ namespace System.Windows.Forms {
if (Clipboard.Item is String) {
atoms[atom_count++] = (int)Atom.XA_STRING;
atoms[atom_count++] = (int)OEMTEXT;
atoms[atom_count++] = (int)UNICODETEXT;
atoms[atom_count++] = (int)UTF8_STRING;
atoms[atom_count++] = (int)UTF16_STRING;
atoms[atom_count++] = (int)RICHTEXTFORMAT;
} else if (Clipboard.Item is Image) {
atoms[atom_count++] = (int)Atom.XA_PIXMAP;
@@ -1737,7 +1746,7 @@ namespace System.Windows.Forms {
while (Marshal.ReadByte(buffer, buflen) != 0) {
buflen++;
}
} else if (xevent.SelectionRequestEvent.target == UNICODETEXT) {
} else if (xevent.SelectionRequestEvent.target == UTF16_STRING) {
Byte [] bytes;
bytes = Encoding.Unicode.GetBytes ((string)Clipboard.Source);
@@ -2612,7 +2621,7 @@ namespace System.Windows.Forms {
//else if (format == "PenData" ) return 10;
//else if (format == "RiffAudio" ) return 11;
//else if (format == "WaveAudio" ) return 12;
else if (format == "UnicodeText" ) return UNICODETEXT.ToInt32();
else if (format == "UnicodeText" ) return UTF16_STRING.ToInt32();
//else if (format == "EnhancedMetafile" ) return 14;
//else if (format == "FileDrop" ) return 15;
//else if (format == "Locale" ) return 16;
@@ -4565,7 +4574,7 @@ namespace System.Windows.Forms {
XGetWindowProperty(DisplayHandle, handle,
_NET_WM_NAME, IntPtr.Zero, new IntPtr (1), false,
UNICODETEXT, out actual_atom, out actual_format, out nitems, out bytes_after, ref prop);
UTF8_STRING, out actual_atom, out actual_format, out nitems, out bytes_after, ref prop);
if ((long)nitems > 0 && prop != IntPtr.Zero) {
text = Marshal.PtrToStringUni (prop, (int)nitems);
@@ -6018,7 +6027,7 @@ namespace System.Windows.Forms {
hwnd = Hwnd.ObjectFromHandle(handle);
lock (XlibLock) {
XChangeProperty(DisplayHandle, hwnd.whole_window, _NET_WM_NAME, UNICODETEXT, 8,
XChangeProperty(DisplayHandle, hwnd.whole_window, _NET_WM_NAME, UTF8_STRING, 8,
PropertyMode.Replace, text, Encoding.UTF8.GetByteCount (text));
// XXX this has problems with UTF8.
@@ -1,3 +1,10 @@
2009-02-04 Marek Habersack <[email protected]>
* SQLite3.cs, SQLite3_UTF16.cs, SQLiteBase.cs, SQLiteFunction.cs,
UnsafeNativeMethods.cs: fixes for custom functions and collations
creation with sqlite3. Fixes bug #470042. Patch from John Millikin
<[email protected]>, thanks!
2008-12-08 Zoltan Varga <[email protected]>
* SQLite3.cs: Avoid IntPtr.ToInt32 () to convert between IntPtr's and integers
@@ -76,7 +76,6 @@ namespace Mono.Data.Sqlite
{
int n = UnsafeNativeMethods.sqlite3_close(_sql);
if (n > 0) throw new SqliteException(n, SqliteLastError());
SqliteFunction.UnbindFunctions(this, _functionsArray);
}
_sql = IntPtr.Zero;
}
@@ -511,32 +510,16 @@ namespace Mono.Data.Sqlite
return UnsafeNativeMethods.sqlite3_aggregate_count(context);
}
internal override IntPtr CreateFunction(string strFunction, int nArgs, SqliteCallback func, SqliteCallback funcstep, SqliteCallback funcfinal)
internal override void CreateFunction(string strFunction, int nArgs, SqliteCallback func, SqliteCallback funcstep, SqliteFinalCallback funcfinal)
{
IntPtr nCookie;
// FIXME: Cookie must be allocated in C# and passed as a parameter to the Sqlite function
int n = UnsafeNativeMethods.sqlite3_create_function(_sql, ToUTF8(strFunction), nArgs, 1, func, funcstep, funcfinal, out nCookie);
int n = UnsafeNativeMethods.sqlite3_create_function(_sql, ToUTF8(strFunction), nArgs, 1, IntPtr.Zero, func, funcstep, funcfinal);
if (n > 0) throw new SqliteException(n, SqliteLastError());
return nCookie;
}
internal override IntPtr CreateCollation(string strCollation, SqliteCollation func)
internal override void CreateCollation(string strCollation, SqliteCollation func)
{
IntPtr nCookie;
// FIXME: Cookie must be allocated in C# and passed as a parameter to the Sqlite function
int n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 1, 0, func, out nCookie);
int n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 1, IntPtr.Zero, func);
if (n > 0) throw new SqliteException(n, SqliteLastError());
return nCookie;
}
internal override void FreeFunction(IntPtr nCookie)
{
// FIXME: must be handled in C#, this function does not exist in the mainstream sqlite3
UnsafeNativeMethods.sqlite3_function_free_callbackcookie(nCookie);
}
internal override long GetParamValueBytes(IntPtr p, int nDataOffset, byte[] bDest, int nStart, int nLength)
@@ -131,28 +131,16 @@ namespace Mono.Data.Sqlite
return ToString(UnsafeNativeMethods.sqlite3_column_table_name16(stmt._sqlite_stmt, index));
}
internal override IntPtr CreateFunction(string strFunction, int nArgs, SqliteCallback func, SqliteCallback funcstep, SqliteCallback funcfinal)
internal override void CreateFunction(string strFunction, int nArgs, SqliteCallback func, SqliteCallback funcstep, SqliteFinalCallback funcfinal)
{
// FIXME: the function interface below is not supported in the mainstream version of sqlite. Need to rewrite the C# API to
// use the mainstream sqlite. The cookie needs to be allocated in C#
IntPtr nCookie;
int n = UnsafeNativeMethods.sqlite3_create_function16(_sql, strFunction, nArgs, 4, func, funcstep, funcfinal, out nCookie);
int n = UnsafeNativeMethods.sqlite3_create_function16(_sql, strFunction, nArgs, 4, IntPtr.Zero, func, funcstep, funcfinal);
if (n > 0) throw new SqliteException(n, SqliteLastError());
return nCookie;
}
internal override IntPtr CreateCollation(string strCollation, SqliteCollation func)
internal override void CreateCollation(string strCollation, SqliteCollation func)
{
// FIXME: the function interface below is not supported in the mainstream version of sqlite. Need to rewrite the C# API to
// use the mainstream sqlite. The cookie needs to be allocated in C#
IntPtr nCookie;
int n = UnsafeNativeMethods.sqlite3_create_collation16(_sql, strCollation, 4, 0, func, out nCookie);
int n = UnsafeNativeMethods.sqlite3_create_collation16(_sql, strCollation, 4, IntPtr.Zero, func);
if (n > 0) throw new SqliteException(n, SqliteLastError());
return nCookie;
}
internal override string GetParamValueText(IntPtr ptr)
@@ -152,9 +152,8 @@ namespace Mono.Data.Sqlite
internal abstract DateTime GetDateTime(SqliteStatement stmt, int index);
internal abstract bool IsNull(SqliteStatement stmt, int index);
internal abstract IntPtr CreateCollation(string strCollation, SqliteCollation func);
internal abstract IntPtr CreateFunction(string strFunction, int nArgs, SqliteCallback func, SqliteCallback funcstep, SqliteCallback funcfinal);
internal abstract void FreeFunction(IntPtr cookie);
internal abstract void CreateCollation(string strCollation, SqliteCollation func);
internal abstract void CreateFunction(string strFunction, int nArgs, SqliteCallback func, SqliteCallback funcstep, SqliteFinalCallback funcfinal);
internal abstract int AggregateCount(IntPtr context);
internal abstract IntPtr AggregateContext(IntPtr context);
@@ -76,6 +76,11 @@ namespace Mono.Data.Sqlite
/// <param name="argsptr">A pointer to the array of argument pointers</param>
internal delegate void SqliteCallback(IntPtr context, int nArgs, IntPtr argsptr);
/// <summary>
/// An internal callback delegate declaration.
/// </summary>
/// <param name="context">Raw context pointer for the user function</param>
internal delegate void SqliteFinalCallback(IntPtr context);
/// <summary>
/// Internal callback delegate for implementing collation sequences
/// </summary>
/// <param name="len1">Length of the string pv1</param>
@@ -109,10 +114,6 @@ namespace Mono.Data.Sqlite
/// </summary>
private SqliteBase _base;
/// <summary>
/// Used internally to keep track of memory allocated for aggregate functions
/// </summary>
private IntPtr _interopCookie;
/// <summary>
/// Internal array used to keep track of aggregate function context data
/// </summary>
private Dictionary<long, object> _contextDataList;
@@ -128,7 +129,7 @@ namespace Mono.Data.Sqlite
/// <summary>
/// Holds a reference to the callback function for finalizing an aggregate function
/// </summary>
private SqliteCallback _FinalFunc;
private SqliteFinalCallback _FinalFunc;
/// <summary>
/// Holds a reference to the callback function for collation sequences
/// </summary>
@@ -380,9 +381,7 @@ namespace Mono.Data.Sqlite
/// An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method.
/// </summary>
/// <param name="context">A raw context pointer</param>
/// <param name="nArgs">Not used, always zero</param>
/// <param name="argsptr">Not used, always zero</param>
internal void FinalCallback(IntPtr context, int nArgs, IntPtr argsptr)
internal void FinalCallback(IntPtr context)
{
long n = (long)_base.AggregateContext(context);
object obj = null;
@@ -524,10 +523,6 @@ namespace Mono.Data.Sqlite
/// It is done this way so that all user-defined functions will access the database using the same encoding scheme
/// as the connection (UTF-8 or UTF-16).
/// </summary>
/// <remarks>
/// The wrapper functions that interop with Sqlite will create a unique cooke value, which internally is a pointer to
/// all the wrapped callback functions. The interop function uses it to map CDecl callbacks to StdCall callbacks.
/// </remarks>
/// <param name="sqlbase">The base object on which the functions are to bind</param>
/// <returns>Returns an array of functions which the connection object should retain until the connection is closed.</returns>
internal static SqliteFunction[] BindFunctions(SqliteBase sqlbase)
@@ -541,15 +536,13 @@ namespace Mono.Data.Sqlite
f._base = sqlbase;
f._InvokeFunc = (pr.FuncType == FunctionType.Scalar) ? new SqliteCallback(f.ScalarCallback) : null;
f._StepFunc = (pr.FuncType == FunctionType.Aggregate) ? new SqliteCallback(f.StepCallback) : null;
f._FinalFunc = (pr.FuncType == FunctionType.Aggregate) ? new SqliteCallback(f.FinalCallback) : null;
f._FinalFunc = (pr.FuncType == FunctionType.Aggregate) ? new SqliteFinalCallback(f.FinalCallback) : null;
f._CompareFunc = (pr.FuncType == FunctionType.Collation) ? new SqliteCollation(f.CompareCallback) : null;
if (pr.FuncType != FunctionType.Collation)
f._interopCookie = sqlbase.CreateFunction(pr.Name, pr.Arguments, f._InvokeFunc, f._StepFunc, f._FinalFunc);
sqlbase.CreateFunction(pr.Name, pr.Arguments, f._InvokeFunc, f._StepFunc, f._FinalFunc);
else
f._interopCookie = sqlbase.CreateCollation(pr.Name, f._CompareFunc);
sqlbase.CreateCollation(pr.Name, f._CompareFunc);
lFunctions.Add(f);
}
@@ -557,28 +550,7 @@ namespace Mono.Data.Sqlite
lFunctions.CopyTo(arFunctions, 0);
return arFunctions;
}
/// <summary>
/// Issued after the base connection is closed, this function cleans up all user-defined functions and disposes of them.
/// </summary>
/// <remarks>
/// Cleaning up here is done mainly because of the interop wrapper. It allocated memory to hold a reference to all the
/// delegates, and now must free that memory.
/// Freeing is done after the connection is closed to ensure no callbacks get hit after we've freed the cookie.
/// </remarks>
/// <param name="sqlbase">The base Sqlite connection object</param>
/// <param name="ar">An array of user-defined functions for this object</param>
internal static void UnbindFunctions(SqliteBase sqlbase, SqliteFunction[] ar)
{
if (ar == null) return;
int x = ar.Length;
for (int n = 0; n < x; n++)
{
sqlbase.FreeFunction(ar[n]._interopCookie);
ar[n].Dispose();
}
}
}
}
@@ -158,13 +158,10 @@ namespace Mono.Data.Sqlite
internal static extern int sqlite3_reset(IntPtr stmt);
[DllImport(SQLITE_DLL)]
internal static extern int sqlite3_create_collation(IntPtr db, byte[] strName, int nType, int nArgs, SqliteCollation func, out IntPtr nCookie);
internal static extern int sqlite3_create_collation(IntPtr db, byte[] strName, int eTextRep, IntPtr ctx, SqliteCollation fcompare);
[DllImport(SQLITE_DLL)]
internal static extern int sqlite3_create_function(IntPtr db, byte[] strName, int nArgs, int nType, SqliteCallback func, SqliteCallback fstep, SqliteCallback ffinal, out IntPtr nCookie);
[DllImport(SQLITE_DLL)]
internal static extern void sqlite3_function_free_callbackcookie(IntPtr nCookie);
internal static extern int sqlite3_create_function(IntPtr db, byte[] strName, int nArgs, int eTextRep, IntPtr app, SqliteCallback func, SqliteCallback fstep, SqliteFinalCallback ffinal);
[DllImport(SQLITE_DLL)]
internal static extern int sqlite3_aggregate_count(IntPtr context);
@@ -257,10 +254,10 @@ namespace Mono.Data.Sqlite
internal static extern IntPtr sqlite3_column_decltype16(IntPtr stmt, int index, out int len);
[DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
internal static extern int sqlite3_create_collation16(IntPtr db, string strName, int nType, int nArgs, SqliteCollation func, out IntPtr nCookie);
internal static extern int sqlite3_create_collation16(IntPtr db, string strName, int eTextRep, IntPtr ctx, SqliteCollation fcompare);
[DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)]
internal static extern int sqlite3_create_function16(IntPtr db, string strName, int nArgs, int nType, SqliteCallback func, SqliteCallback funcstep, SqliteCallback funcfinal, out IntPtr nCookie);
internal static extern int sqlite3_create_function16(IntPtr db, string strName, int nArgs, int eTextRep, IntPtr app, SqliteCallback func, SqliteCallback funcstep, SqliteFinalCallback funcfinal);
[DllImport(SQLITE_DLL)]
internal static extern IntPtr sqlite3_value_text16(IntPtr p);
@@ -1,3 +1,7 @@
2009-01-24 Gonzalo Paniagua Javier <[email protected]>
* Mono.Data.SybaseClient/SybaseConnection.cs: adapt to changes in TdsConnectionPool.
2008-09-06 Daniel Morgan <[email protected]>
* Mono.Data.SybaseClient/SybaseClientFactory.cs:
@@ -284,11 +284,7 @@ namespace Mono.Data.SybaseClient {
if (tds != null && tds.IsConnected) {
if (pooling && tds.Pooling) {
#if NET_2_0
if(pool != null) pool.ReleaseConnection (ref tds);
#else
if(pool != null) pool.ReleaseConnection (tds);
#endif
}else
if(tds != null) tds.Disconnect ();
}
@@ -1,3 +1,24 @@
2009-01-29 Gonzalo Paniagua Javier <[email protected]>
* Tds70.cs: fix for output parameters and '@'.
Fixes bug #470579. Patch from Varadhan.
2009-01-24 Gonzalo Paniagua Javier <[email protected]>
* TdsConnectionPool.cs: made getting/releasing connections thread safe.
If we have a release connection available, we return that without locking
2009-01-21 Christian Hergert <[email protected]>
* TdsComm.cs: optimize Append(byte[],int,byte) for adding data to
the buffer in the largest size of chunks possible. also optimize
other Append overloads to use this rather than lots of Append(byte).
2009-01-20 Gonzalo Paniagua Javier <[email protected]>
* TdsComm.cs: no need for the ManualResetEvent or the timeout instance
variables.
2009-01-14 Gonzalo Paniagua Javier <[email protected]>
* Tds70.cs: fix my mistake in the previous patch.
@@ -541,7 +541,7 @@ namespace Mono.Data.Tds.Protocol
parameterName = parameterName.Substring (1);
}
if (parameter.Direction == TdsParameterDirection.Output)
return String.Format ("@{0}={0} output", parameterName);
return String.Format ("@{0}=@{0} output", parameterName);
if (parameter.Value == null || parameter.Value == DBNull.Value)
return String.Format ("@{0}=NULL", parameterName);
@@ -47,7 +47,6 @@ namespace Mono.Data.Tds.Protocol {
string dataSource;
int commandTimeout;
int connectionTimeout;
byte[] outBuffer;
int outBufferLength;
@@ -68,8 +67,6 @@ namespace Mono.Data.Tds.Protocol {
Socket socket;
TdsVersion tdsVersion;
ManualResetEvent connected = new ManualResetEvent (false);
#endregion // Fields
#region Constructors
@@ -79,7 +76,6 @@ namespace Mono.Data.Tds.Protocol {
this.packetSize = packetSize;
this.tdsVersion = tdsVersion;
this.dataSource = dataSource;
this.connectionTimeout = timeout;
outBuffer = new byte[packetSize];
inBuffer = new byte[packetSize];
@@ -90,8 +86,6 @@ namespace Mono.Data.Tds.Protocol {
IPEndPoint endPoint;
try {
socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
#if NET_2_0
IPAddress ip;
if(IPAddress.TryParse(this.dataSource, out ip)) {
@@ -104,15 +98,16 @@ namespace Mono.Data.Tds.Protocol {
IPHostEntry hostEntry = Dns.Resolve (this.dataSource);
endPoint = new IPEndPoint (hostEntry.AddressList [0], port);
#endif
} catch (SocketException e) {
throw new TdsInternalException ("Server does not exist or connection refused.", e);
}
connected.Reset ();
socket.BeginConnect (endPoint, new AsyncCallback (ConnectCallback), socket);
if (timeout > 0 && !connected.WaitOne (new TimeSpan (0, 0, timeout), true))
try {
socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IAsyncResult ares = socket.BeginConnect (endPoint, null, null);
if (timeout > 0 && !ares.IsCompleted && !ares.AsyncWaitHandle.WaitOne (timeout * 1000, false))
throw Tds.CreateTimeoutException (dataSource, "Open()");
else if (timeout > 0 && !connected.WaitOne ())
throw Tds.CreateTimeoutException (dataSource, "Open()");
socket.EndConnect (ares);
try {
// MS sets these socket option
socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1);
@@ -124,8 +119,17 @@ namespace Mono.Data.Tds.Protocol {
// Let the stream own the socket and take the pleasure of closing it
stream = new NetworkStream (socket, true);
} catch (SocketException e) {
if (socket != null) {
try {
Socket s = socket;
socket = null;
s.Close ();
} catch {}
}
throw new TdsInternalException ("Server does not exist or connection refused.", e);
}
if (!socket.Connected)
throw new TdsInternalException ("Server does not exist or connection refused.", null);
}
#endregion // Constructors
@@ -158,6 +162,16 @@ namespace Mono.Data.Tds.Protocol {
return ret;
}
public void SendIfFull ()
{
if (nextOutBufferIndex == outBufferLength) {
SendPhysicalPacket (false);
nextOutBufferIndex = headerLength;
}
}
public void Append (object o)
{
if (o == null || o == DBNull.Value) {
@@ -208,10 +222,7 @@ namespace Mono.Data.Tds.Protocol {
public void Append (byte b)
{
if (nextOutBufferIndex == outBufferLength) {
SendPhysicalPacket (false);
nextOutBufferIndex = headerLength;
}
SendIfFull ();
Store (nextOutBufferIndex, b);
nextOutBufferIndex++;
}
@@ -241,40 +252,69 @@ namespace Mono.Data.Tds.Protocol {
public void Append (byte[] b)
{
Append (b, b.Length, (byte) 0);
}
}
public void Append (byte[] b, int len, byte pad)
{
int i = 0;
for ( ; i < b.Length && i < len; i++)
Append (b[i]);
int bufBytesToCopy = System.Math.Min (b.Length, len);
int padBytesToCopy = len - bufBytesToCopy;
int bufPos = 0;
for ( ; i < len; i++)
Append (pad);
}
/* copy out of our input buffer in the largest chunks possible *
* at a time. limited only by the buffer size for our outgoing *
* packets. */
while (bufBytesToCopy > 0)
{
SendIfFull ();
int availBytes = outBufferLength - nextOutBufferIndex;
int bufSize = System.Math.Min (availBytes, bufBytesToCopy);
Buffer.BlockCopy (b, bufPos, outBuffer, nextOutBufferIndex, bufSize);
nextOutBufferIndex += bufSize;
bufBytesToCopy -= bufSize;
bufPos += bufSize;
}
while (padBytesToCopy > 0)
{
SendIfFull ();
int availBytes = outBufferLength - nextOutBufferIndex;
int bufSize = System.Math.Min (availBytes, padBytesToCopy);
for (int i = 0; i < bufSize; i++)
outBuffer [nextOutBufferIndex++] = pad;
padBytesToCopy -= bufSize;
}
}
public void Append (short s)
{
if(!BitConverter.IsLittleEndian)
Append (Swap (BitConverter.GetBytes(s)));
Append (Swap (BitConverter.GetBytes(s)), sizeof(short), (byte)0);
else
Append (BitConverter.GetBytes (s));
Append (BitConverter.GetBytes (s), sizeof(short), (byte)0);
}
public void Append (ushort s)
{
if(!BitConverter.IsLittleEndian)
Append (Swap (BitConverter.GetBytes(s)));
Append (Swap (BitConverter.GetBytes(s)), sizeof(short), (byte)0);
else
Append (BitConverter.GetBytes (s));
Append (BitConverter.GetBytes (s), sizeof(short), (byte)0);
}
public void Append (int i)
{
if(!BitConverter.IsLittleEndian)
Append (Swap (BitConverter.GetBytes(i)));
Append (Swap (BitConverter.GetBytes(i)), sizeof(int), (byte)0);
else
Append (BitConverter.GetBytes (i));
Append (BitConverter.GetBytes (i), sizeof(int), (byte)0);
}
public void Append (string s)
@@ -303,25 +343,25 @@ namespace Mono.Data.Tds.Protocol {
public void Append (double value)
{
if (!BitConverter.IsLittleEndian)
Append (Swap (BitConverter.GetBytes (value)));
Append (Swap (BitConverter.GetBytes (value)), sizeof(double), (byte)0);
else
Append (BitConverter.GetBytes (value));
Append (BitConverter.GetBytes (value), sizeof(double), (byte)0);
}
public void Append (float value)
{
if (!BitConverter.IsLittleEndian)
Append (Swap (BitConverter.GetBytes (value)));
Append (Swap (BitConverter.GetBytes (value)), sizeof(float), (byte)0);
else
Append (BitConverter.GetBytes (value));
Append (BitConverter.GetBytes (value), sizeof(float), (byte)0);
}
public void Append (long l)
{
if (!BitConverter.IsLittleEndian)
Append (Swap (BitConverter.GetBytes (l)));
Append (Swap (BitConverter.GetBytes (l)), sizeof(long), (byte)0);
else
Append (BitConverter.GetBytes (l));
Append (BitConverter.GetBytes (l), sizeof(long), (byte)0);
}
public void Append (decimal d, int bytes)
@@ -338,23 +378,15 @@ namespace Mono.Data.Tds.Protocol {
public void Close ()
{
connReset = false;
socket = null;
stream.Close ();
}
public bool IsConnected ()
{
return !(socket.Poll (0, SelectMode.SelectRead) && socket.Available == 0);
return socket != null && socket.Connected && !(socket.Poll (0, SelectMode.SelectRead) && socket.Available == 0);
}
private void ConnectCallback (IAsyncResult ar)
{
Socket s = (Socket) ar.AsyncState;
if (Poll (s, connectionTimeout, SelectMode.SelectWrite)) {
socket.EndConnect (ar);
connected.Set ();
}
}
public byte GetByte ()
{
byte result;
@@ -4,9 +4,10 @@
// Author:
// Lluis Sanchez Gual ([email protected])
// Christian Hergert ([email protected])
// Gonzalo Paniagua Javier ([email protected])
//
// Copyright (C) 2004 Novell, Inc.
//
// Copyright (C) 2009 Novell, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -30,22 +31,14 @@
//
using System;
#if NET_2_0
using System.Collections.Generic;
#else
using System.Collections;
#endif
using System.Threading;
namespace Mono.Data.Tds.Protocol
{
public class TdsConnectionPoolManager
{
#if NET_2_0
Dictionary <string, TdsConnectionPool> pools = new Dictionary <string, TdsConnectionPool> ();
#else
Hashtable pools = new Hashtable ();
#endif
Hashtable pools = Hashtable.Synchronized (new Hashtable ());
TdsVersion version;
public TdsConnectionPoolManager (TdsVersion version)
@@ -55,42 +48,19 @@ namespace Mono.Data.Tds.Protocol
public TdsConnectionPool GetConnectionPool (string connectionString, TdsConnectionInfo info)
{
lock (pools)
{
TdsConnectionPool pool = null;
#if NET_2_0
pools.TryGetValue (connectionString, out pool);
#else
TdsConnectionPool pool = (TdsConnectionPool) pools [connectionString];
if (pool == null) {
pools [connectionString] = new TdsConnectionPool (this, info);
pool = (TdsConnectionPool) pools [connectionString];
#endif
if (pool == null) {
pool = new TdsConnectionPool (this, info);
pools [connectionString] = pool;
}
return pool;
}
return pool;
}
public TdsConnectionPool GetConnectionPool (string connectionString)
{
TdsConnectionPool pool = null;
#if NET_2_0
pools.TryGetValue (connectionString, out pool);
#else
pool = (TdsConnectionPool) pools [connectionString];
#endif
return pool;
return (TdsConnectionPool) pools [connectionString];
}
#if NET_2_0
public IDictionary <string, TdsConnectionPool> GetConnectionPool ()
#else
public IDictionary GetConnectionPool ()
#endif
{
return pools;
}
public virtual Tds CreateConnection (TdsConnectionInfo info)
{
switch (version)
@@ -106,6 +76,11 @@ namespace Mono.Data.Tds.Protocol
}
throw new NotSupportedException ();
}
public IDictionary GetConnectionPool ()
{
return pools;
}
}
public class TdsConnectionInfo
@@ -130,196 +105,147 @@ namespace Mono.Data.Tds.Protocol
public class TdsConnectionPool
{
#if NET_2_0
Tds[] list;
#else
object [] list;
#endif
TdsConnectionInfo info;
bool pooling = true;
bool no_pooling;
TdsConnectionPoolManager manager;
ManualResetEvent connAvailable;
Queue available;
ArrayList conns;
object next_free;
public TdsConnectionPool (TdsConnectionPoolManager manager, TdsConnectionInfo info)
{
int n = 0;
this.info = info;
this.manager = manager;
#if NET_2_0
list = new Tds[info.PoolMaxSize];
#else
list = new object [info.PoolMaxSize];
#endif
conns = new ArrayList (info.PoolMaxSize);
available = new Queue (info.PoolMaxSize);
InitializePool ();
}
// Placeholder for future connections are at the beginning of the array.
for (; n < info.PoolMaxSize - info.PoolMinSize; n++)
list [n] = null;
// Pre-populate with minimum number of connections
for (; n < list.Length; n++) {
list [n] = CreateConnection ();
void InitializePool ()
{
for (int i = 0; i < info.PoolMinSize; i++) {
if (i == 0) {
next_free = manager.CreateConnection (info);
conns.Add (next_free);
} else {
Tds t = manager.CreateConnection (info);
conns.Add (t);
available.Enqueue (t);
}
}
// Event that notifies a connection is available in the pool
connAvailable = new ManualResetEvent (false);
}
public bool Pooling {
get { return pooling; }
set { pooling = value; }
get { return !no_pooling; }
set { no_pooling = !value; }
}
#region Methods
public Tds GetConnection ()
{
Tds connection = null;
int index;
if (no_pooling)
return manager.CreateConnection (info);
retry:
// Reset the connection available event
connAvailable.Reset ();
retry:
Tds result = (Tds) Interlocked.Exchange (ref next_free, null);
if (result != null && !result.IsConnected)
result = null;
index = list.Length - 1;
do {
#if NET_2_0
connection = list [index];
#else
connection = (Tds) list [index];
#endif
if (connection == null) {
// Attempt take-over of array position
connection = CreateConnection ();
(connection as Tds).poolStatus = 1;
#if NET_2_0
if (Interlocked.CompareExchange<Tds> (ref list [index], connection, null) != null) {
#else
if (Interlocked.CompareExchange (ref list [index], connection, null) != null) {
#endif
// Someone beat us to the punch
connection = null;
while (result == null) {
lock (available) {
if (available.Count > 0) {
result = (Tds) available.Dequeue ();
break; // .. and do the reset out of the loop
} else {
continue;
result = (Tds) Interlocked.Exchange (ref next_free, null);
if (result != null && result.IsConnected)
break;
result = null;
}
} else {
if (Interlocked.CompareExchange (ref (connection as Tds).poolStatus, 1, 0) != 0) {
// Someone else owns this connection
connection = null;
} else {
if (!connection.Reset ()) {
ThreadPool.QueueUserWorkItem (new WaitCallback (DestroyConnection), connection);
// remove connection from pool
list [index] = connection = null;
// allow slot be re-used in same run
continue;
} else {
Monitor.Enter (conns);
try {
if (conns.Count >= info.PoolMaxSize) {
Monitor.Exit (conns);
//Console.WriteLine ("GONZ: ENTERING LOCK");
bool got_lock = Monitor.Wait (available, info.Timeout * 1000);
if (!got_lock) {
throw new InvalidOperationException (
"Timeout expired. The timeout period elapsed before a " +
"connection could be obtained. A possible explanation " +
"is that all the connections in the pool are in use, " +
"and the maximum pool size is reached.");
}
continue;
}
} finally {
Monitor.Exit (conns); // Exiting if not owned is ok
}
}
index--;
if (index < 0) {
// TODO: Maintain a list of indices of released connection to save some loop over
// Honor timeout - if pool is full, and no connections are available within the
// timeout period - just throw the exception
if (info.Timeout > 0
&& !connAvailable.WaitOne (new TimeSpan (0, 0, info.Timeout), true))
throw new InvalidOperationException (
"Timeout expired. The timeout period elapsed before a " +
"connection could be obtained. A possible explanation " +
"is that all the connections in the pool are in use, " +
"and the maximum pool size is reached.");
goto retry;
lock (conns) {
if (conns.Count < info.PoolMaxSize) {
try {
//Console.WriteLine ("GONZ: NEW");
result = manager.CreateConnection (info);
conns.Add (result);
return result; // no reset needed
} catch {
}
continue;
}
}
}
} while (connection == null);
return connection;
if (!result.IsConnected || !result.Reset ()) {
//Console.WriteLine ("GONZ: RESET FAILED");
lock (conns)
conns.Remove (result);
ThreadPool.QueueUserWorkItem (new WaitCallback (DestroyConnection), result);
goto retry;
}
//Console.WriteLine ("GONZ: REUSED");
return result;
}
public void ReleaseConnection (Tds connection)
{
connection.poolStatus = 0;
connAvailable.Set ();
if (no_pooling) {
ThreadPool.QueueUserWorkItem (new WaitCallback (DestroyConnection), connection);
return;
}
lock (available) {
if (Interlocked.CompareExchange (ref next_free, connection, null) != null)
available.Enqueue (connection);
Monitor.Pulse (available);
}
}
#if NET_2_0
public void ReleaseConnection (ref Tds connection)
{
if (pooling == false) {
int index = Array.IndexOf (list, connection);
ThreadPool.QueueUserWorkItem (new WaitCallback (DestroyConnection), connection);
list [index] = connection = null;
} else {
connection.poolStatus = 0;
}
connAvailable.Set ();
}
public void ResetConnectionPool ()
{
Tds connection = null;
int index = list.Length - 1;
while (index >= 0)
{
connection = list [index];
// skip free slots
if (connection == null) {
index--;
continue;
}
if (Interlocked.CompareExchange (ref connection.poolStatus, 1, 0) == 0)
ThreadPool.QueueUserWorkItem (new WaitCallback (DestroyConnection), connection);
connection.Pooling = false;
list [index] = connection = null;
connAvailable.Set ();
index--;
}
}
public void ResetConnectionPool (Tds connection)
{
int index = Array.IndexOf (list, connection);
if (index != -1) {
if (connection != null && !connection.Reset ()) {
ThreadPool.QueueUserWorkItem (new WaitCallback (DestroyConnection), connection);
list [index] = connection = null;
connAvailable.Set ();
lock (available) {
available.Clear ();
lock (conns) {
for (int i = 0; i < conns.Count; i++) {
Tds tds = (Tds) conns [i];
ThreadPool.QueueUserWorkItem (new WaitCallback (DestroyConnection), tds);
}
conns.Clear ();
InitializePool ();
Monitor.PulseAll (available);
}
}
}
#endif
Tds CreateConnection ()
{
return manager.CreateConnection (info);
}
void DestroyConnection (object state)
static void DestroyConnection (object state)
{
Tds connection = state as Tds;
if (connection != null) {
try {
connection.Disconnect ();
} finally {
connection = null;
}
connection.Disconnect ();
}
}
#endregion // Methods
}
}
+5
View File
@@ -1,3 +1,8 @@
2009-02-20 Veerapuram Varadhan <[email protected]>
* TdsDataReader.cs: Access TdsDataColumn correctly for NET_2_0.
Fixes #466199. Patch by Tom Hindle <[email protected]>
2008-07-06 Sebastien Pouliot <[email protected]>
* Mono.Data.TdsClient/TdsCommand.cs: Fix unneeded assignment
@@ -389,7 +389,11 @@ namespace Mono.Data.TdsClient {
if (row ["BaseColumnName"] == DBNull.Value)
row ["BaseColumnName"] = row ["ColumnName"];
#if NET_2_0
switch ((TdsColumnType) schema.ColumnType) {
#else
switch ((TdsColumnType) schema ["ColumnType"]) {
#endif
case TdsColumnType.Image :
dataTypeNames.Add ("image");
row ["ProviderType"] = (int) TdsType.Image;
@@ -2,6 +2,7 @@ System/TimeZoneInfoTest.cs
System/TimeZoneInfo.AdjustmentRuleTest.cs
System/TimeZoneInfo.TransitionTimeTest.cs
System.Collections.Generic/HashSetTest.cs
System.Linq/EnumerableFixture.cs
System.Linq/EnumerableTest.cs
System.Linq/EnumerableMoreTest.cs
System.Linq/EnumerableAsQueryableTest.cs
@@ -1,3 +1,23 @@
2009-02-24 Jb Evain <[email protected]>
backport of 127871.
* Expression.cs (BinaryCoreCheck): fix comparison of enums.
2009-02-23 Jb Evain <[email protected]>
backport of 127755.
* Expression.cs (IsNumber): actually decimal is rather a special
case, and not a primitive number.
2009-02-23 Jb Evain <[email protected]>
backport of 127746.
* Expression.cs (BinaryCoreCheck): add decimal operations
are provided by custom operators.
2008-12-17 Jb Evain <[email protected]>
* ExpressionTransformer.cs: fix VisitList.
@@ -241,7 +241,7 @@ namespace System.Linq.Expressions {
}
// Use IsNumber to avoid expensive reflection.
if (IsNumber (ultype)){
if (IsNumber (ultype)) {
if (ultype == urtype && ltype == rtype)
return null;
@@ -265,6 +265,9 @@ namespace System.Linq.Expressions {
if (!ltype.IsValueType && !rtype.IsValueType)
return null;
if (ltype == rtype && ultype.IsEnum)
return null;
if (ltype == rtype && ultype == typeof (bool))
return null;
}
@@ -2221,7 +2224,7 @@ namespace System.Linq.Expressions {
if (IsInt (t))
return true;
return t == typeof (float) || t == typeof (double) || t == typeof (decimal);
return t == typeof (float) || t == typeof (double);
}
static bool IsSignedNumber (Type t)
@@ -1,3 +1,26 @@
2009-02-23 Jb Evain <[email protected]>
backport of 127772.
* Enumerable.cs (IterateNullable): fix initial value
for nullables.
2009-01-22 Jb Evain <[email protected]>
* SortSequenceContext.cs: make sort stable.
2009-01-22 Jb Evain <[email protected]>
* Enumerable.cs (Sum): check the sum operations for possible overfows.
2009-01-22 Jb Evain <[email protected]>
* Enumerable.cs (SequenceEqual): make sure we dispose enumerators.
2009-01-22 Jb Evain <[email protected]>
* Enumerable.cs: optimize Last for lists.
2009-01-15 Jb Evain <[email protected]>
* Lookup.cs: propage the appropriate comparer for the lookup.
+87 -90
View File
@@ -935,6 +935,14 @@ namespace System.Linq
{
Check.Source (source);
var collection = source as ICollection<TSource>;
if (collection != null && collection.Count == 0)
throw new InvalidOperationException ();
var list = source as IList<TSource>;
if (list != null)
return list [list.Count - 1];
return source.Last (PredicateOf<TSource>.Always, Fallback.Throw);
}
@@ -1044,46 +1052,48 @@ namespace System.Linq
{
Check.Source (source);
return IterateNullable (source, int.MinValue, (a, b) => a > b);
return IterateNullable (source, (a, b) => a > b);
}
public static long? Max (this IEnumerable<long?> source)
{
Check.Source (source);
return IterateNullable (source, long.MinValue, (a, b) => a > b);
return IterateNullable (source, (a, b) => a > b);
}
public static double? Max (this IEnumerable<double?> source)
{
Check.Source (source);
return IterateNullable (source, double.MinValue, (a, b) => a > b);
return IterateNullable (source, (a, b) => a > b);
}
public static float? Max (this IEnumerable<float?> source)
{
Check.Source (source);
return IterateNullable (source, float.MinValue, (a, b) => a > b);
return IterateNullable (source, (a, b) => a > b);
}
public static decimal? Max (this IEnumerable<decimal?> source)
{
Check.Source (source);
return IterateNullable (source, decimal.MinValue, (a, b) => a > b);
return IterateNullable (source, (a, b) => a > b);
}
static T? IterateNullable<T> (IEnumerable<T?> source, T initValue, Func<T?, T?, bool> selector) where T : struct
static T? IterateNullable<T> (IEnumerable<T?> source, Func<T?, T?, bool> selector) where T : struct
{
bool empty = true;
T? value = initValue;
T? value = null;
foreach (var element in source) {
if (!element.HasValue)
continue;
if (selector (element.Value, value))
if (!value.HasValue)
value = element.Value;
else if (selector (element.Value, value))
value = element;
empty = false;
@@ -1095,6 +1105,30 @@ namespace System.Linq
return value;
}
static TRet? IterateNullable<TSource, TRet> (
IEnumerable<TSource> source,
Func<TSource, TRet?> source_selector,
Func<TRet?, TRet?, bool> selector) where TRet : struct
{
bool empty = true;
TRet? value = null;
foreach (var element in source) {
TRet? item = source_selector (element);
if (!value.HasValue)
value = item;
else if (selector (item, value))
value = item;
empty = false;
}
if (empty)
return null;
return value;
}
public static TSource Max<TSource> (this IEnumerable<TSource> source)
{
Check.Source (source);
@@ -1176,67 +1210,39 @@ namespace System.Linq
return initValue;
}
static U? IterateNullable<T, U> (IEnumerable<T> source, U initialValue, Func<T, U?, U?> selector) where U : struct
{
bool empty = true;
U? value = initialValue;
foreach (var element in source) {
value = selector (element, value);
if (!value.HasValue)
continue;
empty = false;
}
if (empty)
return null;
return value;
}
public static int? Max<TSource> (this IEnumerable<TSource> source, Func<TSource, int?> selector)
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, int.MinValue, (a, b) => {
var v = selector (a); return v > b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a > b);
}
public static long? Max<TSource> (this IEnumerable<TSource> source, Func<TSource, long?> selector)
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, long.MinValue, (a, b) => {
var v = selector (a); return v > b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a > b);
}
public static double? Max<TSource> (this IEnumerable<TSource> source, Func<TSource, double?> selector)
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, double.MinValue, (a, b) => {
var v = selector (a); return v > b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a > b);
}
public static float? Max<TSource> (this IEnumerable<TSource> source, Func<TSource, float?> selector)
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, float.MinValue, (a, b) => {
var v = selector (a); return v > b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a > b);
}
public static decimal? Max<TSource> (this IEnumerable<TSource> source, Func<TSource, decimal?> selector)
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, decimal.MinValue, (a, b) => {
var v = selector (a); return v > b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a > b);
}
public static TResult Max<TSource, TResult> (this IEnumerable<TSource> source, Func<TSource, TResult> selector)
@@ -1315,35 +1321,35 @@ namespace System.Linq
{
Check.Source (source);
return IterateNullable (source, int.MaxValue, (a, b) => a < b);
return IterateNullable (source, (a, b) => a < b);
}
public static long? Min (this IEnumerable<long?> source)
{
Check.Source (source);
return IterateNullable (source, long.MaxValue, (a, b) => a < b);
return IterateNullable (source, (a, b) => a < b);
}
public static double? Min (this IEnumerable<double?> source)
{
Check.Source (source);
return IterateNullable (source, double.MaxValue, (a, b) => a < b);
return IterateNullable (source, (a, b) => a < b);
}
public static float? Min (this IEnumerable<float?> source)
{
Check.Source (source);
return IterateNullable (source, float.MaxValue, (a, b) => a < b);
return IterateNullable (source, (a, b) => a < b);
}
public static decimal? Min (this IEnumerable<decimal?> source)
{
Check.Source (source);
return IterateNullable (source, decimal.MaxValue, (a, b) => a < b);
return IterateNullable (source, (a, b) => a < b);
}
public static TSource Min<TSource> (this IEnumerable<TSource> source)
@@ -1417,45 +1423,35 @@ namespace System.Linq
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, int.MaxValue, (a, b) => {
var v = selector (a); return v < b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a < b);
}
public static long? Min<TSource> (this IEnumerable<TSource> source, Func<TSource, long?> selector)
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, long.MaxValue, (a, b) => {
var v = selector (a); return v < b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a < b);
}
public static float? Min<TSource> (this IEnumerable<TSource> source, Func<TSource, float?> selector)
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, float.MaxValue, (a, b) => {
var v = selector (a); return v < b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a < b);
}
public static double? Min<TSource> (this IEnumerable<TSource> source, Func<TSource, double?> selector)
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, double.MaxValue, (a, b) => {
var v = selector (a); return v < b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a < b);
}
public static decimal? Min<TSource> (this IEnumerable<TSource> source, Func<TSource, decimal?> selector)
{
Check.SourceAndSelector (source, selector);
return IterateNullable (source, decimal.MaxValue, (a, b) => {
var v = selector (a); return v < b ? v : b;
});
return IterateNullable (source, selector, (a, b) => a < b);
}
public static TResult Min<TSource, TResult> (this IEnumerable<TSource> source, Func<TSource, TResult> selector)
@@ -1847,21 +1843,21 @@ namespace System.Linq
{
Check.Source (source);
return Sum<int, int> (source, (a, b) => a + b);
return Sum<int, int> (source, (a, b) => checked (a + b));
}
public static int? Sum (this IEnumerable<int?> source)
{
Check.Source (source);
return source.SumNullable<int?, int?> (0, (a, b) => a.HasValue ? a + b : a);
return source.SumNullable<int?, int?> (0, (total, element) => element.HasValue ? checked (total + element) : total);
}
public static int Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, int> selector)
{
Check.SourceAndSelector (source, selector);
return Sum<TSource, int> (source, (a, b) => a + selector (b));
return Sum<TSource, int> (source, (a, b) => checked (a + selector (b)));
}
public static int? Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, int?> selector)
@@ -1870,7 +1866,7 @@ namespace System.Linq
return source.SumNullable<TSource, int?> (0, (a, b) => {
var value = selector (b);
return value.HasValue ? a + value.Value : a;
return value.HasValue ? checked (a + value.Value) : a;
});
}
@@ -1878,21 +1874,21 @@ namespace System.Linq
{
Check.Source (source);
return Sum<long, long> (source, (a, b) => a + b);
return Sum<long, long> (source, (a, b) => checked (a + b));
}
public static long? Sum (this IEnumerable<long?> source)
{
Check.Source (source);
return source.SumNullable<long?, long?> (0, (a, b) => a.HasValue ? a + b : a);
return source.SumNullable<long?, long?> (0, (total, element) => element.HasValue ? checked (total + element) : total);
}
public static long Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, long> selector)
{
Check.SourceAndSelector (source, selector);
return Sum<TSource, long> (source, (a, b) => a + selector (b));
return Sum<TSource, long> (source, (a, b) => checked (a + selector (b)));
}
public static long? Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, long?> selector)
@@ -1901,7 +1897,7 @@ namespace System.Linq
return source.SumNullable<TSource, long?> (0, (a, b) => {
var value = selector (b);
return value.HasValue ? a + value.Value : a;
return value.HasValue ? checked (a + value.Value) : a;
});
}
@@ -1909,21 +1905,21 @@ namespace System.Linq
{
Check.Source (source);
return Sum<double, double> (source, (a, b) => a + b);
return Sum<double, double> (source, (a, b) => checked (a + b));
}
public static double? Sum (this IEnumerable<double?> source)
{
Check.Source (source);
return source.SumNullable<double?, double?> (0, (a, b) => a.HasValue ? a + b : a);
return source.SumNullable<double?, double?> (0, (total, element) => element.HasValue ? checked (total + element) : total);
}
public static double Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, double> selector)
{
Check.SourceAndSelector (source, selector);
return Sum<TSource, double> (source, (a, b) => a + selector (b));
return Sum<TSource, double> (source, (a, b) => checked (a + selector (b)));
}
public static double? Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, double?> selector)
@@ -1932,7 +1928,7 @@ namespace System.Linq
return source.SumNullable<TSource, double?> (0, (a, b) => {
var value = selector (b);
return value.HasValue ? a + value.Value : a;
return value.HasValue ? checked (a + value.Value) : a;
});
}
@@ -1940,21 +1936,21 @@ namespace System.Linq
{
Check.Source (source);
return Sum<float, float> (source, (a, b) => a + b);
return Sum<float, float> (source, (a, b) => checked (a + b));
}
public static float? Sum (this IEnumerable<float?> source)
{
Check.Source (source);
return source.SumNullable<float?, float?> (0, (a, b) => a.HasValue ? a + b : a);
return source.SumNullable<float?, float?> (0, (total, element) => element.HasValue ? checked (total + element) : total);
}
public static float Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, float> selector)
{
Check.SourceAndSelector (source, selector);
return Sum<TSource, float> (source, (a, b) => a + selector (b));
return Sum<TSource, float> (source, (a, b) => checked (a + selector (b)));
}
public static float? Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, float?> selector)
@@ -1963,7 +1959,7 @@ namespace System.Linq
return source.SumNullable<TSource, float?> (0, (a, b) => {
var value = selector (b);
return value.HasValue ? a + value.Value : a;
return value.HasValue ? checked (a + value.Value) : a;
});
}
@@ -1971,21 +1967,21 @@ namespace System.Linq
{
Check.Source (source);
return Sum<decimal, decimal> (source, (a, b) => a + b);
return Sum<decimal, decimal> (source, (a, b) => checked (a + b));
}
public static decimal? Sum (this IEnumerable<decimal?> source)
{
Check.Source (source);
return source.SumNullable<decimal?, decimal?> (0, (a, b) => a.HasValue ? a + b : a);
return source.SumNullable<decimal?, decimal?> (0, (total, element) => element.HasValue ? checked (total + element) : total);
}
public static decimal Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, decimal> selector)
{
Check.SourceAndSelector (source, selector);
return Sum<TSource, decimal> (source, (a, b) => a + selector (b));
return Sum<TSource, decimal> (source, (a, b) => checked (a + selector (b)));
}
public static decimal? Sum<TSource> (this IEnumerable<TSource> source, Func<TSource, decimal?> selector)
@@ -1994,7 +1990,7 @@ namespace System.Linq
return source.SumNullable<TSource, decimal?> (0, (a, b) => {
var value = selector (b);
return value.HasValue ? a + value.Value : a;
return value.HasValue ? checked (a + value.Value) : a;
});
}
@@ -2243,18 +2239,19 @@ namespace System.Linq
if (comparer == null)
comparer = EqualityComparer<TSource>.Default;
var first_enumerator = first.GetEnumerator ();
var second_enumerator = second.GetEnumerator ();
using (IEnumerator<TSource> first_enumerator = first.GetEnumerator (),
second_enumerator = second.GetEnumerator ()) {
while (first_enumerator.MoveNext ()) {
if (!second_enumerator.MoveNext ())
return false;
while (first_enumerator.MoveNext ()) {
if (!second_enumerator.MoveNext ())
return false;
if (!comparer.Equals (first_enumerator.Current, second_enumerator.Current))
return false;
if (!comparer.Equals (first_enumerator.Current, second_enumerator.Current))
return false;
}
return !second_enumerator.MoveNext ();
}
return !second_enumerator.MoveNext ();
}
#endregion
@@ -59,8 +59,12 @@ namespace System.Linq {
{
int comparison = comparer.Compare (keys [first_index], keys [second_index]);
if (comparison == 0 && child_context != null)
return child_context.Compare (first_index, second_index);
if (comparison == 0) {
if (child_context != null)
return child_context.Compare (first_index, second_index);
else
comparison = first_index - second_index;
}
return direction == SortDirection.Descending ? -comparison : comparison;
}
@@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F902A50D-6156-4935-A1AC-E82DF0EB83D3}</ProjectGuid>
<OutputType>Library</OutputType>
@@ -105,6 +105,7 @@
<Compile Include="System.Linq.Expressions\ExpressionTest_UnaryPlus.cs" />
<Compile Include="System.Linq.Expressions\ExpressionTest_Utils.cs" />
<Compile Include="System.Linq\EnumerableAsQueryableTest.cs" />
<Compile Include="System.Linq\EnumerableFixture.cs" />
<Compile Include="System.Linq\EnumerableMoreTest.cs" />
<Compile Include="System.Linq\EnumerableTest.cs" />
<Compile Include="System.Linq\LookupTest.cs" />
@@ -129,4 +130,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
File diff suppressed because it is too large. Load diff
@@ -1,3 +1,13 @@
2009-02-23 Veerapuram Varadhan <[email protected]>
* OracleException: 2.0 changes - patch submitted by
Jay Wren <[email protected]>
2009-02-19 Veerapuram Varadhan <[email protected]>
* OracleParameter.cs (bind): Consider OciDataType.Float and .Integer as
OciDataType.Number. Patch provided by Russell <[email protected]>
2008-07-06 Sebastien Pouliot <[email protected]>
* OracleDataReader.cs: Replace a few Type.GetType by typeof
@@ -21,7 +21,12 @@ using System.Runtime.Serialization;
namespace System.Data.OracleClient {
[Serializable]
public sealed class OracleException : SystemException
public sealed class OracleException
#if NET_2_0
: System.Data.Common.DbException
#else
: SystemException
#endif // NET_1_1
{
#region Fields
@@ -550,6 +550,8 @@ namespace System.Data.OracleClient
timezone);
}
break;
case OciDataType.Integer:
case OciDataType.Float:
case OciDataType.Number:
bindType = OciDataType.String;
indicator = 0;
@@ -1,3 +1,8 @@
2009-02-20 Veerapuram Varadhan <[email protected]>
* OdbcDataReader.cs (GetValue): Handle null image data. Fixes ##419224
Patch by John Mortlock <[email protected]>.
2009-01-18 Gert Driesen <[email protected]>
* OdbcDataReader.cs: Fixed GetBytes with limited length. Added reader
@@ -808,21 +808,25 @@ namespace System.Data.Odbc
bufsize = (col.MaxLength < 255 && col.MaxLength > 0 ? col.MaxLength : 255);
buffer= new byte [bufsize];
ArrayList al = new ArrayList ();
do {
ret = libodbc.SQLGetData (hstmt, ColIndex, SQL_C_TYPE.BINARY, buffer, bufsize, ref outsize);
if (ret == OdbcReturn.Error)
break;
if (ret != OdbcReturn.NoData && outsize != -1) {
if (outsize < bufsize) {
byte [] tmparr = new byte [outsize];
Array.Copy (buffer, 0, tmparr, 0, outsize);
al.AddRange (tmparr);
} else
al.AddRange (buffer);
} else {
break;
}
} while (ret != OdbcReturn.NoData);
//get the size of data to be returned.
ret = libodbc.SQLGetData (hstmt, ColIndex, SQL_C_TYPE.BINARY, buffer, 0, ref outsize);
if (outsize != (int) OdbcLengthIndicator.NullData) {
do {
ret = libodbc.SQLGetData (hstmt, ColIndex, SQL_C_TYPE.BINARY, buffer, bufsize, ref outsize);
if (ret == OdbcReturn.Error)
break;
if (ret != OdbcReturn.NoData && outsize != -1) {
if (outsize < bufsize) {
byte [] tmparr = new byte [outsize];
Array.Copy (buffer, 0, tmparr, 0, outsize);
al.AddRange (tmparr);
} else
al.AddRange (buffer);
} else {
break;
}
} while (ret != OdbcReturn.NoData);
}
DataValue = al.ToArray (typeof (byte));
break;
case OdbcType.Binary :
@@ -1,3 +1,7 @@
2009-02-19 Gonzalo Paniagua Javier <[email protected]>
* OleDbFactory.cs: New file.
2008-04-21 Gert Driesen <[email protected]>
* OleDbDataAdapter.cs: Changed argument names to match MS. Removed
@@ -0,0 +1,80 @@
//
// System.Data.oleDb.OleDbFactory
//
// Author:
// Gonzalo Paniagua ([email protected])
//
// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Data.Common;
using System.Security;
using System.Security.Permissions;
namespace System.Data.OleDb {
public sealed class OleDbFactory : DbProviderFactory {
public static readonly OleDbFactory Instance = new OleDbFactory ();
private OleDbFactory()
{
}
public override DbCommand CreateCommand ()
{
return new OleDbCommand ();
}
public override DbCommandBuilder CreateCommandBuilder ()
{
return new OleDbCommandBuilder ();
}
public override DbConnection CreateConnection ()
{
return new OleDbConnection ();
}
public override DbConnectionStringBuilder CreateConnectionStringBuilder ()
{
//TODO: Once we have an OleDbConnectionStringBuilder implementation, comment the next line out
//return new OleDbConnectionStringBuilder ();
return null;
}
public override DbDataAdapter CreateDataAdapter ()
{
return new OleDbDataAdapter ();
}
public override DbParameter CreateParameter ()
{
return new OleDbParameter ();
}
public override CodeAccessPermission CreatePermission (PermissionState state)
{
return new OleDbPermission (state);
}
}
}
#endif
@@ -1,3 +1,8 @@
2009-01-24 Gonzalo Paniagua Javier <[email protected]>
* SqlConnection.cs: adapt to changes in TdsConnectionPool.
Don't Close() on every error.
2009-01-17 Gert Driesen <[email protected]>
* SqlParameter.cs: Renamed isDirty to typeChanged; it is now now only
@@ -302,10 +302,6 @@ namespace System.Data.SqlClient
private void ErrorHandler (object sender, TdsInternalErrorMessageEventArgs e)
{
try {
Close ();
} catch {
}
throw new SqlException (e.Class, e.LineNumber, e.Message, e.Number, e.Procedure, e.Server, "Mono SqlClient Data Provider", e.State);
}
@@ -428,15 +424,12 @@ namespace System.Data.SqlClient
if (tds != null && tds.IsConnected) {
if (pooling && tds.Pooling) {
if (pool != null) {
#if NET_2_0
pool.ReleaseConnection (ref tds);
#else
pool.ReleaseConnection (tds);
#endif
pool = null;
}
}else
if(tds != null) tds.Disconnect ();
} else {
tds.Disconnect ();
}
}
if (tds != null) {
@@ -1693,15 +1686,13 @@ namespace System.Data.SqlClient
public static void ClearAllPools ()
{
#if NET_2_0
IDictionary <string, TdsConnectionPool> pools = SqlConnection.sqlConnectionPools.GetConnectionPool ();
#else
Hashtable pools = SqlConnection.sqlConnectionPools.GetConnectionPool ();
#endif
// FIXME: locking
IDictionary pools = SqlConnection.sqlConnectionPools.GetConnectionPool ();
foreach (TdsConnectionPool pool in pools.Values) {
if (pool != null)
pool.ResetConnectionPool ();
}
pools.Clear ();
}
public static void ClearPool (SqlConnection connection)
@@ -1709,9 +1700,9 @@ namespace System.Data.SqlClient
if (connection == null)
throw new ArgumentNullException ("connection");
// FIXME: locking
if (connection.pooling) {
TdsConnectionPool pool = sqlConnectionPools.GetConnectionPool (
connection.ConnectionString);
TdsConnectionPool pool = sqlConnectionPools.GetConnectionPool (connection.ConnectionString);
if (pool != null)
pool.ResetConnectionPool ();
}
@@ -185,6 +185,7 @@ System.Data.OleDb/OleDbDataReader.cs
System.Data.OleDb/OleDbError.cs
System.Data.OleDb/OleDbErrorCollection.cs
System.Data.OleDb/OleDbException.cs
System.Data.OleDb/OleDbFactory.cs
System.Data.OleDb/OleDbInfoMessageEventArgs.cs
System.Data.OleDb/OleDbInfoMessageEventHandler.cs
System.Data.OleDb/OleDbLiteral.cs
@@ -1,3 +1,17 @@
2009-02-24 Veerapuram Varadhan <[email protected]>
* *Fixes #377146 - in a better way
* XmlDataReader.cs (ReadElementElement): For reference types that
implement IXmlSerializable, call the corresponding ReadXml.
* DataSet.cs (WriteColumnAsElement): For reference types that implement
IXmlSerializable, call the corresponding WriteXml.
2009-02-24 Veerapuram Varadhan <[email protected]>
* Fixes #476523
* DbType.cs: Add DateTime2 and DateTimeOffset - 3.5 additions
Patch by Jay Wren <[email protected]>
2009-01-05 Raja R Harinath <[email protected]>
* DataRelationCollection.cs (BinarySerialize): New. Carved out of ...
+8 -2
View File
@@ -1274,6 +1274,7 @@ namespace System.Data
if (o is TimeSpan) return XmlConvert.ToString ((TimeSpan) o);
if (o is Guid) return XmlConvert.ToString ((Guid) o);
if (o is byte[]) return Convert.ToBase64String ((byte[])o);
return o.ToString ();
}
@@ -1384,8 +1385,13 @@ namespace System.Data
colnspc = col.Namespace;
//TODO check if I can get away with write element string
WriteStartElement (writer, mode, colnspc, col.Prefix, XmlHelper.Encode (col.ColumnName));
writer.WriteString (WriteObjectXml (rowObject));
WriteStartElement (writer, mode, colnspc, col.Prefix, XmlHelper.Encode (col.ColumnName));
if (typeof (IXmlSerializable).IsAssignableFrom (col.DataType)) {
((IXmlSerializable)rowObject).WriteXml (writer);
} else {
writer.WriteString (WriteObjectXml (rowObject));
}
writer.WriteEndElement ();
}
@@ -65,6 +65,8 @@ namespace System.Data
AnsiStringFixedLength = 22,
#if NET_2_0
Xml = 25,
DateTime2 = 26,
DateTimeOffset = 27,
#endif
StringFixedLength = 23
}
@@ -305,13 +305,23 @@ namespace System.Data
// however doesn't behave well with XMLs like the one in
// https://bugzilla.novell.com/show_bug.cgi?id=377146 which is
// apparently supported by MS.NET - to maintain compatibility,
// Try reading the element content as an object type
row [col] = reader.ReadContentAsObject ();
} catch {
// If the obj implements IXmlSerializable, let obj's ReadXml do the reading
IXmlSerializable obj = (IXmlSerializable) Activator.CreateInstance (col.DataType, new object [0]);
if (!reader.IsEmptyElement) {
obj.ReadXml (reader);
reader.ReadEndElement ();
} else {
reader.Skip ();
}
row [col] = obj;
} catch (XmlException e) {
#endif
// XML is not in accordance to expected standards, try reading the content as an xml doc
row [col] = reader.ReadInnerXml ();
#if NET_2_0
} catch (InvalidOperationException e) {
row [col] = reader.ReadInnerXml ();
}
#endif
} else {
@@ -1,3 +1,7 @@
2009-02-20 Veerapuram Varadhan <[email protected]>
* OdbcDataReaderTest.cs: Added test for Bug#419224.
2008-12-31 Gert Driesen <[email protected]>
* OdbcCommandBuilderTest.cs: Improved GetDeleteCommand,
@@ -1116,6 +1116,44 @@ namespace MonoTests.System.Data
Adaptador.Fill(Lector);
}
[Test]
public void Bug419224Test ()
{
cmd = new OdbcCommand ("DROP TABLE IF EXISTS bug419224test");
cmd.Connection = conn;
cmd.ExecuteNonQuery ();
cmd = new OdbcCommand ("CREATE TABLE bug419224test (id_test INTEGER NOT NULL, payload TINYBLOB NOT NULL)");
cmd.Connection = conn;
cmd.ExecuteNonQuery ();
cmd = new OdbcCommand ("INSERT INTO odbc_test (id_test, payload) VALUES (1, 'test for bug419224)");
cmd.Connection = conn;
cmd.ExecuteNonQuery ();
OdbcDataAdapter Adaptador = new OdbcDataAdapter ();
DataSet Lector = new DataSet ();
Adaptador.SelectCommand = new OdbcCommand ("SELECT * FROM odbc_test WHERE id_test=1", (OdbcConnection) conn);
Adaptador.Fill (Lector);
Assert.AreEqual (Lector.Tables[0].Rows[0]["payload"], 1.2346);
OdbcDataReader NewRdr = cmd.ExecuteReader();
// tinyblob column index:
int TinyblobIdx = 1;
bool read = NewRdr.Read();
if (read)
{
bool ret = NewRdr.IsDBNull(TinyblobIdx);
Assert.AreEqual (ret, false);
}
}
static void DoExecuteNonQuery (OdbcConnection conn, string sql)
{
IDbCommand cmd = new OdbcCommand (sql, conn);
@@ -1,3 +1,8 @@
2009-02-08 Gonzalo Paniagua Javier <[email protected]>
* HttpClientTransportSink.cs: if we get an WebException that does not
have a response, dispatch it to the sink.
2008-11-10 Michael Hutchinson <[email protected]>
* HttpServerTransportSink.cs: Seek to beginning of server response
@@ -80,8 +80,10 @@ namespace System.Runtime.Remoting.Channels.Http
response = ex.Response;
//only error 500 is handled by the remoting stack
HttpWebResponse httpResponse = response as HttpWebResponse;
if (httpResponse == null || httpResponse.StatusCode != HttpStatusCode.InternalServerError)
throw;
if (httpResponse == null || httpResponse.StatusCode != HttpStatusCode.InternalServerError) {
sinkStack.DispatchException (ex);
return;
}
}
//this is only valid after the response is fetched
@@ -1,3 +1,10 @@
2009-02-02 Raja R Harinath <[email protected]>
Fix #463999
* CommittableTransaction.cs (CommitCallback): Handle the case
where the callback is invoked before BeginCommit ends due to the
async call ending synchronously.
2007-08-13 Miguel de Icaza <[email protected]>
* Transaction.cs: Remove the exception throwing on Dispose, from
@@ -66,6 +66,8 @@ namespace System.Transactions
private void CommitCallback (IAsyncResult ar)
{
if (asyncResult == null && ar.CompletedSynchronously)
asyncResult = ar;
callback (this);
}
@@ -1,3 +1,8 @@
2009-03-06 Marek Habersack <[email protected]>
* JsonDeserializer.cs: unquoted key values must ignore leading
and trailing whitespace
2008-12-05 Marek Habersack <[email protected]>
* JsonSerializer.cs: StringBuilder extension methods aren't used
@@ -277,8 +277,8 @@ namespace System.Web.Script.Serialization
/*null N3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,OK,__,__,__,__,__,__,__,__,__,__,__,__,__},
/*_. FX*/ {OK,OK,__,OE,__,AE,__,CM,__,__,__,__,__,__,FR,FR,__,__,__,__,E1,__,__,__,__,__,__,__,__,E1,__,__,__,__,__,__},
/*inval. IV*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__},
/*unq.key UK*/ {__,UI,__,__,__,__,UE,__,__,__,__,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,__,UK,UK,UK,UK},
/*unq.ign. UI*/ {__,UI,__,__,__,__,UE,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__},
/*unq.key UK*/ {UI,UI,__,__,__,__,UE,__,__,__,__,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,UK,__,UK,UK,UK,UK},
/*unq.ign. UI*/ {UI,UI,__,__,__,__,UE,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__},
/*i1 I1*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,I2,__,__,__,__,__,__,__,__,__,__,__,__},
/*i2 I2*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,I3,__,__,__,__,__,__,__,__,__,__,__,__,__,__},
/*i3 I3*/ {__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,I4,__,__},
@@ -1,3 +1,10 @@
2009-01-26 Marek Habersack <[email protected]>
* ClientProxyHandler.cs: before generating the proxy check if the
service type is decorated with the [ScriptService] custom
attribute. Only such service types can be called from client
JavaScript.
2008-09-23 Marek Habersack <[email protected]>
* LogicalTypeInfo.cs: do not use
@@ -36,7 +36,11 @@ namespace System.Web.Script.Services
sealed class ClientProxyHandler : IHttpHandler
{
readonly LogicalTypeInfo _logicalTypeInfo;
public ClientProxyHandler (Type type, string filePath) {
readonly Type _type;
public ClientProxyHandler (Type type, string filePath)
{
_type = type;
_logicalTypeInfo = LogicalTypeInfo.GetLogicalTypeInfo (type, filePath);
}
#region IHttpHandler Members
@@ -45,8 +49,15 @@ namespace System.Web.Script.Services
get { return false; }
}
public void ProcessRequest (HttpContext context) {
public void ProcessRequest (HttpContext context)
{
HttpResponse response = context.Response;
object[] attributes = _type.GetCustomAttributes (typeof (ScriptServiceAttribute), true);
if (attributes.Length == 0) {
response.ContentType = "text/html";
throw new InvalidOperationException ("Only Web services with a [ScriptService] attribute on the class definition can be called from script.");
}
response.ContentType = "application/x-javascript";
response.Cache.SetExpires (DateTime.Now.AddYears (1));
response.Cache.SetValidUntilExpires (true);
@@ -1,3 +1,12 @@
2009-03-03 Marek Habersack <[email protected]>
* ListView.cs: SetPageProperties invoked the
PagePropertiesChanging event with the startRowIndex and
maximumRows parameters reversed. Fixes bugs #481250 and #481252
* DataPagerField.cs: GetQueryModeStartRowIndex must return 'true'
if in query mode. Fixes bug #481248
2008-11-28 Marek Habersack <[email protected]>
* ListView.cs: use the _correct_ operator when checking whether
@@ -238,7 +238,7 @@ namespace System.Web.UI.WebControls
}
}
return false;
return true;
}
void AddEventHandler (object key, EventHandler handler)
@@ -2000,7 +2000,7 @@ namespace System.Web.UI.WebControls
if (maximumRows != _maximumRows || startRowIndex != _startRowIndex) {
if (databind) {
var args = new PagePropertiesChangingEventArgs (maximumRows, startRowIndex);
var args = new PagePropertiesChangingEventArgs (startRowIndex, maximumRows);
OnPagePropertiesChanging (args);
}
@@ -1,3 +1,10 @@
2009-01-26 Marek Habersack <[email protected]>
* ScriptManager.cs: before registering script service reference
check if the service type is decorated with the [ScriptService]
custom attribute. Only such service types can be called from
client JavaScript.
2008-10-02 Marek Habersack <[email protected]>
* ScriptManager.cs: reverting revision 114552 since the real bug
@@ -862,10 +862,18 @@ namespace System.Web.UI
return sb.ToString ();
}
void RegisterServiceReference (Control control, ServiceReference serviceReference) {
void RegisterServiceReference (Control control, ServiceReference serviceReference)
{
if (serviceReference.InlineScript) {
string url = control.ResolveUrl (serviceReference.Path);
LogicalTypeInfo logicalTypeInfo = LogicalTypeInfo.GetLogicalTypeInfo (WebServiceParser.GetCompiledType (url, Context), url);
Type type = WebServiceParser.GetCompiledType (url, Context);
if (type != null) {
object[] attributes = type.GetCustomAttributes (typeof (ScriptServiceAttribute), true);
if (attributes.Length == 0)
throw new InvalidOperationException ("Only Web services with a [ScriptService] attribute on the class definition can be called from script.");
}
LogicalTypeInfo logicalTypeInfo = LogicalTypeInfo.GetLogicalTypeInfo (type, url);
RegisterClientScriptBlock (control, typeof (ScriptManager), url, logicalTypeInfo.Proxy, true);
}
else {
@@ -873,6 +881,8 @@ namespace System.Web.UI
string pathInfo = "/js.invoke";
#else
string pathInfo = "/js";
if (IsDebuggingEnabled)
pathInfo += "debug";
#endif
string url = String.Concat (control.ResolveClientUrl (serviceReference.Path), pathInfo);
RegisterClientScriptInclude (control, typeof (ScriptManager), url, url);
@@ -1,3 +1,8 @@
2009-03-06 Marek Habersack <[email protected]>
* JavaScriptSerializerTest.cs: added a test for unquoted tests
surrounded with spaces.
2008-10-22 Marek Habersack <[email protected]>
* JavaScriptSerializerTest.cs: added tests for deserialization of
@@ -375,6 +375,20 @@ namespace Tests.System.Web.Script.Serialization
Assert.AreEqual (1, dict ["itemOne"], "#B1");
Assert.AreEqual (2, dict ["itemTwo"], "#B2");
}
[Test]
public void TestDeserializeUnquotedKeysWithSpaces ()
{
JavaScriptSerializer ser = new JavaScriptSerializer ();
IDictionary dict = ser.Deserialize <Dictionary <string, object>> ("{ itemOne :\"1\",itemTwo:\"2\"}");
Assert.AreEqual ("1", dict ["itemOne"], "#A1");
Assert.AreEqual ("2", dict ["itemTwo"], "#A2");
dict = ser.Deserialize <Dictionary <string, object>> ("{ itemOne :1, itemTwo :2}");
Assert.AreEqual (1, dict ["itemOne"], "#B1");
Assert.AreEqual (2, dict ["itemTwo"], "#B2");
}
[Test]
public void TestDeserialize () {
@@ -802,7 +816,7 @@ namespace Tests.System.Web.Script.Serialization
string s = ser.Serialize(pc);
MyPointContainer pc2 = ser.Deserialize<MyPointContainer>(s);
}
[Test]
public void MaxJsonLengthDeserializeObject ()
{
@@ -1,3 +1,24 @@
2009-02-18 Marek Habersack <[email protected]>
* UrlPattern.cs: TrySubstitute now gets the collection of default
values and uses it to replace url segments instead of failing when
the passed values collection is missing a segment.
Do not use the tokens array in Match.
* RouteCollection.cs: check if name is null or empty, not just
null in GetVirtualPath
* Route.cs: url.TrySubstitute should be passed the defaults
collection when called from GetVirtualPath
2009-02-14 Marek Habersack <[email protected]>
* UrlPattern.cs: use the defaults collection when matching a path
and segments are missing.
* RouteCollection.cs: GetRouteData must use VirtualPathProvider
to check for virtual path existence.
2008-10-23 Atsushi Enomoto <[email protected]>
* UrlPattern.cs : fixed possible out-of-range case ("tableName/" in
@@ -118,7 +118,7 @@ namespace System.Web.Routing
values = requestContext.RouteData.Values;
string s;
if (!url.TrySubstitute (values, out s))
if (!url.TrySubstitute (values, Defaults, out s))
return null;
return new VirtualPathData (this, s);
@@ -119,12 +119,11 @@ namespace System.Web.Routing
if (!RouteExistingFiles) {
var path = httpContext.Request.AppRelativeCurrentExecutionFilePath;
if (path.StartsWith ("~/", StringComparison.Ordinal))
path = path.Substring (2);
if (File.Exists (path))
VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider;
if (path != "~/" && vpp != null && (vpp.FileExists (path) || vpp.DirectoryExists (path)))
return null;
}
if (Count == 0)
return null;
@@ -151,7 +150,7 @@ namespace System.Web.Routing
return null;
VirtualPathData vp = null;
if (name != null) {
if (!String.IsNullOrEmpty (name)) {
RouteBase rb = this [name];
if (rb != null)
vp = rb.GetVirtualPath (requestContext, values);
@@ -36,8 +36,10 @@ namespace System.Web.Routing
{
internal class UrlPattern
{
int segmentsCount;
string [] segments;
bool [] segment_flags;
int [] segmentLengths;
bool [] segment_flags;
string [] tokens;
public UrlPattern (string url)
@@ -60,21 +62,25 @@ namespace System.Web.Routing
var tokens = new List<string> ();
segments = Url.Split ('/');
segment_flags = new bool [segments.Length];
for (int i = 0; i < segments.Length; i++) {
segmentsCount = segments.Length;
segment_flags = new bool [segmentsCount];
segmentLengths = new int [segmentsCount];
for (int i = 0; i < segmentsCount; i++) {
string s = segments [i];
if (s.Length == 0 && i < segments.Length - 1)
int slen = s.Length;
segmentLengths [i] = slen;
if (slen == 0 && i < segmentsCount - 1)
throw new ArgumentException ("Consecutive URL segment separators '/' are not allowed");
int from = 0;
while (from < s.Length) {
while (from < slen) {
int start = s.IndexOf ('{', from);
if (start == s.Length - 1)
if (start == slen - 1)
throw new ArgumentException ("Unterminated URL parameter. It must contain matching '}'");
if (start < 0) {
if (s.IndexOf ('}', from) >= from)
throw new ArgumentException ("Unmatched URL parameter closer '}'. A corresponding '{' must precede");
from = s.Length;
from = slen;
continue;
}
segment_flags [i] = true;
@@ -96,9 +102,21 @@ namespace System.Web.Routing
this.tokens = tokens.ToArray ();
}
string SegmentToKey (string segment)
{
int start = segment.IndexOf ('{');
int end = segment.IndexOf ('}');
if (start == -1)
start = 0;
else
start++;
if (end == -1)
end = segment.Length;
return segment.Substring (start, end - start);
}
RouteValueDictionary tmp = new RouteValueDictionary ();
// FIXME: how is "defaults" used?
public RouteValueDictionary Match (string path, RouteValueDictionary defaults)
{
tmp.Clear ();
@@ -108,15 +126,31 @@ namespace System.Web.Routing
return tmp;
string [] argSegs = path.Split ('/');
if (argSegs.Length != segments.Length)
int argsLen = argSegs.Length;
bool haveDefaults = defaults != null && defaults.Count > 0;
if (!haveDefaults && argsLen != segmentsCount)
return null;
for (int i = 0; i < segments.Length; i++) {
for (int i = 0; i < segmentsCount; i++) {
if (segment_flags [i]) {
string t = segments [i];
string v = argSegs [i];
if (v.Length == 0)
return null; // ends with '/' while more tokens are expected.
string v = i < argsLen ? argSegs [i] : null;
if (String.IsNullOrEmpty (v)) {
string key = SegmentToKey (segments [i]);
object o;
if (haveDefaults && !defaults.TryGetValue (key, out o))
return null; // ends with '/' while more
// tokens are expected and
// there are is no default
// value in the defaults
// dictionary.
v = o as string;
if (v == null)
throw new InvalidOperationException ("The RouteData must contain an item named '" + key + "' with a string value.");
}
int tfrom = 0, vfrom = 0;
while (tfrom < t.Length) {
int start = t.IndexOf ('{', tfrom);
@@ -153,7 +187,7 @@ namespace System.Web.Routing
}
tfrom = end + 1;
}
} else if (segments [i] != argSegs [i])
} else if (i > argsLen || segments [i] != argSegs [i])
return null;
}
@@ -163,17 +197,27 @@ namespace System.Web.Routing
static readonly string [] substsep = {"{{"};
// it may return null for invalid values.
public bool TrySubstitute (RouteValueDictionary values, out string value)
public bool TrySubstitute (RouteValueDictionary values, RouteValueDictionary defaults, out string value)
{
var replacements = new RouteValueDictionary ();
if (values == null) {
value = Url;
return true;
} else {
object val;
bool missing;
foreach (string token in tokens) {
if (!values.ContainsKey (token)) {
val = null;
missing = false;
if (!values.TryGetValue (token, out val))
if (defaults == null || !defaults.TryGetValue (token, out val))
missing = true;
if (missing) {
value = null;
return false;
}
replacements.Add (token, val);
}
}
@@ -181,7 +225,7 @@ namespace System.Web.Routing
string [] arr = Url.Split (substsep, StringSplitOptions.None);
for (int i = 0; i < arr.Length; i++) {
string s = arr [i];
foreach (var p in values)
foreach (var p in replacements)
s = s.Replace ("{" + p.Key + "}", p.Value.ToString ());
arr [i] = s;
}
@@ -258,6 +258,7 @@ namespace MonoTests.System.Web.Routing
}
[Test]
[Ignore ("Pending testing - might be invalid test")]
public void GetRouteData7 ()
{
var r = new Route ("{table}/{action}.aspx", null);
+9
View File
@@ -1,3 +1,12 @@
2009-02-05 Marek Habersack <[email protected]>
* Makefile (TEST_RESOURCE_FILES): added
Test/mainsoft/NunitWebResources/LoginDisplayRememberMe.aspx
2009-01-27 Marek Habersack <[email protected]>
* System.Web.dll.sources: added System.Web.Util/SearchPattern.cs
2009-01-20 Marek Habersack <[email protected]>
* System.Web.dll.sources: added System.Web.UI.WebControls/Substitution.cs
+2 -1
View File
@@ -158,7 +158,8 @@ TEST_RESOURCE_FILES = \
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx \
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master \
Test/mainsoft/NunitWebResources/MissingMasterFile.aspx \
Test/mainsoft/NunitWebResources/CustomSectionEmptyCollection.aspx
Test/mainsoft/NunitWebResources/CustomSectionEmptyCollection.aspx \
Test/mainsoft/NunitWebResources/LoginDisplayRememberMe.aspx
RESX_DIST = resources/TranslationResources.resx
ifeq (net_2_0, $(PROFILE))
@@ -198,7 +198,7 @@ namespace System.Web.Compilation
}
CodeDomProvider provider = null;
CompilationSection compilationSection = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
CompilationSection compilationSection = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
if (compilerInfo == null) {
if (!CodeDomProvider.IsDefinedLanguage (compilationSection.DefaultLanguage))
throw new HttpException ("Failed to retrieve default source language");
@@ -359,7 +359,7 @@ namespace System.Web.Compilation
bool ProcessAppCodeDir (string appCode, AppCodeAssembly defasm)
{
// First process the codeSubDirectories
CompilationSection cs = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
CompilationSection cs = (CompilationSection) WebConfigurationManager.GetWebApplicationSection ("system.web/compilation");
if (cs != null) {
string aname;
@@ -626,7 +626,7 @@ namespace System.Web.Compilation
return;
string appCode = Path.Combine (HttpRuntime.AppDomainAppPath, "App_Code");
ProfileSection ps = WebConfigurationManager.GetSection ("system.web/profile") as ProfileSection;
ProfileSection ps = WebConfigurationManager.GetWebApplicationSection ("system.web/profile") as ProfileSection;
bool haveAppCodeDir = Directory.Exists (appCode);
bool haveCustomProfile = HaveCustomProfile (ps);
@@ -74,7 +74,7 @@ namespace System.Web.Compilation
this.baseAssemblyDirectory = Path.GetDirectoryName (baseAssemblyPath);
this.canonicAssemblyName = canonicAssemblyName;
config = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
config = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
if (config == null || !CodeDomProvider.IsDefinedLanguage (config.DefaultLanguage))
throw new ApplicationException ("Could not get the default compiler.");
ci = CodeDomProvider.GetCompilerInfo (config.DefaultLanguage);
@@ -2,9 +2,10 @@
// System.Web.Compilation.AppResourceFilesCollection
//
// Authors:
// Marek Habersack (grendello@gmail.com)
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2006 Marek Habersack
// (C) 2007-2009 Novell, Inc http://novell.com/
//
//
@@ -33,6 +34,7 @@ using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Globalization;
using System.IO;
using System.Reflection;
@@ -44,8 +46,167 @@ using System.Web.Util;
namespace System.Web.Compilation
{
internal class AppResourcesCompiler
class AppResourcesCompiler
{
class TypeResolutionService : ITypeResolutionService
{
List <Assembly> referencedAssemblies;
Dictionary <string, Type> mappedTypes;
public Assembly GetAssembly (AssemblyName name)
{
return GetAssembly (name, false);
}
public Assembly GetAssembly (AssemblyName name, bool throwOnError)
{
try {
return Assembly.Load (name);
} catch {
if (throwOnError)
throw;
}
return null;
}
public void ReferenceAssembly (AssemblyName name)
{
if (referencedAssemblies == null)
referencedAssemblies = new List <Assembly> ();
Assembly asm = GetAssembly (name, false);
if (asm == null)
return;
if (referencedAssemblies.Contains (asm))
return;
referencedAssemblies.Add (asm);
}
public string GetPathOfAssembly (AssemblyName name)
{
if (name == null)
return null;
Assembly asm = GetAssembly (name, false);
if (asm == null)
return null;
return asm.Location;
}
public Type GetType (string name)
{
return GetType (name, false, false);
}
public Type GetType (string name, bool throwOnError)
{
return GetType (name, throwOnError, false);
}
public Type GetType (string name, bool throwOnError, bool ignoreCase)
{
if (String.IsNullOrEmpty (name)) {
if (throwOnError)
throw new ArgumentNullException ("name");
else
return null;
}
int idx = name.IndexOf (',');
Type type = null;
if (idx == -1) {
type = MapType (name, false);
if (type != null)
return type;
type = FindInAssemblies (name, ignoreCase);
if (type == null) {
if (throwOnError)
throw new InvalidOperationException ("Type '" + name + "' is not fully qualified and there are no referenced assemblies.");
else
return null;
}
return type;
}
type = MapType (name, true);
if (type != null)
return type;
return Type.GetType (name, throwOnError, ignoreCase);
}
Type MapType (string name, bool full)
{
if (mappedTypes == null)
mappedTypes = new Dictionary <string, Type> (StringComparer.Ordinal);
Type ret;
if (mappedTypes.TryGetValue (name, out ret))
return ret;
if (!full) {
if (String.Compare (name, "ResXDataNode", StringComparison.Ordinal) == 0)
return AddMappedType (name, typeof (ResXDataNode));
if (String.Compare (name, "ResXFileRef", StringComparison.Ordinal) == 0)
return AddMappedType (name, typeof (ResXFileRef));
if (String.Compare (name, "ResXNullRef", StringComparison.Ordinal) == 0)
return AddMappedType (name, typeof (ResXNullRef));
if (String.Compare (name, "ResXResourceReader", StringComparison.Ordinal) == 0)
return AddMappedType (name, typeof (ResXResourceReader));
if (String.Compare (name, "ResXResourceWriter", StringComparison.Ordinal) == 0)
return AddMappedType (name, typeof (ResXResourceWriter));
return null;
}
if (name.IndexOf ("System.Windows.Forms") == -1)
return null;
if (name.IndexOf ("ResXDataNode", StringComparison.Ordinal) != -1)
return AddMappedType (name, typeof (ResXDataNode));
if (name.IndexOf ("ResXFileRef", StringComparison.Ordinal) != -1)
return AddMappedType (name, typeof (ResXFileRef));
if (name.IndexOf ("ResXNullRef", StringComparison.Ordinal) != -1)
return AddMappedType (name, typeof (ResXNullRef));
if (name.IndexOf ("ResXResourceReader", StringComparison.Ordinal) != -1)
return AddMappedType (name, typeof (ResXResourceReader));
if (name.IndexOf ("ResXResourceWriter", StringComparison.Ordinal) != -1)
return AddMappedType (name, typeof (ResXResourceWriter));
return null;
}
Type AddMappedType (string name, Type type)
{
mappedTypes.Add (name, type);
return type;
}
Type FindInAssemblies (string name, bool ignoreCase)
{
Type ret = Type.GetType (name, false);
if (ret != null)
return ret;
if (referencedAssemblies == null || referencedAssemblies.Count == 0)
return null;
foreach (Assembly asm in referencedAssemblies) {
ret = asm.GetType (name, false, ignoreCase);
if (ret != null)
return ret;
}
return null;
}
}
const string cachePrefix = "@@LocalResourcesAssemblies";
public const string DefaultCultureKey = ".:!DefaultCulture!:.";
@@ -541,7 +702,7 @@ namespace System.Web.Compilation
try {
source = new FileStream (path, FileMode.Open, FileAccess.Read);
destination = new FileStream (resource, FileMode.Create, FileAccess.Write);
reader = GetReaderForKind (arfi.Kind, source);
reader = GetReaderForKind (arfi.Kind, source, path);
writer = new ResourceWriter (destination);
foreach (DictionaryEntry de in reader) {
object val = de.Value;
@@ -566,11 +727,14 @@ namespace System.Web.Compilation
return resource;
}
IResourceReader GetReaderForKind (AppResourceFileKind kind, Stream stream)
IResourceReader GetReaderForKind (AppResourceFileKind kind, Stream stream, string path)
{
switch (kind) {
case AppResourceFileKind.ResX:
return new ResXResourceReader (stream);
var ret = new ResXResourceReader (stream, new TypeResolutionService ());
if (!String.IsNullOrEmpty (path))
ret.BasePath = Path.GetDirectoryName (path);
return ret;
case AppResourceFileKind.Resource:
return new ResourceReader (stream);
@@ -53,7 +53,7 @@ namespace System.Web.Compilation
if (files == null || files.Length == 0)
return;
CompilationSection cs = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
CompilationSection cs = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
if (cs == null)
throw new HttpException ("Unable to determine default compilation language.");
@@ -223,7 +223,7 @@ namespace System.Web.Compilation
void RegisterConfigControls ()
{
PagesSection pages = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
PagesSection pages = WebConfigurationManager.GetWebApplicationSection ("system.web/pages") as PagesSection;
if (pages == null)
return;
@@ -437,7 +437,7 @@ namespace System.Web.Compilation
#endif
string typeName = String.Concat (nameSpace, ".", componentName);
if (assembly != null)
return assembly.GetType (typeName, true, true);
return assembly.GetType (typeName, false, true);
#if NET_2_0
IList tla = BuildManager.TopLevelAssemblies;
@@ -192,7 +192,7 @@ namespace System.Web.Compilation
bool inForm;
bool useOtherTags;
TagType lastTag;
public AspGenerator (TemplateParser tparser)
{
this.tparser = tparser;
@@ -215,6 +215,17 @@ namespace System.Web.Compilation
public string Filename {
get { return pstack.Filename; }
}
#if NET_2_0
PageParserFilter PageParserFilter {
get {
if (tparser == null)
return null;
return tparser.PageParserFilter;
}
}
#endif
BaseCompiler GetCompilerFromType ()
{
@@ -241,6 +252,10 @@ namespace System.Web.Compilation
parser.Error += new ParseErrorHandler (ParseError);
parser.TagParsed += new TagParsedHandler (TagParsed);
parser.TextParsed += new TextParsedHandler (TextParsed);
#if NET_2_0
parser.ParsingComplete += new ParsingCompleteHandler (ParsingCompleted);
tparser.AspGenerator = this;
#endif
if (!pstack.Push (parser))
throw new ParseException (Location, "Infinite recursion detected including file: " + filename);
@@ -449,8 +464,10 @@ namespace System.Web.Compilation
sb.AppendFormat ("\t<{0}", tagid);
foreach (string key in attributes.Keys) {
value = attributes [key] as string;
if (value == null || value.Length < 16) // optimization
if (value == null || value.Length < 16) { // optimization
sb.AppendFormat (" {0}=\"{1}\"", key, value);
continue;
}
match = runatServer.Match (attributes [key] as string);
if (!match.Success) {
@@ -466,13 +483,14 @@ namespace System.Web.Compilation
group = match.Groups [0];
index = group.Index;
length = group.Length;
if (index > 0)
TextParsed (location, String.Format (" {0}=\"{1}", key, value.Substring (0, index)));
TextParsed (location, String.Format (" {0}=\"{1}", key, index > 0 ? value.Substring (0, index) : String.Empty));;
FlushText ();
ParseAttributeTag (group.Value);
if (index + length < value.Length)
TextParsed (location, value.Substring (index + length) + "\"");
else
TextParsed (location, "\"");
}
if (type == TagType.SelfClosing)
sb.Append ("/>");
@@ -495,6 +513,17 @@ namespace System.Web.Compilation
if (text.Length > 0)
FlushText ();
}
#if NET_2_0
void ParsingCompleted ()
{
PageParserFilter pfilter = PageParserFilter;
if (pfilter == null)
return;
pfilter.ParseComplete (rootBuilder);
}
#endif
void TagParsed (ILocation location, TagType tagtype, string tagid, TagAttributes attributes)
{
@@ -641,7 +670,7 @@ namespace System.Web.Compilation
if (this.text.Length > 0)
FlushText (true);
CodeRenderParser r = new CodeRenderParser (text, stack.Builder);
r.AddChildren ();
r.AddChildren (this);
return;
}
@@ -663,6 +692,11 @@ namespace System.Web.Compilation
return;
if (inScript) {
#if NET_2_0
PageParserFilter pfilter = PageParserFilter;
if (pfilter != null && !pfilter.ProcessCodeConstruct (CodeConstructType.ScriptTag, t))
return;
#endif
tparser.Scripts.Add (new ServerSideScript (t, new System.Web.Compilation.Location (tparser.Location)));
return;
}
@@ -726,6 +760,16 @@ namespace System.Web.Compilation
return true;
}
#endif
public void AddControl (Type type, IDictionary attributes)
{
ControlBuilder parent = stack.Builder;
ControlBuilder builder = ControlBuilder.CreateBuilderFromType (tparser, parent, type, null, null,
attributes, location.BeginLine,
location.Filename);
if (builder != null)
parent.AppendSubBuilder (builder);
}
bool ProcessTag (ILocation location, string tagid, TagAttributes atts, TagType tagtype)
{
@@ -765,6 +809,10 @@ namespace System.Web.Compilation
return false;
#if NET_2_0
PageParserFilter pfilter = PageParserFilter;
if (pfilter != null && !pfilter.AllowControl (builder.ControlType, builder))
throw new ParseException (Location, "Control type '" + builder.ControlType + "' not allowed.");
if (!OtherControlsAllowed (builder))
throw new ParseException (Location, "Only Content controls are allowed directly in a content page that contains Content controls.");
#endif
@@ -906,8 +954,32 @@ namespace System.Web.Compilation
return true;
}
#if NET_2_0
CodeConstructType MapTagTypeToConstructType (TagType tagtype)
{
switch (tagtype) {
case TagType.DataBinding:
return CodeConstructType.ExpressionSnippet;
case TagType.CodeRender:
return CodeConstructType.CodeSnippet;
case TagType.CodeRenderExpression:
return CodeConstructType.DataBindingSnippet;
default:
throw new InvalidOperationException ("Unexpected tag type.");
}
}
#endif
bool ProcessCode (TagType tagtype, string code, ILocation location)
{
#if NET_2_0
PageParserFilter pfilter = PageParserFilter;
if (pfilter != null && (!pfilter.AllowCode || !pfilter.ProcessCodeConstruct (MapTagTypeToConstructType (tagtype), code)))
return true;
#endif
ControlBuilder b = null;
if (tagtype == TagType.CodeRender)
b = new CodeRenderBuilder (code, false, location);
@@ -935,7 +1007,7 @@ namespace System.Web.Compilation
return;
#if NET_2_0
CompilationSection section = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
CompilationSection section = (CompilationSection) WebConfigurationManager.GetWebApplicationSection ("system.web/compilation");
if (section.Compilers[tparser.Language] != section.Compilers[lang])
#else
CompilationConfiguration cfg = CompilationConfiguration.GetInstance (HttpContext.Current);
@@ -951,22 +1023,24 @@ namespace System.Web.Compilation
{
string str;
ControlBuilder builder;
AspGenerator generator;
public CodeRenderParser (string str, ControlBuilder builder)
{
this.str = str;
this.builder = builder;
}
public void AddChildren ()
public void AddChildren (AspGenerator generator)
{
this.generator = generator;
int index = str.IndexOf ("<%");
if (index > 0) {
TextParsed (null, str.Substring (0, index));
str = str.Substring (index);
}
AspParser parser = new AspParser ("@@inner_string@@", new StringReader (str));
AspParser parser = new AspParser ("@@nested_tag@@", new StringReader (str));
parser.Error += new ParseErrorHandler (ParseError);
parser.TagParsed += new TagParsedHandler (TagParsed);
parser.TextParsed += new TextParsedHandler (TextParsed);
@@ -975,14 +1049,31 @@ namespace System.Web.Compilation
void TagParsed (ILocation location, TagType tagtype, string tagid, TagAttributes attributes)
{
if (tagtype == TagType.CodeRender)
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, false, location));
else if (tagtype == TagType.CodeRenderExpression)
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, true, location));
else if (tagtype == TagType.DataBinding)
builder.AppendSubBuilder (new DataBindingBuilder (tagid, location));
else
builder.AppendLiteralString (location.PlainText);
switch (tagtype) {
case TagType.CodeRender:
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, false, location));
break;
case TagType.CodeRenderExpression:
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, true, location));
break;
case TagType.DataBinding:
builder.AppendSubBuilder (new DataBindingBuilder (tagid, location));
break;
case TagType.Tag:
case TagType.SelfClosing:
if (generator != null)
generator.TagParsed (location, tagtype, tagid, attributes);
else
goto default;
break;
default:
builder.AppendLiteralString (location.PlainText);
break;
}
}
void TextParsed (ILocation location, string text)
@@ -41,14 +41,18 @@ namespace System.Web.Compilation
delegate void ParseErrorHandler (ILocation location, string message);
delegate void TextParsedHandler (ILocation location, string text);
delegate void TagParsedHandler (ILocation location, TagType tagtype, string id, TagAttributes attributes);
#if NET_2_0
delegate void ParsingCompleteHandler ();
#endif
class AspParser : ILocation
{
static readonly object errorEvent = new object ();
static readonly object tagParsedEvent = new object ();
static readonly object textParsedEvent = new object ();
#if NET_2_0
static readonly object parsingCompleteEvent = new object();
byte[] md5checksum;
#endif
AspTokenizer tokenizer;
@@ -76,6 +80,13 @@ namespace System.Web.Compilation
remove { events.RemoveHandler (textParsedEvent, value); }
}
#if NET_2_0
public event ParsingCompleteHandler ParsingComplete {
add { events.AddHandler (parsingCompleteEvent, value); }
remove { events.RemoveHandler (parsingCompleteEvent, value); }
}
#endif
public AspParser (string filename, TextReader input)
{
this.filename = filename;
@@ -217,6 +228,10 @@ namespace System.Web.Compilation
EndElement ();
OnTextParsed (text.ToString ());
}
#if NET_2_0
OnParsingComplete ();
#endif
}
bool GetInclude (string str, out string pathType, out string filename)
@@ -510,6 +525,16 @@ namespace System.Web.Compilation
(varname ? TagType.CodeRenderExpression : TagType.CodeRender));
}
public override string ToString ()
{
StringBuilder sb = new StringBuilder ("AspParser {");
if (filename != null && filename.Length > 0)
sb.AppendFormat ("{0}:{1}.{2}", filename, beginLine, beginColumn);
sb.Append ('}');
return sb.ToString ();
}
void OnError (string msg)
{
ParseErrorHandler eh = events [errorEvent] as ParseErrorHandler;
@@ -530,7 +555,15 @@ namespace System.Web.Compilation
if (eh != null)
eh (this, text);
}
}
#if NET_2_0
void OnParsingComplete ()
{
ParsingCompleteHandler eh = events [parsingCompleteEvent] as ParsingCompleteHandler;
if (eh != null)
eh ();
}
#endif
}
}
@@ -48,6 +48,20 @@ namespace System.Web.Compilation
class AspTokenizer
{
class PutBackItem
{
public readonly string Value;
public readonly int Position;
public readonly int CurrentToken;
public PutBackItem (string value, int position, int currentToken)
{
Value = value;
Position = position;
CurrentToken = currentToken;
}
}
static char [] lfcr = new char [] { '\n', '\r' };
TextReader sr;
int current_token;
@@ -64,6 +78,7 @@ namespace System.Web.Compilation
bool have_unget;
int unget_value;
string val;
Stack putBackBuffer;
public AspTokenizer (TextReader reader)
{
@@ -82,18 +97,28 @@ namespace System.Web.Compilation
public void put_back ()
{
if (hasPutBack)
if (hasPutBack && !inTag)
throw new HttpException ("put_back called twice!");
hasPutBack = true;
position -= Value.Length;
if (putBackBuffer == null)
putBackBuffer = new Stack ();
string val = Value;
putBackBuffer.Push (new PutBackItem (val, position, current_token));
position -= val.Length;
}
public int get_token ()
{
if (hasPutBack){
hasPutBack = false;
position += Value.Length;
if (hasPutBack) {
PutBackItem pbi = putBackBuffer.Pop () as PutBackItem;
hasPutBack = putBackBuffer.Count > 0;
position = pbi.Position;
have_value = false;
val = null;
sb = new StringBuilder (pbi.Value);
current_token = pbi.CurrentToken;
return current_token;
}
@@ -119,10 +119,7 @@ namespace System.Web.Compilation {
units = new List <CodeCompileUnit> ();
CompilationSection section;
if (virtualPath != null)
section = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation", virtualPath.Absolute);
else
section = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
section = (CompilationSection) WebConfigurationManager.GetWebApplicationSection ("system.web/compilation");
string tempdir = section.TempDirectory;
if (String.IsNullOrEmpty (tempdir))
tempdir = AppDomain.CurrentDomain.SetupInformation.DynamicBase;
@@ -434,7 +434,7 @@ namespace System.Web.Compilation
protected void CreateProfileProperty ()
{
string retType;
if (AppCodeCompiler.HaveCustomProfile (WebConfigurationManager.GetSection ("system.web/profile") as ProfileSection))
if (AppCodeCompiler.HaveCustomProfile (WebConfigurationManager.GetWebApplicationSection ("system.web/profile") as ProfileSection))
retType = "ProfileCommon";
else
retType = "System.Web.Profile.DefaultProfile";
@@ -635,7 +635,7 @@ namespace System.Web.Compilation
par = null;
#if NET_2_0
CompilationSection config = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
CompilationSection config = (CompilationSection) WebConfigurationManager.GetWebApplicationSection ("system.web/compilation");
Compiler comp = config.Compilers[lang];
if (comp == null) {
@@ -43,6 +43,7 @@ using System.IO;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Xml;
using System.Web;
using System.Web.Caching;
using System.Web.Configuration;
@@ -260,6 +261,8 @@ namespace System.Web.Compilation {
const string BUILD_MANAGER_VIRTUAL_PATH_CACHE_PREFIX = "Build_Manager";
static int BUILD_MANAGER_VIRTUAL_PATH_CACHE_PREFIX_LENGTH = BUILD_MANAGER_VIRTUAL_PATH_CACHE_PREFIX.Length;
static bool hosted;
static IEqualityComparer <string> comparer;
static object buildCacheLock = new object ();
@@ -270,6 +273,8 @@ namespace System.Web.Compilation {
//
// static object buildCountLock = new object ();
// static int buildCount = 0;
static bool is_precompiled;
static Dictionary<string, PreCompilationData> precompiled;
static List<Assembly> AppCode_Assemblies = new List<Assembly>();
static List<Assembly> TopLevel_Assemblies = new List<Assembly>();
@@ -316,8 +321,6 @@ namespace System.Web.Compilation {
static BuildManager ()
{
IEqualityComparer <string> comparer;
if (HttpRuntime.CaseInsensitive)
comparer = StringComparer.CurrentCultureIgnoreCase;
else
@@ -328,6 +331,11 @@ namespace System.Web.Compilation {
dependencyCache = new Dictionary <string, List <string>> (comparer);
compilationTickets = new Dictionary <string, object> (comparer);
hosted = (AppDomain.CurrentDomain.GetData (ApplicationHost.MonoHostedDataKey) as string) == "yes";
is_precompiled = File.Exists (Path.Combine (HttpRuntime.AppDomainAppPath, "PrecompiledApp.config"));
if (is_precompiled) {
LoadPrecompilationInfo ();
}
}
internal static void ThrowNoProviderException (string extension)
@@ -362,7 +370,7 @@ namespace System.Web.Compilation {
{
List <Assembly> al = new List <Assembly> ();
CompilationSection compConfig = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
CompilationSection compConfig = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
if (compConfig == null)
return al;
@@ -411,6 +419,57 @@ namespace System.Web.Compilation {
AddAssembly (Assembly.Load (info.Assembly), al);
}
static void LoadPrecompilationInfo ()
{
string [] compiled = Directory.GetFiles (HttpRuntime.BinDirectory, "*.compiled");
foreach (string str in compiled) {
LoadCompiled (str);
}
}
static void LoadCompiled (string filename)
{
using (XmlTextReader reader = new XmlTextReader (filename)) {
reader.MoveToContent ();
if (reader.Name == "preserve" && reader.HasAttributes) {
reader.MoveToNextAttribute ();
string val = reader.Value;
// 2 -> ashx
// 3 -> ascx, aspx
// 6 -> app_code - nothing to do here
// 8 -> global.asax
// 9 -> App_GlobalResources - nothing to do?
if (reader.Name == "resultType" && (val == "2" || val == "3" || val == "8"))
LoadPageData (reader);
}
}
}
class PreCompilationData {
public string VirtualPath;
public string AssemblyFileName;
public string TypeName;
public Type Type;
}
static void LoadPageData (XmlTextReader reader)
{
PreCompilationData pc_data = new PreCompilationData ();
while (reader.MoveToNextAttribute ()) {
string name = reader.Name;
if (name == "virtualPath")
pc_data.VirtualPath = reader.Value;
else if (name == "assembly")
pc_data.AssemblyFileName = reader.Value;
else if (name == "type")
pc_data.TypeName = reader.Value;
}
if (precompiled == null)
precompiled = new Dictionary<string, PreCompilationData> (comparer);
precompiled.Add (pc_data.VirtualPath, pc_data);
}
static void AddAssembly (Assembly asm, List <Assembly> al)
{
if (al.Contains (asm))
@@ -436,7 +495,7 @@ namespace System.Web.Compilation {
CompilationSection c = section;
if (c == null)
c = WebConfigurationManager.GetSection ("system.web/compilation", virtualPath.Original) as CompilationSection;
c = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
if (c == null)
if (throwOnMissing)
@@ -488,10 +547,39 @@ namespace System.Web.Compilation {
return null;
}
static Type GetPrecompiledType (string virtualPath)
{
PreCompilationData pc_data;
if (precompiled.TryGetValue (virtualPath, out pc_data)) {
if (pc_data.Type == null) {
pc_data.Type = Type.GetType (pc_data.TypeName + ", " + pc_data.AssemblyFileName, true);
}
return pc_data.Type;
}
//Console.WriteLine ("VPath not precompiled: {0}", virtualPath);
return null;
}
internal static Type GetPrecompiledApplicationType ()
{
if (!is_precompiled)
return null;
Type apptype = GetPrecompiledType (HttpRuntime.AppDomainAppVirtualPath + "/Global.asax");
if (apptype == null)
apptype = GetPrecompiledType (HttpRuntime.AppDomainAppVirtualPath + "/global.asax");
return apptype;
}
public static Assembly GetCompiledAssembly (string virtualPath)
{
VirtualPath vp = GetAbsoluteVirtualPath (virtualPath);
if (is_precompiled) {
Type type = GetPrecompiledType (vp.Absolute);
if (type != null)
return type.Assembly;
}
BuildCacheItem ret = GetCachedItem (vp);
if (ret != null)
return ret.assembly;
@@ -507,6 +595,12 @@ namespace System.Web.Compilation {
public static Type GetCompiledType (string virtualPath)
{
VirtualPath vp = GetAbsoluteVirtualPath (virtualPath);
if (is_precompiled) {
Type type = GetPrecompiledType (vp.Absolute);
if (type != null)
return type;
//TODO: What do we do here? Throw?
}
BuildCacheItem ret = GetCachedItem (vp);
if (ret != null)
@@ -619,7 +713,7 @@ namespace System.Web.Compilation {
CompilationSection config;
if (configSection == null)
config = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
config = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
else
config = configSection;
@@ -671,8 +765,7 @@ namespace System.Web.Compilation {
if (req == null)
throw new HttpException ("No context available, cannot build.");
string vpAbsolute = virtualPath.Absolute;
CompilationSection section = WebConfigurationManager.GetSection ("system.web/compilation", vpAbsolute) as CompilationSection;
CompilationSection section = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
List <VirtualFile> files;
try {
@@ -1227,7 +1320,10 @@ namespace System.Web.Compilation {
}
dep = new CacheDependency (files.ToArray ());
dependencyCache.Add (virtualPath, files);
if (dependencyCache.ContainsKey (virtualPath))
dependencyCache [virtualPath] = files;
else
dependencyCache.Add (virtualPath, files);
} else
dep = null;
@@ -1395,7 +1491,7 @@ namespace System.Web.Compilation {
}
internal static CompilationSection CompilationConfig {
get { return WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection; }
get { return WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection; }
}
}
@@ -76,7 +76,7 @@ namespace System.Web.Compilation {
protected CompilerType GetDefaultCompilerType ()
{
CompilationSection config;
config = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
config = (CompilationSection) WebConfigurationManager.GetWebApplicationSection ("system.web/compilation");
return BuildManager.GetDefaultCompilerTypeForLanguage (config.DefaultLanguage, config);
}
@@ -303,7 +303,7 @@ namespace System.Web.Compilation
}
}
CompilationSection cfg = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
CompilationSection cfg = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
AssemblyCollection asmcoll = cfg != null ? cfg.Assemblies : null;
if (asmcoll == null)
@@ -1,3 +1,99 @@
2009-02-28 Gonzalo Paniagua Javier <[email protected]>
* AppResourcesAssemblyBuilder.cs:
* AspComponentFoundry.cs:
* AssemblyBuilder.cs:
* CachingCompiler.cs:
* AspGenerator.cs:
* WsdlBuildProvider.cs:
* BaseCompiler.cs:
* BuildProvider.cs:
* AppWebReferencesCompiler.cs:
* TemplateControlCompiler.cs:
* BuildManager.cs:
* AppCodeCompiler.cs: settings that have to be in
machine.config or the root level web.config now call
GetWebApplicationSection.
2009-02-26 Marek Habersack <[email protected]>
* TagAttributes.cs: modified ToString to return string formatted
in a more helpful way.
* AspParser.cs: added ToString, helpful when debugging.
* AspGenerator.cs: properly print leading and trailing plain text
when looking for embedded tags in ProcessTagsInAttributes.
2009-02-25 Marek Habersack <[email protected]>
* AspTokenizer.cs: put_back now uses a stack and allows more than
one invocation when called inside a tag.
* AspGenerator.cs: when a nested parser is used, pay attention to
server tags found inside client tags and add them to the control
tree.
2009-02-20 Gonzalo Paniagua Javier <[email protected]>
* BuildManager.cs: updated comment.
2009-02-18 Gonzalo Paniagua Javier <[email protected]>
* TemplateControlCompiler.cs: lowercase place holder names
* BuildManager.cs: initial support for precompiled sites.
2009-02-13 Marek Habersack <[email protected]>
* AspParser.cs: added an event raised when parsing is complete.
* AspGenerator.cs: added support for PageParserFilter which, if
found, is used to control certain aspects of code parsing
(accepting/rejecting control types, accepting/rejecting code
snippets, parsing completion)
Added the AddControl method, used by PageParserFilter when a
custom filter wants to inject a control in the current control
builder tree.
2009-02-05 Marek Habersack <[email protected]>
* AppResourcesCompiler.cs: implemented a type resolver for
ResXResourceReader so that it can correctly resolve
System.Resources types which are normally found in
System.Windows.Forms but are included by System.Web
directly. Without the type resolver, code comparing types inside
ResXResourceReader when file references are used in side the .resx
file will not work correctly. The reason for that is that .resx
files will name "System.Resources.ResXFileRef,
System.Windows.Forms" as the file reference handler, while inside
System.Web ResXFileRef will be of type
"System.Resources.ResXFileRef, System.Web". Fixes bug #466059
* GenericBuildProvider.cs: added a new virtual method, MapPath,
which can be overriden by builders which need special handling of
virtual path mapping.
* PageBuildProvider.cs: provide implementation of
GenericBuildProvider.MapPath which takes into account fake virtual
paths. Fixes bug #463950
2009-01-26 Marek Habersack <[email protected]>
* CompilationException.cs: added a Message override to make error
messages more useful.
2009-01-23 Gonzalo Paniagua Javier <[email protected]>
* AspComponentFoundry.cs: no need to throw. Caller handles a null
return value.
2009-01-23 Marek Habersack <[email protected]>
* BuildManager.cs: if dependencyCache already contains the virtual
path, replace its corresponding file set (in AddToCache). This can
happen only if the requested virtual path compilation resulted in
errors and the compilation has been retried. Fixes bug #462681
2009-01-14 Marek Habersack <[email protected]>
* AspGenerator.cs: implemented a work around which allows the
@@ -84,7 +84,11 @@ namespace System.Web.Compilation
info.AddValue ("errmsg", errmsg);
info.AddValue ("errorLines", errorLines);
}
public override string Message {
get { return ErrorMessage; }
}
public override string SourceFile {
get {
if (errors == null || errors.Count == 0)
@@ -58,6 +58,17 @@ namespace System.Web.Compilation
protected abstract string GetClassType (BaseCompiler compiler, TParser parser);
protected abstract AspGenerator CreateAspGenerator (TParser parser);
protected abstract List <string> GetReferencedAssemblies (TParser parser);
protected virtual string MapPath (string virtualPath)
{
HttpContext ctx = HttpContext.Current;
HttpRequest req = ctx != null ? ctx.Request : null;
if (req != null)
return req.MapPath (VirtualPath);
else
return null;
}
protected virtual TParser Parse ()
{
@@ -68,18 +79,9 @@ namespace System.Web.Compilation
if (!IsDirectoryBuilder) {
AspGenerator generator = CreateAspGenerator (parser);
if (_reader != null) {
HttpContext ctx = HttpContext.Current;
HttpRequest req = ctx != null ? ctx.Request : null;
string filename;
if (req != null)
filename = req.MapPath (VirtualPath);
else
filename = null;
generator.Parse (_reader, filename, true);
} else
if (_reader != null)
generator.Parse (_reader, MapPath (VirtualPath), true);
else
generator.Parse ();
}
@@ -48,6 +48,15 @@ namespace System.Web.Compilation {
{
}
protected override string MapPath (string virtualPath)
{
// We need this hack to support out-of-application wsdl helpers
if (StrUtils.StartsWith (virtualPath, BuildManager.FAKE_VIRTUAL_PATH_PREFIX))
return virtualPath.Substring (BuildManager.FAKE_VIRTUAL_PATH_PREFIX.Length);
return base.MapPath (virtualPath);
}
protected override TextReader SpecialOpenReader (string virtualPath, out string physicalPath)
{
// We need this hack to support out-of-application wsdl helpers
@@ -180,20 +180,22 @@ namespace System.Web.Compilation
public override string ToString ()
{
StringBuilder result = new StringBuilder ();
StringBuilder result = new StringBuilder ("TagAttributes {");
string value;
foreach (string key in Keys){
result.Append ('[');
result.Append (key);
value = this [key] as string;
if (value != null)
result.AppendFormat ("=\"{0}\"", value);
result.Append (' ');
result.Append ("] ");
}
if (result.Length > 0 && result [result.Length - 1] == ' ')
result.Length--;
result.Append ('}');
return result.ToString ();
}
Loaded 100 of 376 files, more files were not shown because too many files have changed in this diff. Show more