Compare commits

...
882 Commits
Author SHA1 Message Date
Chris Toshok a17f894b66 merge up to r150220 from branch 2-6
svn path=/branches/moon/moon-2-0/mono/; revision=150389
2010-01-28 19:05:59 +00:00
Chris Toshok 7c591aef69 merge up to r150220 from branch 2-6
svn path=/branches/moon/moon-2-0/mcs/; revision=150388
2010-01-28 19:03:36 +00:00
Sebastien Pouliot 70ffc535d0 2010-01-26 Sebastien Pouliot <[email protected]>
* DataContractJsonSerializer_2_1.cs: Don't hide [Field|Method]
	AccessException inside a SerializationException but in a 
	SecurityException.
	[Backport r150219]


svn path=/branches/mono-2-6/mcs/; revision=150220
2010-01-26 18:33:30 +00:00
Sebastien Pouliot 875517d8cf backport r150214
svn path=/branches/mono-2-6/mcs/; revision=150215
2010-01-26 16:27:26 +00:00
Marek Safar 7bbd05b8d0 2010-01-26 Marek Safar <[email protected]>
A fix for bug #573329
	* eval.cs: Don't disable error reporting completely on silent mode.


svn path=/branches/mono-2-6/mcs/; revision=150204
2010-01-26 09:55:57 +00:00
Sebastien Pouliot be51c5ab18 2010-01-25 Sebastien Pouliot <[email protected]>
* net_2_1_raw_System.ServiceModel.Web.dll.sources: Use custom
	version of DataContractJsonSerializer for Moonlight
	[Backport r150153]


svn path=/branches/mono-2-6/mcs/; revision=150154
2010-01-25 21:03:12 +00:00
Sebastien Pouliot d55de3bf85 2010-01-25 Sebastien Pouliot <[email protected]>
* DataContractJsonSerializerTest.cs: Add non-working test cases
	for null-string, known types and handling floating point special
	values
	[Backport r150141]


svn path=/branches/mono-2-6/mcs/; revision=150152
2010-01-25 21:01:08 +00:00
Sebastien Pouliot 5dd48513d4 2010-01-25 Sebastien Pouliot <[email protected]>
* DataContractJsonSerializer_2_1.cs: New. Simpler version for 
	Moonlight since it does not inherit from the same base type nor
	does it overrides any base methods.
	[Backport r150149]


svn path=/branches/mono-2-6/mcs/; revision=150150
2010-01-25 20:58:39 +00:00
Sebastien Pouliot 1169b69aac 2010-01-25 Sebastien Pouliot <[email protected]>
* AssemblyInfo.cs: Fix attributes for Moonlight
	[Backport r150147]


svn path=/branches/mono-2-6/mcs/; revision=150148
2010-01-25 20:56:45 +00:00
Sebastien Pouliot 97c6f8c4c8 In .:
2010-01-25  Sebastien Pouliot  <[email protected]>

	* System.Net.dll.sources: Add UdpAnySourceMulticastClient and
	UdpSingleSourceMulticastClient stubs (with some validations)
	for SL4 (required to compile tests)
	[Backport r150127]

In System.Net:
2010-01-25  Sebastien Pouliot  <[email protected]>

	* UdpAnySourceMulticastClient.cs: New. Stub for SL4
	* UdpSingleSourceMulticastClient.cs: New. Stub for SL4
	[Backport r150127]


svn path=/branches/mono-2-6/mcs/; revision=150128
2010-01-25 13:22:36 +00:00
Zoltan Varga 3b16547b98 2010-01-25 Zoltan Varga <[email protected]>
* icall.c (ves_icall_System_Array_SetValueImpl): Handle nullable types correctly.
	Fixes #573322.

svn path=/branches/mono-2-6/mono/; revision=150125
2010-01-25 12:47:05 +00:00
Zoltan Varga 25ca9fdef7 2010-01-06 Atsushi Enomoto <[email protected]>
* culture-info-table.h : regenerated.

svn path=/branches/mono-2-6/mono/; revision=150118
2010-01-25 12:02:20 +00:00
Zoltan Varga 1cee1671e0 2010-01-06 Atsushi Enomoto <[email protected]>
* Driver.cs : support FirstDayOfWeek. Fixed bug #567944.
	  Patch by Jose Antonio Sanchez Lazaro.

svn path=/branches/mono-2-6/mono/; revision=150117
2010-01-25 12:02:02 +00:00
Atsushi Eno a8db1a887e backport r150102.
svn path=/branches/mono-2-6/mcs/; revision=150106
2010-01-25 05:36:55 +00:00
Atsushi Eno 910a3be886 backport r150100.
svn path=/branches/mono-2-6/mcs/; revision=150101
2010-01-25 03:40:20 +00:00
Atsushi Eno 1a77eba231 backport r150041.
svn path=/branches/mono-2-6/mcs/; revision=150042
2010-01-22 06:20:41 +00:00
Sebastien Pouliot 86a0bbefd9 2010-01-21 Sebastien Pouliot <[email protected]>
* SocketAsyncEventArgs.cs: Apply Gendarme's ProtectCallToEventDelegatesRule
	[Backport r150033]


svn path=/branches/mono-2-6/mcs/; revision=150034
2010-01-22 01:51:26 +00:00
Carlos Alberto Cortez 0e1ca66be7 2010-01-21 Carlos Alberto Cortez <[email protected]>
* IPEndPoint.cs: When throwing an ArgumentException in Create()
	because of a mismatch in the address family, use a more informative
	message. Patch by Juho Vähä-Herttu<[email protected]>.
	Fixes #505105.


svn path=/branches/mono-2-6/mcs/; revision=150032
2010-01-22 01:16:21 +00:00
Carlos Alberto Cortez 6034c2d32b 2010-01-21 Carlos Alberto Cortez <[email protected]>
* ComboBox.cs: When the normal drop down window is closed, make sure
	that the auto complete list -if any- is closed as well, instead of
	stay open without need.


svn path=/branches/mono-2-6/mcs/; revision=150029
2010-01-21 23:25:18 +00:00
Carlos Alberto Cortez 749f368ea8 * TextBox.cs: When showing the autocomplete listbox, make sure it's on
top, by calling the raw XplatUI.SetZOrder for it, since we can't
 	properly call BringToFront on it as it is parentless. This fixes an
 	issue when using this feature with ComboBox's own parentless listbox.
 	Fixes the remaining bits of #489339.

2010-01-21  Carlos Alberto Cortez <[email protected]>


svn path=/branches/mono-2-6/mcs/; revision=150027
2010-01-21 22:50:43 +00:00
Carlos Alberto Cortez 026da78b76 * XplatUI.cs:
* XplatUIDriver:
	* XplatUICarbon:
 	* XplatUIWin32:
 	* XplatUIX11.cs: 
 	* XplatUIStructs: Implement support for different kind of audible
 	alerts in Windows, and update the requiered classes.
 	* MessageBox.cs: 
 	* TextBoxBase.cs: Update calls to XplatUI.AudibleAlert.
 	Fixes #473725.

2010-01-21  Carlos Alberto Cortez <[email protected]>


svn path=/branches/mono-2-6/mcs/; revision=150024
2010-01-21 22:22:00 +00:00
Carlos Alberto Cortez c512240f2a * ComboBox.cs: When use manually setting DropDownHeight, ignore the
MaxDropDownHeight property - also rename our field 'count' to
	'visible_items_count' to avoid confusion as much as possible.
	Fixes an issue with several items, showing an incorrect layout.

2010-01-21  Carlos Alberto Cortez <[email protected]>


svn path=/branches/mono-2-6/mcs/; revision=150021
2010-01-21 22:06:49 +00:00
Carlos Alberto Cortez 2f49fef718 2010-01-21 Carlos Alberto Cortez <[email protected]>
* RichTextBoxTest.cs: New test for the Modified property.


svn path=/branches/mono-2-6/mcs/; revision=150019
2010-01-21 21:50:19 +00:00
Carlos Alberto Cortez a517a0c465 2010-01-21 Carlos Alberto Cortez <[email protected]>
* RichTextBox.cs: SelectedText should set Modified to true. Observe
	that this is happening just here, not for the Text property, and
	neither for the TextBoxBase impl.
	Fixes #569950.


svn path=/branches/mono-2-6/mcs/; revision=150017
2010-01-21 21:47:49 +00:00
Zoltan Varga bd0b130116 2010-01-21 Zoltan Varga <[email protected]>
* exceptions-amd64.c (mono_arch_notify_pending_exc): Avoid a crash if the
	thread has not fully started yet.

svn path=/branches/mono-2-6/mono/; revision=150014
2010-01-21 21:28:09 +00:00
Rodrigo Kumpera a1bda8ea92 In metadata:
* reflection.c (typebuilder_setup_fields): Pretend field setup already
	happened before starting to encode the actual fields. This avoid ciclic
	dependencies and eventual crashes.

	Fixes #572660.

	Backport of r150008.

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


svn path=/branches/mono-2-6/mono/; revision=150011
2010-01-21 20:22:40 +00:00
Sebastien Pouliot 556c641fbb In Test/System.Net:
2010-01-21  Sebastien Pouliot  <[email protected]>

	* CookieContainerTest.cs: Additional test cases from Tom Philpot
	[Backport r149976 + NET_1_1 fixes]

In System.Net:
2010-01-21  Sebastien Pouliot  <[email protected]>

	* CookieContainer.cs: Fix to cloning and expiration. Patch
	by Tom Philpot <[email protected]>
	[Backport r149976 + NET_1_1 fixes]


svn path=/branches/mono-2-6/mcs/; revision=150006
2010-01-21 18:57:26 +00:00
Zoltan Varga 6a31cfc00c 2010-01-21 Zoltan Varga <[email protected]>
* aot-compiler.c (can_marshal_struct): Allow marshalling enums.

svn path=/branches/mono-2-6/mono/; revision=149992
2010-01-21 16:43:50 +00:00
Gonzalo Paniagua Javier 8ddf3be981 2010-01-21 Gonzalo Paniagua Javier <[email protected]>
* SmtpClient.cs: rethrow inner exception so that
	AsyncCompletedEventArgs.Error gets the right value on error. Patch
	by Dimitar Dobrev.


svn path=/branches/mono-2-6/mcs/; revision=149984
2010-01-21 15:22:31 +00:00
Rodrigo Kumpera 1a71763707 2010-01-21 Rodrigo Kumpera <[email protected]>
* metadata-verify.c (parse_generic_inst): Fail a type signature if it 
	has a recursive reference to itself.

	Fixes #571863.

	Backport of r149969.



svn path=/branches/mono-2-6/mono/; revision=149971
2010-01-21 14:38:44 +00:00
Andrew Jorgensen 55d040c353 more rabbitmq madness
svn path=/branches/mono-2-6/mono/; revision=149935
2010-01-20 22:58:13 +00:00
Gonzalo Paniagua Javier 067c19988f 2010-01-20 Gonzalo Paniagua Javier <[email protected]>
* icall.c: don't raise AppDomain.TypeResolve when the type is loaded
	from the current assembly or mscorlib. Fixes bug #322957.


svn path=/branches/mono-2-6/mono/; revision=149922
2010-01-20 18:01:06 +00:00
Marek Habersack b7354f3de6 Backport of r149919
svn path=/branches/mono-2-6/mcs/; revision=149920
2010-01-20 17:49:16 +00:00
Zoltan Varga ac5e8bef12 2010-01-20 Zoltan Varga <[email protected]>
* mini-posix.c (SIG_HANDLER_SIGNATURE): Avoid
	"Thread (nil) may have been prematurely finalized" messages if this is called
	on a thread not registered with the runtime.

	* mini-exceptions.c (mono_handle_native_sigsegv): Ditto.

svn path=/branches/mono-2-6/mono/; revision=149913
2010-01-20 15:56:36 +00:00
Jb Evain 6f7167aa7e protect ILGenerator.Mono_GetCurrentOffset
svn path=/branches/mono-2-6/mcs/; revision=149904
2010-01-20 13:58:31 +00:00
Marek Habersack c84b626d9f Backport of r149855
svn path=/branches/mono-2-6/mcs/; revision=149856
2010-01-19 22:36:57 +00:00
Rodrigo Kumpera b47a076824 In metadata:
* verify.c (store_local): Better error message.
	
	Backport of r149845.

2010-01-19  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=149854
2010-01-19 21:54:38 +00:00
Marek Habersack 00313fae7e Backport of r149842
svn path=/branches/mono-2-6/mcs/; revision=149843
2010-01-19 21:14:45 +00:00
Zoltan Varga cefd26ffa4 2010-01-19 Zoltan Varga <[email protected]>
* jit-icalls.c (mono_array_new_3): New jit icall.

	* aot-compiler.c aot-runtime.c: Add support for ElementAddr wrappers.

	* arrays.cs: Add a test for 3 dimensional arrays.

svn path=/branches/mono-2-6/mono/; revision=149832
2010-01-19 17:12:51 +00:00
Zoltan Varga 94147a6867 2010-01-19 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_wrapper_info_from_wrapper): New helper function to
	return a point to a wrapper specific info structure describing the wrapper.
	(mono_marshal_get_array_address): Store the rank+elem_size in the wrapper info.

svn path=/branches/mono-2-6/mono/; revision=149831
2010-01-19 17:10:55 +00:00
Sebastien Pouliot 4ee3487474 2010-01-19 Sebastien Pouliot <[email protected]>
* security-core-clr.c (mono_security_core_clr_can_access_internals):
	Handle the case where 'basedir' can be NULL (e.g. SRE assemblies)
	[Backport r149823]


svn path=/branches/mono-2-6/mono/; revision=149824
2010-01-19 16:20:12 +00:00
Rodrigo Kumpera e17c497eca In metadata:
2010-01-19  Rodrigo Kumpera  <[email protected]>

	* icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Handle inflated generic methods
	on a GTD.

	Backport of r149808.


svn path=/branches/mono-2-6/mono/; revision=149811
2010-01-19 12:51:30 +00:00
Marek Habersack 934a28df97 Backport of r149778
svn path=/branches/mono-2-6/mcs/; revision=149779
2010-01-18 22:34:36 +00:00
Rodrigo Kumpera b47afbf37d In metadata:
* metadata-verify.c (parse_type): Fail a type signature if it has a recursive reference
	to itself.

	* metadata-verify.c (mono_verifier_verify_typespec_signature): Change signature to take
	the token as parameter.

	* verify-internals.h: Ditto.

	* metadata.c (mono_type_create_from_typespec): Pass token to verifier.

	Fixes #571460.

	Backport of r149776.

2010-01-18  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=149777
2010-01-18 22:28:04 +00:00
Sebastien Pouliot 082f7e3aa6 2010-01-18 Sebastien Pouliot <[email protected]>
* mono-error.c: Call va_end/va_start before reusing 'args'.
	[Backport r149765]


svn path=/branches/mono-2-6/mono/; revision=149766
2010-01-18 20:09:40 +00:00
Rodrigo Kumpera 0e337eb2ae In metadata:
2010-01-18  Rodrigo Kumpera  <[email protected]>

	* class.c (mono_class_from_typeref): Fail loading of self-referencing typeref tokens.

	Fixes #569579.

	Backport of r149760.


svn path=/branches/mono-2-6/mono/; revision=149761
2010-01-18 19:11:28 +00:00
Marek Habersack 557b82af81 Backport of r149756
svn path=/branches/mono-2-6/mcs/; revision=149757
2010-01-18 17:43:40 +00:00
Zoltan Varga 3fda9b1b2c 2010-01-18 Zoltan Varga <[email protected]>
* mini.h (MonoCompile): Add 'disable_out_of_line_bblocks' flag.

	* branch-opts.c (mono_optimize_branches): Honor the new flag.

	* mini.c (mini_method_compile): Set the new flag when running under the
	debugger.

svn path=/branches/mono-2-6/mono/; revision=149753
2010-01-18 17:33:31 +00:00
Martin Baulig 50b2886808 Put the soft debugger into the 'Mono.Debugger.Soft' namespace.
svn path=/branches/mono-2-6/mcs/; revision=149743
2010-01-18 14:32:25 +00:00
Zoltan Varga a960af777a 2010-01-18 Zoltan Varga <[email protected]>
* mini.c (mono_jit_compile_method_inner): Avoid reading cfg->prof_options
	after cfg has been freed.

svn path=/branches/mono-2-6/mono/; revision=149719
2010-01-18 00:21:29 +00:00
Zoltan Varga d91e676bd4 2010-01-17 Zoltan Varga <[email protected]>
* branch-opts.c (mono_branch_optimize_exception_target): Stop the optimization
	if a clause is skipped because it uses the exception object, since it could
	have caught the exception.

	* exceptions.cs: Add a test.

svn path=/branches/mono-2-6/mono/; revision=149707
2010-01-17 08:47:29 +00:00
Zoltan Varga 28bc6c8233 2010-01-16 Zoltan Varga <[email protected]>
* debugger-agent.c (decode_value): Fix the decoding of I/U/PTR.

svn path=/branches/mono-2-6/mono/; revision=149684
2010-01-16 02:56:18 +00:00
Carlos Alberto Cortez f561a56b55 2010-01-15 Carlos Alberto Cortez <[email protected]>
* Int32Test.cs: Test for TryParse with MaxValue + 1.


svn path=/branches/mono-2-6/mcs/; revision=149681
2010-01-16 01:39:19 +00:00
Carlos Alberto Cortez 495f4bbecf 2010-01-15 Carlos Alberto Cortez <[email protected]>
* DateTimeTest.cs: Fix the tests (DateTimeStyles.AssumeUniversal is
	2.0 only).


svn path=/branches/mono-2-6/mcs/; revision=149680
2010-01-16 01:36:20 +00:00
Zoltan Varga f4af0d1edf 2010-01-16 Zoltan Varga <[email protected]>
* mini-amd64.c (emit_call_body): Always use near calls when AOTing even if
	NOMAP32BIT or optimize_for_xen is set.

svn path=/branches/mono-2-6/mono/; revision=149673
2010-01-16 00:48:27 +00:00
Carlos Alberto Cortez 16696796b9 2010-01-15 Carlos Alberto Cortez <[email protected]>
* Int32.cs: In Parse() cast the parsed value to long *before* changing
	its sign - this way we preserve the original value, instead of
	accidentally changing it. This was happening parsing _exactly_
	MaxValue + 1.
	Fixes #475815.


svn path=/branches/mono-2-6/mcs/; revision=149650
2010-01-15 21:29:47 +00:00
Rodrigo Kumpera e8852db5d6 In metadata:
2010-01-15  Rodrigo Kumpera  <[email protected]>

	* class.c (mono_class_setup_fields): Guard against unfinished types. This
	happens only on 2.6 and not trunk because trunk better deals with unfinished types. 


svn path=/branches/mono-2-6/mono/; revision=149642
2010-01-15 17:11:39 +00:00
Marek Habersack 7ca6f7a3a6 Backport of r149631
svn path=/branches/mono-2-6/mcs/; revision=149632
2010-01-15 13:24:25 +00:00
Atsushi Eno 833bb1cf96 backport r149619 and r149620.
svn path=/branches/mono-2-6/mcs/; revision=149630
2010-01-15 12:42:13 +00:00
Atsushi Eno 159dce275c backport r149609, r149612, r149617 and r149618.
svn path=/branches/mono-2-6/mcs/; revision=149626
2010-01-15 12:40:53 +00:00
Atsushi Eno 8d4203be63 backport r149611 and r149614.
svn path=/branches/mono-2-6/mcs/; revision=149625
2010-01-15 12:38:14 +00:00
Rodrigo Kumpera f54f538a50 In metadata:
2010-01-14  Rodrigo Kumpera  <[email protected]>

	* class.c (mono_type_has_exceptions): Check the generic instance. It can fail
	independently of the GTD.

	* class.c (mono_class_setup_fields): Fail if field has negative offset.

	* class.c (mono_class_setup_fields): Fail if valuetype has zero size. Add sizeof(MonoObject)
	to the upper limit since instance_size includes this amount.

	* class.c (mono_class_layout_fields): Check if the types of the static fields have failed.

	Fixes #569544.

	Backport of r149575.


svn path=/branches/mono-2-6/mono/; revision=149576
2010-01-14 21:12:46 +00:00
Jb Evain 59887d8819 2010-01-14 Jb Evain <[email protected]>
* MarkStep.cs: preserve fields specified by the
	SoapHeader attribute.

	backport r149571.

svn path=/branches/mono-2-6/mcs/; revision=149572
2010-01-14 18:12:41 +00:00
Rolf Bjarne Kvinge 585a395a95 2010-01-14 Rolf Bjarne Kvinge <[email protected]>
* UnmanagedMemoryStream.cs: Read: don't read bytes one-by-one, read all
	at once.

svn path=/branches/mono-2-6/mcs/; revision=149556
2010-01-14 13:17:53 +00:00
Jonathan Pryor 52f97eb8ed * Monodoc/provider.cs, Monodoc/ecma-provider.cs: Improve cache support
by having EcmaHelpSource.GetTextFromUrl() look for cached contents.
	  This greatly speeds up type member listings (e.g. T:...List`1/*),
	  e.g. from ~2.0s to 0.06s.
	* Mono.Documentation/XmlDocUtils.cs: XmlDocUtils.AddExtensionMethods()
	  wasn't adding extension methods which matched *interfaces* of base
	  classes.  Result: Mono.Options.OptionSet (which inherits
	  System.Collections.ObjectModel.KeyedCollection`2 which inherits from
	  System.Collections.ObjectModel.Collection`1 which implements
	  System.Collections.Generic.IEnumerable`1) wasn't getting any of the
	  LINQ extension methods (which is bad).  Fix this.
	* Resources/mdoc-html-utils.xsl: Fix regression caused by 2009-12-02
	  commit adding GetLinkTargetHtml().  The problem was that when
	  running within ASP.NET/monodoc ~all extension method links would be
	  'javascript:alert("...")M:Foo.Method(...)', which is clearly wrong.
	  This occurred because $linkid's generation would always call
	  GetLinkTargetHtml() with a $cref value of '', thus the monodoc
	  GetLinkTarget() would return '', so GetLinkTargetHtml() would return
	  the javascript "not found" alert.  Thus, we can't expect
	  GetLinkTargetHtml() with $cref='' to work under monodoc, but it's
	  ~required to work sanely under 'mdoc export-html'.
	  Solution is to not call GetLinkTargetHtml() here UNLESS we're doing
	  'mdoc export-html' generation, which we assume to be the case if
	  $html-anchor is true.

svn path=/branches/mono-2-6/mcs/; revision=149553
2010-01-14 12:50:31 +00:00
Jonathan Pryor b51b58935f * Mono.Documentation/monodocs2slashdoc.cs: Fix NamespaceSummaries.xml
generation to look at the ns-NAMESPACE.xml files, not just
	  NAMESPACE.xml files.

svn path=/branches/mono-2-6/mcs/; revision=149552
2010-01-14 12:46:19 +00:00
Geoff Norton 9c6bce34ae fix monotouch build
svn path=/branches/mono-2-6/mcs/; revision=149503
2010-01-13 23:56:36 +00:00
Gonzalo Paniagua Javier 5768c58fd6 2010-01-13 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: when the server returns several different
	authentication methods, pick the one that works.
	Fixes bug #562043.


svn path=/branches/mono-2-6/mcs/; revision=149501
2010-01-13 23:23:03 +00:00
Sebastien Pouliot 4dea4c540e 2010-01-13 Sebastien Pouliot <[email protected]>
* HttpWebRequest_2_1.cs: Throw for CookieContainer. It is 
	implemented only in the client http stack (and for a limited
	time in the browser stack too ;-)
	* InternalWebRequestStreamWrapper.cs: Keep the MemoryStream data
	available after closing/disposing (by user) since our own code
	will need it later (e.g. when posting like DRT287)
	* WebHeaderCollection_2_1.cs: Provide an argument to 
	ArgumentException. Found by Gendarme's ArgumentException
	InstantiateArgumentExceptionCorrectlyRule
	[Backport r149484]


svn path=/branches/mono-2-6/mcs/; revision=149485
2010-01-13 18:40:46 +00:00
Paolo Molaro 77d06337e6 Wed Jan 13 15:54:53 CET 2010 Paolo Molaro <[email protected]>
* jit.h, method-to-ir.c: added ability to set the policy for
	inserting breakpoints from the break IL instruction or the
	Debugger.Break () API call.


svn path=/branches/mono-2-6/mono/; revision=149473
2010-01-13 15:03:00 +00:00
Jb Evain a5f096e879 2010-01-13 Jb Evain <[email protected]>
* MarkStep.cs: preserve methods specified by the
	XmlSchemaProvider attribute.

	backport r149460.

svn path=/branches/mono-2-6/mcs/; revision=149461
2010-01-13 13:28:35 +00:00
Atsushi Eno 694b59cf8a Fix build (forgotten backport bits).
svn path=/branches/mono-2-6/mcs/; revision=149446
2010-01-13 11:06:12 +00:00
Atsushi Eno 9aa5cfdf6b backport r149383 and r149411 from trunk.
svn path=/branches/mono-2-6/mcs/; revision=149442
2010-01-13 09:57:22 +00:00
Atsushi Eno 966ebb8976 backport recent bugfixes from trunk.
svn path=/branches/mono-2-6/mcs/; revision=149440
2010-01-13 09:48:37 +00:00
Atsushi Eno 5249c14350 backport recent bugfixes from trunk.
svn path=/branches/mono-2-6/mcs/; revision=149439
2010-01-13 09:47:12 +00:00
Sebastien Pouliot 3b33f27d09 2010-01-12 Sebastien Pouliot <[email protected]>
* WebRequest_2_1.cs: Rework registration wrt the two, browser
	and client, stacks offered in SL3. Only global works now.
	[Backport r149423]


svn path=/branches/mono-2-6/mcs/; revision=149424
2010-01-12 18:44:17 +00:00
Rodrigo Kumpera 326b9a5c59 In metadata:
* class.c (mono_class_get_implemented_interfaces): Now take a MonoError argument.

	* class.c:
	* cominterop.c:
	* icall.c:
	* object.c: 
	* class-internals.h: Adjust for new signature of mono_class_get_implemented_interfaces.

	Backport of r149414.

2010-01-12  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=149417
2010-01-12 16:54:28 +00:00
Rodrigo Kumpera bf875af2e7 In metadata:
2010-01-12  Rodrigo Kumpera  <[email protected]>

	* class.c (mono_class_setup_interfaces): Now take a MonoError argument and
	it can fail loading the type.

	* class.c: Add mono_class_inflate_generic_class_checked.

	* class.c:
	* verify.c:
	* class-internals.h: Adjust for new signature of mono_class_setup_interfaces.

	Backport of r149413.


svn path=/branches/mono-2-6/mono/; revision=149415
2010-01-12 16:50:33 +00:00
Sebastien Pouliot f76fb4d9af In Test/System.Net:
2010-01-12  Sebastien Pouliot  <[email protected]>

	* NetworkCredentialTest.cs: New. Unit tests.
	[Backport r149401]

In System.Net:
2010-01-12  Sebastien Pouliot  <[email protected]>

	* NetworkCredential.cs: Fix properties to never return null.

In .:
2010-01-12  Sebastien Pouliot  <[email protected]>

	* System_test.dll.sources: Add NetworkCredentialTest.cs to the tests
	[Backport r149401]


svn path=/branches/mono-2-6/mcs/; revision=149402
2010-01-12 13:09:49 +00:00
Zoltan Varga 6ddb87775a 2010-01-12 Zoltan Varga <[email protected]>
* profiles/basic.make: Document that mono 2.6 can't be compiled with mono SVN HEAD.

svn path=/branches/mono-2-6/mcs/; revision=149365
2010-01-12 02:12:52 +00:00
Carlos Alberto Cortez 7812e1a803 2010-01-11 Carlos Alberto Cortez <[email protected]>
* Int32Test.cs: Add test case for exponent support in the Parse
	methods.


svn path=/branches/mono-2-6/mcs/; revision=149359
2010-01-11 23:57:32 +00:00
Carlos Alberto Cortez 51098747b2 2010-01-11 Carlos Alberto Cortez <[email protected]>
* Int32.cs: Implement support for exponent in the Parse methods.
	Fixes #542464.

	Backport r149356.


svn path=/branches/mono-2-6/mcs/; revision=149358
2010-01-11 23:50:19 +00:00
Zoltan Varga 07d7a708a8 2010-01-11 Zoltan Varga <[email protected]>
* socket-io.c (AI_ADDRCONFIG): Applied patch from John Lightsey ([email protected]).
	Fixes build on rh 7.3.

svn path=/branches/mono-2-6/mono/; revision=149345
2010-01-11 22:28:10 +00:00
Zoltan Varga 9fb43d41e5 2010-01-11 Zoltan Varga <[email protected]>
* mono-profiler-logging.c (_ProfilerFileWriteBuffer): Use MONO_ZERO_LEN_ARRAY.
	Fixes #569806.

svn path=/branches/mono-2-6/mono/; revision=149343
2010-01-11 22:24:30 +00:00
Andrew Jorgensen dd528c7e82 add RabbitMQ.Client.Apigen
svn path=/branches/mono-2-6/mono/; revision=149341
2010-01-11 21:35:25 +00:00
Zoltan Varga 2eb18ee5c3 2009-12-16 Zoltan Varga <[email protected]>
* class.c (mono_bounded_array_class_get): Make these classes PUBLIC. Fixes
	#565120.

svn path=/branches/mono-2-6/mono/; revision=149337
2010-01-11 21:01:50 +00:00
Zoltan Varga 2fef9fed47 2009-12-26 Zoltan Varga <[email protected]>
* monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait): Don't close the
	wait handle if the wait is interrupted, since it is still in mon->wait_list, and
	we can't remove it from it since we don't hold the lock.
	(mon_new): Free the orphaned events here when a mon structure is added to the
	freelist. Fixes #561239. Thanks to Mike Rieker <[email protected]> for tracking
	this down.

svn path=/branches/mono-2-6/mono/; revision=149335
2010-01-11 21:00:46 +00:00
Zoltan Varga 8a62669178 2009-12-26 Zoltan Varga <[email protected]>
* generic-sharing.c (instantiate_other_info): Avoid creating jump trampolines since
	they cannot be patched. Partly fixes #564408.

svn path=/branches/mono-2-6/mono/; revision=149333
2010-01-11 20:59:44 +00:00
Sebastien Pouliot 63983799a4 Makefile: For 2.1 build System.Core.dll before System.Net.dll
svn path=/branches/mono-2-6/mcs/; revision=149332
2010-01-11 20:55:02 +00:00
Sebastien Pouliot 53cb002de6 In .:
2010-01-11  Sebastien Pouliot  <[email protected]>

	* System.Net.dll.sources: Add InternalWebRequestStreamWrapper.cs
	* Makefile: Add reference to System.Core (for Action<T>)
	[Backport r149327]

In System.Net:
2010-01-11  Sebastien Pouliot  <[email protected]>

	* InternalWebRequestStreamWrapper.cs: New. Moved (and adapted) 
	from Moonlight System.Windows.Browser assembly.
	* InternalWebResponseStreamWrapper.cs: New. Moved (and adapted) 
	from Moonlight System.Windows.Browser assembly.
	* WebClient_2_1.cs: Remove custom delegate declaration (Gendarme's
	AvoidDeclaringCustomDelegatesRule). Remove locking over a variable
	(Gendarme's ReviewLockUsedOnlyForOperationsOnVariablesRule). 
	Avoid potential race with event handlers (Gendarme's 
	ProtectCallsToEventDelegatesRule). Implement OnWriteStreamClosed
	* WebRequest_2_1.cs: Signature change from delegate to 
	Action<long,long,object>. Found using Gendarme's
	AvoidDeclaringCustomDelegatesRule
	[Backport r149327]


svn path=/branches/mono-2-6/mcs/; revision=149328
2010-01-11 20:29:41 +00:00
Zoltan Varga deffbb6a29 2010-01-11 Zoltan Varga <[email protected]>
* debugger-agent.c (mono_debugger_agent_parse_options): Allow onthrow without
	an argument which matches any exception.

svn path=/branches/mono-2-6/mono/; revision=149297
2010-01-11 04:09:34 +00:00
Carlos Alberto Cortez aa6f7b9be1 2010-01-10 Carlos Alberto Cortez <[email protected]>
* ToolStripMenuItemTest: New test for the events related to the check
	state.


svn path=/branches/mono-2-6/mcs/; revision=149293
2010-01-11 00:46:58 +00:00
Carlos Alberto Cortez e6ebacb2b4 2010-01-10 Carlos Alberto Cortez <[email protected]>
* ToolStripMenuItem.cs: Put the Checked/CheckState logic in a single
	place and synchronize the events properly. Fixes a lack of
	coordination between the events - which should be fired together.


svn path=/branches/mono-2-6/mcs/; revision=149291
2010-01-11 00:43:36 +00:00
Zoltan Varga 5fa55c5f7f 2010-01-10 Zoltan Varga <[email protected]>
* method-to-ir.c (mono_emit_method_call_full): Avoid the virt->nonvirt
	optimization if the called method is gshared and marshalbyref, since gshared
	methods can' have wrappers. Fixes #569390.

	* generics.cs: Add a test.

svn path=/branches/mono-2-6/mono/; revision=149287
2010-01-10 22:42:31 +00:00
Zoltan Varga 190fc745e1 2010-01-10 Zoltan Varga <[email protected]>
* mini-exceptions.c (mono_print_thread_dump_from_ctx): New helper function
	callable from gdb.

svn path=/branches/mono-2-6/mono/; revision=149281
2010-01-10 01:53:19 +00:00
Zoltan Varga 2af95eb471 2010-01-10 Zoltan Varga <[email protected]>
* mini.c (mono_print_method_from_ip): Fix the lookup of trampolines.

svn path=/branches/mono-2-6/mono/; revision=149279
2010-01-10 01:34:01 +00:00
Zoltan Varga 76d3cbb00c 2010-01-09 Zoltan Varga <[email protected]>
* debugger-agent.c (transport_connect): comment out freeaddrinfo calls under win32,
	since it is not supported in win2000.

svn path=/branches/mono-2-6/mono/; revision=149275
2010-01-09 21:28:57 +00:00
Carlos Alberto Cortez 64358872dc 2010-01-09 Carlos Alberto Cortez <[email protected]>
* TrackBarTest.cs: New test for events.


svn path=/branches/mono-2-6/mcs/; revision=149272
2010-01-09 18:28:07 +00:00
Carlos Alberto Cortez 8d5112637e 2010-01-09 Carlos Alberto Cortez <[email protected]>
* TrackBar.cs: Move our events code to a single method, allowing it to
	optionally fire the Scroll event. This way we both avoid the
	duplicated calls to OnScroll and also will be able to fire Scroll
	*before* OnValueChanged in other places.
	Fixes #568026.


svn path=/branches/mono-2-6/mcs/; revision=149271
2010-01-09 17:18:42 +00:00
Marek Habersack 4b70cd35d5 Backport of r149262
svn path=/branches/mono-2-6/mcs/; revision=149263
2010-01-09 00:31:01 +00:00
Jb Evain 180d854345 2010-01-08 Jb Evain <[email protected]>
* Expression.cs (Call): properly deal with zero length array
	of type arguments for non generic methods. Fixes #568989.

	backport r149241.

svn path=/branches/mono-2-6/mcs/; revision=149242
2010-01-08 14:02:03 +00:00
Atsushi Eno e950db318c more complete backporting.
svn path=/branches/mono-2-6/mcs/; revision=149218
2010-01-08 04:51:52 +00:00
Atsushi Eno 21fba62c09 more complete backporting.
svn path=/branches/mono-2-6/mcs/; revision=149217
2010-01-08 04:50:11 +00:00
Atsushi Eno 98ea1eb62a backport everything, now that I believe it became at least as stable as it used to be.
svn path=/branches/mono-2-6/mcs/; revision=149216
2010-01-08 04:48:50 +00:00
Atsushi Eno 32a31d1e4d backport everything.
svn path=/branches/mono-2-6/mcs/; revision=149213
2010-01-08 04:32:53 +00:00
Atsushi Eno 274f525ab1 backport everything from trunk.
svn path=/branches/mono-2-6/mcs/; revision=149211
2010-01-08 04:17:00 +00:00
Gonzalo Paniagua Javier 8eeae714e4 2010-01-07 Gonzalo Paniagua Javier <[email protected]>
* assembly.c: fix MONO_PATH debug output.


svn path=/branches/mono-2-6/mono/; revision=149191
2010-01-07 20:34:17 +00:00
Sebastien Pouliot 47a0c65e12 2010-01-07 Sebastien Pouliot <[email protected]>
* Consts.cs.in: Update FX version for SL3 latest released version
	[Backport r149187]


svn path=/branches/mono-2-6/mcs/; revision=149188
2010-01-07 20:21:42 +00:00
Jb Evain fd29972f85 fix the net_1_1 build
svn path=/branches/mono-2-6/mcs/; revision=149178
2010-01-07 16:28:30 +00:00
Jb Evain 6fc40bbb24 fix the net_1_1 build
svn path=/branches/mono-2-6/mcs/; revision=149177
2010-01-07 16:27:41 +00:00
Jb Evain 4054667f43 in System:
2010-01-07  Jb Evain  <[email protected]>

	* MonoType.cs (.MemberType): return the proper member type
	for generic parameters.

	backport r149175.

in Test/System:
2010-01-07  Jb Evain  <[email protected]>

	* TypeTest.cs: add test for the MemberType of
	a generic parameter.

	backport r149175.

svn path=/branches/mono-2-6/mcs/; revision=149176
2010-01-07 16:22:58 +00:00
Sebastien Pouliot 487ee8a3d0 In System:
2010-01-07  Sebastien Pouliot  <[email protected]>

	* Convert.cs: Fix line endings in ToBase64String (bug #568778)
	and also the default line length. Code changed to not require
	a BinaryReader over a MemoryStream to reduce memory requirements.
	[Backport r149171]

In Test/System:
2010-01-07  Sebastien Pouliot  <[email protected]>

	* ConvertTest.cs: Add test case for #568778 and the default
	line length.
	[Backport r149171]

In System.Security.Cryptography:
2010-01-07  Sebastien Pouliot  <[email protected]>

	* ToBase64Transform.cs: Static-ify some methods to make it easier 
	to use from System.Convert
	[Backport r149171]


svn path=/branches/mono-2-6/mcs/; revision=149172
2010-01-07 15:24:21 +00:00
Zoltan Varga 6cbb31843f 2010-01-07 Zoltan Varga <[email protected]>
* mini-llvm-cpp.cpp (mono_llvm_create_ee): Add an ugly hack to fix #564695.
	If LLVM decides to set the code model to Large, reset it to Default.

svn path=/branches/mono-2-6/mono/; revision=149160
2010-01-07 07:19:18 +00:00
Zoltan Varga d25ef310a2 2010-01-07 Zoltan Varga <[email protected]>
* aot-compiler.c (mono_xdebug_flush): Export it so it is present in
	stripped binaries as well.

svn path=/branches/mono-2-6/mono/; revision=149154
2010-01-07 03:08:48 +00:00
Jb Evain 944fde135c 2010-12-06 Jb Evain <[email protected]>
* Descriptors/mscorlib.xml: optimize descriptor.

svn path=/branches/mono-2-6/mcs/; revision=149120
2010-01-06 13:28:40 +00:00
Marek Habersack dc6936d47a Backport of r149116
svn path=/branches/mono-2-6/mcs/; revision=149117
2010-01-06 09:29:59 +00:00
Atsushi Eno 0bbfa99e64 backport r149104.
svn path=/branches/mono-2-6/mcs/; revision=149105
2010-01-06 04:34:22 +00:00
Marek Habersack 3d1a899564 Backport of r149089
svn path=/branches/mono-2-6/mcs/; revision=149090
2010-01-05 23:13:27 +00:00
Rodrigo Kumpera 79563d2fff In System.Reflection:
* ParameterInfo.cs (DefaultProperty): Fix small typo.

2010-01-05 Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mcs/; revision=149088
2010-01-05 22:14:57 +00:00
Rodrigo Kumpera 1269ad94c2 In Test/System.Reflection:
2010-01-05 Rodrigo Kumpera  <[email protected]>

	* DateTimeConstantAttribute.cs: Add internal Ticks property.

	Backport of r149083.

In System.Runtime.CompilerServices:
2010-01-05 Rodrigo Kumpera  <[email protected]>

	* DateTimeConstantAttribute.cs: Add internal Ticks property.

	Backport of r149083.

In System.Reflection:
2010-01-05 Rodrigo Kumpera  <[email protected]>

	* ParameterInfoTest.cs: Add a test for default values from custom
	attributes.

	Backport of r149083.


svn path=/branches/mono-2-6/mcs/; revision=149084
2010-01-05 18:08:18 +00:00
Rodrigo Kumpera bbb57e05d6 In metadata:
2010-01-05  Rodrigo Kumpera  <[email protected]>

	* verify.c (mono_verifier_verify_class): Properly check for broken parent. Ignore
	types that are meant to not have a parent.

	Backport of r149053.

In mini:
2010-01-05  Rodrigo Kumpera  <[email protected]>

	* mini.c (mono_compile_is_broken): Skip methods from serialization's
	internal assembly.

	Backport of r149053.


svn path=/branches/mono-2-6/mono/; revision=149082
2010-01-05 16:42:15 +00:00
Sebastien Pouliot e5c119df53 pedump.c: Backport earlier fixes from Rodrigo Kumpera since they are useful for testing ML
svn path=/branches/mono-2-6/mono/; revision=149081
2010-01-05 14:40:11 +00:00
Marek Habersack 6e9cf155eb Backport of r149077
svn path=/branches/mono-2-6/mcs/; revision=149078
2010-01-05 12:13:49 +00:00
Carlos Alberto Cortez ec76cba184 2010-01-04 Carlos Alberto Cortez <[email protected]>
* RadioButton.cs: When drawing, if Appearance is Button use the old
	normal routine in the theme engine, instead of using the one in 2.0,
	since this last one doesn't support proper rendering of the control as
	a button.
	Fixes #567904.


svn path=/branches/mono-2-6/mcs/; revision=149075
2010-01-05 11:40:54 +00:00
Zoltan Varga 65d6041639 2010-01-04 Zoltan Varga <[email protected]>
* mini-trampolines.c (mono_convert_imt_slot_to_vtable_slot): Call
	mono_method_get_vtable_slot () instead of accessing imt_method->slot directly,
	to fix an AOT case.

svn path=/branches/mono-2-6/mono/; revision=149057
2010-01-04 22:11:44 +00:00
Zoltan Varga 5684426f99 2009-12-22 Geoff Norton <[email protected]>
* configure.in: Fix invalid escaping.  Patch from Spina from
	www.slacky.eu.

svn path=/branches/mono-2-6/mono/; revision=149049
2010-01-04 21:04:51 +00:00
Rodrigo Kumpera 6661518399 In mini:
2009-01-04  Rodrigo Kumpera  <[email protected]>

	* mini.c (mini_method_compile): Verify the method before calling
	mono_compile_create_vars as this might crash since it uses method
	information.

	Fixes #560196.

	Backport of r149045.


svn path=/branches/mono-2-6/mono/; revision=149046
2010-01-04 19:52:28 +00:00
Sebastien Pouliot 2ab4b20086 verify.c (verify_valuetype_layout_with_target): Fix case that can lead to infinite recursion. Fix bug #567861. [Backport r149042]
svn path=/branches/mono-2-6/mono/; revision=149043
2010-01-04 18:47:21 +00:00
Rodrigo Kumpera 3cf6a9d9dd In metadata:
* class.c (count_virtual_methods): Remove the assert and now
	fail properly.
	
	* class.c (setup_interface_offsets): This can fail now.

	* class.c (mono_class_setup_vtable_general): Check for parent vtable
	errors. Check setup_interface_offsets errors.

	* class.c (setup_interface_offsets): Simplify the return error logic
	and remove class_init_ok.

	Fixes #560327.

	Backport of r149031.

2010-01-04  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=149032
2010-01-04 17:01:50 +00:00
Rodrigo Kumpera a5861ec5c9 In metadata:
2010-01-04  Rodrigo Kumpera  <[email protected]>

	* class.c (mono_class_init): Do class verification at the beginning. Add
	some asserts to avoid tripping into invalid memory.

	* object.c (compute_class_bitmap): Replace a g_assert_not_reached with a
	g_error and a decent message.

	* verify.c (mono_verifier_verify_class): Verify for invalid super type.

	Fixes #567548.

	Backport of r149028.


svn path=/branches/mono-2-6/mono/; revision=149029
2010-01-04 16:02:06 +00:00
Jonathan Pryor 7ecd46bab0 * Makefile: Ensure that Test/* files are distributed (so that
'make check' works on tarball builds).  Partial fix for #564987.

svn path=/branches/mono-2-6/mcs/; revision=149024
2010-01-04 13:15:37 +00:00
Jb Evain 7ce982039b 2010-01-04 Jb Evain <[email protected]>
* TimeZoneInfo.AdjustmentRule.cs, TimeZoneInfo.TransitionTime.cs:
	Do not include in both mscorlib and System.Core for a NET_2_1 profile.

	backport r149020.

svn path=/branches/mono-2-6/mcs/; revision=149021
2010-01-04 12:54:21 +00:00
Carlos Alberto Cortez 4721b6805e 2010-01-03 Carlos Alberto Cortez <[email protected]>
* GroupBoxRenderer.cs: Properly use SystemColors.GrayText to draw to
	text of the group box if it is disabled.
	Fixes #567847.


svn path=/branches/mono-2-6/mcs/; revision=149013
2010-01-04 11:51:26 +00:00
Zoltan Varga 3c40535253 2010-01-03 Zoltan Varga <[email protected]>
* marshal.c (mono_marshal_get_runtime_invoke): Fix a memory leak.

svn path=/branches/mono-2-6/mono/; revision=148990
2010-01-03 16:48:55 +00:00
Zoltan Varga 0dffa52aca 2010-01-03 Zoltan Varga <[email protected]>
* mono-path.c (mono_path_resolve_symlinks): Use g_strfreev () to free the
	result of g_strplit.

svn path=/branches/mono-2-6/mono/; revision=148985
2010-01-03 16:36:16 +00:00
Zoltan Varga 3f88554113 2010-01-03 Zoltan Varga <[email protected]>
* TransactionAbortedException.cs: Make the default ctor public. Fixes #567872.

svn path=/branches/mono-2-6/mcs/; revision=148979
2010-01-03 14:15:24 +00:00
Zoltan Varga 368500522a 2010-01-03 Zoltan Varga <[email protected]>
* Array.cs: Fix ArrayReadOnlyList.CopyTo. Fixes #564095.

svn path=/branches/mono-2-6/mcs/; revision=148976
2010-01-03 14:10:45 +00:00
Zoltan Varga 613462c324 2010-01-03 Zoltan Varga <[email protected]>
* DateTime.cs (TryParseExact): Handle exceptions. Fixes #567857.

svn path=/branches/mono-2-6/mcs/; revision=148972
2010-01-03 13:53:55 +00:00
Zoltan Varga f084c27e38 2010-01-03 Zoltan Varga <[email protected]>
* locales.c (construct_culture_from_specific_name): Applied patch from
	José Antonio Sánchez Lázaro <[email protected]>. Fix a crash if a culture was
	not found. Fixes #567900.

svn path=/branches/mono-2-6/mono/; revision=148969
2010-01-03 13:29:53 +00:00
Carlos Alberto Cortez a74918503e 2009-12-31 Carlos Alberto Cortez <[email protected]>
* XplatUICarbon.cs: Implement the overriden AudibleAlert
	function in XplatUICarbon.  Currently it throws
	NotImplementedException which will kill a WinForms application showing
	a dialog box.
	Patch by  Erik Ylvisaker ([email protected]).


svn path=/branches/mono-2-6/mcs/; revision=148958
2009-12-31 23:42:10 +00:00
Sebastien Pouliot caf8ea503e loader.c (mono_method_get_signature_full): Remove two asserts. Return NULL instead so that the verifier can handle both cases gracefully. Fix bug #564897. [Backport r148951]
svn path=/branches/mono-2-6/mono/; revision=148952
2009-12-31 15:19:39 +00:00
Rodrigo Kumpera c78ca4093b In metadata:
* class.c (mono_class_setup_methods): Use checked version of mono_class_inflate_generic_method_full
	so we can properly fail types instead of crashing.

	Fixes #567676.

	Backpor of r148948.

2009-12-30  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=148949
2009-12-30 20:41:17 +00:00
Jonathan Pryor 0089ae3369 * Lucene.Net/Lucene.Net/QueryParser/QueryParser.cs: Fix crash when
searching for "()".  Fixes #423853.  
	  Thanks to Benoît Tuduri <[email protected]>.

svn path=/branches/mono-2-6/mcs/; revision=148945
2009-12-30 20:03:48 +00:00
Rodrigo Kumpera 27e2e40074 In metadata:
2009-12-30  Rodrigo Kumpera  <[email protected]>

	* marshal.c (mono_mb_emit_restore_result): Properly handle generic enums.

	Backport of r148941.

In mini:
2009-12-30  Rodrigo Kumpera  <[email protected]>

	* mini.c:
	* method-to.ir.c:
	* mini-*.c: Properly handle generic enums.

	Fixes #566294

	Backport of r148941.


svn path=/branches/mono-2-6/mono/; revision=148942
2009-12-30 13:49:56 +00:00
Sebastien Pouliot f06264ae54 2009-12-28 Sebastien Pouliot <[email protected]>
* Cookie.cs: Don't use automatic properties to let older mcs
	(e.g. bootstrap) compile this for NET_1_1 profile


svn path=/branches/mono-2-6/mcs/; revision=148921
2009-12-28 17:15:24 +00:00
Zoltan Varga 2a1e433854 2009-12-28 Zoltan Varga <[email protected]>
* method-to-ir.c (mono_method_to_ir): Handle the failure of mono_class_vtable ()
	in a few more places.

svn path=/branches/mono-2-6/mono/; revision=148916
2009-12-28 01:58:45 +00:00
Zoltan Varga cf04036d5d 2009-12-27 Zoltan Varga <[email protected]>
* aot-compiler.c (add_wrappers): Don't use dyn runtime invoke for methods with
	nullable parameters. Fixes #567351.

svn path=/branches/mono-2-6/mono/; revision=148914
2009-12-27 16:16:59 +00:00
Rodrigo Kumpera b7e171bc2d In metadata:
* verify.c (init_stack_with_value_at_exception_boundary): Do stack overflow checking here
	as max stack might be zero.

	Fixes #562320.

	Backport of r148911.

2009-12-26  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=148912
2009-12-27 00:13:10 +00:00
Rodrigo Kumpera f883d707c6 In metadata:
Rework all uses of mono_class_setup_methods to accept that it can fail now.

	* class.c (mono_class_setup_methods): This function now can fail the class. Do so for generic
	instances if the GTD did.

	* class.c (mono_class_setup_properties): Ditto.

	* class.c (mono_class_setup_events): Ditto.

	* class.c (mono_class_setup_vtable): Fail early if the type is already broken.

	* class.c (mono_class_setup_vtable_general): Add a few more missing broken type checks.	Sanitize
	error setting.

	* class.c (mono_class_init): Fail if GTD did.

	* cominterop.c:
	* generic-sharing.c:
	* icall.c:
	* loader.c:
	* object.c:
	* verify.c: Properly handle failure of mono_class_setup_methods.

	Backport of r148905.

2009-12-26  Rodrigo Kumpera  <[email protected]>

In mini:
2009-12-26  Rodrigo Kumpera  <[email protected]>

	* mini-trampolines.c (common_call_trampoline): Add assert for NULL resolved generic method.

	Backport of r148905.


svn path=/branches/mono-2-6/mono/; revision=148907
2009-12-26 21:41:45 +00:00
Rodrigo Kumpera 9f33f36695 In metadata:
2009-12-26  Rodrigo Kumpera  <[email protected]>

	* class-internals.c: Add mono_class_inflate_generic_method_full_checked and make
	mono_class_inflate_generic_method_full internal.

	* class.c (inflate_generic_context): Now takes a MonoError argument.

	* class.c (mono_class_inflate_generic_method_full): Now calls the _checked and abort on
	errors.

	Backport of r148904.


svn path=/branches/mono-2-6/mono/; revision=148906
2009-12-26 21:24:28 +00:00
Zoltan Varga 95b7204a39 2009-12-26 Zoltan Varga <[email protected]>
* domain.c (mono_domain_free): Backport part of r143047. Free special static
	fields earlier to avoid crashes if the types they refer to are freed. Fixes
	#565923.

svn path=/branches/mono-2-6/mono/; revision=148903
2009-12-26 16:32:37 +00:00
Sebastien Pouliot c8750dd6f6 In Test/System.Net:
2009-12-24  Sebastien Pouliot  <[email protected]>

	* CookieContainerTest.cs: Split many tests into smaller test 
	cases. Add test cases for DefaultPerDomainCookieLimit and
	DefaultCookieLimit. Remove all, but one 1.x, [Category 
	("NotWorking")] since everything works now.

In System.Net:
2009-12-24  Sebastien Pouliot  <[email protected]>

	* Cookie.cs: Re-work ToString to be useable in more cases. Fix
	some issues found by Gendarme.
	* CookieContainer.cs: Fix 2.0 NonWorking (and new) unit tests.
	Implement removing oldest cookies when limits are reached.
	* CookieCollection.cs: Fix sort to be closer to MS implementation
	(but still not 100% identical). Fix some issues found by Gendarme


svn path=/branches/mono-2-6/mcs/; revision=148892
2009-12-24 18:20:36 +00:00
Sebastien Pouliot 5a843f6077 2009-12-24 Sebastien Pouliot <[email protected]>
* method-to-ir.c (mono_method_to_ir): Avoid SIGSEGV when
	mono_method_get_signature returns NULL. Fix #567084
	[Backport r148889]


svn path=/branches/mono-2-6/mono/; revision=148890
2009-12-24 13:50:32 +00:00
Geoff Norton 4f7e1e0e33 2009-10-05 Atsushi Enomoto <[email protected]>
* JsonReader.cs : \uXXXX parser was totally wrong, giving wrong #.

svn path=/branches/mono-2-6/mcs/; revision=148881
2009-12-23 23:08:26 +00:00
Geoff Norton 05b1685a6a 2009-12-23 Geoff Norton <[email protected]>
* DeflateStream.cs: Ensure our callbacks go into the correct
	static methods.

svn path=/branches/mono-2-6/mcs/; revision=148866
2009-12-23 17:03:22 +00:00
Zoltan Varga 2ec1db8f85 2009-12-23 Zoltan Varga <[email protected]>
* mini-trampolines.c (mono_create_llvm_imt_trampoline): Fix the LLVM build on
	platforms without mono_arch_get_llvm_imt_trampoline ().

svn path=/branches/mono-2-6/mono/; revision=148864
2009-12-23 15:02:00 +00:00
Jo Shields 74ee0e1382 Backport r148856 from trunk to fix broken RabbitMQ build
svn path=/branches/mono-2-6/mcs/; revision=148857
2009-12-23 02:34:36 +00:00
Geoff Norton a1757b0a1a fix typo
svn path=/branches/mono-2-6/mono/; revision=148851
2009-12-22 19:16:36 +00:00
Zoltan Varga 1cf6dce252 2009-12-22 Zoltan Varga <[email protected]>
* aot-runtime.c (decode_klass_ref): Avoid a crash if a decode_klass_ref () call
	fails. Fixes #566689.

svn path=/branches/mono-2-6/mono/; revision=148849
2009-12-22 17:51:57 +00:00
Jo Shields 53acd847f0 Backport r148843 and r148844 from trunk
svn path=/branches/mono-2-6/mono/; revision=148846
2009-12-22 17:44:20 +00:00
Marek Habersack a14f404bd5 Backport of r148840
svn path=/branches/mono-2-6/mcs/; revision=148841
2009-12-22 12:24:48 +00:00
Rodrigo Kumpera 8e3c81eb2d In .:
2009-12-21  Rodrigo Kumpera  <[email protected]>

	* loader.c (mono_method_get_signature_full): Check if the returned signature is compatible
	with the one from the original method.

	* metadata-verify.c (mono_verifier_is_sig_compatible): New function to verify signature
	compatibility.

	* verify-internals.h: Add new function to the internal API.

	Fixes #566295.

	Backport of r148828.


svn path=/branches/mono-2-6/mono/; revision=148829
2009-12-22 01:18:25 +00:00
Sebastien Pouliot c0639bae0e 2009-12-21 Sebastien Pouliot <[email protected]>
* File.cs (ReadAllBytes): We cannot assume that a single call to
	Read will return all the data we require.
	[Backport r148822]


svn path=/branches/mono-2-6/mcs/; revision=148823
2009-12-21 22:41:03 +00:00
Zoltan Varga 352161e5dc In :
2009-12-21  Zoltan Varga  <[email protected]>

	* configure.in: Add an LLVM_CFLAGS automake variable.

In mono/mini:

2009-12-21  Zoltan Varga  <[email protected]>

	* Makefile.am (AM_CFLAGS): Include LLVM_CFLAGS.

	* mini-llvm.c: Avoid defining the __STDC_... macros if already defined.

svn path=/branches/mono-2-6/mono/; revision=148817
2009-12-21 18:46:42 +00:00
Gonzalo Paniagua Javier e5d8c57558 2009-12-21 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionGroup.cs:
	* ServicePoint.cs: implemented CloseConnectionGroup().


svn path=/branches/mono-2-6/mcs/; revision=148814
2009-12-21 17:13:52 +00:00
Marek Habersack 39f355ff7d Backport r148806
svn path=/branches/mono-2-6/mcs/; revision=148807
2009-12-21 14:27:37 +00:00
Rolf Bjarne Kvinge a2eb9c3486 In mono/metadata:
2009-12-18  Dimitar Dobrev  <[email protected]>

	* culture-info-tables.h: regenerated it to include the Georgian culture.

In tools/locale-builder:
2009-12-18  Dimitar Dobrev  <[email protected]>

	* langs/ka.xml: added a file with the settings of the neutral
	Georgian culture
	* locales/ka-GE.xml: added a file with the settings of the
	specific Georgian culture
	* supp/ka-GE.xml: added a file with the date and time formats
	of the Georgian culture
	* lcids.xml: added entries for the neutral and specific
	Georgian culture
	* Makefile.am: included supp/ka-GE.xml in the build and dist the new
	we're not downloading from primates.ximian.com.

	[Fixes bug 564910].
	[Backport of r148776].

svn path=/branches/mono-2-6/mono/; revision=148803
2009-12-21 12:12:02 +00:00
Michael Barker 4043c68978 2009-12-19 Michael Barker <[email protected]>
* Added stripped xml to avoid licensing issues.

svn path=/branches/mono-2-6/mcs/; revision=148796
2009-12-20 21:44:40 +00:00
Zoltan Varga b9bbc51c89 In System:
2009-12-19  Zoltan Varga  <[email protected]>

	* String.cs: Fix the various IndexOf and LastIndexOf methods so they handle
	"" and a non-zero startIndex correctly. Fixes #566106.

In Test/System:

2009-12-19  Zoltan Varga  <[email protected]>

	* StringTest.cs: Add tests for IndexOf ("", startIndex, count).

svn path=/branches/mono-2-6/mcs/; revision=148790
2009-12-19 21:23:08 +00:00
Jérémie Laval 0a27db5933 2009-11-02 Jérémie Laval <[email protected]>
In class/corlib/System.Threading/:
   * Parallel.cs: Added fix for Bug #536919.

In class/corlib/Test/System.Threading/:
   * ParallelTests.cs: Added unit test for Bug #536919, cleaned up.

svn path=/branches/mono-2-6/mcs/; revision=148782
2009-12-19 10:46:55 +00:00
Jonathan Pryor bf7b65723d * src/**/*: Sync with DbLinq r1294. This is DbLinq 0.19. Fixes
DataContext.Transaction.

svn path=/branches/mono-2-6/mcs/; revision=148774
2009-12-18 20:54:31 +00:00
Zoltan Varga 03905de06b 2009-12-18 Zoltan Varga <[email protected]>
* mini-x86.c (mono_arch_get_argument_info): Allocate memory for CallInfo using
	alloca as g_malloc is not signal safe.

svn path=/branches/mono-2-6/mono/; revision=148767
2009-12-18 17:36:49 +00:00
Zoltan Varga 2abe570213 2009-12-18 Zoltan Varga <[email protected]>
* reflection.c (mono_reflection_get_type_internal_dynamic): Use assembly->domain
	instead of the current domain, since the two might not match if this is called
	from the debugger.

	* metadata-internals.h (MonoDynamicAssembly): Add a 'domain' field to specify the
	domain which created this assembly.

svn path=/branches/mono-2-6/mono/; revision=148759
2009-12-18 15:36:14 +00:00
Marek Habersack bd3f49a9f0 Backport of r148743
svn path=/branches/mono-2-6/mcs/; revision=148744
2009-12-18 11:07:55 +00:00
Marek Habersack 0950f336bb Backport of r148741
svn path=/branches/mono-2-6/mcs/; revision=148742
2009-12-18 09:46:17 +00:00
Atsushi Eno f9fd0ae689 2009-12-18 Atsushi Enomoto <[email protected]>
* I18N.CJK.Test.cs : add NET_2_0 condition. fix 1.1 test.


svn path=/branches/mono-2-6/mcs/; revision=148739
2009-12-18 05:05:21 +00:00
Sebastien Pouliot 3a989e7d01 backport r148706
svn path=/branches/mono-2-6/mcs/; revision=148707
2009-12-17 15:31:21 +00:00
Atsushi Eno 82f0bcaa7d Fix 1.1 build (previous test was 2.0-only, so it couldn't be simply backported).
svn path=/branches/mono-2-6/mcs/; revision=148705
2009-12-17 14:53:39 +00:00
Marek Habersack 3e13cdf770 Backport of r148697
svn path=/branches/mono-2-6/mono/; revision=148698
2009-12-17 12:38:03 +00:00
Rodrigo Kumpera 80fa10b7c6 In .:
2009-12-17  Rodrigo Kumpera  <[email protected]>

	* icall.c (ves_icall_Type_GetMethodsByName): Don't pin virtual methods if they are newslot.
	A private virtual newslot method is used to implement an interface method without exposing
	it to users. When querying for public instance methods, such method would hide a public one
	on a parent type.

	Fixes #564379.

	Backport of r148694.


svn path=/branches/mono-2-6/mono/; revision=148695
2009-12-17 12:08:05 +00:00
Zoltan Varga a381edd354 2009-12-17 Zoltan Varga <[email protected]>
* libtest.c pinvoke2.cs: Add a test for calling pinvoke methods using calli.

svn path=/branches/mono-2-6/mono/; revision=148684
2009-12-17 09:33:02 +00:00
Zoltan Varga ca08e5c579 2009-12-17 Zoltan Varga <[email protected]>
* method-to-ir.c (mono_method_to_ir): Add support for CALLI with unmanaged
	signatures. Fixes #565143.

	* jit-icalls.c (mono_get_native_calli_wrapper): New JIT icall.

svn path=/branches/mono-2-6/mono/; revision=148683
2009-12-17 09:32:55 +00:00
Zoltan Varga d2e06609db 2009-12-17 Zoltan Varga <[email protected]>
* reflection.c (resolve_object): Fix the encoding of unmanaged calling
	conventions.

svn path=/branches/mono-2-6/mono/; revision=148682
2009-12-17 09:32:48 +00:00
Chris Toshok 31af90c154 revert this, as we need to figure out a better versioning scheme
svn path=/branches/moon/moon-2-0/mono/; revision=148647
2009-12-17 04:17:23 +00:00
Chris Toshok 4827009bbe rename this module so we get the right tarball names when we dist
svn path=/branches/moon/moon-2-0/mono/; revision=148628
2009-12-17 02:31:19 +00:00
Andrew Jorgensen 687ccd9db7 bump version
svn path=/branches/mono-2-6/mono/; revision=148609
2009-12-16 22:54:42 +00:00
Miguel de Icaza 36511ffde8 Fix
svn path=/branches/mono-2-6/mcs/; revision=148608
2009-12-16 22:44:42 +00:00
Miguel de Icaza acf33df432 Attempt to fix 'var foo = bar<TAB>' crash
svn path=/branches/mono-2-6/mcs/; revision=148604
2009-12-16 22:20:06 +00:00
Miguel de Icaza ac7a364349 2009-12-16 Miguel de Icaza <[email protected]>
* repl.cs: Avoid crash, fixes 554898

svn path=/branches/mono-2-6/mcs/; revision=148598
2009-12-16 22:17:19 +00:00
Miguel de Icaza b893812701 Backport
svn path=/branches/mono-2-6/mcs/; revision=148597
2009-12-16 22:01:54 +00:00
Gonzalo Paniagua Javier ee8c48257c 2009-12-16 Gonzalo Paniagua Javier <[email protected]>
* zlib-helper.c: when finishing uncompressing a buffer, we might need
	more than one call to deflate with Z_FINISH since the uncompressed
	data can take more space than the allocated buffer.

	Fixes the IPY+Chiron test case.


svn path=/branches/mono-2-6/mono/; revision=148593
2009-12-16 21:43:44 +00:00
Rodrigo Kumpera 90c08d2298 In .:
* reflection.c (mono_type_get_object): Guard against NULL generic param owner.

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


svn path=/branches/mono-2-6/mono/; revision=148585
2009-12-16 21:16:21 +00:00
Rodrigo Kumpera 0c85600a76 In .:
2009-12-16  Rodrigo Kumpera  <[email protected]>

	* reflection.c (mono_type_get_object): If the type is VAR or MVAR check
	if the owner class has not been finished before returning reflection_info.	

	Fixes #565127.

	Backport of r148575.


svn path=/branches/mono-2-6/mono/; revision=148579
2009-12-16 19:54:03 +00:00
Chris Toshok 40eb2f6974 merge mono and mcs up to version 148571 for moonlight 2.0 branch
svn path=/branches/moon/moon-2-0/mono/; revision=148572
2009-12-16 17:09:12 +00:00
Rodrigo Kumpera 9b196c5cd1 In .:
2009-12-16 Rodrigo Kumpera  <[email protected]>

	* mini-x86.h: Forgot to add a 0x to MONO_ARCH_MAX_FRAME_SIZE define
	making max stack 10x smaller.

	Backport of r148570.


svn path=/branches/mono-2-6/mono/; revision=148571
2009-12-16 16:46:52 +00:00
Zoltan Varga 7f6e379dad 2009-12-16 Zoltan Varga <[email protected]>
* reflection.c (mono_custom_attrs_from_param): Avoid a crash if a dynamic
	param doesn't have custom attributes. Fixes #565117.

svn path=/branches/mono-2-6/mono/; revision=148561
2009-12-16 12:42:36 +00:00
Chris Toshok 7af3f538bc merge mono and mcs up to version 148513 for moonlight 2.0 branch
svn path=/branches/moon/moon-2-0/mcs/; revision=148530
2009-12-15 21:40:59 +00:00
Chris Toshok afbdf5f3f5 merge mono and mcs up to version 148513 for moonlight 2.0 branch
svn path=/branches/moon/moon-2-0/mono/; revision=148529
2009-12-15 21:40:45 +00:00
Rodrigo Kumpera 0d60a16ee0 In .:
* method-to-ir.c (mini_emit_memcpy): Assert if size is too big.

	Backport of r148504.

2009-12-15 Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=148513
2009-12-15 19:48:42 +00:00
Rodrigo Kumpera c214e0af59 In .:
2009-12-15  Rodrigo Kumpera  <[email protected]>

	* class.c (mono_class_setup_fields): Fail valuetypes that are bigger than 1Mb.

	Backport of r148503.


svn path=/branches/mono-2-6/mono/; revision=148511
2009-12-15 19:41:59 +00:00
Rodrigo Kumpera f9b23f82ef In .:
2009-12-15 Rodrigo Kumpera  <[email protected]>

	* mini-x86.c (mono_arch_allocate_vars): Fail compilation if the frame size is
	bigger than MONO_ARCH_MAX_FRAME_SIZE.

	* mini-x86.c (mono_arch_emit_prolog): Handle huge frames.

	* mini-x86.h: Define MONO_ARCH_MAX_FRAME_SIZE to be 1Mb.

	* mini-amd64.c / mini-amd64.h: Same fixes as of above.

	* mini.c (mini_method_compile): Check if mono_arch_allocate_vars failed
	the compilation.

	Backport of r148502.


svn path=/branches/mono-2-6/mono/; revision=148509
2009-12-15 19:37:58 +00:00
Marek Habersack b3b164e0e2 Backport of r148498
svn path=/branches/mono-2-6/mcs/; revision=148499
2009-12-15 18:45:51 +00:00
Zoltan Varga 19181affc0 2009-11-20 Zoltan Varga <[email protected]>
* libtest.c (mono_test_marshal_bool_in): Use 'short' as the type of the
	variant bool argument.

	* marshalbool.cs: Pass -1 as the 'expected' argument instead of 0xffff, which
	causes sign extensions issues on some platforms.

svn path=/branches/mono-2-6/mono/; revision=148485
2009-12-15 17:15:12 +00:00
Marek Habersack 5d24e70618 Backport of r148474
svn path=/branches/mono-2-6/mono/; revision=148475
2009-12-15 12:21:13 +00:00
Geoff Norton c2752833c4 2009-12-14 Geoff Norton <[email protected]>
* debugger-agent.c: The end_runtime_invoke guard isn't working
        on AMD64 as __builtin_frame_address (1) returns NULL.  Disable the
        behaviour by default, and make it runtime configurable.

svn path=/branches/mono-2-6/mono/; revision=148421
2009-12-14 21:57:44 +00:00
Miguel de Icaza a7ad353f69 Backport from trunk
009-12-14  Miguel de Icaza  <[email protected]>

	* method-to-ir.c (mono_method_to_ir): CEE_UNUSUED opcodes now
	raise an invalid program exception.   

	For other opcodes that we might not handle use a g_warning and
	raise the exception.   Beats termination.

	Fixes #561724

2009-12-14  Miguel de Icaza  <[email protected]>

	* verify.c (mono_method_verify): The Unused opcodes produce an
	InvalidProgramException on .NET




svn path=/branches/mono-2-6/mono/; revision=148418
2009-12-14 21:14:05 +00:00
Sebastien Pouliot 896c8ae485 2009-12-14 Sebastien Pouliot <sebastien at ximian.com>
* Mono.Cecil/BaseAssemblyResolver.cs: Update to .net fx 4 beta2
	version number and reduce code duplication.


svn path=/branches/mono-2-6/mcs/; revision=148411
2009-12-14 20:43:22 +00:00
Sebastien Pouliot b3a8ccf695 loader.c (mono_method_get_header): Move assert after the verifier has been called on the method header. [Backport r148406]
svn path=/branches/mono-2-6/mono/; revision=148407
2009-12-14 19:53:07 +00:00
Marek Habersack 14e6ab3447 Backport of r148388
svn path=/branches/mono-2-6/mcs/; revision=148389
2009-12-14 14:15:17 +00:00
Marek Habersack 62f20dc082 Backport of r148378
svn path=/branches/mono-2-6/mcs/; revision=148379
2009-12-14 13:05:25 +00:00
Jonathan Chambers ac3b1ae1ad 2009-12-13 Jonathan Chambers <[email protected]>
* debugger-agent.c (mono_debugger_agent_thread_interrupt): Handle a NULL
	sigctx being passed in, as we have no CONTEXT available in the APC.
	
	(mono_debugger_agent_cleanup): Use explicit cond wait implementation
	for now.

	Code contributed under MIT/X11 license.

svn path=/branches/mono-2-6/mono/; revision=148352
2009-12-13 18:12:31 +00:00
Zoltan Varga a1f6bc713c 2009-12-12 Zoltan Varga <[email protected]>
* mini-llvm.c (mono_llvm_emit_method): Allocate the 'pindexes' array with the
	proper size.

svn path=/branches/mono-2-6/mono/; revision=148332
2009-12-12 09:41:19 +00:00
Jonathan Chambers f2c0e2415d Backport changes from HEAD to fix VS build.
svn path=/branches/mono-2-6/mono/; revision=148328
2009-12-12 03:33:29 +00:00
Zoltan Varga 794ab0c147 2009-12-12 Zoltan Varga <[email protected]>
* debugger-agent.c: Encode the this argument of vtype methods as a struct, not
	as a primitive type.

svn path=/branches/mono-2-6/mono/; revision=148193
2009-12-12 01:04:50 +00:00
Rolf Bjarne Kvinge 007b786026 2009-12-12 Rolf Bjarne Kvinge <[email protected]>
* WebClient_2_1.cs: When creating the request we need to copy over
	any headers the user set on us. We also need to wrap
	InvalidOperationExceptions in WebExceptions.

svn path=/branches/mono-2-6/mcs/; revision=148181
2009-12-12 00:08:49 +00:00
Chris Toshok f5cfcf20cb in System.Runtime.Serialization.Json:
2009-12-11  Chris Toshok  <[email protected]>

	* TypeMap.cs (CreateDefaultTypeMap): only include non-public
	property info when dealing with KeyValuePair<,>.  This is *not*
	the way MS handles it, but we emulate things much better with this
	hack.

in test/System.Runtime.Serialization.Json/:
2009-12-11  Chris Toshok  <[email protected]>

	* DataContractJsonSerializerTest.cs: add a test case for
	non-public properties.

svn path=/branches/mono-2-6/mcs/; revision=148138
2009-12-11 20:30:00 +00:00
Zoltan Varga bc764d6bb1 2009-12-11 Zoltan Varga <[email protected]>
* driver.c: Applied patch from Matt McClellan ([email protected]). Add a check
	for 2 parameter sched_setaffinity in older glibc versions. Fixes
	#564000.

svn path=/branches/mono-2-6/mono/; revision=148125
2009-12-11 19:53:23 +00:00
Zoltan Varga a6ea1406b7 2009-12-11 Zoltan Varga <[email protected]>
* configure.in: Applied patch from Matt McClellan ([email protected]). Add a check
	for 2 parameter sched_setaffinity in older glibc versions. Fixes
	#564000.

svn path=/branches/mono-2-6/mono/; revision=148124
2009-12-11 19:53:15 +00:00
Paolo Molaro 747445cc54 Fri Dec 11 18:24:04 CET 2009 Paolo Molaro <[email protected]>
* boehm-gc.c: fixed race condition while getting the target of a
	disappearing link (bug #522233).



svn path=/branches/mono-2-6/mono/; revision=148106
2009-12-11 17:17:37 +00:00
Chris Toshok 9e0f402833 merge mono and mcs up to version 148086 for moonlight 2.0 branch
svn path=/branches/moon/moon-2-0/mcs/; revision=148089
2009-12-11 05:06:47 +00:00
Chris Toshok 5d89c857e3 merge mono and mcs up to version 148086 for moonlight 2.0 branch
svn path=/branches/moon/moon-2-0/mono/; revision=148088
2009-12-11 05:06:31 +00:00
Zoltan Varga 8511b36fb1 2009-12-10 Zoltan Varga <[email protected]>
* aot-compiler.c (add_wrappers): Avoid generating synchronized wrappers for
	generic methods.

svn path=/branches/mono-2-6/mono/; revision=148039
2009-12-10 18:46:03 +00:00
Geoff Norton 58810b7bb7 Fix 2.6 on OSX 10.4 PPC
svn path=/branches/mono-2-6/mono/; revision=148001
2009-12-10 04:06:33 +00:00
Sebastien Pouliot 0c2ad9a11d 2009-12-09 Sebastien Pouliot <[email protected]>
* loader.c (mono_method_signature): Always call mono_loader_unlock 
	before returning.
	[Backport r147991]


svn path=/branches/mono-2-6/mono/; revision=147992
2009-12-10 01:23:33 +00:00
Rodrigo Kumpera 456fa62714 In .:
2009-12-09  Rodrigo Kumpera  <[email protected]>

	* metadata-verify.c: Add mono_verifier_verify_string_signature to check
	user string blobs.

	* verify-internals.h: Add new function to the internal API.

	* verify.c (do_ldstr): Call into mono_verifier_verify_string_signature to
	check if it's a valid string.

	* object.c (mono_ldstr): Ditto.

	Fixes #561943.

	Backport of r147941.


svn path=/branches/mono-2-6/mono/; revision=147949
2009-12-09 21:29:37 +00:00
Geoff Norton a3e6e82b52 fix the build on the mac 10.4
svn path=/branches/mono-2-6/mono/; revision=147946
2009-12-09 20:55:17 +00:00
Geoff Norton 4f52abe7f6 fix build on win32
svn path=/branches/mono-2-6/mono/; revision=147945
2009-12-09 20:49:01 +00:00
Jb Evain a0f7c6ea11 2009-12-09 Jb Evain <[email protected]>
* ThreadPool.cs (QueueUserWorkItem): properly throw
	an ANE instead of triggering a NRE when being passed a null callback.

	backports r147934.


svn path=/branches/mono-2-6/mcs/; revision=147938
2009-12-09 19:25:44 +00:00
Jb Evain bb834cd689 2009-12-09 Jb Evain <[email protected]>
* StringComparer.cs (GetHashCode): properly throw an
	ANE instead of triggering a NRE.

	backports r147932.


svn path=/branches/mono-2-6/mcs/; revision=147937
2009-12-09 19:24:33 +00:00
Chris Toshok 1c102ac0d5 2009-12-09 Chris Toshok <[email protected]>
* Encoding.cs (get_Default): moonlight defaults to UTF8, not
	UTF8Unmarked.

svn path=/branches/mono-2-6/mcs/; revision=147922
2009-12-09 17:38:57 +00:00
Zoltan Varga c8167fc356 2009-12-09 Zoltan Varga <[email protected]>
* debugger-agent.c (start_runtime_invoke): Fix a crash if this is called
	on the debugger thread.

svn path=/branches/mono-2-6/mono/; revision=147913
2009-12-09 15:04:28 +00:00
Geoff Norton 8ff52f4e31 Disable this on 2.6
svn path=/branches/mono-2-6/mono/; revision=147884
2009-12-08 20:55:28 +00:00
Geoff Norton 7d53402ef0 2009-12-08 Geoff Norton <[email protected]>
* debugger-agent.c:  Refactor the mono_runtime_invoke guarding against
	stepping out into native code.  There were issues with nested invokes
	like .cctors.

svn path=/branches/mono-2-6/mono/; revision=147883
2009-12-08 20:55:25 +00:00
Jonathan Pryor cb11cb28de * sqlmetal.exe.config: Add provider entry for SQL Server.
* sqlmetal.exe.sources: Add additional files.

svn path=/branches/mono-2-6/mcs/; revision=147881
2009-12-08 19:57:44 +00:00
Jonathan Pryor 7eb8ca18fd * src/**/*, examples/**/*: Sync with DbLinq r1293. This adds
SchemaLoader support for Microsoft SQL Server, allowing sqlmetal to 
	  generate entity stubs against SQL Server databases.
	* System.Data.Linq.dll.sources: Add files to the build.

svn path=/branches/mono-2-6/mcs/; revision=147880
2009-12-08 19:57:26 +00:00
Jb Evain 23222c4965 2009-12-08 Jb Evain <[email protected]>
* Enum.cs (IConvertible.ToType): properly convert enum values
	to strings instead of their numeric values.

	backport r147482.


svn path=/branches/mono-2-6/mcs/; revision=147858
2009-12-08 14:35:40 +00:00
Sebastien Pouliot 9830efc1ba 2009-12-08 Sebastien Pouliot <[email protected]>
* driver.c: Fail gracefully with --compile-all if mono_method_signature
	returns NULL (e.g. a bad assembly).


svn path=/branches/mono-2-6/mono/; revision=147854
2009-12-08 14:11:44 +00:00
Marek Safar 7244335fbb 2009-12-08 Marek Safar <[email protected]>
A fix for bug #561149
	anonymous.cs: Use actual type parameters when checking for generic
	method host.


svn path=/branches/mono-2-6/mcs/; revision=147846
2009-12-08 13:01:23 +00:00
Chris Toshok 86d426f94e 2009-12-08 Chris Toshok <[email protected]>
* JsonSerializationReader.cs (DeserializeGenericCollection): in
	the 2.1 case we still need to convert the List<> to an array.

svn path=/branches/mono-2-6/mcs/; revision=147834
2009-12-08 08:05:00 +00:00
Chris Toshok 31ed81efbf in System.ServiceModel.Web/System.Runtime.Serialization.Json:
2009-12-07  Chris Toshok  <[email protected]>

	* JsonReaderWriterFactory.cs (CreateJsonReader): pass null for the
	encoding parameter instead of calling Detect.  The jsonreader's
	PushbackReader will autodetect.
	(Detect): remove.  a BufferedStream created from an unseekable
	stream is itself unseekable, which makes it just as useless.  This
	breaks netflix's isostore file parsing.

	* JsonReader.cs (PushbackReader): add a ctor which doesn't take an
	encoding, for the autodetecting reader case.  for this ctor, pass
	true to StreamReader's ctor for detectEncodingFromByteOrderMarks.

svn path=/branches/mono-2-6/mcs/; revision=147830
2009-12-08 04:56:50 +00:00
Geoff Norton 04d595a679 2009-12-07 Geoff Norton <[email protected]>
* debugger-agent.c:  Darwin can colesce signals, so we need to handle
	the interrupt_count slightly differently.  Native threads were never
	marked as resumed.

svn path=/branches/mono-2-6/mono/; revision=147817
2009-12-07 23:18:11 +00:00
Rodrigo Kumpera 674d53942a In metadata:
2009-12-07  Rodrigo Kumpera  <[email protected]>

	* class.c (mono_class_from_typeref): Bounds check idx against the 
	assemblyref table.

	Backport of r147797.


svn path=/branches/mono-2-6/mono/; revision=147798
2009-12-07 18:53:58 +00:00
Chris Toshok c7793c1daa in class/corlib/System.Collections.Generic/:
2009-12-06  Chris Toshok  <[email protected]>

	* KeyValuePair.cs: we need setters for Key and Value so they can
	be set via reflection from
	System.ServiceModel.System.Runtime.Serialization.Json.TypeMap.cs.

in class/System.ServiceModel.Web/System.Runtime.Serialization.Json/:
2009-12-06  Chris Toshok  <[email protected]>

	* JsonSerializationReader.cs (DeserializeGenericCollection): this
	is jb's (iirc) patch, actually.  Types subclassing from
	ICollection<T> need to be supported, and since it's an interface
	the implementation might be explicit.  So instead of groveling
	around in the actual type, we need to dispatch through the
	interface's method.

	* TypeMap.cs (CreateDefaultTypeMap): we need to include non-public
	properties, since KeyValuePair items must be able to write to Key
	and Value properties.

	* JsonReader.cs (ReadContent): for builtin values (null, true,
	false), use TryReadString instead of individual ReadChar's, since
	they aren't reversible if the string didn't match.  In the default
	case, if we're LameSilverlightLiseralParser, we need to push back
	the current character onto the stream -- this is because for
	netflix's AppConfig.json we were parsing "frameRatePolicy" as
	"rameRatePolicy" (the 'f' was triggering the "false" parsing).
	(class PushBackReader): add this class to unify all the pushing
	back of characters we need to do.  1 character (JsonReader's old
	"saved_char") isn't enough given that you could have a property
	named, e.g., "falsifiable", and we'd need 4 characters worth of
	pushback to recognize that correctly.

svn path=/branches/mono-2-6/mcs/; revision=147767
2009-12-07 07:40:04 +00:00
Zoltan Varga ac520ae2a8 2009-12-05 Zoltan Varga <[email protected]>
* debugger-agent.c (buffer_add_value): Treat I/U as a valuetype, so the
	client can distinguish between intptrs and longs.

svn path=/branches/mono-2-6/mono/; revision=147746
2009-12-05 18:12:52 +00:00
Sebastien Pouliot dde7cdb961 2009-12-05 Sebastien Pouliot <[email protected]>
* System.Net.dll.sources: Remove (almost) everything. This 
	assembly in 3.5+ does not share anything with what SL2/3 
	provide (the later being a part of System.dll)
	[Backport r147727]


svn path=/branches/mono-2-6/mcs/; revision=147743
2009-12-05 17:48:41 +00:00
Zoltan Varga 7056310051 2009-12-05 Zoltan Varga <[email protected]>
Applied patch from Laurent Etiemble ([email protected]).

	* mono/metadata/assembly.c: When opening an assembly image, pass the real
	names in addition to the runtime generated one.

	* mono/metadata/image.h: Add a function to take the real name of the assembly
	image.

	* mono/metadata/image.c: If a real name has been passed to load an assembly,
	use it instead of the runtime generated one.

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-6/mono/; revision=147741
2009-12-05 17:33:31 +00:00
Zoltan Varga f93581d4ce 2009-12-05 Zoltan Varga <[email protected]>
* marshal.c (emit_marshal_vtype): Do the klass == date_time_class checks
	before the other checks to prevent problems if the DateTime class is blittable.
	Hopefully fixes #559600.

svn path=/branches/mono-2-6/mono/; revision=147738
2009-12-05 06:34:46 +00:00
Geoff Norton 3c8838a150 2009-12-04 Geoff Norton <[email protected]>
* debugger-agent.c: When doing a func-eval invoke on a suspended runtime,
	we need to track the original suspend count so the thread properly
	wakes up in resume_thread.

svn path=/branches/mono-2-6/mono/; revision=147734
2009-12-05 04:06:21 +00:00
Lluis Sanchez 59bb3789ae 2009-12-05 Lluis Sanchez <[email protected]>
* StructMirror.cs: Fix field indexer for structs with static fields.
	* VirtualMachineManager.cs: Added an option to LaunchOptions which
	allows providing a custom method for launching the process. This
	allows launching mono in a wrapper process.


svn path=/branches/mono-2-6/mcs/; revision=147728
2009-12-05 00:56:17 +00:00
Sebastien Pouliot 7aebd64c92 2009-12-04 Sebastien Pouliot <[email protected]>
* CodeModule.cs: Silverlight does not allow AssemblyBuilderAccess.
	RunAndSave so we reduce it to AssemblyBuilderAccess.Run


svn path=/branches/mono-2-6/mcs/; revision=147715
2009-12-04 22:02:21 +00:00
Sebastien Pouliot a7266dcf84 In .:
2009-12-04  Sebastien Pouliot  <[email protected]>

	* net_2_1_raw_System.Net.dll.sources: Remove HttpStatusCode_2_1.cs
	[Backport r147704]

In System.Net:
2009-12-04  Sebastien Pouliot  <[email protected]>

	* HttpStatusCode_2_1.cs: Remove. SL3 provides all status code 
	since they are used for the client stack
	* WebClient_2_1.cs: Add Credentials property and change
	ResponseHeaders property to public
	* WebRequest_2_1.cs: Add Credentials property
	[Backport r147704]


svn path=/branches/mono-2-6/mcs/; revision=147705
2009-12-04 20:49:18 +00:00
Sebastien Pouliot fb93127829 2009-12-04 Sebastien Pouliot <[email protected]>
* SocketAsyncEventArgs.cs: Implement ConnectByNameError for 
	Moonlight 3


svn path=/branches/mono-2-6/mcs/; revision=147701
2009-12-04 20:23:21 +00:00
Sebastien Pouliot 9d33ebc014 2009-12-04 Sebastien Pouliot <[email protected]>
* HttpWebRequest_2_1.cs: Add CookieCollection, need to be 
	implemented in the client stack
	* HttpWebResponse_2_1.cs: CookieContainer is virtual. Add FIXME
	to move (a real) implementation into the client stack
	* WebRequest_2_1.cs: Add Create(string) overload (SL3)
	[Backport r147670]


svn path=/branches/mono-2-6/mcs/; revision=147671
2009-12-04 16:48:23 +00:00
Zoltan Varga fb0004eeb8 2009-12-04 Zoltan Varga <[email protected]>
* mini-trampolines.c (mono_create_static_rgctx_trampoline): Use a cache
	keyed on the method+addr pair, since addr could be either the method addr or
	an unbox trampoline in the AOT case. Fixes #560246.

svn path=/branches/mono-2-6/mono/; revision=147644
2009-12-04 07:45:58 +00:00
Jonathan Pobst 4e66ddedfd [Backport to 2.6]
2009-12-03  Jonathan Pobst  <[email protected]>

	* SortOrder.cs: Add enum.

2009-12-03  Jonathan Pobst  <[email protected]>

	* System.Data.dll.sources: Add SortOrder.cs.

svn path=/branches/mono-2-6/mcs/; revision=147637
2009-12-04 02:28:14 +00:00
Zoltan Varga cd14c2ec20 2009-12-03 Zoltan Varga <[email protected]>
* mini.c (mini_method_compile): Call handle_exception_clauses () in the same
	place it was called before too.

svn path=/branches/mono-2-6/mono/; revision=147625
2009-12-03 22:48:09 +00:00
Zoltan Varga 6019fee28f 2009-12-03 Zoltan Varga <[email protected]>
* mini.c (mono_jit_runtime_invoke): Avoid the call to mono_class_setup_vtable ()
	if no security manager is present, to speed up the AOT case. Call
	mono_class_vtable () full with raise_on_error == TRUE instead.

svn path=/branches/mono-2-6/mono/; revision=147610
2009-12-03 21:26:34 +00:00
Zoltan Varga 3111a70c90 2009-12-03 Zoltan Varga <[email protected]>
* mini.c (mini_method_compile): Call handle_exception_clauses earlier so
	the local optimization passes can take its result into account. Fixes
	#559876.

	* exceptions.cs: Add a test.

svn path=/branches/mono-2-6/mono/; revision=147606
2009-12-03 21:12:41 +00:00
Zoltan Varga 006e069345 2009-01-24 Steven Munroe <[email protected]>
This patch is contributed under the terms of the MIT/X11 license

        * cpu-ppc64.md (load_memindex): Add loadi8_memindex.

svn path=/branches/mono-2-6/mono/; revision=147600
2009-12-03 20:54:47 +00:00
Zoltan Varga 43d7c99d5d 2009-12-03 Zoltan Varga <[email protected]>
* src/gmisc-unix.c (g_get_user_name): Avoid returning NULL if the env
	var is not set.

svn path=/branches/mono-2-6/mono/; revision=147587
2009-12-03 19:36:12 +00:00
Zoltan Varga 6fa30df202 2009-12-03 Zoltan Varga <[email protected]>
* StructMirror.cs (this): Ignore static fields.

svn path=/branches/mono-2-6/mcs/; revision=147579
2009-12-03 18:37:16 +00:00
Rodrigo Kumpera afd465bdd9 In .:
2009-12-03  Rodrigo Kumpera  <[email protected]>

	* loader.c (find_method_in_class): Ignore methods with broken signatures.

	Fixes #559906.

	Backport of r147557.


svn path=/branches/mono-2-6/mono/; revision=147558
2009-12-03 13:50:10 +00:00
Geoff Norton 12ac0cfb81 2009-12-02 Geoff Norton <[email protected]>
* VirtualMachineManager.cs: We might get a SocketException (interrupted)
	here, so lets just handle all Exceptions to our Accept pattern the same
	way

svn path=/branches/mono-2-6/mcs/; revision=147527
2009-12-03 04:15:30 +00:00
Zoltan Varga db97682388 2009-12-03 Zoltan Varga <[email protected]>
* debugger-agent.c: Rework the handling of stack traces of running threads to
	avoid crashes if compute_frames () tries to walk the stack of running thread.

	* mini.c (mono_print_method_from_ip): Use mini_jit_info_table_find.

	* mini-exceptions.c (mono_jit_walk_stack_from_ctx_in_thread): Set frame->lmf.

	* mini.h (StackFrameInfo): Add an 'lmf' field.

svn path=/branches/mono-2-6/mono/; revision=147519
2009-12-03 01:52:40 +00:00
Sebastien Pouliot e5e171b0ed 2009-12-02 Sebastien Pouliot <[email protected]>
* CommunicationObjectAbortedException.cs, ServerTooBusyException.cs,
	ServiceActivationException.cs: Fix base class
	* ServiceKnownTypeAttribute.cs: Seal type and add missing 
	[AttributeUsage] attribute
	[Backport r147513]


svn path=/branches/mono-2-6/mcs/; revision=147514
2009-12-03 01:38:02 +00:00
Miguel de Icaza 8d19501475 Backport
svn path=/branches/mono-2-6/mono/; revision=147500
2009-12-02 21:33:03 +00:00
Gonzalo Paniagua Javier 48c22433a8 2009-12-02 Gonzalo Paniagua Javier <[email protected]>
* Expression.cs: expression can be null for static getters. Patch from
	Miguel de Icaza ([email protected]).


svn path=/branches/mono-2-6/mcs/; revision=147499
2009-12-02 21:01:55 +00:00
Rodrigo Kumpera 94acf2e05e In .:
* verify.c (get_stack_type): Return that the type is invalid instead of
	asserting.

	* verify.c (mono_method_verify): Verify that all locals and arguments
	have valid stack types.

	Fixes #559913.

	Backport of r147485.

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


svn path=/branches/mono-2-6/mono/; revision=147486
2009-12-02 19:13:10 +00:00
Rodrigo Kumpera 726091788b In .:
* verify.c (mono_method_verify): Bounds check the filter offset. Make all
	bounds checking overflow aware.

	Fixes #559910.

	Backport of r147472.

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


svn path=/branches/mono-2-6/mono/; revision=147473
2009-12-02 18:04:46 +00:00
Rodrigo Kumpera bc5d476580 In .:
* verify.c (do_invoke_method): Check for invalid method signatures.

	Fixes #553450.

	Backport of r147464.

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


svn path=/branches/mono-2-6/mono/; revision=147466
2009-12-02 17:04:37 +00:00
Rodrigo Kumpera a951193a79 In .:
2009-12-02  Rodrigo Kumpera  <[email protected]>
	* class.c (mono_class_setup_fields): Fail an enum without an instance field.

	Fixes #558042.

	Backport of r147455.


svn path=/branches/mono-2-6/mono/; revision=147456
2009-12-02 16:06:34 +00:00
Paolo Molaro af80a02eb3 Wed Dec 2 16:35:49 CET 2009 Paolo Molaro <[email protected]>
* class.c: remove asserts for invalid type token in
	mono_class_name_from_token(), mono_assembly_name_from_token() and
	mono_class_create_from_typedef () (fixes bug #553318).


svn path=/branches/mono-2-6/mono/; revision=147445
2009-12-02 15:32:13 +00:00
Paolo Molaro d3c3e13c76 Wed Dec 2 15:48:19 CET 2009 Paolo Molaro <[email protected]>
* metadata.c, class.c, loader.c: remove assert after bsearch() for
	incorrect assemblies (bug #553322).


svn path=/branches/mono-2-6/mono/; revision=147440
2009-12-02 14:48:37 +00:00
Rodrigo Kumpera d50e89a3d7 In .:
* metadata.c (mono_metadata_inflate_generic_inst): Add MonoError parameter.

	* metadata-internals.h: Change signature of mono_metadata_inflate_generic_inst. 

	* class.c (inflate_generic_type): Use new version of mono_metadata_inflate_generic_inst.

	* class.c (inflate_generic_context): Ditto.

	* loader.c (method_from_methodspec): Ditto.

	Fixes #558230.

	Backport of r147436.

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


svn path=/branches/mono-2-6/mono/; revision=147437
2009-12-02 14:35:22 +00:00
Rodrigo Kumpera 95fbfbc0d0 In .:
* class.c (mono_type_retrieve_from_typespec): Use MonoError machinery to report errors.

	* class.c (mono_class_create_from_typespec): Ditto.

	* class.c (mono_class_get_full): Fix for change on the above 2 functions.

	* class.c (mono_type_get_full): Fix for change on the above 2 functions.

	Fixes #558184.

	Backport of r147427.

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


svn path=/branches/mono-2-6/mono/; revision=147428
2009-12-02 13:24:43 +00:00
Rodrigo Kumpera 118fb543a6 In .:
2009-12-02  Rodrigo Kumpera  <[email protected]>

	* verify.c (mono_class_has_default_constructor): Check fror broken signatures.

	* verify.c (verify_delegate_compatibility): Ditto.

	* verify.c (do_newobj): Ditto.

	Fixes #558046.

	Backport of r147422.


svn path=/branches/mono-2-6/mono/; revision=147424
2009-12-02 12:36:19 +00:00
Marek Habersack e79c9d3504 Backport of r147399
svn path=/branches/mono-2-6/mcs/; revision=147401
2009-12-02 09:01:51 +00:00
Chris Toshok ce62f72758 merge mono and mcs up to version 147226 for moonlight 2.0 branch
svn path=/branches/moon/moon-2-0/mono/; revision=147285
2009-12-02 06:18:24 +00:00
Chris Toshok 399ba28adc merge mono and mcs up to version 147226 for moonlight 2.0 branch
svn path=/branches/moon/moon-2-0/mcs/; revision=147285
2009-12-02 06:18:24 +00:00
Sebastien Pouliot cc90c9b8d3 2009-12-01 Sebastien Pouliot <[email protected]>
* DataContractSerializer.cs: Add two missing methods for FX3.0 
	and SL2/SL3.
	[Backport r147280]


svn path=/branches/mono-2-6/mcs/; revision=147281
2009-12-02 02:08:06 +00:00
Zoltan Varga 230a49d4c9 2009-12-02 Zoltan Varga <[email protected]>
* debugger-agent.c (suspend_current): Always set really_suspended.

svn path=/branches/mono-2-6/mono/; revision=147278
2009-12-02 02:01:25 +00:00
Zoltan Varga b325135bd7 2009-12-02 Zoltan Varga <[email protected]>
* debugger-agent.c (clear_event_request): Clear method entry/exit requests too.

	* exceptions-x86.c (mono_arch_get_restore_context): Restore EAX too.

svn path=/branches/mono-2-6/mono/; revision=147274
2009-12-01 23:44:28 +00:00
Zoltan Varga 0ec5aff390 2009-12-01 Zoltan Varga <[email protected]>
* VirtualMachine.cs (ErrorHandler): Handle NOT_SUSPENDED error code too.

svn path=/branches/mono-2-6/mcs/; revision=147272
2009-12-01 22:27:38 +00:00
Zoltan Varga a3aa25068f 2009-12-01 Zoltan Varga <[email protected]>
* debugger-agent.c (vm_commands): Don't allow invokes on threads which are not
	really suspended.

svn path=/branches/mono-2-6/mono/; revision=147271
2009-12-01 22:26:53 +00:00
Rodrigo Kumpera 90daa550c5 In .:
* verify.c (mono_method_verify): Check for catch clauses with broken
	types.

	Fixes #558465.

	Backport of r147261.

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


svn path=/branches/mono-2-6/mono/; revision=147262
2009-12-01 19:42:37 +00:00
Rodrigo Kumpera a94b3e2399 In mono/metadata:
* verify.c (code_bounds_check): Do proper overflow checking.

	* verify.c (mono_method_verify): The number of switch entries is
	an unsigned int. Properly bounds check it.

	Fixes #558594.

	Backport of r147259.

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


svn path=/branches/mono-2-6/mono/; revision=147260
2009-12-01 19:19:24 +00:00
Zoltan Varga e22dd447f7 2009-12-01 Zoltan Varga <[email protected]>
* cpu-ppc64.md (store_memindex): Add storei8_memindex.

svn path=/branches/mono-2-6/mono/; revision=147258
2009-12-01 19:08:36 +00:00
Rodrigo Kumpera 64d9eda0c4 In .:
* mini-trampolines.c: Fix MSVC build.

	Backport of r147245.

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


svn path=/branches/mono-2-6/mono/; revision=147253
2009-12-01 18:34:13 +00:00
Rodrigo Kumpera 78b9e915a9 In .:
* metadata.c: Kill mono_metadata_get_param_attrs_checked. Add
	mono_metadata_method_has_param_attrs which only checks if a given param
	list has a non zero flags entry.

	* metadata.c (mono_metadata_get_param_attrs): Add param_count parameter
	to inform how many params should we expect to decode.

	* loader.c (mono_method_signature): Use mono_metadata_method_has_param_attrs
	as it's faster than mono_metadata_get_param_attrs.

	* metadata-internals.h: Fix mono_metadata_get_param_attrs signature and
	add mono_metadata_method_has_param_attrs.

	Backport of r147244.

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


svn path=/branches/mono-2-6/mono/; revision=147252
2009-12-01 18:31:30 +00:00
Sebastien Pouliot c355383183 2009-12-01 Sebastien Pouliot <[email protected]>
* XmlDictionaryReader.cs: Fix ReadValueAsBase64 return value and
	remove NET_2_1 (gui-compare shows this in our 3.0 SP1 profile)
	[Backport r147250]


svn path=/branches/mono-2-6/mcs/; revision=147251
2009-12-01 18:25:29 +00:00
Sebastien Pouliot 6783d561cd 2009-12-01 Sebastien Pouliot <[email protected]>
* net_2_1_raw_System.dll.sources: Add existing files that are 
	part of Silverlight 3 (but were not in Silverlight 2)


svn path=/branches/mono-2-6/mcs/; revision=147238
2009-12-01 16:02:24 +00:00
Sebastien Pouliot 5e160a8c79 oops, typo
svn path=/branches/mono-2-6/mcs/; revision=147234
2009-12-01 14:41:53 +00:00
Sebastien Pouliot 6c8320808c 2009-12-01 Sebastien Pouliot <[email protected]>
* CryptoConfig_2_1.cs: Add mapping for SHA256 since it's used 
	internally in corlib (e.g. HMAC256)
	* KeySizes.cs, RandomNumberGenerator.cs, RNGCryptoServiceProvider.cs:
	Remove [ComVisible] attribute from NET_2_1 build.


svn path=/branches/mono-2-6/mcs/; revision=147226
2009-12-01 14:02:51 +00:00
Rodrigo Kumpera dc32001c51 In .:
2009-12-01 Rodrigo Kumpera  <[email protected]>

	* mini-trampolines.c: Check for mono_method_get_vtable_slot failures.

	Backport of r147220.


svn path=/branches/mono-2-6/mono/; revision=147224
2009-12-01 13:54:55 +00:00
Rodrigo Kumpera 3f58280e19 In .:
* class.c (mono_class_setup_vtable_general): Check for mono_method_get_vtable_slot
	failures.

	* class.c (mono_method_get_vtable_slot): Don't assert if the computed method slot
	is -1 but its class is broken.

	Fixes #558522.

	Backport of r147219.

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


svn path=/branches/mono-2-6/mono/; revision=147223
2009-12-01 13:53:11 +00:00
Rodrigo Kumpera 838bee9b74 In .:
* metadata.c: Introduce mono_metadata_get_param_attrs_checked which checks
	for parameter overflow.

	* metadata.c (mono_metadata_parse_method_signature_full): Use checked version
	of mono_metadata_get_param_attrs.

	* metadata-internals.h: Add mono_metadata_get_param_attrs_checked to the internal
	API.

	* loader.c (mono_method_signature): Use checked version of mono_metadata_get_param_attrs.

	Backport of r147218.

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


svn path=/branches/mono-2-6/mono/; revision=147222
2009-12-01 13:52:47 +00:00
Rodrigo Kumpera 8b6fbe262b In .:
2009-12-01  Rodrigo Kumpera  <[email protected]>

	* class.c (mono_class_setup_fields): Check for fields with broken types.

	Fixes #558741.

	Backport of r147214.


svn path=/branches/mono-2-6/mono/; revision=147215
2009-12-01 12:32:48 +00:00
Chris Toshok 2b6be89b67 merge 146453 from mono-2-6
svn path=/branches/moon/moon-2-0/mono/; revision=147187
2009-12-01 08:19:32 +00:00
Atsushi Eno b9a2c9d229 backport r147183.
svn path=/branches/mono-2-6/mcs/; revision=147184
2009-12-01 07:15:13 +00:00
Atsushi Eno a55a564918 backport r147178 and r147181.
svn path=/branches/mono-2-6/mcs/; revision=147182
2009-12-01 06:41:11 +00:00
Sebastien Pouliot e390d66fc6 2009-11-30 Sebastien Pouliot <[email protected]>
* CookieCollection.cs: Seal inner CookieCollectionPathComparer
	* IPAddress.cs: Avoid multiple casts in Equals
	* SocketAddress.cs: Avoid multiple casts in Equals
	[Found using Gendarme]
	[Backport r147163]


svn path=/branches/mono-2-6/mcs/; revision=147164
2009-12-01 02:07:53 +00:00
Sebastien Pouliot 57b211972c 2009-11-30 Sebastien Pouliot <[email protected]>
* AssemblyInfo.cs: Remove [StringFreezing] and [DefaultDependency]
	from NET_2_1 builds
	[Backport r147158]


svn path=/branches/mono-2-6/mcs/; revision=147159
2009-12-01 01:38:35 +00:00
Sebastien Pouliot 7d9c1e759d 2009-11-30 Sebastien Pouliot <[email protected]>
* Uri.cs: Hide protected EscapeString and Unescape for SL2/3
	* UriTypeConverter.cs: Seal type for SL2/3
	[Backport r147156]


svn path=/branches/mono-2-6/mcs/; revision=147157
2009-12-01 01:28:25 +00:00
Sebastien Pouliot 3184ffc4bc 2009-11-30 Sebastien Pouliot <[email protected]>
* TypeConverterAttribute.cs: Add missing [ComVisible] for SL2/3 builds
	[Backport r147154]


svn path=/branches/mono-2-6/mcs/; revision=147155
2009-12-01 01:21:35 +00:00
Sebastien Pouliot d994a4f8fa 2009-11-30 Sebastien Pouliot <[email protected]>
* Debug_2_1.cs: Change type to sealed to match SL2/3


svn path=/branches/mono-2-6/mcs/; revision=147152
2009-12-01 01:10:41 +00:00
Zoltan Varga a099d612d9 2009-11-30 Zoltan Varga <[email protected]>
* mini-arm.c (mono_arch_lowering_pass): Fix an assert which is hit when
	the instruction following an OP_FCOMPARE is optimized away.

svn path=/branches/mono-2-6/mono/; revision=147103
2009-11-30 16:27:21 +00:00
Andrés G. Aragoneses a59ec954c2 * Assembly/AssemblyInfo.cs:
* Makefile: Remove the MOON_A11Y_INTERNAL_HACK define
for MoonAtkBridge after audit finished r147098.

svn path=/branches/mono-2-6/mcs/; revision=147102
2009-11-30 16:27:17 +00:00
Geoff Norton c3c3dd0da9 add Stopwatch to monotouch
svn path=/branches/mono-2-6/mcs/; revision=147099
2009-11-30 16:09:50 +00:00
Marek Habersack 6d6b34516e Backport of r147094
svn path=/branches/mono-2-6/mcs/; revision=147095
2009-11-30 12:52:16 +00:00
Zoltan Varga 2797d41db5 2009-11-29 Zoltan Varga <[email protected]>
* aot-compiler.c: Add an option to set the number of static rgctx trampolines
	generated.

svn path=/branches/mono-2-6/mono/; revision=147064
2009-11-28 23:12:55 +00:00
Zoltan Varga 487afeafc4 2009-11-28 Zoltan Varga <[email protected]>
* appdomain.c (create_exceptions): New helper function extracted from
	mono_runtime_init () to precreate objects used during exception handling.
	(mono_runtime_init): Call it.
	(mono_domain_create_appdomain_internal): Ditto. Fixes #555264.

svn path=/branches/mono-2-6/mono/; revision=147058
2009-11-28 17:34:14 +00:00
Zoltan Varga bff469cafa Fix a warning.
svn path=/branches/mono-2-6/mono/; revision=147041
2009-11-27 15:24:54 +00:00
Zoltan Varga 12986e9a2f 2009-11-27 Zoltan Varga <[email protected]>
* class.c (mono_class_setup_vtable_general): Cache the result of
	get_virtual_methods () since it can be slow because of the metadata
	optimization.

svn path=/branches/mono-2-6/mono/; revision=147039
2009-11-27 15:24:06 +00:00
Zoltan Varga 37b4075223 2009-11-27 Zoltan Varga <[email protected]>
* metadata-internals.h (_MonoImage): Change 'method_cache' to a GHashTable
	from a MonoValueHashTable for now, since the later is based on an earlier
	version of hpj's internal probing code and seems to have serious collision
	issues.

	* loader.c (mono_get_method_full): Update after the change above.

svn path=/branches/mono-2-6/mono/; revision=147038
2009-11-27 15:23:59 +00:00
Zoltan Varga 0fd5b334b0 2009-11-27 Zoltan Varga <[email protected]>
* aot-compiler.c (emit_globals_table): Use temp_prefix instead of .L in a few
	places.

svn path=/branches/mono-2-6/mono/; revision=147021
2009-11-27 02:31:44 +00:00
Zoltan Varga 519a232b2d 2009-11-24 Zoltan Varga <[email protected]>
* aot-compiler.c: Avoid infinite recursion when generic virtual recursion is
	encountered.

svn path=/branches/mono-2-6/mono/; revision=147018
2009-11-26 23:53:41 +00:00
Zoltan Varga 58f33f8959 2009-11-27 Zoltan Varga <[email protected]>
* aot-compiler.c (emit_globals_table): Emit a hash table for the globals, to
	avoid linear searches at runtime.

	* aot-runtime.c (find_symbol): Update this to use the hash.

	* mini.h: Bump AOT file format version.

svn path=/branches/mono-2-6/mono/; revision=147017
2009-11-26 23:53:34 +00:00
Zoltan Varga 1ccdb2b294 Fix the previous commit.
svn path=/branches/mono-2-6/mono/; revision=147014
2009-11-26 21:01:47 +00:00
Zoltan Varga b50110122d 2009-11-26 Zoltan Varga <[email protected]>
* mono-ehash.c (mono_g_hash_table_find): Add this for eglib too.

svn path=/branches/mono-2-6/mono/; revision=147012
2009-11-26 20:54:03 +00:00
Marek Safar f28f29e604 2009-11-26 Marek Safar <[email protected]>
A fix for bug #545081
	* decl.cs: Check private nested types of nested types recursively.


svn path=/branches/mono-2-6/mcs/; revision=147004
2009-11-26 17:45:04 +00:00
Marek Safar 24e5f03bcf 2009-11-26 Marek Safar <[email protected]>
A fix for bug #558305
	* location.cs: Ignore self referencing #line directive


svn path=/branches/mono-2-6/mcs/; revision=146998
2009-11-26 15:32:19 +00:00
Sebastien Pouliot de60184478 2009-11-26 Sebastien Pouliot <[email protected]>
* Random.cs: Fix case where the diff between min and max
	is very large in Next(int,int). Fix bug #558593
	[Backport r146993]


svn path=/branches/mono-2-6/mcs/; revision=146994
2009-11-26 15:21:29 +00:00
Marek Safar 406b2d7a00 2009-11-26 Marek Safar <[email protected]>
A fix for bug #558292
	* class.cs: Allow single unsafe fixed buffer fields.


svn path=/branches/mono-2-6/mcs/; revision=146989
2009-11-26 14:46:56 +00:00
Rodrigo Kumpera ee9a969d25 In metadata:
2009-11-26  Rodrigo Kumpera  <[email protected]>

	* class.c (check_interface_method_override): Check for NULL signatures and fail
	the type.

	* debug-helpers.c (mono_signature_get_desc): Return a fixed string for NULL signatures.

	Fixes #553428.

	Backport of r146970.


svn path=/branches/mono-2-6/mono/; revision=146971
2009-11-26 11:01:16 +00:00
Rodrigo Kumpera a8307a851d In metadata:
* loader.c (field_from_memberref): Resolve the class first then the field
	signature. Remove a lot of duplicated code and make sure we don't pass valid
	values to mono_loader_set_error_field_load.

	Fixes #553306.

	Backport of r146937.

2009-11-25  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=146941
2009-11-25 19:52:19 +00:00
Rodrigo Kumpera 38e80cb638 In metadata:
2009-11-25  Rodrigo Kumpera  <[email protected]>

	* class.c (inflate_generic_type): Change code to use new signature of
	mono_error_set_bad_image.

	Fixes #558124.

	Backport of r146936.

In utils:
2009-11-25 Rodrigo Kumpera  <[email protected]>

	* mono-error-internals.h: Add mono_error_set_bad_image_name and change signature
	of mono_error_set_bad_image to take a MonoImage instead of a const char *.

	* mono-error.c: Same.

	Backport of r146936.


svn path=/branches/mono-2-6/mono/; revision=146939
2009-11-25 19:36:43 +00:00
Jb Evain 0fc5630825 in System.Collections.Generic:
2009-11-25  Jb Evain  <[email protected]>

	* Queue.cs (Enqueue): deal with the case where the tail
	is off the array when deciding to enlarge the capacity.

	backport 146925.

in Test/System.Collections.Generic:
2009-11-25  Jb Evain  <[email protected]>

	* QueueTest.cs: add test for a specific combination of
	calls that make the queue crash when enqueuing an item.

	backport 146925.

svn path=/branches/mono-2-6/mcs/; revision=146926
2009-11-25 17:33:10 +00:00
Sebastien Pouliot 4e11e4cef8 2009-11-25 Sebastien Pouliot <[email protected]>
* verify.c (mono_method_verify): Don't free ctx.params items if 
	we aborted while inflating the ctx.locals. Complete previous fix
	[Backport 146919]


svn path=/branches/mono-2-6/mono/; revision=146920
2009-11-25 16:19:17 +00:00
Jb Evain f4bf675eef in System.Collections.Generic:
2009-11-25  Jb Evain  <[email protected]>

	* Queue.cs (ICollection.CopyTo): fix typo, remove code duplication.

	backport r146914.

in Test/System.Collections.Generic:
2009-11-25  Jb Evain  <[email protected]>

	* QueueTest.cs: add tests for ICollection.CopyTo.

	backport r146914.

svn path=/branches/mono-2-6/mcs/; revision=146915
2009-11-25 15:44:30 +00:00
Zoltan Varga 7a30c3b1ba 2009-11-25 Zoltan Varga <[email protected]>
* Delegate.cs (GetHashCode): Fix this so it is constant.

svn path=/branches/mono-2-6/mcs/; revision=146905
2009-11-25 13:39:35 +00:00
Sebastien Pouliot 19e874fd82 2009-11-25 Sebastien Pouliot <[email protected]>
* verify.c (mono_method_verify): Use the uninflated type name, 
	when the inflated is null, to report errors. Also take care when
	freeing, not to free everything since, in case of an error, some
	stuff would be copies (i.e. not allocated by the function itself)
	Fix bug #558145
	[Backport r146900]


svn path=/branches/mono-2-6/mono/; revision=146901
2009-11-25 13:08:36 +00:00
Zoltan Varga 8c28cbe7a4 2009-11-25 Zoltan Varga <[email protected]>
* debugger-agent.c (vm_commands): Implement EXIT by invoking Environment.Exit ()
	on a random thread if possible.

svn path=/branches/mono-2-6/mono/; revision=146899
2009-11-25 12:51:39 +00:00
Zoltan Varga 398e639c0c 2009-11-25 Zoltan Varga <[email protected]>
* mono-hash.c (mono_g_hash_table_find): Implement this.

svn path=/branches/mono-2-6/mono/; revision=146898
2009-11-25 12:51:29 +00:00
Rodrigo Kumpera 6b0fe6fbb0 In metadata:
* verify.c (stack_push, stack_pop, stack_pop_safe): Assert if we underflow
	or overflow. The caller must have done this check explicitly. This guard us
	from accessing invalid memory.

	* verify.c (do_push_static_field): Check for stack overflow.

	Fixes #553333.

	Backport of r146876.

2009-11-24  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=146881
2009-11-25 02:22:57 +00:00
Rodrigo Kumpera e0c474d88c In .:
2009-11-24  Rodrigo Kumpera  <[email protected]>

	* loader.c (find_method_in_class): Don't crash if the signature cannot
	be resolved.

	* metadata.c (mono_metadata_parse_generic_param): Return NULL instead
	of asserting for the case of invalid params.

	Fixes #553304.

	Backport of r146875.


svn path=/branches/mono-2-6/mono/; revision=146880
2009-11-25 02:05:36 +00:00
Geoff Norton 71a789e874 2009-11-24 Geoff Norton <[email protected]>
* mini-darwin.c: Work around apple bug rdar://7209349  See
        http://openradar.appspot.com/7209349 for details.  Synopsis,
        CoreFoundation SIGTRAP's if you dlopen it off the main thread if its
        never been initialized before.

svn path=/branches/mono-2-6/mono/; revision=146872
2009-11-25 00:53:08 +00:00
Zoltan Varga 38a62af6c3 2009-11-24 Zoltan Varga <[email protected]>
* tramp-arm.c: Use blx instead of mov pc, reg to improve support for thumb.

	* mini-arm.c (mono_arm_thumb_supported): New helper function.

svn path=/branches/mono-2-6/mono/; revision=146864
2009-11-24 21:58:43 +00:00
Bill Holmes 6273d99a9b 2009-11-24 Bill Holmes <[email protected]>
Backport of 144280.

	* cominterop.c : Search the interface parts of vtable to find
	  method matches.  Fixes 547030.

	Code is contributed under MIT/X11 license.


svn path=/branches/mono-2-6/mono/; revision=146860
2009-11-24 20:40:35 +00:00
Zoltan Varga 373365e391 2009-11-24 Zoltan Varga <[email protected]>
* cfold.c (mono_constant_fold_ins): Fix a problem in the previous change,
	OP_SHL_IMM is not 32 bit.

svn path=/branches/mono-2-6/mono/; revision=146853
2009-11-24 18:32:12 +00:00
Sebastien Pouliot a2e70adbe3 2009-11-24 Sebastien Pouliot <[email protected]>
* image.c (mono_image_load_module): Fix crash when a bad assembly
	has no module at all (fix bug #553412) and also replace the 
	g_assert with a return NULL (documented return value for failure)
	[Backport r146839]


svn path=/branches/mono-2-6/mono/; revision=146840
2009-11-24 16:18:21 +00:00
Jb Evain d24d4a16c4 2009-11-24 Jb Evain <[email protected]>
* Array.cs: use ContainsGenericParameters instead of
	IsGenericTypeDefinition as it catches more cases.

	backport r146834.


svn path=/branches/mono-2-6/mcs/; revision=146835
2009-11-24 15:25:21 +00:00
Jb Evain 11ead8847c in System:
2009-11-24  Jb Evain  <[email protected]>

	* Array.cs (IList.this[int]): prevent the use of the IList indexer 
	when dealing with a multi dimensional array.

	backport r146831.

in Test/System:
2009-11-24  Jb Evain  <[email protected]>

	* ArrayTest.cs: test that we don't allow the use of the IList indexer
	on a multi dimensional array.

	backport r146831.

svn path=/branches/mono-2-6/mcs/; revision=146832
2009-11-24 15:04:28 +00:00
Jb Evain 3e4b9eab12 in System:
2009-11-24  Jb Evain  <[email protected]>

	* Array.cs (Clear): throw an IndexOutOfRangeException instead
	of an ArgumentOutRangeException for a negative length.

	backport of r146825.

in Test/System:
2009-11-24  Jb Evain  <[email protected]>

	* ArrayTest: test for the proper exception on Clear ().

	backport of r146825.

svn path=/branches/mono-2-6/mcs/; revision=146827
2009-11-24 14:23:13 +00:00
Jb Evain e2b4686ee1 2009-11-24 Jb Evain <[email protected]>
* ArrayTest.cs: add test ensuring we do not allow open
	generic types in CreateInstance.

	backport of r146823.


svn path=/branches/mono-2-6/mcs/; revision=146824
2009-11-24 13:59:25 +00:00
Jb Evain 4de78797d2 2009-11-24 Jb Evain <[email protected]>
* Array.cs (CreateInstance): do not allow open generic types.

	backport r146821.


svn path=/branches/mono-2-6/mcs/; revision=146822
2009-11-24 13:58:05 +00:00
Jb Evain 2a4644b98b Fix all CreateInstance overloads for void
svn path=/branches/mono-2-6/mcs/; revision=146819
2009-11-24 13:44:07 +00:00
Jb Evain da5f305ee8 2009-11-24 Jb Evain <[email protected]>
* ArrayTest.cs: Add test ensuring we do not allow void arrays.

	backport r146815.

svn path=/branches/mono-2-6/mcs/; revision=146817
2009-11-24 13:33:11 +00:00
Jb Evain 8d29fbdbeb 2009-11-24 Jb Evain <[email protected]>
* Array.cs (CreateInstance): do not allow void arrays.

	backport r146814.

svn path=/branches/mono-2-6/mcs/; revision=146816
2009-11-24 13:32:58 +00:00
Zoltan Varga 39630e629a 2009-11-24 Zoltan Varga <[email protected]>
* debugger-agent.c: Sync this with the version of HEAD to make backporting
	easier.

svn path=/branches/mono-2-6/mono/; revision=146811
2009-11-24 13:06:21 +00:00
Zoltan Varga dba382bccb 2009-11-24 Zoltan Varga <[email protected]>
* ObjectMirror.cs TypeMirror.cs StructMirror.cs: Make the BeginInvokeMethod
	which takes a 'vm' argument obsolete, it was added by mistake, add a version
	without that argument instead.

svn path=/branches/mono-2-6/mcs/; revision=146810
2009-11-24 13:04:03 +00:00
Zoltan Varga 7b6b1d589f 2009-11-19 Zoltan Varga <[email protected]>
* AssemblyMirror.cs: Add a GetName () method.

svn path=/branches/mono-2-6/mcs/; revision=146809
2009-11-24 13:03:44 +00:00
Zoltan Varga 1244874e36 2009-11-24 Zoltan Varga <[email protected]>
* debugger-agent.c (resume_vm): Signal the suspend_cond even if suspend_count
	> 0 since some threads can resume if their resume_count is > 0.
	(invoke_method): Avoid reading freed memory.

svn path=/branches/mono-2-6/mono/; revision=146808
2009-11-24 13:02:41 +00:00
Zoltan Varga 94e71fae97 2009-11-24 Zoltan Varga <[email protected]>
* debugger-agent.c (process_suspend): Extract the suspend code from
	process_single_step_inner () to a separate function. Rework the code to prevent
	races between this function and thread interrupts.

svn path=/branches/mono-2-6/mono/; revision=146807
2009-11-24 13:02:34 +00:00
Zoltan Varga 3a38c41837 2009-11-24 Zoltan Varga <[email protected]>
* debugger-agent.c (suspend_current): Check the resume_count field instead
	of resume_one so suspends+resumes during single threaded invokes work
	correctly.

svn path=/branches/mono-2-6/mono/; revision=146778
2009-11-23 23:18:29 +00:00
Zoltan Varga d7941e0e61 2009-11-22 Zoltan Varga <[email protected]>
* debugger-agent.c: Fix the cygwin build.

svn path=/branches/mono-2-6/mono/; revision=146774
2009-11-23 22:08:29 +00:00
Marek Habersack 355cd2241e Forward-port of r146772
svn path=/branches/mono-2-6/mcs/; revision=146773
2009-11-23 22:03:09 +00:00
Marek Habersack b88e3eb6e4 Backport of r146764
svn path=/branches/mono-2-6/mcs/; revision=146765
2009-11-23 19:00:54 +00:00
Marek Habersack d82248bfa9 typo
svn path=/branches/mono-2-6/mcs/; revision=146751
2009-11-23 17:37:40 +00:00
Marek Habersack b65bf9c867 Fix 1.1 build
svn path=/branches/mono-2-6/mcs/; revision=146747
2009-11-23 17:28:35 +00:00
Marek Habersack b4f535348e Backport of r146732
svn path=/branches/mono-2-6/mcs/; revision=146733
2009-11-23 16:26:04 +00:00
Zoltan Varga bc56cd99ed Fix the 2.6 build.
svn path=/branches/mono-2-6/mono/; revision=146714
2009-11-23 09:29:18 +00:00
Zoltan Varga 10182053a9 2009-11-23 Zoltan Varga <[email protected]>
* debugger-agent.c: Implement single threaded invokes.

svn path=/branches/mono-2-6/mono/; revision=146694
2009-11-23 01:34:29 +00:00
Zoltan Varga a04af9118a 2009-11-23 Zoltan Varga <[email protected]>
* method-to-ir.c (inline_method): Prevent infinite recursion. Fixes
	#557606.

	* generics.cs: Add a test.

svn path=/branches/mono-2-6/mono/; revision=146689
2009-11-22 23:24:02 +00:00
Zoltan Varga 256a98a381 2009-11-21 Zoltan Varga <[email protected]>
* cfold.c (mono_constant_fold_ins): Fix constant folding of shr_imm. Fixes
	#557262.

	* basic.cs: Add a test.

svn path=/branches/mono-2-6/mono/; revision=146668
2009-11-21 02:48:49 +00:00
Atsushi Eno ba4906bc4f backport r146613.
svn path=/branches/mono-2-6/mcs/; revision=146614
2009-11-20 12:08:20 +00:00
Zoltan Varga 4ba4545e8d 2009-11-20 Zoltan Varga <[email protected]>
* tramp-ppc.c (mono_arch_create_generic_class_init_trampoline_full): These
	receive their argument in MONO_ARCH_VTABLE_REG, not in the first argument reg.

svn path=/branches/mono-2-6/mono/; revision=146604
2009-11-20 07:24:55 +00:00
Atsushi Eno bc56f1060e backport r146350.
svn path=/branches/mono-2-6/mcs/; revision=146602
2009-11-20 06:15:36 +00:00
Atsushi Eno 06c665c5ff backport r146348.
svn path=/branches/mono-2-6/mcs/; revision=146601
2009-11-20 06:14:21 +00:00
Atsushi Eno 7fd1ce6d9d backport r146599.
svn path=/branches/mono-2-6/mcs/; revision=146600
2009-11-20 06:09:06 +00:00
Zoltan Varga e372287a58 2009-11-20 Zoltan Varga <[email protected]>
* debugger-agent.c (create_event_list): Fix a crash if an empty assembly list
	was used as an assembly filter.

svn path=/branches/mono-2-6/mono/; revision=146598
2009-11-20 06:00:27 +00:00
Zoltan Varga d643fdb3da 2009-11-19 Zoltan Varga <[email protected]>
* debugger-agent.c (assembly_commands): Implement GET_NAME command.

svn path=/branches/mono-2-6/mono/; revision=146597
2009-11-20 05:59:39 +00:00
Marek Habersack 4cd467c7de Backport of r146546
svn path=/branches/mono-2-6/mcs/; revision=146547
2009-11-19 15:18:58 +00:00
Marek Habersack e48563c4a2 Backport of r146525
svn path=/branches/mono-2-6/mcs/; revision=146526
2009-11-19 12:20:11 +00:00
Marek Habersack ce4c084b61 Backport r146458
svn path=/branches/mono-2-6/mcs/; revision=146459
2009-11-18 22:36:44 +00:00
Sebastien Pouliot 929d904551 2009-11-18 Sebastien Pouliot <[email protected]>
* class.c (can_access_internals): Allow CoreCLR to participate in
	allowing (or not) [InternalsVisibleTo] between assemblies.
	* security-core-clr.c|h: Make sure that only trusted code (a 
	superset of platform code) can access the internals of platform
	code.
	[Backport r146452]


svn path=/branches/mono-2-6/mono/; revision=146453
2009-11-18 21:50:28 +00:00
Zoltan Varga 62c644372c 2009-11-18 Zoltan Varga <[email protected]>
* debugger-agent.c (mono_debugger_agent_handle_exception): Pass a MonoJitInfo to
	create_event_list () so assembly filters can be used.

svn path=/branches/mono-2-6/mono/; revision=146391
2009-11-17 23:54:35 +00:00
Chris Toshok 04c7042d17 merge mono and mcs up to version 146362 for moonlight 2.0 branch
svn path=/branches/moon/moon-2-0/mono/; revision=146385
2009-11-17 23:27:58 +00:00
Chris Toshok 7a6b7bae4a merge mono and mcs up to version 146362 for moonlight 2.0 branch
svn path=/branches/moon/moon-2-0/mcs/; revision=146385
2009-11-17 23:27:58 +00:00
Marek Habersack 035c90b4c4 2009-11-17 Marek Habersack <[email protected]>
* tests.make (TEST_RUNTIME_WRAPPERS_PATH): added - used to set up
	correct PATH for tests

svn path=/branches/mono-2-6/mcs/; revision=146379
2009-11-17 22:15:40 +00:00
Marek Habersack 3f61068a5c 2009-11-17 Marek Habersack <[email protected]>
* runtime/Makefile.am (TEST_SUPPORT_FILES): added bin/al2 - needed
	for System.Web tests.

svn path=/branches/mono-2-6/mono/; revision=146378
2009-11-17 22:15:13 +00:00
Marek Habersack f63d52594b Fix 1.1 tests
svn path=/branches/mono-2-6/mcs/; revision=146374
2009-11-17 21:33:17 +00:00
Jackson Harper 87c37b1280 * WebResponse_2_1.cs: Update to the SL3 API.
* HttpWebRequest.cs: Add cookies.


svn path=/branches/mono-2-6/mcs/; revision=146362
2009-11-17 17:13:54 +00:00
Jackson Harper 90433c3359 * WebResponse_2_1.cs: Update to the SL3 API.
svn path=/branches/mono-2-6/mcs/; revision=146357
2009-11-17 16:34:30 +00:00
Zoltan Varga 2be4540393 2009-11-17 Zoltan Varga <[email protected]>
* aot-compiler.c (add_generic_instances): Emit instances of common generic
	classes for char/bool too.

svn path=/branches/mono-2-6/mono/; revision=146323
2009-11-17 08:44:11 +00:00
Zoltan Varga 6f21bda280 2009-11-17 Zoltan Varga <[email protected]>
* debugger-agent.c (DebuggerTlsData): Honor the DISABLE_SOFT_DEBUG option.

svn path=/branches/mono-2-6/mono/; revision=146314
2009-11-17 02:39:30 +00:00
Zoltan Varga f112f87bdc 2009-11-17 Zoltan Varga <[email protected]>
* debugger-agent.c (DebuggerTlsData): Add a 'really_suspended' flag, not yet
	used.

svn path=/branches/mono-2-6/mono/; revision=146313
2009-11-17 02:39:23 +00:00
Zoltan Varga b47223981c 2009-11-17 Zoltan Varga <[email protected]>
* configure.in: Add a --enable-minimal=soft-debug option.

svn path=/branches/mono-2-6/mono/; revision=146312
2009-11-17 02:39:17 +00:00
Atsushi Eno ae382bd6a1 backport r146307.
svn path=/branches/mono-2-6/mcs/; revision=146308
2009-11-17 01:19:23 +00:00
Zoltan Varga 4f2a7eab9a 2009-11-17 Zoltan Varga <[email protected]>
* Connection.cs ObjectMirror.cs: Implement invokes in a real asynchronous way,
	without waiting.

svn path=/branches/mono-2-6/mcs/; revision=146304
2009-11-17 00:54:38 +00:00
Zoltan Varga f37073904e Fix a typo.
svn path=/branches/mono-2-6/mono/; revision=146299
2009-11-16 23:20:10 +00:00
Zoltan Varga 3816040cc3 2009-11-17 Zoltan Varga <[email protected]>
* debugger-agent.c: Add some definitions to make backporting to 2.4 easier.
	Fix warnings.

svn path=/branches/mono-2-6/mono/; revision=146296
2009-11-16 23:15:31 +00:00
Zoltan Varga 86e648cd02 2009-11-15 Andreas Faerber <[email protected]>
* debugger-agent.c (mono_debugger_agent_thread_interrupt): Signature fix.

	This commit is licensed under the MIT X11 license.

svn path=/branches/mono-2-6/mono/; revision=146294
2009-11-16 23:10:05 +00:00
Gonzalo Paniagua Javier 657cf62e8f 2009-11-16 Gonzalo Paniagua Javier <[email protected]>
* DefaultWatcher.cs: patch by James P. Mitchel III.
	The change corrects an instance of unsynchronized access to shared
	state and is probably the intent of the original code.


svn path=/branches/mono-2-6/mcs/; revision=146291
2009-11-16 21:39:32 +00:00
Marek Habersack 7df0404424 Backport of r146275
svn path=/branches/mono-2-6/mcs/; revision=146276
2009-11-16 17:09:39 +00:00
Sebastien Pouliot 33f7592f9e 2009-11-16 Sebastien Pouliot <[email protected]>
* security-core-clr.c (get_caller_no_reflection_related): 
	[Mono]Type.InvokeMember is outside System.Reflection[.Emit] but
	it's still reflection and must be filtered correctly.


svn path=/branches/mono-2-6/mono/; revision=146257
2009-11-16 14:35:33 +00:00
Marek Habersack 623e2346d5 Backport of r146250
svn path=/branches/mono-2-6/mcs/; revision=146251
2009-11-16 11:54:18 +00:00
Atsushi Eno c33c4d4a92 backport r146023.
svn path=/branches/mono-2-6/mcs/; revision=146244
2009-11-16 08:43:59 +00:00
Atsushi Eno d746ee6888 backport r145920.
svn path=/branches/mono-2-6/mcs/; revision=146243
2009-11-16 08:39:46 +00:00
Atsushi Eno a53c72f671 backport r145910.
svn path=/branches/mono-2-6/mcs/; revision=146242
2009-11-16 08:38:13 +00:00
Gonzalo Paniagua Javier 277019c06c no need for g_strdup_printf here
svn path=/branches/mono-2-6/mono/; revision=146230
2009-11-15 17:42:10 +00:00
Jb Evain c5777ff927 backport unit tests
svn path=/branches/mono-2-6/mcs/; revision=146228
2009-11-15 16:56:28 +00:00
Jb Evain ed8d0fd5b7 2009-11-15 Jb Evain <[email protected]>
backport of 146225.

	* Expression (Call): deal with lambda expression <> delegate
	comparison when filtering methods.
	Fixes #536637.


svn path=/branches/mono-2-6/mcs/; revision=146227
2009-11-15 16:54:10 +00:00
Jb Evain ea7ccc0ca2 2009-11-15 Jb Evain <[email protected]>
backport of 146222.

	* Expression (Call): better filtering of generic methods.
	Fixes #537768.


svn path=/branches/mono-2-6/mcs/; revision=146223
2009-11-15 15:55:46 +00:00
Zoltan Varga cd2414b5ae 2009-11-15 Zoltan Varga <[email protected]>
* boehm-gc.c (mono_gc_base_init): Applied patch from DKoushik K. Dutta (
	[email protected]). Disable GC_no_dls on android.

svn path=/branches/mono-2-6/mono/; revision=146216
2009-11-15 01:20:28 +00:00
Jb Evain 7c15f2f524 backport [146208:146210
svn path=/branches/mono-2-6/mcs/; revision=146212
2009-11-14 15:58:19 +00:00
Zoltan Varga 17882f969c 2009-11-14 Zoltan Varga <[email protected]>
(mono_debugger_agent_thread_interrupt): Save the context so stacktraces for
	threads in native code work.

svn path=/branches/mono-2-6/mono/; revision=146206
2009-11-14 02:42:36 +00:00
Zoltan Varga e4b072c2d7 2009-11-14 Zoltan Varga <[email protected]>
* debugger-agent.c: Pass the 'flags' argument to VM_INVOKE_METHOD earlier in
	the parameter list, so it can be acted upon by vm_commands (). Bump protocol
	version.

svn path=/branches/mono-2-6/mono/; revision=146202
2009-11-14 01:27:24 +00:00
Marek Habersack 47867f30b9 Backport of r146199
svn path=/branches/mono-2-6/mcs/; revision=146200
2009-11-14 01:22:27 +00:00
Zoltan Varga f169b36c49 2009-11-14 Zoltan Varga <[email protected]>
* InvokeOptions.cs: Add SingleThreaded option, not yet works.

	* VirtualMachineManager.cs (Launch): Pass options to BeginLaunch.

svn path=/branches/mono-2-6/mcs/; revision=146198
2009-11-14 01:21:01 +00:00
Marek Habersack cbae4b7ef1 Backport of r146191
svn path=/branches/mono-2-6/mcs/; revision=146192
2009-11-13 23:44:20 +00:00
Zoltan Varga 3d71a2a6e5 2009-11-14 Zoltan Varga <[email protected]>
* ObjectMirror.cs TypeMirror.cs StructMirror.cs: Implement an async version of
	InvokeMethod ().

svn path=/branches/mono-2-6/mcs/; revision=146190
2009-11-13 23:35:36 +00:00
Andreia Gaita 179dfaf89d * XmlTextReaderTests.cs: Added ParsingWithNSMgrSubclass test to check
r146175 fix (chained namespace lookups using XmlNamespaceManager
subclasses)

svn path=/branches/mono-2-6/mcs/; revision=146181
2009-11-13 21:30:56 +00:00
Andreia Gaita e7031d9bb1 [backport r146174]
* XmlNamespaceManager.cs: XmlReader.Read calls LookupNamespace via
the internal sig, which skips any overrides that might exist on
subclasses, so redirect all calls to the public call to make sure
all overrides are called as well.
Make AddNamespace, HasNamespace and RemoveNamespace private.

svn path=/branches/mono-2-6/mcs/; revision=146175
2009-11-13 19:37:22 +00:00
Jonathan Chambers 419504fba0 2009-11-13 Jonathan Chambers <[email protected]>
* debugger-agent.c: Implementation for Windows platform.

        * mini-x86.c: Add support for Windows. Use mono-* synchronization
        primitives. Use SEH to implement breakpoints and single stepping.

        * mini-x86.h: Enable soft debugger on Windows.

        Code contributed under MIT/X11 license.


svn path=/branches/mono-2-6/mono/; revision=146169
2009-11-13 18:18:23 +00:00
Marek Habersack e60ebd985e Backport of r146151
svn path=/branches/mono-2-6/mcs/; revision=146153
2009-11-13 15:47:13 +00:00
Marek Habersack 03b9ccb25f Backport of r146148
svn path=/branches/mono-2-6/mcs/; revision=146149
2009-11-13 15:42:48 +00:00
Marek Habersack 310cc8b767 More fixes to make all 1.1 tests succeed
svn path=/branches/mono-2-6/mcs/; revision=146144
2009-11-13 15:21:06 +00:00
Marek Habersack 8577f45a0c Restore setting up shadow copying for 1.1 to fix failing tests
svn path=/branches/mono-2-6/mcs/; revision=146141
2009-11-13 14:24:33 +00:00
Marek Habersack a95609cfe9 1.1 build fix
svn path=/branches/mono-2-6/mcs/; revision=146138
2009-11-13 14:02:48 +00:00
Marek Habersack 70bf8472dd Backport of several fixes needed to make all 2.0 tests succeed
svn path=/branches/mono-2-6/mcs/; revision=146137
2009-11-13 14:00:23 +00:00
Marek Habersack f31512897b 1.1 build fix
svn path=/branches/mono-2-6/mcs/; revision=146134
2009-11-13 13:26:20 +00:00
Marek Habersack 482b4192d2 Backport of r146126
svn path=/branches/mono-2-6/mcs/; revision=146127
2009-11-13 12:57:10 +00:00
Zoltan Varga 4efab9d7d0 Add missing file to fix the build.
svn path=/branches/mono-2-6/mcs/; revision=146120
2009-11-13 10:42:26 +00:00
Zoltan Varga f948bdc1b0 2009-11-13 Zoltan Varga <[email protected]>
* mini-amd64.c (emit_call_body): Disable usage of near calls when running
	under XEN. Fixes #522894.

svn path=/branches/mono-2-6/mono/; revision=146110
2009-11-13 06:37:12 +00:00
Zoltan Varga 988ccf0b29 2009-11-13 Zoltan Varga <[email protected]>
* InvokeOptions.cs: New file.

	* ObjectMirror.cs TypeMirror.cs StructMirror.cs: Add support for passing flags
	to InvokeMethod ().

	* Connection.cs: Bump protocol version.

svn path=/branches/mono-2-6/mcs/; revision=146108
2009-11-13 06:31:57 +00:00
Zoltan Varga 7c41fdb7ae 2009-11-12 Zoltan Varga <[email protected]>
* VirtualMachineManager.cs: Put back the old Launch (string[], LaunchOptions)
	overload.

svn path=/branches/mono-2-6/mcs/; revision=146107
2009-11-13 06:31:50 +00:00
Zoltan Varga b66da756a1 2009-11-13 Zoltan Varga <[email protected]>
* debugger-agent.c: Add support for passing flags to invokes. Add a
	DISABLE_BREAKPOINTS flag. Bump protocol version.

svn path=/branches/mono-2-6/mono/; revision=146106
2009-11-13 06:29:42 +00:00
Zoltan Varga e955b6943c 2009-11-13 Zoltan Varga <[email protected]>
* processes.c: Include mono-path.h.

svn path=/branches/mono-2-6/mono/; revision=146102
2009-11-13 06:22:55 +00:00
Marek Habersack 9a707334fb Backport of r146092
svn path=/branches/mono-2-6/mcs/; revision=146093
2009-11-13 02:04:44 +00:00
Zoltan Varga 039bda3c65 2009-11-13 Zoltan Varga <[email protected]>
* debugger-agent.c (mono_debugger_agent_single_step_event): Avoid a crash if
	this is called on the debugger thread.

svn path=/branches/mono-2-6/mono/; revision=146091
2009-11-13 01:53:10 +00:00
Marek Habersack c854b9e2d0 Backport of r146086
svn path=/branches/mono-2-6/mcs/; revision=146087
2009-11-13 01:19:06 +00:00
Zoltan Varga a7422ba9bb 2009-11-12 Zoltan Varga <[email protected]>
* acinclude.m4 (dolt_supported): Handle 'i686-pc-cygwin' too.

svn path=/branches/mono-2-6/mono/; revision=146078
2009-11-12 22:46:33 +00:00
Geoff Norton b7922d723a 2009-11-12 Geoff Norton <[email protected]>
* mono-path.c: When resolving symlinks in a path, we need to
	split on the directory separator and check each level, as
	readlink only checks the final destination.

svn path=/branches/mono-2-6/mono/; revision=146067
2009-11-12 22:07:08 +00:00
Geoff Norton a232e26de1 2009-11-12 Geoff Norton <[email protected]>
* processes.c: match_procname_to_modulename should resolve
	symlinks when checking if two process modules match.

svn path=/branches/mono-2-6/mono/; revision=146066
2009-11-12 22:07:05 +00:00
Carlos Alberto Cortez e2c6f6e791 2009-11-12 Carlos Alberto Cortez <[email protected]>
* ComboBoxTest.cs: New test case for data binding and Text
	interaction.


svn path=/branches/mono-2-6/mcs/; revision=146047
2009-11-12 16:39:39 +00:00
Carlos Alberto Cortez 5b10b1d6a9 [merge the very last changes from trunk, -r 144884:145790]
2009-11-09  Carlos Alberto Cortez <[email protected]>
	
		* DataGridTextBoxColumn.cs:
		* DataGrid.cs: Position the cursor in the add row should *not* show
		yet another new row - that will happen till we get any real input data
		from the user. When that happens, we will also mark the new row as
		ready to commit - otherwise, when the cursor moves to a different row,
		the just added row will be discarded. This is exactly what .Net seems
		to do.

	2009-11-09  Carlos Alberto Cortez <[email protected]>

		* DataGrid.cs: The large value for our vertical scrollbar should
		depend on the number of visible rows, instead of trying to re-use the
		value of VisibleRowCount, which is the value of *current* visible
		rows, and can easily end messed up if new rows are added/removed.

	2009-11-09  Carlos Alberto Cortez <[email protected]>

		* DataGrid.cs: When moving the scroll, *dont* ever end the current
		edit - this could seriously mess up our current edit cycle, specially
		when adding new rows.

		2009-11-02  Carlos Alberto Cortez <[email protected]>

		* TabControl.cs: In OnKeyDown call the base implementation first -
		this way we let the user tell us whether we should handle the key or
		not.
		Fixes #543717.

	2009-11-02  Carlos Alberto Cortez <[email protected]>

		* DataGrid.cs: Implement removal of rows the Correct Way by creating a
		copy of the indexes, as any direct write access to the source will cause to
		reset the entire selection - also, do the linear de-selection in
		reverse order to avoid any index mismatch in the source, due to out of
		synchronization removing the rows.

	2009-11-02  Carlos Alberto Cortez <[email protected]>

		* DataGridTextBoxColumn.cs:
		* DataGrid.cs: Don't use this add-pending behaviour to try to add a
		new row until we have the first input char - it was helping us to fix
		other issues we have/had, but it's not matching .net.

	2009-10-30  Carlos Alberto Cortez <[email protected]>

		* TextBoxBase.cs: When returning the preferred height, and we are
		supposed to be borderless, return the TopMargin value - usually in
		borderless mode it has a value of 0, but in the ToolStrip controls we
		need to set the margin manually.
		Fixes #551214.

	2009-10-29  Carlos Alberto Cortez <[email protected]>

		* ToolTip.cs: ShowAlways works at the form level, not at the control
		level. Fixes #544565.

	2009-10-28  Carlos Alberto Cortez <[email protected]>

		* ButtonBase.cs: Usually the click routines are handled in Control,
		but in this class we are handling it ourselved, thus we need to have
		the same calls, and we were missing the call to MouseClick.
		Patch by Eric Petit <[email protected]>.

	2009-10-26  Carlos Alberto Cortez <[email protected]>

		* ComboBox.cs: When setting Text and data source is being used, if the
		passed value is not matching any of the items in the source, don't
		pass it to GetItemText, since it's useless, as GetItemText expects a
		valid item.
		Fixes #546009.

2009-11-12  Carlos Alberto Cortez <[email protected]>


svn path=/branches/mono-2-6/mcs/; revision=146046
2009-11-12 16:39:28 +00:00
Eric Maupin ee905d0c03 * System.Linq/Lookup.cs: Support null keys
* System.Linq/Enumerable.cs: Support null keys

svn path=/branches/mono-2-6/mcs/; revision=146040
2009-11-12 15:04:44 +00:00
Carlos Alberto Cortez f5628732ec 2009-11-12 Carlos Alberto Cortez <[email protected]>
[backport the improvements and speedups for ListView from trunk,
-r 142738:144115]

	2009-10-14  Carlos Alberto Cortez <[email protected]>

		* ListView.cs: When retrieving the top item, take into account the
		offset represented by the header control, to retrieve the proper
		value. Patch by Christoph von Wittich (Christoph at ApiViewer.de)
		Fixes the remaining bits of #543773.

		2009-10-14  Carlos Alberto Cortez <[email protected]>

		* ListView.cs: TopItem setter should set the value as the top, not
		only ensuring its visibility.
		Fixes part of #543773.

		2009-10-12  Carlos Alberto Cortez <[email protected]>

		* ListView.cs: For virtual mode, when navigating the items using keyboard,
		don't use the matrix of positions, and instead calculate the positions
		based on the number of cols and rows, taking advantage of the fixed
		positions of items. Use the same idea to implement FirstVisibleIndex,
		so we avoid iterating over all the items. Patch by Stephen Robinson
		mono at esar.org.uk.
		Fixes part of #467418.

		2009-10-07  Carlos Alberto Cortez <[email protected]>

		* ListView.cs: When computing the value for groups height don't use
		text_size field, since in LargeIcon view it sometimes contains a
		double height value - use Font.Height directly, and also improve the
		padding value.
		* ThemeWin32Classic: The same as above.
		This way the space between the group header, the line, and the items
		area is not that big in LargeIcon view.

		2009-10-04  Carlos Alberto Cortez <[email protected]>

		* ListView.cs: When retrieving the fixed positions for the items in
		virtual mode, use the row value to compute the coords of the item,
		instead of the col value, as opposed to SmallIcon/LargeIcon views.

		2009-09-29  Carlos Alberto Cortez <[email protected]>

		* ListView.cs: The location of the items should be computed on the fly
		in virtual mode - that decreased speed overall, but reduces the load
		time.that decreased speed overall, but reduces the load time. Also,
		handle the cases where we were using data structures we don't need to
		use/create for this mode.
		Fixes part of #467418.

		2009-09-28  Carlos Alberto Cortez <[email protected]>

		* ListView.cs: Tile view and VirtualMode can't be applied together.
		Patch by Stephen Robinson <[email protected]>.

		2009-09-28  Carlos Alberto Cortez <[email protected]>

		* ListView.cs: When calculating the layout for Details view, don't ask
		for the items *at all* in case we are in virtual mode. This should
		re-enable the proper behaviour of virtual mode.


svn path=/branches/mono-2-6/mcs/; revision=146038
2009-11-12 13:50:29 +00:00
Jb Evain 1c21cdd969 2009-11-12 Jb Evain <[email protected]>
* Aes.cs: avoid using an hardcoded assembly version for System.Core.


svn path=/branches/mono-2-6/mcs/; revision=146034
2009-11-12 12:34:20 +00:00
Jb Evain 1261df67de 2009-11-12 Jb Evain <[email protected]>
* Consts.cs.in: add a AssemblySystem_Core constant.


svn path=/branches/mono-2-6/mcs/; revision=146032
2009-11-12 12:33:00 +00:00
Geoff Norton d5fc6487e8 2009-11-11 Geoff Norton <[email protected]>
* VirtualMachineManager.cs: Refactor the APIs to have async methods.
	Remove a bunch of Listen overloads that are pointless.  Refactor
	Launch to take a ProcessStartInfo instead of string arguments.

svn path=/branches/mono-2-6/mcs/; revision=145991
2009-11-11 22:35:31 +00:00
Sebastien Pouliot c6cd62fc13 fix display of smcs errors
svn path=/branches/moon/moon-2-0/mcs/; revision=145959
2009-11-11 15:45:36 +00:00
Sebastien Pouliot 039addd678 2009-11-11 Sebastien Pouliot <[email protected]>
* Console.cs: Reduce duplication between OpenStandard[Input|
	Output|Error] and, for Moonlight, don't return a NullStream if
	security is disabled (e.g. when smcs executes)

	r: alan


svn path=/branches/mono-2-6/mcs/; revision=145957
2009-11-11 15:06:11 +00:00
Andrew Jorgensen b03bdf690a spec file fixes
svn path=/branches/mono-2-6/mono/; revision=145898
2009-11-10 23:18:21 +00:00
Geoff Norton 89feb05d76 Add ReaderWriterLockSlim to monotouch
svn path=/branches/mono-2-6/mcs/; revision=145891
2009-11-10 22:47:32 +00:00
Geoff Norton e214896cef restore iso-8859-1 to monotouch
svn path=/branches/mono-2-6/mcs/; revision=145880
2009-11-10 20:50:44 +00:00
Geoff Norton 664192081a cant use net_2_1_bootstrap as it does not include the pinvoke callback attribute
svn path=/branches/mono-2-6/mcs/; revision=145879
2009-11-10 20:50:17 +00:00
Rodrigo Kumpera a0abbe81d7 In .:
* reflection.c (mono_image_module_basic_init): Handle exceptions correctly.

	Backport of r145798.

2009-11-10  Rodrigo Kumpera  <[email protected]>

svn path=/branches/mono-2-6/mono/; revision=145857
2009-11-10 17:28:40 +00:00
Rodrigo Kumpera e72be115d0 In .:
2009-11-10  Rodrigo Kumpera  <[email protected]>
    
	* object-internals.h: Change signature for mono_string_to_utf8_image.
	* object.c (mono_string_to_utf8_image): Change signature to take a MonoError
	argument.

	* reflection.c: Take care of mono_string_to_utf8_image change and avoid raising
	exceptions due to mono_string_to_utf8.

	Backport of r145797.


svn path=/branches/mono-2-6/mono/; revision=145855
2009-11-10 17:27:16 +00:00
Rodrigo Kumpera 48017d25b5 In metadata:
* object-internals.h: Change signature for mono_string_to_utf8_mp.

    * object.c (mono_remote_class): Make sure all resources are released before
    raising an exception.

    * object.c (mono_print_unhandled_exception): Avoid raising an exception.

	Backport of r145796.

2009-11-09  Rodrigo Kumpera  <[email protected]>

svn path=/branches/mono-2-6/mono/; revision=145854
2009-11-10 17:17:52 +00:00
Rodrigo Kumpera 5a192ac3f9 In .:
* mono-perfcounters.c (network_get_impl): Change variable initialization
     ordering to fix potential memory leak in case of exceptions.
 
     * mono-perfcounters.c (mono_perfcounter_create): Properly handle badly
     encoded strings.
	Backport of r145795. 

2009-11-09  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=145849
2009-11-10 16:49:07 +00:00
Rodrigo Kumpera b22c806052 In .:
2009-11-09  Rodrigo Kumpera  <[email protected]>

    * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): Change
    variable initialization ordering to fix potential memory leak in case
    of exceptions.

	Backport of r145794.


svn path=/branches/mono-2-6/mono/; revision=145848
2009-11-10 16:44:33 +00:00
Rodrigo Kumpera 2673f937de In .:
* appdomain.c: Fix shadow path code to better deal with exceptions.

	Backport of r145658.

2009-11-10  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=145847
2009-11-10 16:43:06 +00:00
Rodrigo Kumpera 4589a8c5fb In .:
* appdomain.c: Use checked version of mono_string_to_utf8 to avoid raising an
    exception in the middle of the runtime code.

	Backport of r145657.

2009-11-10  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=145837
2009-11-10 14:23:39 +00:00
Rodrigo Kumpera 2a0e0be91f In .:
* icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): Don't
    leak memory with broken envvar value.

	Backport of r145656.

2009-11-10  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=145836
2009-11-10 14:18:13 +00:00
Marek Habersack 9b5480fbf4 Backport of r145831
svn path=/branches/mono-2-6/mcs/; revision=145832
2009-11-10 13:49:25 +00:00
Rodrigo Kumpera a206154c18 In .:
2009-11-10  Rodrigo Kumpera  <[email protected]>

	* object-internals.h: Add mono_string_to_utf8_checked.

	* object.c: Implement mono_string_to_utf8_checked.

	Backport of r145539.


svn path=/branches/mono-2-6/mono/; revision=145830
2009-11-10 13:38:30 +00:00
Rodrigo Kumpera eb657d1b71 In .:
2009-11-10 Rodrigo Kumpera  <[email protected]>
 
     * mono-error-internals.h: Add mono_error_set_argument and mono_error_raise_exception.
 
     * mono-error.h: Add new MONO_ERROR_ARGUMENT constant for
     ArgumentException.
 
     * mono-error.c: Implement mono_error_set_argument, mono_error_raise_exception.
 
     * mono-error.c (mono_error_prepare_exception) Init error_out at the beginning. Add support
     for MONO_ERROR_ARGUMENT.

	Backport of r145538.


svn path=/branches/mono-2-6/mono/; revision=145828
2009-11-10 13:31:37 +00:00
Marek Habersack 216c827113 Backport of r145824
svn path=/branches/mono-2-6/mcs/; revision=145825
2009-11-10 10:42:00 +00:00
Gonzalo Paniagua Javier b22d833768 2009-11-10 Gonzalo Paniagua Javier <[email protected]>
* Socket_2_1.cs: throw when shutting down a socket that is not
	connected. Don't linger if the socket is not connected.


svn path=/branches/mono-2-6/mcs/; revision=145808
2009-11-10 05:56:07 +00:00
Zoltan Varga b33b11f9d5 2009-11-10 Zoltan Varga <[email protected]>
* VirtualMachineManager.cs (Launch): Close the listening socket instead of
	shutting it down since Shutdown throws on exception on non-connected sockets
	in ms.net.

svn path=/branches/mono-2-6/mcs/; revision=145804
2009-11-10 04:50:37 +00:00
Zoltan Varga 5ed2d7937b 2009-11-06 Zoltan Varga <[email protected]>
* debugger-agent.c (resume_from_signal_handler): New helper function extracted
	from the single step/breakpoint handlers. Add a FIXME.

svn path=/branches/mono-2-6/mono/; revision=145791
2009-11-10 01:58:43 +00:00
Zoltan Varga 7dcae3becc 2009-11-10 Zoltan Varga <[email protected]>
* exceptions-arm.c (mono_arch_get_call_filter_full): Update after the
	LDMIA->LDM macro name change.

svn path=/branches/mono-2-6/mono/; revision=145789
2009-11-10 01:00:41 +00:00
Zoltan Varga eb92a1217d 2009-11-10 Zoltan Varga <[email protected]>
* arm/arm-codegen.h: Fix the names of the LDMIA/STMIA macros, they don't actually
	update the base register.

svn path=/branches/mono-2-6/mono/; revision=145788
2009-11-10 01:00:32 +00:00
Geoff Norton 9f97213017 Support building on 10.6
svn path=/branches/mono-2-6/mono/; revision=145785
2009-11-09 23:45:33 +00:00
Chris Toshok e0eee654e3 2009-11-09 Chris Toshok <[email protected]>
* Console.cs (OpenStandardError,OpenStandardOut,OpenStandardInput):
        for NET_2_1 && !MONOTOUCH, disable these streams unless a debugger
        is attached, or unless the MOONLIGHT_ENABLE_CONSOLE environment
        variable is defined.

        reviewed: alan
        


svn path=/branches/mono-2-6/mcs/; revision=145773
2009-11-09 21:17:17 +00:00
Marek Safar dc46c4ab7e Fixed dlr dist
svn path=/branches/mono-2-6/mcs/; revision=145768
2009-11-09 20:48:30 +00:00
Stephen Shaw 6ab9b9616d Added lc to spec file
svn path=/branches/mono-2-6/mono/; revision=145757
2009-11-09 18:16:16 +00:00
Stephen Shaw dcf3a9eceb add gcc-c++ dep (ajorg)
svn path=/branches/mono-2-6/mono/; revision=145753
2009-11-09 17:37:42 +00:00
Jonathan Pryor 63cd0a2589 * src/DbLinq.MySql/MysqlDataContext.cs: Delete.
* System.Data.Linq.dll.sources: Use src/DbLinq.MySql/MySqlDataContext.cs; 
	  fixes the build for case-insensitive filesystems.

svn path=/branches/mono-2-6/mcs/; revision=145749
2009-11-09 17:10:37 +00:00
Marek Habersack 2c23326622 Backport of r145740
svn path=/branches/mono-2-6/mcs/; revision=145741
2009-11-09 14:21:28 +00:00
Marek Habersack 52bff1dfe0 Backport of r145735
svn path=/branches/mono-2-6/mcs/; revision=145736
2009-11-09 13:36:48 +00:00
Marek Habersack a53f1b85a1 Backport of r145727
svn path=/branches/mono-2-6/mcs/; revision=145728
2009-11-09 12:31:23 +00:00
Marek Habersack 6c93b0c613 Backport r145721
svn path=/branches/mono-2-6/mcs/; revision=145722
2009-11-09 11:46:58 +00:00
Jb Evain 551c3e365a bring XslCompiledTransform to MonoTouch
svn path=/branches/mono-2-6/mcs/; revision=145712
2009-11-09 10:33:21 +00:00
Zoltan Varga 61715e57c9 2009-11-09 Zoltan Varga <[email protected]>
* mini-arm.c (mono_arch_allocate_vars): Fix the previous change by passing
	&align to mini_type_stack_size_full ().

svn path=/branches/mono-2-6/mono/; revision=145700
2009-11-09 02:04:12 +00:00
Zoltan Varga ea48e253e3 2009-11-08 Zoltan Varga <[email protected]>
* mini-arm.c: Compute the stack space used by arguments using
	mini_type_stack_size_full ().

svn path=/branches/mono-2-6/mono/; revision=145686
2009-11-08 22:37:29 +00:00
Zoltan Varga 46692f3796 2009-11-07 Zoltan Varga <[email protected]>
* driver.c (mono_jit_parse_options): New public API function to parse options
	as done by the runtime executable.

svn path=/branches/mono-2-6/mono/; revision=145654
2009-11-07 22:10:24 +00:00
Zoltan Varga 8ad7a5d34a 2009-11-07 Zoltan Varga <[email protected]>
* debugger-agent.c (buffer_add_cattrs): Fix reading an uninitialized variable
	when handling named arguments.

svn path=/branches/mono-2-6/mono/; revision=145652
2009-11-07 21:41:37 +00:00
Marek Safar e267e170ed 2009-11-07 Marek Safar <[email protected]>
A fix for bug #553465

	* expression.cs: Fixed mixed version of expression tree anonymous
	type.


svn path=/branches/mono-2-6/mcs/; revision=145646
2009-11-07 10:08:44 +00:00
Zoltan Varga 42f310d152 Add missing files.
svn path=/branches/mono-2-6/mcs/; revision=145642
2009-11-07 08:51:47 +00:00
Zoltan Varga 3dd4322874 2009-11-07 Zoltan Varga <[email protected]>
* Makefile (net_2_0_dirs): Add System.Data.Services.

svn path=/branches/mono-2-6/mcs/; revision=145634
2009-11-07 02:47:46 +00:00
Zoltan Varga 1136d59fc0 2009-11-07 Zoltan Varga <[email protected]>
*: Move .cs files to the System.Data.Services subdir to match their namespace,
	move tests to 'Test' from 'Tests', add Makefile.

svn path=/branches/mono-2-6/mcs/; revision=145633
2009-11-07 02:47:39 +00:00
Zoltan Varga b6d22a08d7 Added System.Data.Services sources
svn path=/branches/mono-2-6/mcs/; revision=145632
2009-11-07 02:47:23 +00:00
Jonathan Pryor f3194d60b5 * Makefile: re-enable the tests. They were disabled in r137153
because they weren't compiling, which was because System.Data.Linq
	  wasn't listing sqlmetal_net_2_0 as a friend assembly.  (Why this
	  built before I couldn't tell you...)  Fixed in latest S.D.L.

svn path=/branches/mono-2-6/mcs/; revision=145617
2009-11-06 21:51:49 +00:00
Jonathan Pryor 6d2aa53461 * src/**/*: Sync with DbLinq r1265. This fixes sqlmetal (it shouldn't
generate constructors referring to IVendor), enhances query support
	  so that extension methods can be used within 'select' blocks,
	  various FirebirdSQL fixes, etc.

svn path=/branches/mono-2-6/mcs/; revision=145616
2009-11-06 21:51:21 +00:00
Geoff Norton 3b38f04754 backport missing file for monotouch build
svn path=/branches/mono-2-6/mcs/; revision=145602
2009-11-06 16:59:31 +00:00
Marek Safar 1ad7c28cc7 2009-11-06 Marek Safar <[email protected]>
A fix for bug #553031

	* linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
	expression tree version of anonymous type with members declaration.


svn path=/branches/mono-2-6/mcs/; revision=145585
2009-11-06 13:21:30 +00:00
Marek Safar e7c6847d8c Updated.
svn path=/branches/mono-2-6/mcs/; revision=145583
2009-11-06 13:15:43 +00:00
Zoltan Varga e06b86c2e7 2009-11-06 Zoltan Varga <[email protected]>
* mini-arm.c debugger-agent.c: Android changes from Koushik K. Dutta
	([email protected]).

svn path=/branches/mono-2-6/mono/; revision=145575
2009-11-06 09:15:20 +00:00
Zoltan Varga 442a5c1927 2009-11-06 Zoltan Varga <[email protected]>
* mini-arm.c (handle_thunk): Add a domain argument to control the domain
	where the thunk memory should be allocated from. Fixes appdomain unloading
	on arm.

svn path=/branches/mono-2-6/mono/; revision=145570
2009-11-06 08:18:18 +00:00
Zoltan Varga af8b26cfce 2009-11-06 Zoltan Varga <[email protected]>
* mini-arm.c exceptions-arm.c: Make ctx->regs map directly to the 16 hardware
	registers, instead of r4..r11,ip,lr. Make restore_context () restore r0..r3 too.

svn path=/branches/mono-2-6/mono/; revision=145564
2009-11-06 06:03:03 +00:00
Geoff Norton aedff42490 2009-11-05 Geoff Norton <[email protected]>
* HttpsTransportBindingElement.cs: Implement basic https transport
	binding support for Moonlight and MonoTouch

svn path=/branches/mono-2-6/mcs/; revision=145558
2009-11-06 04:18:49 +00:00
Geoff Norton ac13a98236 2009-11-05 Geoff Norton <[email protected]>
* ClientRuntimeChannel.cs: Support OperationContext in async calls
        as well

svn path=/branches/mono-2-6/mcs/; revision=145557
2009-11-06 04:18:29 +00:00
Zoltan Varga 94a0a08a5a 2009-11-05 Rodrigo Kumpera <[email protected]>
* debugger-agent.c: Fix windows build.

svn path=/branches/mono-2-6/mono/; revision=145553
2009-11-05 22:19:03 +00:00
Zoltan Varga 8e89b3a0ca 2009-11-05 Zoltan Varga <[email protected]>
* mini-amd64.c (mono_arch_output_basic_block): Don't allow OP_SEQ_POINT in
	AOT, as it is not implemented yet.

	* mini-x86.c (mono_arch_output_basic_block): Ditto.

svn path=/branches/mono-2-6/mono/; revision=145552
2009-11-05 22:07:03 +00:00
Zoltan Varga 8c45bb18fe 2009-11-05 Zoltan Varga <[email protected]>
* debugger-agent.c (debugger_thread): Call mono_set_is_debugger_attached ()
	after the client connects/disconnects.

svn path=/branches/mono-2-6/mono/; revision=145551
2009-11-05 22:06:56 +00:00
Zoltan Varga a9a8ebac53 2009-11-05 Zoltan Varga <[email protected]>
* debugger-agent.c: Add an 'onthrow' option to start the debugger agent
	when an exception of a given type is thrown.

svn path=/branches/mono-2-6/mono/; revision=145550
2009-11-05 22:06:49 +00:00
Zoltan Varga b1769245b8 2009-11-05 Zoltan Varga <[email protected]>
* debugger-agent.c: Add a 'onuncaught' option to start the debugger agent
	only on an uncaught exception.

	* mini-exceptions.c: Notify the debugger agent on an uncaught exception.

svn path=/branches/mono-2-6/mono/; revision=145549
2009-11-05 22:06:42 +00:00
Zoltan Varga 404fd5363d 2009-11-05 Zoltan Varga <[email protected]>
* debugger-agent.c: Add a 'launch' option.

svn path=/branches/mono-2-6/mono/; revision=145548
2009-11-05 22:06:35 +00:00
Zoltan Varga b97e620cd1 2009-11-05 Zoltan Varga <[email protected]>
* debugger-agent.c: Add a 'timeout' option.

svn path=/branches/mono-2-6/mono/; revision=145547
2009-11-05 22:06:28 +00:00
Zoltan Varga d8b6135f69 2009-11-05 Zoltan Varga <[email protected]>
* debugger-agent.c: Implement the 'server' and 'suspend' options supported by
	the JDWP agent.

svn path=/branches/mono-2-6/mono/; revision=145546
2009-11-05 22:06:21 +00:00
Zoltan Varga f8dc6c2e12 2009-11-04 Zoltan Varga <[email protected]>
* mini-arm.c: Fix the arm build.

svn path=/branches/mono-2-6/mono/; revision=145545
2009-11-05 22:06:05 +00:00
Zoltan Varga 7053970b84 2009-11-04 Gonzalo Paniagua Javier <[email protected]>
* debugger-agent.c: defer including mono-mutex.h until we know the
	agent is supported.

svn path=/branches/mono-2-6/mono/; revision=145544
2009-11-05 22:05:48 +00:00
Zoltan Varga 082692d778 2009-11-04 Jonathan Chambers <[email protected]>
* debugger-agent.c: Changes to build on windows. Use mono-mutex instead
	of pthreads directly.

	* mini.c (mono_sigfpe_signal_handler): Changed signature of Windows
	exception handlers. Pass info argument.

	* mini.h: Adjust signatures of soft debugger functions to pass void*
	instead of siginfo_t. Adjust SIG_HANDLER_SIGNATURE on Windows.

	* mini-amd64.c (mono_arch_is_single_step_event): Adjust signature to pass void*
	instead of siginfo_t. Value is EXCEPTION_RECORD on Windows.
	(mono_arch_is_breakpoint_event): Adjust signature to pass void*
	instead of siginfo_t. Value is EXCEPTION_RECORD on Windows.

	* mini-amd64.h: Adjust MonoW32ExceptionHandler signature.

	* mini-x86.c (mono_arch_is_single_step_event): Adjust signature to pass void*
	instead of siginfo_t. Value is EXCEPTION_RECORD on Windows.
	(mono_arch_is_breakpoint_event): Adjust signature to pass void*
	instead of siginfo_t. Value is EXCEPTION_RECORD on Windows.

	* mini-x86.h: Adjust MonoW32ExceptionHandler signature.

	* exceptions-x86.c: Adjust W32_SEH_HANDLE_EX for new signature.

	* exceptions-amd64.c: Adjust W32_SEH_HANDLE_EX for new signature.

	* mono-semaphore.h: Skeleton implementation for Windows.

	Code contributed under MIT/X11 license.

svn path=/branches/mono-2-6/mono/; revision=145543
2009-11-05 22:05:28 +00:00
Sebastien Pouliot af1d4ea013 2009-11-05 Sebastien Pouliot <[email protected]>
* class.c: When CoreCLR is enabled don't call mono_init_com_types
	if MONO_CLASS_IS_IMPORT return true unless the type reside in 
	platform (trusted) code. Instead we return a TypeLoadException to
	be thrown later. This is the exception thrown by Silverlight 2 if
	a type, inside application (user) code is marked with [ComImport]
	[Backport r145534]


svn path=/branches/mono-2-6/mono/; revision=145535
2009-11-05 21:19:25 +00:00
Zoltan Varga f65ba83e60 2009-11-05 Zoltan Varga <[email protected]>
* icall.c (ves_icall_System_Diagnostics_Debugger_IsAttached_internal): Call
	mono_is_debugger_attached () too.

	* mono-debug.c (mono_is_debugger_attached): New helper function.
	(mono_set_is_debugger_attached): Ditto.

svn path=/branches/mono-2-6/mono/; revision=145523
2009-11-05 18:11:19 +00:00
Rodrigo Kumpera ea4b86c45a In metadata:
* class.c: Add missing check for load errors after every
	call to mono_class_setup_fields

	Fixes #552282.

	Backport of r145501.

2009-11-05  Rodrigo Kumpera  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=145516
2009-11-05 17:53:36 +00:00
Rolf Bjarne Kvinge 0eb5a45672 2009-11-05 Rolf Bjarne Kvinge <[email protected]>
* net_2_1_raw_System.Net.dll.sources: Add Consts.cs, Locale.cs and
	MonoTODOAttribute.cs to the build to fix ambiguous references to
	those types in corlib and System.dll. This way we'll use our own
	types.

svn path=/branches/mono-2-6/mcs/; revision=145487
2009-11-05 15:58:23 +00:00
Rodrigo Kumpera 7d6bcfe942 In .:
2009-11-05  Rodrigo Kumpera  <[email protected]>

	* metadata.c: Change event table schema to use TDOR for event type
	as this is what it's meant to be.

	* metadata.c (mono_metadata_compute_size): Change MONO_TABLE_ASSEMBLYPROCESSOR
	to MONO_TABLE_ASSEMBLYREFPROCESSOR, which is table that has a MONO_MT_TABLE_IDX
	entry.

	* metadata.c (mono_metadata_compute_size): Trim MT_TABLE_IDX of code that no
	longer makes sense: remove MONO_TABLE_EVENT and remove checks for non-existent
	rows in MONO_TABLE_GENERICPARAM.

	Fixes #552289.

	Backport of r145478.


svn path=/branches/mono-2-6/mono/; revision=145480
2009-11-05 13:57:06 +00:00
Rolf Bjarne Kvinge 4397219217 In mono/metadata:
2009-11-05  Rolf Bjarne Kvinge  <[email protected]>

	* culture-info-tables.h: regenerated.

In tools/locale-builder:
2009-11-05  Rolf Bjarne Kvinge  <[email protected]>

	* Driver.cs: Generate locale data for neutral cultures too. Moonlight
	requires it.

svn path=/branches/mono-2-6/mono/; revision=145468
2009-11-05 10:06:32 +00:00
Rolf Bjarne Kvinge e4c4eaa42c 2009-11-04 Rolf Bjarne Kvinge <[email protected]>
* CultureInfo.cs: Allow neutral cultures, and fix zh-Hans/zh-Hant
	- they're stored internally as zh-chs/zh-cht, and only visible as
	zh-Hans/zh-Hant. zh-CHS/zh-CHS are invalid cultures in SL.

svn path=/branches/mono-2-6/mcs/; revision=145465
2009-11-05 09:34:11 +00:00
Zoltan Varga 59fb647a1f 2009-11-05 Zoltan Varga <[email protected]>
* VirtualMachineManager.cs (Listen): Resurrect the old listen method.

svn path=/branches/mono-2-6/mcs/; revision=145460
2009-11-05 05:59:20 +00:00
Geoff Norton e87c31e9a9 fix the moonlight/mt builds
svn path=/branches/mono-2-6/mcs/; revision=145457
2009-11-05 04:59:55 +00:00
Zoltan Varga a2a81a55b3 2009-11-05 Zoltan Varga <[email protected]>
* VirtualMachineManager.cs (Connect): New method to connect to a runtime
	listening at the provided address.

svn path=/branches/mono-2-6/mcs/; revision=145454
2009-11-05 04:07:26 +00:00
Zoltan Varga f165c2b439 * src/gptrarray.c: implement g_ptr_array_remove_index_fast
* src/glib.h: fix g_ptr_array_remove_index_fast declaration
* test/ptrarray.c: new tests

2009-10-15 Andreia Gaita <[email protected]>

svn path=/branches/mono-2-6/mono/; revision=145452
2009-11-05 03:13:07 +00:00
Gonzalo Paniagua Javier ecff58cc2c 2009-11-04 Gonzalo Paniagua Javier <[email protected]>
* debug-helpers.c: avoid g_strdup() in mono_type_full_name().


svn path=/branches/mono-2-6/mono/; revision=145450
2009-11-05 00:53:54 +00:00
Gonzalo Paniagua Javier 87d2f0b3ff 2009-11-04 Gonzalo Paniagua Javier <[email protected]>
* aot-compiler.c: don't leak the value returned from
	mono_type_full_name().


svn path=/branches/mono-2-6/mono/; revision=145448
2009-11-05 00:36:48 +00:00
Zoltan Varga 832835b220 2009-11-05 Zoltan Varga <[email protected]>
* debugger-agent.c (set_breakpoint): Emit a log message.

svn path=/branches/mono-2-6/mono/; revision=145444
2009-11-05 00:21:19 +00:00
Rodrigo Kumpera be4a4d84ad In .:
* verify.c: Replace calls to mono_class_inflate_generic_type with
	mono_class_inflate_generic_type_checked. Fixes #480005.

	Backport of r144759 and r145284.

2009-11-04  Rodrigo Kumpera  <[email protected]>

svn path=/branches/mono-2-6/mono/; revision=145425
2009-11-04 20:25:15 +00:00
Rodrigo Kumpera b50b26823e In .:
2009-11-04  Rodrigo Kumpera  <[email protected]>
 
     * class-internals.h: Change signature of mono_class_inflate_generic_type_with_mempool to take
     a MonoError parameter.
 
     * class-internals.h: Add new mono_class_inflate_generic_type_checked version that can does proper error handling.
 
     * class.c (inflate_generic_type): Add a MonoError parameter. Don't assert on error, use new mono error machinery.
 
     * class.c (mono_class_inflate_generic_type_with_mempool): Add new MonoError parameter.
 
     * class.c, generics-sharing.c: Changes to handle mono_class_inflate_generic_type_with_mempool new signature.

	Backport of r144688 and r144755.


svn path=/branches/mono-2-6/mono/; revision=145424
2009-11-04 20:24:08 +00:00
Sebastien Pouliot 607df4fed0 2009-11-04 Sebastien Pouliot <[email protected]>
* string-icalls.c|h: Remove string internal calls that are not 
	used anymore by the class libraries.
	* icall.c: Remove System_Reflection_FieldInfo_internal_from_handle
	which is not used in the class librairies.
	* icall-def.h: Update tables.
	[Backport r145416]


svn path=/branches/mono-2-6/mono/; revision=145417
2009-11-04 19:34:06 +00:00
Rodrigo Kumpera ec0d78aa47 In .:
2009-11-04  Rodrigo Kumpera  <[email protected]>

	* reflection.c (fieldref_encode_signature): If field_image is NULL then
	the token is already properly encoded. Fixs 4.0 build.

	Backport of r145396.


svn path=/branches/mono-2-6/mono/; revision=145412
2009-11-04 19:11:47 +00:00
Rodrigo Kumpera f50e76c580 In .:
2009-11-04  Rodrigo Kumpera  <[email protected]>

	- Add kumpera's mono-error stuff to hopefully fix the build.

	Backport of r144696 by Jonathan Pobst  <[email protected]>


svn path=/branches/mono-2-6/mono/; revision=145411
2009-11-04 18:23:58 +00:00
Rodrigo Kumpera 740935759d In .:
2009-11-04 Rodrigo Kumpera  <[email protected]>

    * mono-error.c, mono-error.h, mono-error-internal.h: New error handling
    structures and functions.

    * Makefile.am: Add new files.


svn path=/branches/mono-2-6/mono/; revision=145410
2009-11-04 18:18:19 +00:00
Zoltan Varga ab2b9ae132 2009-11-04 Zoltan Varga <[email protected]>
* acinclude.m4 (dolt_supported): Applied patch from Kornél Pál
	<[email protected]>. Enable dolt on cygwin.

svn path=/branches/mono-2-6/mono/; revision=145400
2009-11-04 14:39:13 +00:00
Rolf Bjarne Kvinge c1f54f2585 2009-11-04 Rolf Bjarne Kvinge <[email protected]>
* locales.c (construct_number_format): Check if the number index is
	valid before trying to use it, if not, just return.

svn path=/branches/mono-2-6/mono/; revision=145388
2009-11-04 11:40:16 +00:00
Marek Habersack e23eb863d9 Backport of r145381
svn path=/branches/mono-2-6/mcs/; revision=145382
2009-11-04 09:50:30 +00:00
Miguel de Icaza 7f4ab42e17 Backport
svn path=/branches/mono-2-6/mcs/; revision=145372
2009-11-04 05:03:02 +00:00
Gonzalo Paniagua Javier 2af0c5e9dd 2009-11-03 Gonzalo Paniagua Javier <[email protected]>
* Socket_2_1.cs: stop any blocking thread before closing the socket.


svn path=/branches/mono-2-6/mcs/; revision=145370
2009-11-04 03:32:28 +00:00
Zoltan Varga c31c2edae7 2009-11-04 Zoltan Varga <[email protected]>
* aot-compiler.c (mono_save_xdebug_info): Bump the threshold for flushing
	debug info to 100 because 10 still slows down gdb too much.

svn path=/branches/mono-2-6/mono/; revision=145368
2009-11-04 02:59:41 +00:00
Rodrigo Kumpera c8b10edc24 2009-11-03 Rodrigo Kumpera <[email protected]>
* reflection.c (fieldref_encode_signature): Add new field_image parameter
	to indicate which assembly to use when resolving a custom-mod.

	Fixes handling of volatile fields used across assemblies as reported in #551513.

	Backport of r145337.


svn path=/branches/mono-2-6/mono/; revision=145362
2009-11-04 02:01:44 +00:00
Geoff Norton 895284ddbd ensure we add punctuation as characters, patch from john moshakis
svn path=/branches/mono-2-6/mcs/; revision=145360
2009-11-04 01:39:41 +00:00
Geoff Norton e1a5fc5aa4 remove confusing debug spew
svn path=/branches/mono-2-6/mcs/; revision=145357
2009-11-04 01:34:05 +00:00
Rodrigo Kumpera eecd4147be In metadata:
2009-11-03  Rodrigo Kumpera  <[email protected]>

	* class.c (mono_class_setup_methods): Only give a slot for virtual methods
	of interfaces. Fixes IKVM.

	* class.c (mono_class_setup_vtable_general): Improve debug spew.

	Backport of r145307.


svn path=/branches/mono-2-6/mono/; revision=145354
2009-11-04 01:25:33 +00:00
Gonzalo Paniagua Javier 496c69e0b2 add new library for windows
svn path=/branches/mono-2-6/mono/; revision=145350
2009-11-04 00:44:52 +00:00
Lluis Sanchez d5bf2c0713 2009-11-04 Lluis Sanchez <[email protected]>
* VirtualMachineManager.cs: Properly redirect standard output.


svn path=/branches/mono-2-6/mcs/; revision=145346
2009-11-03 23:56:20 +00:00
Geoff Norton 27c370a851 oops, backport using too
svn path=/branches/mono-2-6/mcs/; revision=145342
2009-11-03 23:19:23 +00:00
Geoff Norton d942242990 update to the latest listening api
svn path=/branches/mono-2-6/mcs/; revision=145340
2009-11-03 23:12:57 +00:00
Rodrigo Kumpera 9b03c346fd In .:
2009-11-03  Rodrigo Kumpera  <[email protected]>

	* simd-intrinsics.c (load_simd_vreg): Add extra argument to signal if
	the value was loaded from memory.

	* simd-intrinsics.c (simd_intrinsic_emit_setter): Store back to memory if
	the value was loader from there.

	* simd-intrinsics.c (simd_intrinsic_emit_shuffle): Fail correctly for Shuffle
	without constant swizzle.

	Backport of r145283.


svn path=/branches/mono-2-6/mono/; revision=145338
2009-11-03 22:48:19 +00:00
Sebastien Pouliot 67139125d4 2009-11-03 Sebastien Pouliot <[email protected]>
* SocketAsyncEventArgs.cs: Set error back to SocketError.Success
	once CheckEndPoint succeed.
	[Fix bug #549586]
	[Backport r145329]


svn path=/branches/mono-2-6/mcs/; revision=145330
2009-11-03 21:58:33 +00:00
Sebastien Pouliot 59d7404e1b backport r145313
svn path=/branches/mono-2-6/mcs/; revision=145314
2009-11-03 19:18:23 +00:00
Jb Evain b714fcf819 2009-11-03 Jb Evain <[email protected]>
* Mono.Tuner/CheckVisibility.cs: detect a throw_on_visibility_error
	linker parameter to decide whether or not throw when an error
	have been encountered.


svn path=/branches/mono-2-6/mcs/; revision=145303
2009-11-03 17:05:42 +00:00
Jb Evain ccb5ea5924 remove some cwl left over
svn path=/branches/mono-2-6/mcs/; revision=145302
2009-11-03 16:58:40 +00:00
Zoltan Varga 3e2ed5d493 2009-11-03 Zoltan Varga <[email protected]>
* aot-runtime.c (mono_aot_get_method): Refactor some code into a new helper
	function mono_aot_get_array_helper_from_wrapper ().

	* aot-compiler.c (add_generic_class): Refactor the code a bit, really emit
	array helper methods.

svn path=/branches/mono-2-6/mono/; revision=145299
2009-11-03 16:37:21 +00:00
Sebastien Pouliot de2e6c2658 2009-11-03 Sebastien Pouliot <[email protected]>
* AssemblyInfo.cs: Open up the internals to System.Net.dll (which
	needs Uri.IsDefaultPort) for NET_2_1 and remove it for 
	System.ComponentModel.DataAnnotations (again for NET_2_1)
	[Backport r145294]


svn path=/branches/mono-2-6/mcs/; revision=145295
2009-11-03 16:24:14 +00:00
Zoltan Varga ab3dc22a2c 2009-11-03 Zoltan Varga <[email protected]>
* Makefile: Don't define LIBRARY_PACKAGE so it gets installed normally.

svn path=/branches/mono-2-6/mcs/; revision=145293
2009-11-03 16:18:26 +00:00
Marek Habersack 5a8c7954b9 Backport of r145280
svn path=/branches/mono-2-6/mcs/; revision=145281
2009-11-03 12:13:44 +00:00
Zoltan Varga 45e7a987de 2009-11-03 Zoltan Varga <[email protected]>
* debugger-agent.c: Include netinet/in.h to fix the bsd build.

svn path=/branches/mono-2-6/mono/; revision=145270
2009-11-03 05:31:33 +00:00
Zoltan Varga 285052b5c6 2009-11-03 Zoltan Varga <[email protected]>
* configure.in: Check for netinet/in.h.

svn path=/branches/mono-2-6/mono/; revision=145268
2009-11-03 05:27:28 +00:00
Zoltan Varga be45adc365 2009-11-03 Zoltan Varga <[email protected]>
* debugger-agent.c: Add support for filtering events by assemblies.

svn path=/branches/mono-2-6/mono/; revision=145259
2009-11-03 02:22:45 +00:00
Zoltan Varga 674da8fdc4 2009-11-03 Zoltan Varga <[email protected]>
* debugger-agent.c (mono_debugger_agent_thread_interrupt): Return false if
	the agent is not enabled.

svn path=/branches/mono-2-6/mono/; revision=145258
2009-11-03 02:22:38 +00:00
Zoltan Varga 88e041c46e LAST one!
svn path=/branches/mono-2-6/mono/; revision=145256
2009-11-03 02:22:32 +00:00
Zoltan Varga ebb0681764 one more
svn path=/branches/mono-2-6/mono/; revision=145255
2009-11-03 02:22:27 +00:00
Zoltan Varga dcac4ba42c 2009-11-02 Gonzalo Paniagua Javier <[email protected]>
* exceptions-x86.c: hopefully last change to fix the windows build.
	This one courtesy of Jonathan Chambers.

svn path=/branches/mono-2-6/mono/; revision=145254
2009-11-03 02:22:20 +00:00
Zoltan Varga cb0b45a4e3 2009-11-02 Gonzalo Paniagua Javier <[email protected]>
* debugger-agent.c: remove unused function.

svn path=/branches/mono-2-6/mono/; revision=145253
2009-11-03 02:22:14 +00:00
Zoltan Varga e5e32696e1 2009-11-02 Gonzalo Paniagua Javier <[email protected]>
* debugger-agent.c: add #ifdefs for a few header files.
	* mini-x86.h: disable the soft debugger in windows.
	Step 1 of 2 to make this compile on windows with gcc.

svn path=/branches/mono-2-6/mono/; revision=145252
2009-11-03 02:22:07 +00:00
Zoltan Varga 3fe9da1a6b 2009-11-02 Gonzalo Paniagua Javier <[email protected]>
* configure.in: add a few missing header file checks.

svn path=/branches/mono-2-6/mono/; revision=145251
2009-11-03 02:22:01 +00:00
Zoltan Varga b6a7fc1f8a 2009-07-01 Zoltan Varga <[email protected]>
Merge the soft debugger branch.

	* debugger-agent.h debugger-agent.c: New files containing the soft
	mode debugger module.

	* method-to-ir.c (mono_method_to_ir): Generate OP_SEQ_POINT opcodes
	at the appropriate locations.

	* mini-<ARCH>.c (mono_arch_output_basic_block): Handle OP_SEQ_POINT
	opcode.

	* mini-<ARCH>.c: Add new arch-specific functions to set/clear breakpoints,
	enable/disable single stepping.

	* exceptions-<ARCH>.c (mono_arch_find_jit_info_ext): New stack unwinding api
	which returns all information in a StackFrameInfo structure, and can handle the
	LMF frames added by the debugger.

	* mini-<ARCH>.h (MonoLMFExt): New structure containing additional information
	about an LMF frame.

	* mini-exceptions.c (mono_jit_walk_stack_from_ctx_in_thread): New stack
	walker function which works on a specific thread and passes a StackFrameInfo
	structure to its callback.

	* mini.c (mini_init): Initialize the debugger agent.

	* aot-compiler.c aot-runtime.c: Add soft-debug support.

	* mini-ops.h: Add OP_SEQ_POINT opcode.

	* driver.c (mono_main): Add new '--debugger-agent' option for passing
	arguments to the debugger agent.

svn path=/branches/mono-2-6/mono/; revision=145249
2009-11-03 02:18:50 +00:00
Zoltan Varga d730a668b1 2009-11-03 Zoltan Varga <[email protected]>
* EventRequest.cs (AssemblyFilter): New property to filter
	events based on a list of assemblies.

	* Connection.cs: Add assembly filters to the protocol implementation.

svn path=/branches/mono-2-6/mcs/; revision=145245
2009-11-03 01:55:39 +00:00
Zoltan Varga 9f98591560 2009-11-03 Zoltan Varga <[email protected]>
* Makefile: Move Mono.Debugger.Soft to net_2_0_dirs for 2.6.

svn path=/branches/mono-2-6/mcs/; revision=145238
2009-11-03 01:11:04 +00:00
Zoltan Varga 2335431b38 2009-11-02 Zoltan Varga <[email protected]>
* Makefile: Add Mono.Debugger.Soft.

In Mono.Debugger.Soft:

2009-11-02  Zoltan Varga  <[email protected]>

	* New directory containing the managed interface to the soft-mode debugger.

svn path=/branches/mono-2-6/mcs/; revision=145237
2009-11-03 01:10:25 +00:00
Zoltan Varga 0abadb40a1 2009-11-02 Zoltan Varga <[email protected]>
* debug-mono-symfile.c (check_line): Fix the handling of IL offset 0.

	* threads.c (mono_thread_attach): Call the profiler thread start callback.

	* object-internals.h (_MonoThreadInternal): Add a 'flags' field.

	* threads.c (build_wait_tids): Ignore threads which have the DONT_MANAGE
	flag set.

	* profiler.c: Add new profiler callbacks for runtime invoke.

	* object.c (mono_runtime_invoke): Call the runtime invoke callbacks.

svn path=/branches/mono-2-6/mono/; revision=145233
2009-11-03 00:35:00 +00:00
Sebastien Pouliot 2f3a1b3dbf 2009-11-02 Sebastien Pouliot <[email protected]>
* Thread.cs (set_CurrentUICulture): Delay setting in_currentculture
	to true until after the null check and the return statement.


svn path=/branches/mono-2-6/mcs/; revision=145215
2009-11-02 20:06:05 +00:00
Jb Evain 26cae340b4 2009-11-02 Jb Evain <[email protected]>
* Mono.Tuner/MoonlightAssemblyStep.cs: adapt to the MT linker merge.


svn path=/branches/mono-2-6/mcs/; revision=145210
2009-11-02 16:19:48 +00:00
Jb Evain f21d6449fa 2009-11-02 Jb Evain <[email protected]>
Merge the MonoTouch Linker branch.

	* monolinker.exe.sources: update

	* Mono.Linker/Annotations.cs:
		- add an preserved methods annotation on a type.
		- add an annotation to get the base methods of a method.
		- add an annotation to get the overriden method of a method.

	* Mono.Linker/AssemblyAction.cs:
		add a Delete action to remove an assembly from the output set.

	* Mono.Linker.Steps/TypeMapStep.cs:
		new step that create a map of virtual methods implementation.

	* Mono.Linker.Steps/MarkStep.cs:
		- removal of virtual methods.
		- fix for custom attributes assigning properties and field
			defined in a base type.
		- mark scopes.
		- mark default constructors of types used as a generic instance
			of a generic parameter constrained with new().
		- apply preserved methods.

	* Mono.Linker.Steps/SweepStep.cs: remove unused assemblies.

	* Mono.Linker.Steps/LoadI18nAssemblies.cs:
		fix linking of i18n assemblies.

	* Mono.Linker.Steps/OutputStep.cs:
		fix the copied assemblies when the output directory
		is the same as the origin of the assemblies.

	* Mono.Linker.Steps/ResolveFromXmlStep.cs
	* Mono.Linker.Steps/ResolveFromAssemblyStep.cs
	* Mono.Linker.Steps/BaseStep.cs
	* Mono.Linker/Driver.cs
	* Mono.Linker/Pipeline.cs:
		Cosmetics.


svn path=/branches/mono-2-6/mcs/; revision=145209
2009-11-02 16:19:15 +00:00
Zoltan Varga 3e7cea1232 2009-11-02 Zoltan Varga <[email protected]>
* mini.c (mini_method_compile): Disable llvm for methods with an lmf here to
	speed things up.

	* mini-llvm.c (mono_llvm_emit_method): Add support for OP_LOCALLOC.

svn path=/branches/mono-2-6/mono/; revision=145197
2009-11-02 12:45:00 +00:00
Zoltan Varga a988a10992 2009-11-02 Zoltan Varga <[email protected]>
* mini.c (mini_init): Avoid using the IMT trampoline in the LLVM case.

	* mini-trampolines.c (mono_llvm_vcall_trampoline): Add a static rgctx trampoline
	if needed.
	(mono_create_llvm_imt_trampoline): New function to create a trampoline which
	sets the IMT argument and makes a virtual call.

	* mini-llvm.c: Enable interface calls using the llvm imt trampoline.

svn path=/branches/mono-2-6/mono/; revision=145192
2009-11-02 12:00:45 +00:00
Zoltan Varga 7e07d13efe Fix the 2.6 build.
svn path=/branches/mono-2-6/mono/; revision=145177
2009-11-01 19:28:01 +00:00
Zoltan Varga b33f8408a7 2009-11-01 Zoltan Varga <[email protected]>
* configure.in: Make the LLVM warning a bit more up-to-date.

svn path=/branches/mono-2-6/mono/; revision=145176
2009-11-01 19:25:06 +00:00
Zoltan Varga ff6805c6d2 2009-11-01 Zoltan Varga <[email protected]>
* Makefile.am (llvm_sources): Enable the llvm option since it no longer breaks
	the windows build.

svn path=/branches/mono-2-6/mono/; revision=145174
2009-11-01 19:16:47 +00:00
Zoltan Varga b25ad6aaff 2009-11-01 Zoltan Varga <[email protected]>
* configure.in: Pass -mno-cygwin to CXX too on windows. Enable AC_PROG_CXX
	since it now works on windows too.

svn path=/branches/mono-2-6/mono/; revision=145173
2009-11-01 19:16:40 +00:00
Sebastien Pouliot f80650fa1e 2009-11-01 Sebastien Pouliot <[email protected]>
* MoonIsolatedStorageFile.cs: Add new CheckSearchPattern 
	validation method. Fix GetDirectoryNames to behave like 
	GetFileNames wrt searchPattern
	[Backport r145167]


svn path=/branches/mono-2-6/mcs/; revision=145168
2009-11-01 16:47:10 +00:00
Sebastien Pouliot 7f7c90c70e 2009-11-01 Sebastien Pouliot <[email protected]>
* ResourceManager.cs (GetResourceFilePath): Don't use 
	'resourceDir' which should always be null for Moonlight
	[Backport r145165]


svn path=/branches/mono-2-6/mcs/; revision=145166
2009-11-01 16:46:04 +00:00
Miguel de Icaza 31dd3aca62 Backport: 2009-10-31 Miguel de Icaza <[email protected]>
* threads.c: refactor the code that initializes the
	thread_start_args into a reusable function and use this in the two
	methods that start up threads.

svn path=/branches/mono-2-6/mono/; revision=145155
2009-10-31 22:36:20 +00:00
Zoltan Varga 84465817b5 2009-10-25 Zoltan Varga <[email protected]>
* threads.c (start_wrapper): Avoid an assert if thread_start_args () is NULL.

svn path=/branches/mono-2-6/mono/; revision=145151
2009-10-31 22:04:24 +00:00
Sebastien Pouliot cd862e8258 2009-10-31 Sebastien Pouliot <[email protected]>
* BinaryCommon.cs: Disable MONO_REFLECTION_SERIALIZER override 
	for Moonlight plugin.
	[Backport r145147]


svn path=/branches/mono-2-6/mcs/; revision=145148
2009-10-31 16:20:57 +00:00
Zoltan Varga 038367c545 2009-10-31 Zoltan Varga <[email protected]>
* appdomain.c (mono_domain_try_unload): Applied patch from Romain Tartière.
	Fix returning when WaitForSingleObjectEx returns WAIT_IO_COMPLETION.

svn path=/branches/mono-2-6/mono/; revision=145144
2009-10-31 14:13:11 +00:00
Gonzalo Paniagua Javier ed232ae225 2009-10-31 Gonzalo Paniagua Javier <[email protected]>
* mono-perfcounters.c: add the "_Total" instance for CPU counters.
	Until now, we only had the per-cpu(core) counters.

2009-10-30 Gonzalo Paniagua Javier <[email protected]>

	* mono-proclib.c: hz is only multiplied by the number of cpus when
	requesting "_Total".

	Fixes bug #523520.

svn path=/branches/mono-2-6/mono/; revision=145135
2009-10-31 04:06:56 +00:00
Veerapuram Varadhan c6c53d568b backport of r145122
svn path=/branches/mono-2-6/mcs/; revision=145123
2009-10-30 20:58:47 +00:00
Sebastien Pouliot e64e6483ce 2009-10-30 Sebastien Pouliot <[email protected]>
* MethodBuilderTest.cs: Add (copy from TypeBuilderTest) test 
	cases for two DefineGenericParameters
	[Backport r145118]


svn path=/branches/mono-2-6/mcs/; revision=145120
2009-10-30 20:13:40 +00:00
Sebastien Pouliot 17626ad634 2009-10-30 Sebastien Pouliot <[email protected]>
* MethodBuilder.cs: Add missing 'names' validations in 
	DefineGenericParameters
	[Backport r145118]


svn path=/branches/mono-2-6/mcs/; revision=145119
2009-10-30 20:12:48 +00:00
Marek Habersack 62509d7f33 Backport of r145109
svn path=/branches/mono-2-6/mcs/; revision=145111
2009-10-30 15:59:01 +00:00
Zoltan Varga e980095ec9 2009-10-30 Zoltan Varga <[email protected]>
* mini.c (mini_cleanup): Call profiler shutdown before shutting down the
	runtime. Fixes #551228.

svn path=/branches/mono-2-6/mono/; revision=145104
2009-10-30 15:19:30 +00:00
Sebastien Pouliot f0a8a458d1 2009-10-30 Sebastien Pouliot <[email protected]>
* MonoMethod.cs: Remove CAS check in MonoCMethod.Invoke (just 
	like it was done for MonoMethod.Invoke sister method)
	[Backport r145101]


svn path=/branches/mono-2-6/mcs/; revision=145102
2009-10-30 15:05:39 +00:00
Sebastien Pouliot c05d8961d5 MonoType.cs: Don't pass null value to icalls GetCorrespondingInflated[Constructor|Method]
svn path=/branches/mono-2-6/mcs/; revision=145100
2009-10-30 15:03:58 +00:00
Chris Toshok 90d3f7a97e 2009-10-29 Chris Toshok <[email protected]>
* TypeMap.cs (Deserialize): use
        FormatterServices.GetUninitializedObject instead of
        Activator.CreateInstance, since we shouldn't be invoking the
        default ctor.


svn path=/branches/mono-2-6/mcs/; revision=145077
2009-10-30 05:04:17 +00:00
Andreia Gaita e18c231fc8 * DataContractJsonSerializer.cs: SL accepts keys without "", so tweak
the data to fix the quotes before passing it to the deserializer
[backported from r145075]

svn path=/branches/mono-2-6/mcs/; revision=145076
2009-10-30 02:26:30 +00:00
Veerapuram Varadhan 385d93e3bc backport of r145072
svn path=/branches/mono-2-6/mcs/; revision=145073
2009-10-30 01:09:16 +00:00
Marek Habersack b066dcaa56 Backport of r145069
svn path=/branches/mono-2-6/mcs/; revision=145070
2009-10-30 00:53:35 +00:00
Veerapuram Varadhan 13dd868c42 backport of r145064
svn path=/branches/mono-2-6/mcs/; revision=145065
2009-10-29 20:54:40 +00:00
Veerapuram Varadhan 4471cba319 backport of r145054
svn path=/branches/mono-2-6/mcs/; revision=145055
2009-10-29 18:39:28 +00:00
Sebastien Pouliot 20f61ae832 2009-10-29 Sebastien Pouliot <[email protected]>
* CompareInfoTest.cs: Add test cases to validate parameters
	[Backport r145023]


svn path=/branches/mono-2-6/mcs/; revision=145026
2009-10-29 14:14:43 +00:00
Sebastien Pouliot 2825f28523 2009-10-29 Sebastien Pouliot <[email protected]>
* CompareInfo.cs: Add/fix CompareOptions validations. Reduce code
	duplication in Compare methods (wrt CompareOptions). Fix 
	calculation bug	in Compare(string,int.string,int,CompareOptions).
	[Backport r145023]


svn path=/branches/mono-2-6/mcs/; revision=145025
2009-10-29 14:13:52 +00:00
Zoltan Varga 3871e25478 2009-10-29 Zoltan Varga <[email protected]>
* mini-x86.c (mono_arch_output_basic_block): Fix % 1. Fixes #550970.

	* basic.cs: Add a test.

svn path=/branches/mono-2-6/mono/; revision=145018
2009-10-29 13:08:46 +00:00
Sebastien Pouliot 9d1b407625 2009-10-29 Sebastien Pouliot <[email protected]>
* ModuleBuilderTest.cs: Add test cases for GetType overloads
	* TypeBuilderTest.cs: Remove NotWorking from two 
	DefineGenericParameters test case.
	[Backport r145013]


svn path=/branches/mono-2-6/mcs/; revision=145015
2009-10-29 12:53:47 +00:00
Sebastien Pouliot d24244af13 2009-10-29 Sebastien Pouliot <[email protected]>
* ModuleBuilder.cs: Add missing 'className' validations in GetType
	* TypeBuilder.cs: Add missing 'names' validations in 
	DefineGenericParameters
	[Backport r145013]


svn path=/branches/mono-2-6/mcs/; revision=145014
2009-10-29 12:52:54 +00:00
Veerapuram Varadhan cbbc5a16a6 backport r145011
svn path=/branches/mono-2-6/mcs/; revision=145012
2009-10-29 12:49:27 +00:00
Sebastien Pouliot c27526153b 2009-10-29 Sebastien Pouliot <[email protected]>
* FileStream.cs: Reduce code duplication by merging FillBuffer 
	with FillBufferToStream
	[Backport r145008]


svn path=/branches/mono-2-6/mcs/; revision=145010
2009-10-29 12:15:23 +00:00
Zoltan Varga d7b68fa40b 2009-10-29 Zoltan Varga <[email protected]>
* method-to-ir.c (mono_method_to_ir): Use EMIT_NEW_LOAD_MEMBASE_TYPE to
	load vtypes instead if OP_LOADV_MEMBASE in the implementation of
	CONSTRAINED. Fixes #550964.

	* generics.cs: Add a test.

svn path=/branches/mono-2-6/mono/; revision=145007
2009-10-29 12:09:16 +00:00
Jb Evain 0ea412d547 2009-10-29 Jb Evain <[email protected]>
* ActivationServices.cs: avoid a static constructor.


svn path=/branches/mono-2-6/mcs/; revision=145003
2009-10-29 10:49:36 +00:00
Marek Safar 73ebfb6251 2009-10-29 Marek Safar <[email protected]>
A fix for bug #550580	
	* convert.cs: Don't eliminate explicit precission casts.


svn path=/branches/mono-2-6/mcs/; revision=144997
2009-10-29 10:01:04 +00:00
Marek Safar b81781bbe4 Updated.
svn path=/branches/mono-2-6/mcs/; revision=144996
2009-10-29 10:00:46 +00:00
Veerapuram Varadhan 7c712848f1 backport of r144980
svn path=/branches/mono-2-6/mcs/; revision=144981
2009-10-29 02:13:28 +00:00
Lluis Sanchez f46f770b16 2009-10-28 Lluis Sanchez Gual <[email protected]>
* MarshalByRefObject.cs: In InitializeLifetimeService, if a lease
	exists for the object return it, instead of always creating
	a new one. Fixes bug #544357.


svn path=/branches/mono-2-6/mcs/; revision=144963
2009-10-28 18:40:05 +00:00
Marek Habersack b7ef95a35d Backport of r144947
svn path=/branches/mono-2-6/mcs/; revision=144948
2009-10-28 14:01:48 +00:00
Sebastien Pouliot 1cf1d66a3e 2009-10-28 Sebastien Pouliot <[email protected]>
* FileStream.cs: Move code to deal with 'anonymous' filenames
	into two methods (returning the path, fullpath or only the 
	filename). Default Moonlight to anonymous (not only for isolated
	storage) unless the coreclr is disable (e.g. smcs)
	[Backport r144945]


svn path=/branches/mono-2-6/mcs/; revision=144946
2009-10-28 13:42:56 +00:00
Marek Habersack 3afb337dec Fix 1.1 build
svn path=/branches/mono-2-6/mcs/; revision=144939
2009-10-28 12:05:39 +00:00
Marek Habersack b213aa0bf2 Backport of r144935
svn path=/branches/mono-2-6/mcs/; revision=144936
2009-10-28 10:37:37 +00:00
Marek Habersack 423ea8af8e Backport of r144932
svn path=/branches/mono-2-6/mcs/; revision=144933
2009-10-28 10:19:34 +00:00
Sebastien Pouliot a5727b1062 2-6 still supports 1.1 profile...
svn path=/branches/mono-2-6/mcs/; revision=144929
2009-10-28 01:03:05 +00:00
Sebastien Pouliot c3d41f08f9 2009-10-27 Sebastien Pouliot <[email protected]>
* StringTest.cs: Add test case for methods that can return
	empty strings.
	[Backport r144921]


svn path=/branches/mono-2-6/mcs/; revision=144925
2009-10-27 23:46:18 +00:00
Sebastien Pouliot 9de4121212 2009-10-27 Sebastien Pouliot <[email protected]>
* UnicodeEncodingTest.cs: Add test cases with an odd number of 
	bytes being used in GetString (it does not crash but it does not
	work like MS FX either).
	[Backport r144921]


svn path=/branches/mono-2-6/mcs/; revision=144924
2009-10-27 23:45:41 +00:00
Sebastien Pouliot a29c9418a8 2009-10-27 Sebastien Pouliot <[email protected]>
* String.cs: Remove unused (and unneeded) internal call defs.
	Reduce duplication (and fix test) for Concat (object,object).
	Avoid allocating zero-length strings in the cases where the
	FX does not do so.
	[Backport r144921]


svn path=/branches/mono-2-6/mcs/; revision=144923
2009-10-27 23:45:00 +00:00
Sebastien Pouliot 38087128b7 2009-10-27 Sebastien Pouliot <[email protected]>
* TextInfo.cs: Avoid allocating zero-length strings in ToLower 
	and ToUpper methods
	[Backport r144921]


svn path=/branches/mono-2-6/mcs/; revision=144922
2009-10-27 23:43:47 +00:00
Veerapuram Varadhan e3783491dc 2009-10-28 Veerapuram Varadhan <[email protected]>
** Fixes #385028/#385029
	* DbCommandBuilder.cs (CreateInsertCommand): Workaround for inserting
	DEFAULT values to non-null-columns.
	(GetInsertCommand): New overload added to handle above workaround.
	(set_DataAdapter): Register for the RowUpdatingEventHandler.

svn path=/branches/mono-2-6/mcs/; revision=144917
2009-10-27 21:21:27 +00:00
Marek Habersack 5c80561e2e Backport of r144898
svn path=/branches/mono-2-6/mcs/; revision=144899
2009-10-27 13:10:55 +00:00
Marek Habersack 45aeaa1253 Backport of r144894
svn path=/branches/mono-2-6/mcs/; revision=144895
2009-10-27 09:56:10 +00:00
Zoltan Varga f1a66b8ed5 Really fix the osx build.
svn path=/branches/mono-2-6/mono/; revision=144874
2009-10-26 20:08:00 +00:00
Zoltan Varga b2cc33d3db Fix osx build.
svn path=/branches/mono-2-6/mono/; revision=144872
2009-10-26 20:00:59 +00:00
Zoltan Varga cd6613509c In libgc:
2009-10-25  Zoltan Varga  <[email protected]>

	* misc.c (GC_get_suspend_signal): New API function to return the suspend signal
	used by libgc.

In mono/mini:

2009-10-25  Zoltan Varga  <[email protected]>

	* mini-posix.c (add_signal_handler): Delay the GC suspend signal while
	executing a SIGSEGV handler on an altstack, since libgc can't handle that.

In mono/tests:

2009-10-25  Zoltan Varga  <[email protected]>

	* misc.c (GC_get_suspend_signal): New API function to return the suspend signal
	used by libgc.

svn path=/branches/mono-2-6/mono/; revision=144871
2009-10-26 20:00:51 +00:00
Zoltan Varga d8da3eab41 2009-10-25 Zoltan Varga <[email protected]>
* threads.c (start_wrapper): Call mono_profiler_thread_start () later after
	signalling start_notify.

svn path=/branches/mono-2-6/mono/; revision=144870
2009-10-26 20:00:40 +00:00
Sebastien Pouliot ae40d18e07 2009-10-26 Sebastien Pouliot <[email protected]>
* Assembly.cs: Share code between GetSatelliteAssembly and 
	GetSatelliteAssemblyNoThrow. For Moonlight ensure both 
	GetManifestResourceStream and GetSatelliteAssembly don't load
	anything "below" the assembly path.
	[Backport r144845]


svn path=/branches/mono-2-6/mcs/; revision=144846
2009-10-26 12:11:50 +00:00
Sebastien Pouliot a89a5936ac 2009-10-26 Sebastien Pouliot <[email protected]>
* Consts.cs.in: Update SL2 FX version to the second (and last)
	released version.
	[Backport r144843]


svn path=/branches/mono-2-6/mcs/; revision=144844
2009-10-26 12:03:41 +00:00
Sebastien Pouliot 5880e4bf3c 2009-10-26 Sebastien Pouliot <[email protected]>
* InterlockedTest.cs: Add test case for generic methods
	CompareExchange and Exchange
	[Backport r144840]


svn path=/branches/mono-2-6/mcs/; revision=144842
2009-10-26 11:57:12 +00:00
Sebastien Pouliot dc7d62f122 TypeTest.cs: New. Add test cases for IsInstanceOfType
svn path=/branches/mono-2-6/mcs/; revision=144841
2009-10-26 11:56:37 +00:00
Sebastien Pouliot 796a9ea860 2009-10-25 Sebastien Pouliot <[email protected]>
* ThreadTest.cs: Add test cases for Current[UI]Culture (not 
	working), Name, Join, Sleep and SpinWait
	[Backport r144824]


svn path=/branches/mono-2-6/mcs/; revision=144826
2009-10-25 16:43:07 +00:00
Sebastien Pouliot 2548566d31 2009-10-25 Sebastien Pouliot <[email protected]>
* Thread.cs: Fix validations for Join and Sleep overloads
	[Backport r144824]


svn path=/branches/mono-2-6/mcs/; revision=144825
2009-10-25 16:42:04 +00:00
Geoff Norton fe8c4d8126 make uri no braindead on mt
svn path=/branches/mono-2-6/mcs/; revision=144815
2009-10-24 21:25:05 +00:00
Gonzalo Paniagua Javier dff48874e3 2009-10-24 Gonzalo Paniagua Javier <[email protected]>
marshal.c: BeginInvoke cannot be called on multicast delegates with
	multiple targets. Fixes bug #574426.
	Backported from trunk.


svn path=/branches/mono-2-6/mono/; revision=144812
2009-10-24 20:52:26 +00:00
Gonzalo Paniagua Javier 8c2cc0f8b1 2009-10-24 Gonzalo Paniagua Javier <[email protected]>
* appdomain.c: do not test the st_mode field for shadow-copies.
	Fixes bug #545276.


svn path=/branches/mono-2-6/mono/; revision=144809
2009-10-24 20:04:31 +00:00
Gonzalo Paniagua Javier 94beec4383 2009-10-24 Gonzalo Paniagua Javier <[email protected]>
* DeflateStreamTest.cs: test from bug #549492.


svn path=/branches/mono-2-6/mcs/; revision=144803
2009-10-24 17:26:56 +00:00
Gonzalo Paniagua Javier 7ec5d41688 2009-10-24 Gonzalo Paniagua Javier <[email protected]>
* zlib-helper.c: stop trying to decompress when we get Z_STREAM_END.
	Patch by Ives Bastide. Fixes bug #549942.


svn path=/branches/mono-2-6/mono/; revision=144800
2009-10-24 17:22:13 +00:00
Sebastien Pouliot c49415d54c 2009-10-24 Sebastien Pouliot <[email protected]>
* StackFrame.cs: Relax GetSecureFileName when the coreclr is not 
	active (i.e. show full path when compiling with smcs)
	[Backport r144797]


svn path=/branches/mono-2-6/mcs/; revision=144798
2009-10-24 16:11:58 +00:00
Sebastien Pouliot e11b6645cd 2009-10-24 Sebastien Pouliot <[email protected]>
* TypeBuilderTest.cs: Validation test cases for GetConstructor
	[Backport r144791]


svn path=/branches/mono-2-6/mcs/; revision=144793
2009-10-24 15:50:51 +00:00
Sebastien Pouliot 76e901f710 2009-10-24 Sebastien Pouliot <[email protected]>
* AssemblyBuilder.cs: For Silverlight only AssemblyBuilderAccess.Run
	is supported (browser-side) but we still allow other values when
	compiling (e.g. smcs) outside the browser (wo coreclr)
	* TypeBuilder.cs (GetConstructor): Fix validations
	[Backport r144791]


svn path=/branches/mono-2-6/mcs/; revision=144792
2009-10-24 15:46:51 +00:00
Zoltan Varga 6fe974d80d Fix the build.
svn path=/branches/mono-2-6/mono/; revision=144790
2009-10-24 13:28:06 +00:00
Zoltan Varga 9ede4e5632 2009-10-24 Zoltan Varga <[email protected]>
* mini-exceptions.c (mini_jit_info_table_find): Add an 'out_domain' argument
    	which will contain the domain where the method was found.

    	* exceptions-<ARCH>.c mini-exceptions.c: Update callers of
    	mini_jit_info_table_find ().

svn path=/branches/mono-2-6/mono/; revision=144789
2009-10-24 13:27:59 +00:00
Gonzalo Paniagua Javier e67e2fae94 2009-10-24 Gonzalo Paniagua Javier <[email protected]>
* threadpool.[ch]: added hooks for thread start/finish and item
	processing begin/end. For monotouch use only.


svn path=/branches/mono-2-6/mono/; revision=144783
2009-10-24 04:35:13 +00:00
Zoltan Varga 75e9de6dd3 Fix the build.
svn path=/branches/mono-2-6/mono/; revision=144781
2009-10-24 02:32:23 +00:00
Zoltan Varga 74f0572274 2009-10-24 Zoltan Varga <[email protected]>
* threads.c (mono_thread_get_name): New helper function.

svn path=/branches/mono-2-6/mono/; revision=144780
2009-10-24 02:27:40 +00:00
Zoltan Varga 389692ae85 2009-10-24 Zoltan Varga <[email protected]>
* reflection.c (resolve_object): Set handle_class for strings too.
	(mono_reflection_create_custom_attr_data_args): New helper function to decode
	a cattr blob into a set of arrays and structures without creating the custom
	attributes themselves.
	(create_custom_attr_data): Simplify using create_custom_attr_data_args.

	* mono-debug.c (mono_debug_il_offset_from_address): New helper function.

	* debug-mono-symfile.c (mono_debug_symfile_get_line_numbers): New helper
	function.

svn path=/branches/mono-2-6/mono/; revision=144778
2009-10-24 02:19:39 +00:00
Zoltan Varga 7b436d9afc 2009-10-24 Zoltan Varga <[email protected]>
* aot-compiler.c (xdebug_end_emit): Remove so stray debug code.

svn path=/branches/mono-2-6/mono/; revision=144772
2009-10-24 00:56:59 +00:00
Zoltan Varga 245474ed6f 2009-10-24 Zoltan Varga <[email protected]>
* branch-opts.c (mono_if_conversion): Avoid running deadce if it is disabled.

svn path=/branches/mono-2-6/mono/; revision=144764
2009-10-23 23:28:10 +00:00
Alexandre Gomes 370db981b3 Fixed GetWebRequest overriding problems, bug: https://bugzilla.novell.com/show_bug.cgi?id=549580
svn path=/branches/mono-2-6/mcs/; revision=144754
2009-10-23 18:37:47 +00:00
Sebastien Pouliot dbb67cab7a security-manager.c: Report if core-clr is active from ves_icall_System_Security_SecurityManager_get_SecurityEnabled to allow Moonlight BCL to behave appropriately (both in browser and outside, e.g. smcs)
svn path=/branches/mono-2-6/mono/; revision=144738
2009-10-23 14:34:04 +00:00
Sebastien Pouliot 042f77071a 2009-10-23 Sebastien Pouliot <[email protected]>
* SecurityManager_2_1.cs: Return to duty for SecurityEnabled, it
	will allow us to distinguish between running in the browser
	(coreclr active) and on the console (e.g. smcs) from managed code
	[Backport r144732]


svn path=/branches/mono-2-6/mcs/; revision=144733
2009-10-23 12:55:25 +00:00
Gonzalo Paniagua Javier 971d062268 2009-10-23 Gonzalo Paniagua Javier <[email protected]>
* mono-config.c: ignore UTF-8 BOM and report parser errors.
	Fixes bug #549108.


svn path=/branches/mono-2-6/mono/; revision=144729
2009-10-23 12:05:21 +00:00
Gonzalo Paniagua Javier b1a3d29a9e 2009-10-23 Gonzalo Paniagua Javier <[email protected]>
* Configuration.cs: make this work again with bundled configuration
	files. Fixes bug #495957. Patch from Tor Lillqvist.


svn path=/branches/mono-2-6/mcs/; revision=144723
2009-10-23 09:53:44 +00:00
Andreia Gaita 313b593071 * XmlConvert.cs: make ToUri static, fixes #548918 (moon)
[backport r144712]

2009-10-23  Andreia Gaita  <[email protected]>

svn path=/branches/mono-2-6/mcs/; revision=144713
2009-10-23 04:14:05 +00:00
Atsushi Eno cde520de2d merge r144706.
svn path=/branches/mono-2-6/mcs/; revision=144711
2009-10-23 03:46:01 +00:00
Atsushi Eno 428416e37d merge r144707.
svn path=/branches/mono-2-6/mcs/; revision=144710
2009-10-23 03:45:26 +00:00
Atsushi Eno 3184c790c7 merge everything from trunk.
svn path=/branches/mono-2-6/mcs/; revision=144704
2009-10-23 03:04:22 +00:00
Gonzalo Paniagua Javier 3e814f1d9b 2009-10-22 Gonzalo Paniagua Javier <[email protected]>
* class.c: fix typo.


svn path=/branches/mono-2-6/mono/; revision=144692
2009-10-22 22:49:45 +00:00
Sebastien Pouliot cf715cb40a corlib_test.dll.sources: Add System/WeakReferenceTest and System.Threading/EventWaitHandleTest.cs
svn path=/branches/mono-2-6/mcs/; revision=144685
2009-10-22 20:54:49 +00:00
Sebastien Pouliot a1f76a2fcf 2009-10-22 Sebastien Pouliot <[email protected]>
* EventWaitHandleTest.cs: New. Test case for EventResetMode 
	validation
	[Backport r144681]


svn path=/branches/mono-2-6/mcs/; revision=144684
2009-10-22 20:53:40 +00:00
Sebastien Pouliot 2645469dac 2009-10-22 Sebastien Pouliot <[email protected]>
* WeakReferenceTest.cs: New. Basic test cases
	[Backport r144681]


svn path=/branches/mono-2-6/mcs/; revision=144683
2009-10-22 20:49:58 +00:00
Sebastien Pouliot 426cc16e68 2009-10-22 Sebastien Pouliot <[email protected]>
* EventWaitHandleTest.cs: New. Test case for EventResetMode 
	validation
	[Backport r144681]


svn path=/branches/mono-2-6/mcs/; revision=144682
2009-10-22 20:47:55 +00:00
Marek Habersack d6a32cd6ce Backport of r144675
svn path=/branches/mono-2-6/mcs/; revision=144677
2009-10-22 20:01:50 +00:00
Zoltan Varga 8f82fce186 2009-10-22 Zoltan Varga <[email protected]>
* mini-x86.c (mono_arch_emit_prolog): Disable aot for methods with save_lmf
	set, its not supported yet.

svn path=/branches/mono-2-6/mono/; revision=144676
2009-10-22 20:01:43 +00:00
Zoltan Varga bbf387a8f2 2009-10-22 Zoltan Varga <[email protected]>
* aot-runtime.c (mono_aot_get_method): Avoid asserting if a array generic
	iface wrapper is not found.
	(mono_aot_get_method): Ditto for GetGenericValueImpl.

svn path=/branches/mono-2-6/mono/; revision=144673
2009-10-22 19:53:31 +00:00
Zoltan Varga 34c65cd606 2009-10-22 Zoltan Varga <[email protected]>
* aot-runtime.c (mono_aot_get_method): Avoid asserting if a array generic
	iface wrapper is not found.

svn path=/branches/mono-2-6/mono/; revision=144666
2009-10-22 18:54:18 +00:00
Marek Habersack 8c5d96e873 Backport of r144662
svn path=/branches/mono-2-6/mcs/; revision=144663
2009-10-22 18:32:58 +00:00
Jonathan Pryor 920fc7c140 * AssemblyInfo.cs: Use Consts.FxVersion when building for MONOTOUCH.
svn path=/branches/mono-2-6/mcs/; revision=144660
2009-10-22 18:20:03 +00:00
Atsushi Eno 3e977b2172 merge every changes to this assembly upto r144652.
svn path=/branches/mono-2-6/mcs/; revision=144658
2009-10-22 18:15:20 +00:00
Zoltan Varga 8d6429e08c 2009-10-22 Zoltan Varga <[email protected]>
* marshal.c (mono_string_builder_to_utf16): Applied patch from
	Hib Eris  <[email protected]>. Return empty string for empty string builders.
	Fixes #549173.

svn path=/branches/mono-2-6/mono/; revision=144654
2009-10-22 17:49:47 +00:00
Lluis Sanchez 9bed95350d 2009-10-22 Lluis Sanchez Gual <[email protected]>
* CodeNamespaceImportCollection.cs: Properly update the internal
	keys hashtable when there are changes in the items.


svn path=/branches/mono-2-6/mcs/; revision=144651
2009-10-22 16:29:41 +00:00
Atsushi Eno cc737a9ba2 backport r144647.
svn path=/branches/mono-2-6/mcs/; revision=144648
2009-10-22 16:12:06 +00:00
Sebastien Pouliot dd953f50c5 2009-10-22 Sebastien Pouliot <[email protected]>
* MonitorTest.cs: Mark existing tests as "NotWorking" since they
	fail in MS FX2 (maybe they worked in 1.x?). Add more test cases
	to validate the TryEnter and Wait overloaded methods.
	[Backport r144627]


svn path=/branches/mono-2-6/mcs/; revision=144629
2009-10-22 11:53:53 +00:00
Sebastien Pouliot 085200c215 2009-10-22 Sebastien Pouliot <[email protected]>
* Monitor.cs: Fix validations for TryEnter and Wait. Reduce 
	duplicated code between overloads.
	[Backport r144627]


svn path=/branches/mono-2-6/mcs/; revision=144628
2009-10-22 11:53:28 +00:00
Gonzalo Paniagua Javier 14599e07ed 2009-10-22 Carlo Kok <[email protected]>
* Fixed AssemblyInfo.cs to reflect proper copyright.


svn path=/branches/mono-2-6/mcs/; revision=144614
2009-10-22 09:03:41 +00:00
Gonzalo Paniagua Javier 9f906977c4 2009-10-21 Carlo Kok <[email protected]>
* RuntimeLicenseContext.cs: Support for the resourceAssembly parameter.


svn path=/branches/mono-2-6/mcs/; revision=144612
2009-10-22 09:02:37 +00:00
Gonzalo Paniagua Javier be8dbdf6df Add man page for lc
svn path=/branches/mono-2-6/mono/; revision=144590
2009-10-22 02:14:11 +00:00
Gonzalo Paniagua Javier f4c3f2d686 2009-10-21 Gonzalo Paniagua Javier <[email protected]>
* sockets.[ch]: fix function definition.


svn path=/branches/mono-2-6/mono/; revision=144577
2009-10-21 21:40:06 +00:00
Gonzalo Paniagua Javier 12a0a0ad85 2009-10-21 Gonzalo Paniagua Javier <[email protected]>
* socket-io.[ch]: fix VS build.


svn path=/branches/mono-2-6/mono/; revision=144574
2009-10-21 21:38:28 +00:00
Zoltan Varga 1d2fd92a88 2009-10-21 Zoltan Varga <[email protected]>
* aot-runtime.c (mono_aot_get_method): Fix support for the IList<T> wrappers,
	which have a different name.

svn path=/branches/mono-2-6/mono/; revision=144570
2009-10-21 21:04:00 +00:00
Zoltan Varga 8add79cafb 2009-10-21 Zoltan Varga <[email protected]>
* aot-runtime.c (mono_aot_get_method): Special case the array generic iface
	wrappers and Array.GetGenericValueImpl ().

	* aot-compiler.c: Avoid emitting some wrappers which are not needed anymore
	because of the change above.

	* generics.cs: Add a test for full aot + generic array ifaces.

svn path=/branches/mono-2-6/mono/; revision=144566
2009-10-21 19:35:13 +00:00
Jb Evain fa842425c7 2009-10-21 Jb Evain <[email protected]>
* SerializationMap.cs, KnownTypeCollection.cs: avoid using LINQ
	on arrays as MonoTouch has issues with them.


svn path=/branches/mono-2-6/mcs/; revision=144550
2009-10-21 16:47:54 +00:00
Rodrigo Kumpera e1c04a3fcf In metadata:
2009-10-21  Rodrigo Kumpera  <[email protected]>

	* verify.c (verify_delegate_compatibility): Properly verify delegate creation of static
	methods. Fixes #543021.

	Backport of r144534.

>>>>>>> .r144538

svn path=/branches/mono-2-6/mono/; revision=144544
2009-10-21 13:36:43 +00:00
Sebastien Pouliot 7a51fff22c corlib_test.dll.sources: Add System.Threading/WaitHandleTest.cs
svn path=/branches/mono-2-6/mcs/; revision=144532
2009-10-21 12:21:38 +00:00
Sebastien Pouliot b7a7012115 2009-10-21 Sebastien Pouliot <[email protected]>
* WaitHandleTest.cs: New. Add test cases for Wait[One|All|Any]
	methods overloads (at least the one present in Silverlight 2)
	[Backport r144529]


svn path=/branches/mono-2-6/mcs/; revision=144531
2009-10-21 12:20:35 +00:00
Sebastien Pouliot 066dd83f5d 2009-10-21 Sebastien Pouliot <[email protected]>
* WaitHandle.cs: Add missing validations for 'millisecondsTimeout'
	in Wait[One|Any|All]. Also call the overloaded (bool) methods for
	WaitAll to reduce code duplication.
	[Backport r144529]


svn path=/branches/mono-2-6/mcs/; revision=144530
2009-10-21 12:19:45 +00:00
Gonzalo Paniagua Javier ed2f872e65 2009-10-21 Gonzalo Paniagua Javier <[email protected]>
* Socket.cs: implement *SendFile().


svn path=/branches/mono-2-6/mcs/; revision=144511
2009-10-21 06:43:44 +00:00
Gonzalo Paniagua Javier 1759857a1f 2009-10-21 Gonzalo Paniagua Javier <[email protected]>
* icall-def.h:
	* socket-io.[ch]: implemented SendFile.


svn path=/branches/mono-2-6/mono/; revision=144508
2009-10-21 06:34:48 +00:00
Gonzalo Paniagua Javier 3ed983bcab 2009-10-21 Gonzalo Paniagua Javier <[email protected]>
* sockets.[ch]: added TransmitFile implementation.


svn path=/branches/mono-2-6/mono/; revision=144505
2009-10-21 06:31:11 +00:00
Marek Habersack 3ae87c406b Backport of r144487
svn path=/branches/mono-2-6/mcs/; revision=144488
2009-10-20 19:22:13 +00:00
Zoltan Varga 5fbbcc177f 2009-10-20 Zoltan Varga <[email protected]>
* class.c (mono_class_create_from_typedef): Initialize class->element_class
	before the interfaces to avoid crashes later if class initialization fails.
	Fixes #548417.

svn path=/branches/mono-2-6/mono/; revision=144484
2009-10-20 19:03:53 +00:00
Gonzalo Paniagua Javier dd726bd89f 2009-10-20 Gonzalo Paniagua Javier <[email protected]>
* ApplicationHost.cs: set the shadow copy options calling the methods
	in AppDomain, instead of setting them in a copy of the setup
	information.


svn path=/branches/mono-2-6/mcs/; revision=144479
2009-10-20 18:31:55 +00:00
Zoltan Varga 51bca79c22 2009-10-16 Zoltan Varga <[email protected]>
* Makefile: Avoid else ifeq which is not recognized by some make versions.

svn path=/branches/mono-2-6/mcs/; revision=144471
2009-10-20 17:01:53 +00:00
Sebastien Pouliot b26939284a 2009-10-20 Sebastien Pouliot <[email protected]>
* TimerTest.cs: Add more validation tests
	[Backport r144466]


svn path=/branches/mono-2-6/mcs/; revision=144468
2009-10-20 15:54:08 +00:00
Sebastien Pouliot 9f622ff4ee 2009-10-20 Sebastien Pouliot <[email protected]>
* Timer.cs: Always call Init from every constructors to avoid 
	duplicate checks. Fix validations on different dueTime and period
	(ctor and Change methods). Seal private TimerComparer class and
	avoid multiple (identical) casts in its Compare method. Seal 
	private Scheduler class.
	[Backport r144466]


svn path=/branches/mono-2-6/mcs/; revision=144467
2009-10-20 15:53:31 +00:00
Gonzalo Paniagua Javier 06e892b980 2009-10-20 Gonzalo Paniagua Javier <[email protected]>
* Timer.cs: make sure we don't insert 2 timers with the same key.


svn path=/branches/mono-2-6/mcs/; revision=144463
2009-10-20 15:29:50 +00:00
Gonzalo Paniagua Javier 143af05a93 2009-10-20 Gonzalo Paniagua Javier <[email protected]>
* ServerContext.cs:
	* SslServerStream.cs: add new parameter that forces sending the
	CertificateRequest record. Make sure we raise the client certificate
	validation event when it is requested or required.


svn path=/branches/mono-2-6/mcs/; revision=144460
2009-10-20 15:25:48 +00:00
Sebastien Pouliot ef4767f919 2009-10-20 Sebastien Pouliot <[email protected]>
* MonoProperty.cs: Reduce code duplication and the number of direct
	calls to icalls (affecting the number of SecuritySafeCritical in
	Moonlight)
	[Backport 144448]


svn path=/branches/mono-2-6/mcs/; revision=144449
2009-10-20 12:05:20 +00:00
Jb Evain 47333cf53e 2009-10-20 Jb Evain <[email protected]>
* Thread.cs: change type of the current_appcontext field to object
	to avoid triggering static constructors unless explicitely required.


svn path=/branches/mono-2-6/mcs/; revision=144430
2009-10-20 09:02:57 +00:00
Sebastien Pouliot 38e2758eb0 2009-10-19 Sebastien Pouliot <[email protected]>
* assembly.c (mono_assembly_load_reference): Fix leak when 'status'
	code is known. (parse_public_key) Remove duplicate (unneeded) NULL
	check since 'pubkey' can't be NULL at this stage
	* icall.c (ves_icall_System_Array_FastCopy): Add comment about
	the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
	initialization of 'iter'
	[Backport r144403]


svn path=/branches/mono-2-6/mono/; revision=144405
2009-10-19 19:39:10 +00:00
Sebastien Pouliot b3bef3cb6a 2009-10-19 Sebastien Pouliot <[email protected]>
* aot-compiler.c (emit_plt): Remove duplicate 'debug_sym' variable 
	that hides the previous one.
	[Backport r144402]


svn path=/branches/mono-2-6/mono/; revision=144404
2009-10-19 19:37:39 +00:00
Sebastien Pouliot 64f837613d 2009-10-19 Sebastien Pouliot <[email protected]>
* MonoEvent.cs: Reduce code duplication and the number of direct
	calls to icalls (affecting the number of SecuritySafeCritical in
	Moonlight)
	[Backport r144363]


svn path=/branches/mono-2-6/mcs/; revision=144364
2009-10-19 11:49:05 +00:00
Sebastien Pouliot 20e81a7bd0 2009-10-18 Sebastien Pouliot <[email protected]>
* MethodBaseTest.cs: Add new, working, test for non-generic
	GetMethodFromHandle. Add test case to show generic overload
	behave exactly the same when no second RuntimeMethodHandle is
	provided. Remove [Category("NotWorking")] on existing test case.
	[Backport r144335]


svn path=/branches/mono-2-6/mcs/; revision=144337
2009-10-18 23:53:42 +00:00
Sebastien Pouliot 6088064eb7 * MethodBase.cs: Reduce code duplication and the number of direct
calls to icalls (affecting the number of SecuritySafeCritical in
	Moonlight)
	[Backport r144335]

2009-10-18  Sebastien Pouliot  <[email protected]>


svn path=/branches/mono-2-6/mcs/; revision=144336
2009-10-18 23:53:00 +00:00
Zoltan Varga 7a90062ebe 2009-10-18 Zoltan Varga <[email protected]>
* aot-compiler.c (can_marshal_struct): Allow some System.dll structs to be
	marshalled. Fixes #541623.

svn path=/branches/mono-2-6/mono/; revision=144332
2009-10-18 18:17:35 +00:00
Geoff Norton e0e853111c make these public on monotouch
svn path=/branches/mono-2-6/mcs/; revision=144327
2009-10-18 17:11:06 +00:00
Sebastien Pouliot dbece2a334 In .:
2009-10-18  Sebastien Pouliot  <[email protected]>

	* corlib.dll.sources: Remove System.IO.IntPtrStream since it can
	be replaced by (public in 2.0+) UnmanagedMemoryStream
	* net_2_1_raw_corlib.dll.sources: Remove System.IO.IntPtrStream 
	since it can be replaced by UnmanagedMemoryStream
	[Backport r144322]

In System.Resources:
2009-10-18  Sebastien Pouliot  <[email protected]>

	* ResourceReader.cs, ResourceSet.cs, RuntimeResourceSet.cs: Use 
	UnmanagedMemoryStream (instead of IntPtrStream)
	[Backport r144322]

In System.IO:
2009-10-18  Sebastien Pouliot  <[email protected]>

	* UnmanagedMemoryStream.cs: Allow the use under NET_1_1 so we can
	remove the internal IntPtrStream from every profile.

In System.Reflection:
2009-10-18  Sebastien Pouliot  <[email protected]>

	* Assembly.cs: Use UnmanagedMemoryStream (instead of IntPtrStream)
	in every profile


svn path=/branches/mono-2-6/mcs/; revision=144323
2009-10-18 15:08:03 +00:00
Gonzalo Paniagua Javier 7148b88fc6 2009-10-17 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: add 3 missing DoCallback() calls in
	EndRead/EndWrite.


svn path=/branches/mono-2-6/mcs/; revision=144316
2009-10-18 02:09:23 +00:00
Sebastien Pouliot ce43336bb8 2009-10-17 Sebastien Pouliot <[email protected]>
* EqualityComparer.cs: Seal internal classes
	[Backport r144308]


svn path=/branches/mono-2-6/mcs/; revision=144309
2009-10-17 15:54:37 +00:00
Sebastien Pouliot 59a7e4c2de 2009-10-17 Sebastien Pouliot <[email protected]>
* MonoMethod.cs: Reduce code duplication and the number of direct
	calls to icalls (affecting the number of SecuritySafeCritical in
	Moonlight)
	[Backport r144306]


svn path=/branches/mono-2-6/mcs/; revision=144307
2009-10-17 14:56:38 +00:00
Zoltan Varga f6a4795925 2009-10-16 Zoltan Varga <[email protected]>
* aot-compiler.c (emit_extra_methods): Remove some asserts which are not needed.

svn path=/branches/mono-2-6/mono/; revision=144277
2009-10-16 15:43:51 +00:00
Marek Safar 71f60a3d4a 2009-10-16 Marek Safar <[email protected]>
A fix for bug #493523, #507067
	* convert.cs, nullable.cs, expression.cs: Do implicit and explicit
	standard nullable conversion using underlying standard conversion
	and not full conversion.


svn path=/branches/mono-2-6/mcs/; revision=144266
2009-10-16 13:47:18 +00:00
Atsushi Eno c81b863ef0 backport r144249.
svn path=/branches/mono-2-6/mcs/; revision=144250
2009-10-16 03:53:04 +00:00
Gonzalo Paniagua Javier 5002ce6535 add lc
svn path=/branches/mono-2-6/mono/; revision=144246
2009-10-16 03:18:12 +00:00
Gonzalo Paniagua Javier a665fdb2e9 add lc
svn path=/branches/mono-2-6/mcs/; revision=144245
2009-10-16 03:17:46 +00:00
Gonzalo Paniagua Javier 38079f5fa0 2009-10-12 Carlo Kok <[email protected]>
* DesigntimeLicenseContextSerializer.cs: Properly serialize licenses.
	* RuntimeLicenseContext.cs: Properly deserialize licenses.


svn path=/branches/mono-2-6/mcs/; revision=144240
2009-10-16 02:49:32 +00:00
Sebastien Pouliot 53665d2a9c 2009-10-15 Sebastien Pouliot <[email protected]>
* UnmanagedMemoryStreamTest.cs: Add more test cases to cover all
	validations
	[Backport r144226]


svn path=/branches/mono-2-6/mcs/; revision=144228
2009-10-15 20:20:17 +00:00
Sebastien Pouliot 286bcb9e60 2009-10-15 Sebastien Pouliot <[email protected]>
* UnmanagedMemoryStream.cs: Fix some and add missing validations
	[Backport r144226]


svn path=/branches/mono-2-6/mcs/; revision=144227
2009-10-15 20:19:37 +00:00
Sebastien Pouliot 9621c55b69 2009-10-15 Sebastien Pouliot <[email protected]>
* RuntimeHelpersTest.cs: Add more test cases for validations
	[Backport r144208]


svn path=/branches/mono-2-6/mcs/; revision=144210
2009-10-15 14:37:52 +00:00
Sebastien Pouliot dd815fb7fe 2009-10-15 Sebastien Pouliot <[email protected]>
* RuntimeHelpers.cs: Add missing validations
	[Backport r144208]


svn path=/branches/mono-2-6/mcs/; revision=144209
2009-10-15 14:37:06 +00:00
Sebastien Pouliot 839e971be3 2009-10-15 Sebastien Pouliot <[email protected]>
* GCHandleTest.cs: Add more test cases for validations
	[Backport r144204]


svn path=/branches/mono-2-6/mcs/; revision=144206
2009-10-15 14:22:19 +00:00
Sebastien Pouliot 17fa7867f8 2009-10-15 Sebastien Pouliot <[email protected]>
* GCHandle.cs: Add missing validations
	[Backport r144204]


svn path=/branches/mono-2-6/mcs/; revision=144205
2009-10-15 14:21:34 +00:00
Sebastien Pouliot aca521aca6 2009-10-15 Sebastien Pouliot <[email protected]>
* HttpRequestChannel.cs (WaitEnd): Neither Moonlight nor MonoTouch
	support contexts so we call the non-overloaded WaitOne method 
	(which defaults to false).
	[Backport r144200]


svn path=/branches/mono-2-6/mcs/; revision=144201
2009-10-15 12:54:23 +00:00
Sebastien Pouliot 10274adf0a 2009-10-15 Sebastien Pouliot <[email protected]>
* ClientRuntimeChannel.cs: Remove the WaitOne 'emitContext' 
	overloads from the Moonlight build. Directly call WaitHandle.
	WaitAll from WaitOne(int) (since the overloads are not always
	present)
	[Backport r144198]


svn path=/branches/mono-2-6/mcs/; revision=144199
2009-10-15 12:52:42 +00:00
Jb Evain 062e9f5266 2009-10-15 Jb Evain <[email protected]>
* monotouch_System.dll.sources: add Semaphore to MonoTouch.


svn path=/branches/mono-2-6/mcs/; revision=144192
2009-10-15 10:45:25 +00:00
Zoltan Varga c8bad1334e 2009-10-15 Zoltan Varga <[email protected]>
* mini.c (mono_op_imm_to_op): Handle OP_AND/OR/XOR_IMM.

svn path=/branches/mono-2-6/mono/; revision=144168
2009-10-15 00:12:37 +00:00
Jonathan Pryor a5d121ff11 Fix MonoTouch on the mono-2-6 branch.
svn path=/branches/mono-2-6/mcs/; revision=144154
2009-10-14 21:42:18 +00:00
Gonzalo Paniagua Javier 396faa531e fix the build
svn path=/branches/mono-2-6/mcs/; revision=144152
2009-10-14 20:58:11 +00:00
Jonathan Pryor 451dd25eb9 * Makefile: Add Mono.Data.Tds, System.Transactions, System.Data, and
Mono.Data.Sqlite to the MonoTouch build.
	* System/System.ComponentModel/TypeConverter_2_1.cs: Skip this type in
		the MonoTouch profile; MonoTouch will be using the 2.0 version of 
		TypeConverter.
	* System/System.ComponentModel/ComponentCollection.cs, 
		System/System.ComponentModel/PropertyDescriptor.cs: MonoTouch uses the
		.NET 2.0 versions of these types.
	* System/monotouch_System.dll.sources: Add lots of additional .NET 2.0
		functionality to the MonoTouch profile.
	* System.Transactions/Makefile (VALID_PROFILE): Add monotouch.
	* System.Data/System.Data.Common/DbConnection.cs: Throw 
		NotImplementedException for DbConnection.DbProviderFactory, as 
		DbProviderFactories isn't included in the MonoTouch profile.
	* System.Data/System.Data.SqlClient/SqlConnection.cs: Remove 
		EnterpriseServices dependency from the MonoTouch profile.
	* System.Data/monotouch_System.Data.dll.sources: Added.
	* System.Data/System.Data/XmlSchemaDataImporter.cs: Remove 
		DbProviderFactories dependency in the MonoTouch profile.

svn path=/branches/mono-2-6/mcs/; revision=144142
2009-10-14 20:28:31 +00:00
Gonzalo Paniagua Javier 7252b6595e 2009-10-14 Gonzalo Paniagua Javier <[email protected]>
* ApplicationHost.cs: use shadowCopyBinAssemblies from
	<hostingEnvironment>.


svn path=/branches/mono-2-6/mcs/; revision=144138
2009-10-14 19:30:28 +00:00
Marek Habersack 1f16f07de0 Backport of r144016
svn path=/branches/mono-2-6/mcs/; revision=144129
2009-10-14 18:18:35 +00:00
Sebastien Pouliot 3bf0adf06b 2009-10-14 Sebastien Pouliot <[email protected]>
* CultureInfo.cs: Refactor to reduce unsafe methods/scope.
	[Backport r144106]


svn path=/branches/mono-2-6/mcs/; revision=144107
2009-10-14 15:14:25 +00:00
Sebastien Pouliot bfea298166 2009-10-14 Sebastien Pouliot <[email protected]>
* Exception.cs: Use StackFrame.GetSecureFileName to display (or 
	not) the file names (and paths). Don't serialize Source for
	Moonlight.
	* ValueType.cs: Change InternalEquals (icall) visibility to 
	private since it is not used elsewhere outside the type.
	[Backport r144104]


svn path=/branches/mono-2-6/mcs/; revision=144105
2009-10-14 15:09:48 +00:00
Martin Baulig 480d488ef3 Backport of 144049; add a new 'MONO_DEBUGGER_EVENT_TRAMPOLINE' notification for the debugger which also includes the address of the callsite.
2009-10-13  Martin Baulig  <[email protected]>

	* debug-mini.c (mono_debugger_trampoline_compiled): Add
	`const guint8 *trampoline' argument; send both the old and the new
	notification.

2009-10-13  Martin Baulig  <[email protected]>

	* mono-debug-debugger.h (MonoDebuggerEvent): Renamed
	`MONO_DEBUGGER_EVENT_TRAMPOLINE' into
	`MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
	`MONO_DEBUGGER_EVENT_TRAMPOLINE'.

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

svn path=/branches/mono-2-6/mono/; revision=144065
2009-10-13 23:03:19 +00:00
Zoltan Varga 06e50b881f 2009-10-13 Zoltan Varga <[email protected]>
* mono-gdb.py: Add an 'xdb' command to flush the debugging info.

svn path=/branches/mono-2-6/mono/; revision=144036
2009-10-13 18:26:08 +00:00
Zoltan Varga ff049da6c1 2009-10-13 Zoltan Varga <[email protected]>
* aot-compiler.c (mono_save_xdebug_info): Group methods into groups of 10 to
	avoid registering 1 symbol file per method with gdb.

svn path=/branches/mono-2-6/mono/; revision=144034
2009-10-13 18:20:30 +00:00
Zoltan Varga 43e1fd9f0e 2009-10-11 Zoltan Varga <[email protected]>
* aot-compiler.c (mono_save_xdebug_info): Emit a symbol for the method which
	can be used to set breakpoints in gdb.

	* image-writer.c (bin_writer_emit_writeout): Add support for setting the text
	segment to an absolute address.

svn path=/branches/mono-2-6/mono/; revision=144033
2009-10-13 18:20:22 +00:00
Zoltan Varga b680cf6b99 2009-10-13 Bill Holmes <[email protected]>
* aot-compiler.c : Fix the MSVC builds

	Code is contributed under MIT/X11 license.

svn path=/branches/mono-2-6/mono/; revision=144029
2009-10-13 17:52:18 +00:00
Zoltan Varga b5a02e9870 Fix the eglib build.
svn path=/branches/mono-2-6/mono/; revision=144015
2009-10-13 15:08:27 +00:00
Veerapuram Varadhan ee48d73acd backport of r143993, r143995
svn path=/branches/mono-2-6/mcs/; revision=143996
2009-10-13 01:19:28 +00:00
Marek Habersack 1950420281 Backport of r143990
svn path=/branches/mono-2-6/mcs/; revision=143991
2009-10-12 22:52:16 +00:00
Zoltan Varga feaafeeb4e Fix the build.
svn path=/branches/mono-2-6/mcs/; revision=143989
2009-10-12 22:47:14 +00:00
Zoltan Varga dae32f25ea 2009-10-12 Zoltan Varga <[email protected]>
* Process.cs (Dispose): Close the async output/error readers. Fixes #545429.

svn path=/branches/mono-2-6/mcs/; revision=143986
2009-10-12 21:31:08 +00:00
Marek Habersack 5c4860a930 Backport of r143979
svn path=/branches/mono-2-6/mcs/; revision=143980
2009-10-12 21:11:43 +00:00
Marek Habersack 30a5dda745 Backport of r143972
svn path=/branches/mono-2-6/mcs/; revision=143973
2009-10-12 14:43:19 +00:00
Marek Habersack 2289967204 Backport of r143967
svn path=/branches/mono-2-6/mcs/; revision=143968
2009-10-12 12:52:05 +00:00
Dick Porter e91a24c3f4 2009-10-12 Dick Porter <[email protected]>
* Splitter.cs: Adjust offsets when more than one splitter is
	present in a control.  Fixes bug 509472.


svn path=/branches/mono-2-6/mcs/; revision=143965
2009-10-12 12:30:26 +00:00
Ankit Jain 75d91d9c99 Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild:
2009-10-12  Ankit Jain  <[email protected]>

	* xbuild/Microsoft.Common.targets: For referenced projects,
	when trying to get the deploy items, ensure that the split
	lists of project references are available.
	(SplitProjectReferencesByExistent): New.
	Set DependsOnTargets appropriately.

2009-10-12  Ankit Jain  <[email protected]>

	* SolutionParser.cs: Handle non-existing project files, and
	project file load errors. Raise warnings instead of failing.
	* xbuild/Microsoft.Common.targets: Handle non-existant
	Project references, skip instead of failing.

In class/Microsoft.Build.Tasks:
2009-10-12  Ankit Jain  <[email protected]>

	* Makefile: Add reference to Microsoft.Build.Engine .

In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
2009-10-12  Ankit Jain  <[email protected]>

	* ResolveAssemblyReference.cs: Remove unnecessary tab in the warning
	messages.

2009-10-12  Ankit Jain  <[email protected]>

	* MSBuild.cs (Execute): Handle build errors.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-10-12  Ankit Jain  <[email protected]>

	* Target.cs (TargetFile): New. Gives the name of the file
	containing the target definition.
	* BuildEngine.cs (.ctor): Add a 'taskfile' parameters, and
	return this for ProjectFileOfTaskNode.
	* BuildTask.cs (LogTaskStarted):
	(LogTaskFinished): Use parentTarget.ProjectFileOfTaskNode for
	the event.
	(InitializeTask): Set BuildEngine's task file to parent target's
	TargetFile.
	* Engine.cs (LogProjectStarted): Incase of default targets, set
	TargetNames to String.Empty .
	* TargetBatchingImpl.cs (LogTargetStarted):
	(LogTargetFinished): Use target.TargetFile for the event.

	* ConsoleLogger.cs: Keep a stack of project/target/task being
	executed. And corresponding list of errors and warnings.
	(EventsToString): Stringifies the current "stack", to be used
	as key to the table of errors/warnings and for show messages
	at the end of the build.

2009-10-12  Ankit Jain  <[email protected]>

	* Project.cs (Load): Add argument checks.

In class/Microsoft.Build.Utilities/Microsoft.Build.Utilities:
2009-10-12  Ankit Jain  <[email protected]>

	* TaskLoggingHelper.cs: Use the buildEngine.ProjectFileOfTaskNode
	in the event args.

2009-10-12  Ankit Jain  <[email protected]>

	* ToolTask.cs (ExecuteTool): Don't set toolOutput to null.
	(HandleTaskExecutionErrors): toolOutput can be null.
	Set toolOutput to null here.


svn path=/branches/mono-2-6/mcs/; revision=143964
2009-10-12 12:23:53 +00:00
Gonzalo Paniagua Javier 2fefe83b93 fix build
svn path=/branches/mono-2-6/mono/; revision=143963
2009-10-12 12:23:00 +00:00
Zoltan Varga d3442a8864 2009-10-12 Zoltan Varga <[email protected]>
* data/Makefile.am (gdb_DATA): Install mono-gdb.py alongside the mono executable.

svn path=/branches/mono-2-6/mono/; revision=143961
2009-10-12 12:04:21 +00:00
Zoltan Varga 054aa8742c 2009-10-12 Zoltan Varga <[email protected]>
* mono-gdb.py: Update this to gdb 7.0.

	* mono-gdbinit: Removed, no longer needed.

svn path=/branches/mono-2-6/mono/; revision=143960
2009-10-12 12:04:15 +00:00
Zoltan Varga 218d0e4fd6 2009-10-12 Zoltan Varga <[email protected]>
* data/gdb-pre7.0: New directory, containing the mono support files for
	gdb versions before 7.0.

svn path=/branches/mono-2-6/mono/; revision=143959
2009-10-12 12:04:08 +00:00
Marek Habersack 02d778b53f Backport of r143950
svn path=/branches/mono-2-6/mcs/; revision=143951
2009-10-12 10:50:12 +00:00
Marek Habersack d3db87f166 Backport of r143945
svn path=/branches/mono-2-6/mcs/; revision=143946
2009-10-12 09:52:38 +00:00
Gonzalo Paniagua Javier bd265b0b4c Patch by Joel Reed that implements a few network interface counters
svn path=/branches/mono-2-6/mono/; revision=143935
2009-10-12 05:56:18 +00:00
Ankit Jain cdde6d1025 * xbuild.1: Add info about env var XBUILD_COLORS.
Backported from trunk.

svn path=/branches/mono-2-6/mono/; revision=143907
2009-10-11 01:40:39 +00:00
Ankit Jain 85453c1f27 Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild:
2009-10-11  Ankit Jain  <[email protected]>

	* Main.cs: Add support for emitting messages in color.
	Taking relevant code from mcs/report.cs . Using ANSI
	color codes here instead of Console.ForegroundColor
	because of a bug in Console.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-10-11  Ankit Jain  <[email protected]>

	* ConsoleLogger.cs (no_colors): Rename to ..
	(use_colors): .. this. Fix the case when XBUILD_COLORS
	is not set.

2009-10-11  Ankit Jain  <[email protected]>

	* ConsoleLogger.cs: Use ColorSetter and ColorResetter .
	Support 'XBUILD_COLORS' to set colors for errors, warnings,
	events and messages.

2009-10-10  Ankit Jain  <[email protected]>

	* ConsoleLogger.cs (ProjectFinishedHandler): Once projectFailed
	becomes true, don't reset it. We are looking for "atleast one
	project failed".


svn path=/branches/mono-2-6/mcs/; revision=143904
2009-10-11 01:33:37 +00:00
Zoltan Varga 8523e6fd4c 2009-10-10 Zoltan Varga <[email protected]>
* aot-compiler.c (mono_save_trampoline_xdebug_info): Implement this for the
	gdb mode.

svn path=/branches/mono-2-6/mono/; revision=143895
2009-10-10 18:57:32 +00:00
Zoltan Varga 0d44e4bd88 2009-10-09 Zoltan Varga <[email protected]>
* mono.1: Document --debug=gdb option.

svn path=/branches/mono-2-6/mono/; revision=143891
2009-10-09 19:01:39 +00:00
Zoltan Varga 5fe74de573 2009-10-09 Zoltan Varga <[email protected]>
* driver.c (parse_debug_options): Add a 'gdb' option.

	* mini.c (mini_parse_debug_options): Add a 'gdb' option.

svn path=/branches/mono-2-6/mono/; revision=143890
2009-10-09 19:01:32 +00:00
Zoltan Varga 610c46ca01 2009-10-09 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoSupport.run_hook): Set MONO_XDEBUG to 'gdb' to activate
	the GDB support mode in the runtime.

svn path=/branches/mono-2-6/mono/; revision=143889
2009-10-09 19:01:25 +00:00
Zoltan Varga 05ec37ee5d 2009-10-09 Zoltan Varga <[email protected]>
* image-writer.c: Add support for emitting the image into a memory buffer.

	* dwarfwriter.c: Add support for sharing one IL file between multiple images.

	* aot-compiler.c: Add support for registering debug info with GDB using the
	new JIT debugging interface in GDB 7.0. It can be turned on by setting
	MONO_XDEBUG to 'gdb'.

svn path=/branches/mono-2-6/mono/; revision=143888
2009-10-09 19:01:18 +00:00
Ankit Jain c39fd613b6 Update xbuild and Microsoft.Build.* from trunk.
2009-10-09  Ankit Jain  <[email protected]>

	* Exec.cs (AddCommandLineCommands): Add '/q' for cmd.exe, to
	turn 'echo off'. And make sure the script file on windows, has
	a '.bat' extension, otherwise cmd.exe opens it in a text editor.

2009-10-09  Ankit Jain  <[email protected]>

	Fix bug #545703.
	* Exec.cs (Command): On unix, change CRLF to CR.


svn path=/branches/mono-2-6/mcs/; revision=143881
2009-10-09 15:52:17 +00:00
Zoltan Varga ae4b04c837 2009-10-09 Zoltan Varga <[email protected]>
* image-writer.c (bin_writer_emit_writeout): Fix a copy paste error causing
	the LOC section to overwrite the LINE section.

svn path=/branches/mono-2-6/mono/; revision=143875
2009-10-09 14:49:13 +00:00
Marek Safar fcdff7ed33 Fixed bootstrap with trunk
svn path=/branches/mono-2-6/mcs/; revision=143870
2009-10-09 14:13:21 +00:00
Atsushi Eno e84d2dde76 backport r143819.
svn path=/branches/mono-2-6/mcs/; revision=143820
2009-10-09 03:28:45 +00:00
Veerapuram Varadhan ab56f08cdf 2009-09-30 Veerapuram Varadhan <[email protected]>
** Fixes #543207
	* OracleParameter.cs (Bind): Do not remove the trailing-null-byte.

svn path=/branches/mono-2-6/mcs/; revision=143805
2009-10-08 19:38:29 +00:00
Sebastien Pouliot e7ca8f20c4 2009-10-08 Sebastien Pouliot <[email protected]>
* StackFrame.cs: Introduce a new GetSecureFileName method that
	will deal with CAS (regular framework) and will remove the path
	(for Moonlight) on a stack frame.
	* StackTrace.cs: Use the new StackFrame.GetSecureFileName to
	simplify logic
	[Backport r143802]


svn path=/branches/mono-2-6/mcs/; revision=143804
2009-10-08 19:31:10 +00:00
Sebastien Pouliot 15b13478af 2009-10-08 Sebastien Pouliot <[email protected]>
* AppDomain.cs: Remove NET_2_1 specific DefineDynamicAssembly(
	AssemblyName,AssemblyBuilderAccess,bool) since it is not part
	of SL. Provide a ToString implementation similar to Silverlight
	for Moonlight (and without directly using an icall)
	[Backport r143799]


svn path=/branches/mono-2-6/mcs/; revision=143800
2009-10-08 19:06:02 +00:00
Jb Evain d0cc112de9 2009-10-08 Jb Evain <[email protected]>
* Makefile: build the i18n assemblies on MonoTouch.


svn path=/branches/mono-2-6/mcs/; revision=143774
2009-10-08 13:57:23 +00:00
Jb Evain 1bbc0280f6 use the expression interpreter on MonoTouch
svn path=/branches/mono-2-6/mcs/; revision=143770
2009-10-08 13:53:02 +00:00
Ankit Jain 2f8194612d Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild:
	* xbuild/Microsoft.Common.targets: Don't get list of files
	to deploy, for 'Private' project references.
	Fix target named for *CopyDeploy*.

2009-10-08  Ankit Jain  <[email protected]>

In tools/xbuild/tests:
2009-10-08  Ankit Jain  <[email protected]>

	* standalone/Project1: Add a new Lib5 project, and add
	private references to various projects.
	Update final-outputs.txt .
	* standalone/Project01/Lib5/*: New.

In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
	* ResolveAssemblyReference.cs: Don't resolve any dependencies for
	assemblies resolved from {PkgConfig}. Honor parent's CopyLocal for
	dependencies.

2009-10-08  Ankit Jain  <[email protected]>


svn path=/branches/mono-2-6/mcs/; revision=143741
2009-10-08 02:19:49 +00:00
Ankit Jain be9de0e1ac Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild:
2009-10-08  Ankit Jain  <[email protected]>

	* xbuild/Microsoft.Common.tasks: Add RemoveDuplicates task.

In class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks:
2009-10-08  Ankit Jain  <[email protected]>

	* TestMessageLogger.cs (CheckLoggedAny): New.

2009-10-08  Ankit Jain  <[email protected]>

	* RemoveDuplicatesTest.cs: New.

In class/Microsoft.Build.Tasks:
2009-10-08  Ankit Jain  <[email protected]>

	* Microsoft.Build.Tasks_test.dll.sources: Added
	RemoveDuplicatesTest.cs

In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
2009-10-08  Ankit Jain  <[email protected]>

	* MSBuild.cs (Execute): Don't share target output items,
	always create a copy.

2009-10-08  Ankit Jain  <[email protected]>

	* RemoveDuplicates.cs: Use item's ItemSpec as the key.

2009-10-07  Ankit Jain  <[email protected]>

	* ManagedCompiler.cs (HandleTaskExecutionErrors): Log error if
	required.

2009-10-06  Ankit Jain  <[email protected]>

	* Exec.cs (ExecuteTool): Use DeleteTempFile instead of File.Delete
	(HandleTaskExecutionErrors): Log error, if required.
	* MSBuild.cs: Don't log error.
	* Warning.cs: Don't log if @text is empty.

In class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine:
2009-10-08  Ankit Jain  <[email protected]>

	* ProjectTest.cs (TestBatchedMetadataRefInOutput): New.

In class/Microsoft.Build.Engine/Test/various:
2009-10-08  Ankit Jain  <[email protected]>

	* Items.cs (TestItemsWithWildcards): New.

2009-10-08  Ankit Jain  <[email protected]>

	* Items.cs (TestItems5): Fix to work correctly on windows
	and unix.
	(TestReservedMetadata): New.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-10-08  Ankit Jain  <[email protected]>

	* DirectoryScanner.cs: Use Path.GetPathRoot, instead of
	directly using DirectoryInfo ("z:"), that doesn't return
	a dir info for "z:".

2009-10-08  Ankit Jain  <[email protected]>

	* DirectoryScanner.cs: Handle absolute paths. Fix to work
	correctly on windows. Change order of adding paths to match
	msbuild, useful to have.

2009-10-08  Ankit Jain  <[email protected]>

	* TaskBatchingImpl.cs (ParseTaskAttributes): Parse attributes
	of the 'Output' element also.
	* TaskEngine.cs (PublishOutput): Honor condition on 'Output' also.

2009-10-07  Ankit Jain  <[email protected]>

	* ConsoleLogger.cs: Mark build as failed, if any project failed.

2009-10-06  Ankit Jain  <[email protected]>

	* ConsoleLogger: Improve error reporting. Don't count failed task,
	target or project as another error. Show "errors" after "warnings",
	more useful to the user.
	* Project.cs (BuildTarget): Log error instead of using CWL.

In class/Microsoft.Build.Utilities/Mono.XBuild.Utilities:
2009-10-08  Ankit Jain  <[email protected]>

	* ReservedNameUtils.cs: Fix 'RootDir', 'Directory'.
	(WithTrailingSlash): New.
	Update to use the new WithTrailingSlash method.

In class/Microsoft.Build.Utilities/Microsoft.Build.Utilities:
2009-10-06  Ankit Jain  <[email protected]>

	* ToolTask.cs (Execute): HandleTaskExecutionErrors is called only
	if exitCode != 0.
	(ExecuteTool): Move logging of exitcode to HandleTaskExecutionErrors.
	Remove MonoTODOs.
	* TaskLoggingHelper.cs (LogMessageFromText): New.
	(LogMessage): Refactor to use above.


svn path=/branches/mono-2-6/mcs/; revision=143736
2009-10-08 00:58:55 +00:00
Atsushi Eno 5464542c55 backport r143704 from trunk.
svn path=/branches/mono-2-6/mcs/; revision=143706
2009-10-07 19:14:40 +00:00
Atsushi Eno 4ce9ff767f I have committed extraneous stuff (that I once did too in trunk).
svn path=/branches/mono-2-6/mcs/; revision=143705
2009-10-07 19:13:32 +00:00
Atsushi Eno db5459c586 merge all changes from trunk (r143247 - r143697)
svn path=/branches/mono-2-6/mcs/; revision=143702
2009-10-07 19:04:59 +00:00
Atsushi Eno 3268e37cd1 merge all commits from trunk (r142816 - r143609)
svn path=/branches/mono-2-6/mcs/; revision=143700
2009-10-07 18:54:05 +00:00
Sebastien Pouliot d4674914b9 2009-10-07 Sebastien Pouliot <[email protected]>
* String.cs: Remove unsafe code duplication in ToCharArray.
	Define out the unused InternalStrcpy icalls
	* StringComparer.cs: Seal internal/private inner classes.
	[Backport r143651]


svn path=/branches/mono-2-6/mcs/; revision=143653
2009-10-07 13:46:13 +00:00
Sebastien Pouliot e7702bf35d 2009-10-07 Sebastien Pouliot <[email protected]>
* CompareInfo.cs: Don't allow MONO_DISABLE_MANAGED_COLLATION
	override for Moonlight and move all icalls together so they
	can be #if-ed out.
	[Backport r143648]


svn path=/branches/mono-2-6/mcs/; revision=143649
2009-10-07 13:41:18 +00:00
Zoltan Varga c3f5ca896a 2009-10-07 Zoltan Varga <[email protected]>
* pinvoke2.cs libtest.c: Add a test for marshalling DateTime to unmanaged code.

svn path=/branches/mono-2-6/mono/; revision=143642
2009-10-07 13:21:53 +00:00
Zoltan Varga a41a82a694 2009-10-07 Zoltan Varga <[email protected]>
* marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
	Fixes #322934.

svn path=/branches/mono-2-6/mono/; revision=143641
2009-10-07 13:21:45 +00:00
Sebastien Pouliot bdb31e441e net_2_1_raw_corlib.dll.sources: Remove System/LocalDataStoreSlot.cs from Moonlight build
svn path=/branches/mono-2-6/mcs/; revision=143634
2009-10-07 12:44:25 +00:00
Sebastien Pouliot 0b8e8c6cb7 2009-10-07 Sebastien Pouliot <[email protected]>
* Context.cs: Remove LocalDataStoreSlot-related methods from
	Moonlight build
	[Backport r143631]


svn path=/branches/mono-2-6/mcs/; revision=143632
2009-10-07 12:42:07 +00:00
Sebastien Pouliot e4c96ec70a 2009-10-07 Sebastien Pouliot <[email protected]>
* Thread.cs: Remove LocalDataStoreSlot-related methods from
	Moonlight build
	[Backport r143629]


svn path=/branches/mono-2-6/mcs/; revision=143630
2009-10-07 12:35:56 +00:00
Sebastien Pouliot f91f74d6d7 In Test/System.ServiceModel:
2009-10-07  Sebastien Pouliot  <[email protected]>

	* OperationContextTest.cs: Add test case for OperationContext.Current
	[Backport r143620]

In System.ServiceModel:
2009-10-07  Sebastien Pouliot  <[email protected]>

	* OperationContext.cs: Use [ThreadStatic] instead of Thread.
	GetNamedDataSlot with Thread.[Get|Set]Data since it offers type
	safety and don't require keeping extra API inside Moonlight
	[Backport r143620]


svn path=/branches/mono-2-6/mcs/; revision=143621
2009-10-07 12:05:01 +00:00
Marek Habersack 0263ba084f Backport of r143611
svn path=/branches/mono-2-6/mcs/; revision=143612
2009-10-07 10:49:21 +00:00
Gonzalo Paniagua Javier 4b085e4b62 2009-10-07 Gonzalo Paniagua Javier <[email protected]>
* StaticFileHandler.cs: it's the last flush even when a VPP is used.


svn path=/branches/mono-2-6/mcs/; revision=143598
2009-10-07 04:03:06 +00:00
Atsushi Eno 651f863792 backport r143593.
svn path=/branches/mono-2-6/mcs/; revision=143594
2009-10-07 02:22:55 +00:00
Marek Habersack 2365397ca3 Backport of r143587
svn path=/branches/mono-2-6/mcs/; revision=143588
2009-10-07 00:10:27 +00:00
Sebastien Pouliot dfd3372251 2009-10-06 Sebastien Pouliot <[email protected]>
* Decimal.cs: Use Compare method instead of directly using the
	decimalCompare internal call.
	[Backport r143554]


svn path=/branches/mono-2-6/mcs/; revision=143555
2009-10-06 20:09:20 +00:00
Sebastien Pouliot 4c9ee53953 2009-10-06 Sebastien Pouliot <[email protected]>
* Enum.cs: Add an internal Value property as a single point to 
	call the internal call get_value.
	[Backport r143549]


svn path=/branches/mono-2-6/mcs/; revision=143550
2009-10-06 18:53:49 +00:00
Sebastien Pouliot 8921ca9e49 net_2_1_raw_corlib.dll.sources: Remove normalization files from Moonlight build
svn path=/branches/mono-2-6/mcs/; revision=143541
2009-10-06 17:18:41 +00:00
Sebastien Pouliot bf1d85db26 2009-10-06 Sebastien Pouliot <[email protected]>
* Encoding.cs: Remove normalization methods for Moonlight
	[Backport r143536]


svn path=/branches/mono-2-6/mcs/; revision=143537
2009-10-06 17:16:20 +00:00
Sebastien Pouliot 4f5f2e43e2 2009-10-06 Sebastien Pouliot <[email protected]>
* String.cs: Remove normalization methods for Moonlight
	[Backport r143533]


svn path=/branches/mono-2-6/mcs/; revision=143535
2009-10-06 17:13:17 +00:00
Zoltan Varga 0d8d9abd48 2009-10-06 Zoltan Varga <[email protected]>
* aot-compiler.c (add_generic_class): Add an instance of GenericComparer<T> for
	each instance of Comparer<T>.

	* generics.cs: Add a new test.

svn path=/branches/mono-2-6/mono/; revision=143532
2009-10-06 17:10:01 +00:00
Gonzalo Paniagua Javier 9f4abfb1d5 2009-10-06 Gonzalo Paniagua Javier <[email protected]>
* GatewayIPAddressInformationCollection.cs:
	* IPInterfaceProperties.cs: implement GatewayAddresses for linux.
	Original patch by Christoph von Wittich.
	Fixes bug #544640.


svn path=/branches/mono-2-6/mcs/; revision=143526
2009-10-06 16:25:59 +00:00
Jonathan Chambers 22c4e0ee3b 2009-10-06 Jonathan Chambers <[email protected]>
* String.cs (Contains): Use CompareOptions.Ordinal. Fixes bug
        #535425.


svn path=/branches/mono-2-6/mcs/; revision=143521
2009-10-06 15:14:43 +00:00
Mark Probst 4e92234406 2009-10-06 Mark Probst <[email protected]>
* object.c (mono_method_return_message_restore): Handle the case
        where the argument is an instance of a generic type.  Fixes
        #544446.

        Backport of r143506.

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

        * bug-544445.cs: New test.

        * Makefile.am: Test added.

        Backport of r143506.

svn path=/branches/mono-2-6/mono/; revision=143510
2009-10-06 13:15:18 +00:00
Marek Habersack 4ab670066a Fix the build
svn path=/branches/mono-2-6/mcs/; revision=143429
2009-10-05 17:58:35 +00:00
Marek Safar 29f9e5ff3d 2009-10-05 Marek Safar <[email protected]>
* expression.cs: Equality comparison of generic parameter with
	class constraint.


svn path=/branches/mono-2-6/mcs/; revision=143421
2009-10-05 16:50:49 +00:00
Marek Safar 292fa3413f 2009-10-05 Marek Safar <[email protected]>
A fix for bug #543570
	* generic.cs: Import predefined constraints correctly.


svn path=/branches/mono-2-6/mcs/; revision=143418
2009-10-05 16:05:18 +00:00
Marek Habersack 17ebd3efa0 Backport of r143388
svn path=/branches/mono-2-6/mcs/; revision=143389
2009-10-05 11:15:22 +00:00
Marek Habersack 7b6992976a Backport of r143384
svn path=/branches/mono-2-6/mcs/; revision=143385
2009-10-05 10:45:56 +00:00
Atsushi Eno 02bd2a8b2d backport r143368 and r143369.
svn path=/branches/mono-2-6/mcs/; revision=143371
2009-10-05 06:02:52 +00:00
Atsushi Eno 4415259ba1 backport r143367.
svn path=/branches/mono-2-6/mcs/; revision=143370
2009-10-05 06:01:30 +00:00
Zoltan Varga 8253721cb0 2009-10-04 Zoltan Varga <[email protected]>
* aot-compiler.c (add_generic_class): Only add GetGenericValueImpl wrappers
	when using full-aot.

svn path=/branches/mono-2-6/mono/; revision=143350
2009-10-04 16:34:37 +00:00
Zoltan Varga 589b50de6f 2009-10-04 Zoltan Varga <[email protected]>
* processes.c: Implement get_process_name_from_proc () on solaris.

svn path=/branches/mono-2-6/mono/; revision=143341
2009-10-04 15:35:47 +00:00
Ankit Jain 85f197004d Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild:
2009-10-03  Ankit Jain  <[email protected]>

	Fix bug#542461.
	* xbuild/Microsoft.Common.targets (KeyOriginatorFile): Set to
	$(AssemblyOriginatorKeyFile), if SignAssembly is true.
	Use it for satellite assemblies also.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-10-03  Ankit Jain  <[email protected]>

	* Project.cs (OS): New.
	(InitializeProperties): Set 'OS' as a pre-defined property, set to
	'Windows_NT', 'Unix' or 'OSX' depending on the platform.


svn path=/branches/mono-2-6/mcs/; revision=143317
2009-10-02 22:08:37 +00:00
Zoltan Varga 01c866af9c 2009-10-02 Zoltan Varga <[email protected]>
* mini-sparc.c (mono_arch_emit_setret): Emit long return values using OP_LMOVE.
	(mono_arch_create_vars): Instead of allocating a stack slot by hand, allocate
	a variable to hold the stack slot used by the int<->float conversion opcodes.

svn path=/branches/mono-2-6/mono/; revision=143311
2009-10-02 18:53:26 +00:00
Zoltan Varga 4bf53054c2 2009-09-25 Zoltan Varga <[email protected]>
* mini-sparc.c (mono_arch_create_vars): Make the component vars of a long ret
	variable volatile. Fixes #541577.

	* basic-calls.cs: Add a new test.

	* basic-long.cs: Remove tests which are now in basic-calls.cs.

svn path=/branches/mono-2-6/mono/; revision=143310
2009-10-02 18:53:18 +00:00
Zoltan Varga 04ca35cc6a 2009-10-02 Zoltan Varga <[email protected]>
* mini-sparc.c (mono_arch_build_imt_thunk): Implement support for fail_tramp.

svn path=/branches/mono-2-6/mono/; revision=143270
2009-10-02 10:49:14 +00:00
Marek Safar 43806c6701 2009-10-02 Marek Safar <[email protected]>
* ecore.cs: Don't crash on overloads with optional paremeters where
	arguments count overflows.
	
	* parameter.cs: Import optional parameter constants using optional
	value type.


svn path=/branches/mono-2-6/mcs/; revision=143265
2009-10-02 10:43:14 +00:00
Ankit Jain 8dd2dbbe9e Update xbuild and Microsoft.Build.* from trunk.
In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-10-02  Ankit Jain  <[email protected]>

	* Expression.cs (Parse): Don't change '/' to '\\', not required.

In class/Microsoft.Build.Utilities/Microsoft.Build.Utilities:
2009-10-02  Ankit Jain  <[email protected]>

	* AppDomainIsolatedTask.cs (BuildEngine): Init 'log'.


svn path=/branches/mono-2-6/mcs/; revision=143217
2009-10-01 20:40:44 +00:00
Geoff Norton 5c45430b3f Include async dns in monotouch
svn path=/branches/mono-2-6/mcs/; revision=143194
2009-10-01 18:33:11 +00:00
Miguel de Icaza d70052496a Backport
svn path=/branches/mono-2-6/mcs/; revision=143110
2009-10-01 02:42:30 +00:00
Gonzalo Paniagua Javier 3de2cd8abe 2009-09-30 Gonzalo Paniagua Javier <[email protected]>
* HtmlSelectBuilder.cs: <option> allows the value of the 'selected'
	attribute to be a boolean or the string "selected", which is treated
	as "true".


svn path=/branches/mono-2-6/mcs/; revision=143106
2009-10-01 02:24:44 +00:00
Gonzalo Paniagua Javier 91f3e24d60 2009-09-30 Gonzalo Paniagua Javier <[email protected]>
* CodeNamespace.cs:
	* CodeTypeReference.cs:
	* CodeMemberMethod.cs:
	* CodeCompileUnit.cs:
	* CodeNamespaceImportCollection.cs:
	* CodeTypeDeclaration.cs: renamed/added fields so that we're
	compatible with MS serialization.


svn path=/branches/mono-2-6/mcs/; revision=143103
2009-10-01 01:44:23 +00:00
Gonzalo Paniagua Javier 681488c662 2009-09-30 Gonzalo Paniagua Javier <[email protected]>
* Hashtable.cs: MS (at least latest and greatest) does not always
	serialized the HashCodeProvider. Ignoring the error when the field
	is not found.


svn path=/branches/mono-2-6/mcs/; revision=143100
2009-10-01 01:41:07 +00:00
Gonzalo Paniagua Javier 3b095deb1e undo. Proper fix was in BuildManager
svn path=/branches/mono-2-6/mcs/; revision=143097
2009-10-01 01:25:17 +00:00
Gonzalo Paniagua Javier 5cc7eaea6e 2009-09-30 Gonzalo Paniagua Javier <[email protected]>
* BuildManager.cs: load/set the global resources assembly for
	precompiled and merged sites correctly.


svn path=/branches/mono-2-6/mcs/; revision=143094
2009-10-01 01:22:15 +00:00
Ankit Jain 7803cd3ec4 Update xbuild and Microsoft.Build.* from trunk.
In class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine:
2009-10-01  Ankit Jain  <[email protected]>

	* ImportTest.cs (TestAdd1): Add tests for multiple imports.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-10-01  Ankit Jain  <[email protected]>

	* Project.cs (AddImport): Show the correct source file name, when
	the import is in the main project file.

2009-10-01  Ankit Jain  <[email protected]>

	Fix bug #543299.
	* Import.cs (.ctor): Evaluate and set EvaluatedProjectPath to
	the full path of the imported project here itself, instead of ..
	(Evaluate): .. here.
	* ImportCollection.cs (Add): Use import.EvaluatedProjectPath .
	(Contains): New.
	* Project.cs (AddImport): Don't process if condition is false.
	Warn if a circular reference is detected, and ignore the import.


svn path=/branches/mono-2-6/mcs/; revision=143082
2009-09-30 23:21:18 +00:00
Geoff Norton 4ebde82145 Add AssemblyInfo so we can strong name the dll
svn path=/branches/mono-2-6/mcs/; revision=143064
2009-09-30 19:42:48 +00:00
Geoff Norton b9b681b89f fix S.W.S on monotouch
svn path=/branches/mono-2-6/mcs/; revision=143062
2009-09-30 19:39:07 +00:00
Geoff Norton a5aeef3952 2009-09-30 Miguel de Icaza <[email protected]>
* ExtensionManager.cs: Initialize the NET_2_0 pieces with
	MonoTouch, but do not register any of the System.Configuration
	depending extensions.

	BuildExtensionImporters, BuildExtensionReflectors: empty methods
	for MOnoTouch.

	* ServiceDescriptionImporter.cs, WebReference.cs: Remove
	codegeneration features for MonoTouch

2009-09-30  Miguel de Icaza  <[email protected]>

	* Methods.cs: Empty extensions for MonoTouch for now.

	* ServerType.cs: On MonoTouch, we do not support HttpGet or
	HttpPost variations yet.

	* SoapExtension.cs: Avoid System.Configuration features.

svn path=/branches/mono-2-6/mcs/; revision=143061
2009-09-30 19:38:50 +00:00
Jackson Harper 4de89dd439 Add a couple of classes to net_2_1 these are available in SL3
svn path=/branches/mono-2-6/mcs/; revision=143046
2009-09-30 16:30:55 +00:00
Geoff Norton 15c9b8f2ca Put WCF back in to monotouch
svn path=/branches/mono-2-6/mcs/; revision=143022
2009-09-30 15:09:17 +00:00
Jonathan Pobst 8baca4235f 2009-09-26 Jonathan Pobst <[email protected]>
[Backport]
	* TreeNode.cs: When we invalidate a node, make sure we start at
	0, instead of the node's Bounds.Left, which does not include
	the +/-, checkbox, or stateimages.
	[Fixes bug #542481]

svn path=/branches/mono-2-6/mcs/; revision=143020
2009-09-30 15:05:29 +00:00
Zoltan Varga a927d1db6a 2009-09-29 Zoltan Varga <[email protected]>
* mini-sparc.c: Fix the handling of enums with base type long.

svn path=/branches/mono-2-6/mono/; revision=143008
2009-09-30 13:50:38 +00:00
Zoltan Varga efed257d39 2009-09-29 Zoltan Varga <[email protected]>
* mini-sparc.c (mono_arch_output_basic_block): Fix IREM_UN_IMM.

svn path=/branches/mono-2-6/mono/; revision=143007
2009-09-30 13:50:30 +00:00
Zoltan Varga 9ad9b08458 2009-09-29 Zoltan Varga <[email protected]>
* mono-compiler.h (MONO_INTERNAL): Disable this on solaris as it produces a
	millions of warnings during compilation.

svn path=/branches/mono-2-6/mono/; revision=143006
2009-09-30 13:50:23 +00:00
Zoltan Varga 9b2393d1c7 2009-09-29 Zoltan Varga <[email protected]>
* mini-sparc.c (mono_arch_allocate_vars): Use mono_class_from_mono_type ()
	instead of using type->data.klass as the later doesn't work with generics.

svn path=/branches/mono-2-6/mono/; revision=143005
2009-09-30 13:50:16 +00:00
Zoltan Varga 463c186397 2009-09-29 Zoltan Varga <[email protected]>
* mini-sparc.c (mono_arch_allocate_vars): Use mono_class_from_mono_type ()
	instead of using type->data.klass as the later doesn't work with generics.

svn path=/branches/mono-2-6/mono/; revision=143004
2009-09-30 13:50:09 +00:00
Zoltan Varga 45d870860c 2009-09-30 Zoltan Varga <[email protected]>
* pinvoke2.cs libtest.c: Add a test for #543133.

svn path=/branches/mono-2-6/mono/; revision=143000
2009-09-30 13:32:00 +00:00
Zoltan Varga 47df667e6e 2009-09-30 Zoltan Varga <[email protected]>
* marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
	Fixes #543133.

svn path=/branches/mono-2-6/mono/; revision=142999
2009-09-30 13:31:53 +00:00
Zoltan Varga 62e7e2c54d 2009-09-30 Zoltan Varga <[email protected]>
* aot-compiler.c (add_wrappers): Add a runtime invoke wrapper which is used by
	mono_runtime_capture_context () without calling mono_runtime_invoke ().
	(can_marshal_struct): Skip structures with auto layout.

svn path=/branches/mono-2-6/mono/; revision=142993
2009-09-30 12:49:29 +00:00
Zoltan Varga 788c9757fd 2009-09-30 Zoltan Varga <[email protected]>
* tramp-arm.c (GEN_TRAMP_SIZE): Increase this by 4.

svn path=/branches/mono-2-6/mono/; revision=142992
2009-09-30 12:49:21 +00:00
Marek Habersack daa2f108f3 Backport of r142984
svn path=/branches/mono-2-6/mcs/; revision=142985
2009-09-30 10:39:28 +00:00
Marek Safar 81bb1146d4 2009-09-30 Marek Safar <[email protected]>
A fix for bug #542959
	* delegate.cs: Emit correct delegate instance variable when there
	are static and non-static overloads.


svn path=/branches/mono-2-6/mcs/; revision=142978
2009-09-30 09:35:40 +00:00
Jb Evain 8da02c6d46 2009-09-30 Jb Evain <[email protected]>
* HttpRequestChannel.cs: When compiling for MonoTouch, avoid
	to use any of the remoting features.

svn path=/branches/mono-2-6/mcs/; revision=142972
2009-09-30 08:43:35 +00:00
Gonzalo Paniagua Javier fa1a176ef6 changelog
svn path=/branches/mono-2-6/mcs/; revision=142965
2009-09-30 06:06:31 +00:00
Gonzalo Paniagua Javier aebf222336 2009-09-30 Gonzalo Paniagua Javier <[email protected]>
* BinaryFormatter.cs: NoCheckDeserialize() was using PeekChar() on a
	reader when it should only read 1 byte. Also BinaryReader.PeekChar()
	tries to set the position of hte stream back to where it was before
	the read, which does not work well with broken Stream
	implementations like BZip2InputStream (reports CanSeek is true when
	it really can't seek). Now we do a Read() and then pass the value we
	read on to the next methods.

	* MessageFormatter.cs: 
	* ObjectReader.cs: added overloads that take a BinaryElement instead
	of reading it from the reader. Only for the methods used in
	NoCheckDeserialize.

	Fixes bug #503435.


svn path=/branches/mono-2-6/mcs/; revision=142964
2009-09-30 06:06:18 +00:00
Gonzalo Paniagua Javier 5afdc7affb 2009-09-30 Gonzalo Paniagua Javier <[email protected]>
* InotifyWatcher.cs: fixes bug #322330. Patch by Alexander Kojevnikov.
	This patch fixes the issues reported by the OP and in my previous
	comment. In particular:

	Hunks 1 and 4 remove the new_name_needed flag, it's not used
	anywhere and only adds confusion.

	Hunk 2 skips DeleteSelf event for sub-directories, they receive the
	Delete event anyway.

	Hunk 3 makes sure that we use a combination of Deleted+Created
	notifications instead of a single Renamed notification, if the watched item
	has been moved from one directory to another. This is because RenamedEventArgs
	supports only one directory name: FullPath is always directory+name,
	OldFullPath is always directory+old_name.

	Hunk 5 updates relevant InotifyData instances with the new directory
	name.  Without this, notifications always use the original folder names.

	The last hunk may be a bit slow as it needs to iterate on all the
	InotifyData instances. On the other hand, we are already doing it on the
	Delete event (lines 560:568) and by default inotify allows only 8192 watches
	per user.


svn path=/branches/mono-2-6/mcs/; revision=142959
2009-09-30 05:26:52 +00:00
Gonzalo Paniagua Javier 7d6aa1e322 2009-09-29 Gonzalo Paniagua Javier <[email protected]>
* TermInfoDriver.cs: attempt to fix bug #527487.


svn path=/branches/mono-2-6/mcs/; revision=142948
2009-09-30 03:14:42 +00:00
Marek Habersack db66ea05c0 Backport of r142943
svn path=/branches/mono-2-6/mcs/; revision=142944
2009-09-29 23:25:14 +00:00
Marek Habersack 43e34e9221 Backport of r142934
svn path=/branches/mono-2-6/mcs/; revision=142935
2009-09-29 21:52:05 +00:00
Andrew Jorgensen 69154db126 15:40 <kangaroo> its just apples assembler is horribly old and stupid
svn path=/branches/mono-2-6/mono/; revision=142933
2009-09-29 21:43:00 +00:00
Gonzalo Paniagua Javier 1f7a1c183c 2009-09-29 Gonzalo Paniagua Javier <[email protected]>
* AsyncResult.cs: do not create the handle if not needed.


svn path=/branches/mono-2-6/mcs/; revision=142930
2009-09-29 21:02:39 +00:00
Gonzalo Paniagua Javier beb7543392 2009-09-29 Gonzalo Paniagua Javier <[email protected]>
* EndPointListener.cs: fix matching a listener in presence of a query
	string or anchor.


svn path=/branches/mono-2-6/mcs/; revision=142901
2009-09-29 17:16:29 +00:00
Ankit Jain d0dbad9ad7 Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild:
2009-09-29  Ankit Jain  <[email protected]>

	* SolutionParser.cs (Insert): Show project name in case of a cyclic
	dependency.

In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
2009-09-29  Ankit Jain  <[email protected]>

	* Exec.cs: Write the commands, which can be multiline,
	to a temporary file, and execute that with "cmd.exe /c"
	on windows and "sh" on non-windows.
	(LogToolCommand): Override, and emit the commands instead
	of the actual args passed to the shell.

In class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine:
2009-09-29  Ankit Jain  <[email protected]>

	* ProjectTest.cs (TestPropertiesFromImportedProjects): New.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-09-29  Ankit Jain  <[email protected]>

	* GroupingCollection.cs (Evaluate): Mark internal.
	* Project.cs (AddImport): Only evaluate the properties,
	till before the import.

2009-09-29  Ankit Jain  <[email protected]>

	* Project.cs (DoLoad): Don't use XmlReader.Create, for loading
	the project xml, as returned Xml*Reader normalizes the newlines.
	Instead directly use the TextReader with XmlDocument.Load ().

In class/Microsoft.Build.Utilities/Microsoft.Build.Utilities:
2009-09-29  Ankit Jain  <[email protected]>

	* ToolTask.cs (ExecuteTool): Use LogToolCommand, instead of
	directly logging.
	(LogToolCommand): Implement.


svn path=/branches/mono-2-6/mcs/; revision=142871
2009-09-29 14:47:09 +00:00
Alan McGovern 4f8c33af39 2009-09-29 Alan McGovern <[email protected]>
* CategoryAttributeTest.cs: Added new test file.


svn path=/branches/mono-2-6/mcs/; revision=142867
2009-09-29 14:28:01 +00:00
Alan McGovern 90c46b9308 2009-09-29 Alan McGovern <[email protected]>
* DefaultValueAttribute.cs: Implement the cctor which takes
	a Type and a string for the SL2 case.
	* CategoryAttribute.cs: Fix a typo in the CategoryAttribute.Asynchronous
	ctor and fix some SL2 specific naming changes for the default properties.


svn path=/branches/mono-2-6/mcs/; revision=142866
2009-09-29 14:27:34 +00:00
Sebastien Pouliot 8082e15625 2009-09-29 Sebastien Pouliot <[email protected]>
* Timer_2_1.cs: Removed. No longer needed by Moonlight
	[Backport r142853]


svn path=/branches/mono-2-6/mcs/; revision=142855
2009-09-29 12:13:04 +00:00
Sebastien Pouliot 58864d7fca 2009-09-29 Sebastien Pouliot <[email protected]>
* net_2_1_raw_System.Net.dll.sources: Remove Timer_2_1.cs and 
	related classes from System.dll - they are not required anymore
	since Gonzalo's changes on Socket.Close(int)
	[Backport r142851]


svn path=/branches/mono-2-6/mcs/; revision=142852
2009-09-29 12:10:39 +00:00
Rolf Bjarne Kvinge c79c91c80c 2009-09-29 Rolf Bjarne Kvinge <[email protected]>
* Thread.cs: StartSafe: ignore ThreadAbortExceptions.

	Backport of r142847.

svn path=/branches/mono-2-6/mcs/; revision=142848
2009-09-29 11:01:18 +00:00
Rolf Bjarne Kvinge 8973515d9d 2009-09-29 Rolf Bjarne Kvinge <[email protected]>
* appdomain.c|h: Add a mono_domain_try_unload method which is
	equivalent to mono_domain_unload, except that it returns an exception
	instead of throwing it. Make mono_domain_unload use the
	mono_domain_try_unload method to avoid code-duplication.

	Backport of r142658.

svn path=/branches/mono-2-6/mono/; revision=142846
2009-09-29 10:55:42 +00:00
Gonzalo Paniagua Javier 9346c56300 Fix 1.1 profile
svn path=/branches/mono-2-6/mcs/; revision=142837
2009-09-29 09:25:25 +00:00
Gonzalo Paniagua Javier 5a4e4d261b 2009-09-29 Gonzalo Paniagua Javier <[email protected]>
* Ping.cs: fix the check for a time-out return value from 'ping'.


svn path=/branches/mono-2-6/mcs/; revision=142821
2009-09-29 05:57:31 +00:00
Gonzalo Paniagua Javier 259bc42379 2009-09-29 Gonzalo Paniagua Javier <[email protected]>
* HttpContext.cs: try to load App_GlobalResouces.dll if it has not
	been set but it exists in 'bin'.


svn path=/branches/mono-2-6/mcs/; revision=142818
2009-09-29 05:42:13 +00:00
Andrew Jorgensen 9b28a1de73 use wildcards for .mdbs
svn path=/branches/mono-2-6/mono/; revision=142814
2009-09-29 04:06:21 +00:00
Andrew Jorgensen 1eb27e1f63 don't build moonlight (not installed anyway)
grab entire xbuild directory (it's a deep structure and rpm doesn't like
un-owned directories)

svn path=/branches/mono-2-6/mono/; revision=142810
2009-09-29 03:34:16 +00:00
Marek Habersack 7edb572581 Backport of r142798
svn path=/branches/mono-2-6/mcs/; revision=142799
2009-09-28 21:42:17 +00:00
Ankit Jain 364a5d0b74 * mono-core.spec.in: Add Microsoft.WebApplication.targets
Backport r142787	

svn path=/branches/mono-2-6/mono/; revision=142788
2009-09-28 19:09:15 +00:00
Marek Habersack 3aa9628276 Backport of r142783
svn path=/branches/mono-2-6/mcs/; revision=142785
2009-09-28 18:54:18 +00:00
Marek Habersack bcc8b6fb2d Backport of r142780
svn path=/branches/mono-2-6/mcs/; revision=142781
2009-09-28 18:50:21 +00:00
Marek Habersack eefca1d2f0 Backport of r142773
svn path=/branches/mono-2-6/mcs/; revision=142776
2009-09-28 18:08:33 +00:00
Marek Habersack 075b2246c4 Backport of r142766
svn path=/branches/mono-2-6/mcs/; revision=142767
2009-09-28 16:44:14 +00:00
Atsushi Eno 70390d5989 merge from trunk (r142744, r142745, r142760).
svn path=/branches/mono-2-6/mcs/; revision=142761
2009-09-28 15:24:15 +00:00
Sebastien Pouliot 08a3283160 2009-09-28 Sebastien Pouliot <[email protected]>
* SocketAsyncEventArgs.cs: Default SocketError.AccessDenied on 
	Connect in case none of the DnsEndPoint provides an adequate 
	address (family).
	[Backport r142746]


svn path=/branches/mono-2-6/mcs/; revision=142747
2009-09-28 12:03:28 +00:00
Ankit Jain f65e2f5bde Update xbuild and Microsoft.Build.* from trunk.
In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
2009-09-28  Ankit Jain  <[email protected]>

	* WriteLinesToFiles.cs (Execute): Handle empty list of
	lines.

In class/Microsoft.Build.Utilities/Microsoft.Build.Utilities:
2009-09-28  Ankit Jain  <[email protected]>

	* ToolTask.cs (ProcessOuputTool): Move logging of tool
	output from here to ..
	(ExecuteTool): .. here. As, ProcessOuputTool can be
	overridden.


svn path=/branches/mono-2-6/mcs/; revision=142742
2009-09-28 10:51:40 +00:00
Atsushi Eno 89a11d5206 backport r142735.
svn path=/branches/mono-2-6/mcs/; revision=142736
2009-09-28 04:48:46 +00:00
Gonzalo Paniagua Javier cd1791a956 fix
svn path=/branches/mono-2-6/mcs/; revision=142732
2009-09-28 03:29:48 +00:00
Gonzalo Paniagua Javier 06bce6170a 2009-09-27 Gonzalo Paniagua Javier <[email protected]>
* Socket_2_1.cs: Close(int timeout) blocks up to timeout ms if there's
	pending data to be written to the socket. If there's no pending data,
	it closes and returns right away. Instead of using Timer and then
	doing a 'hard' close(), we set the linger option for the socket.


svn path=/branches/mono-2-6/mcs/; revision=142730
2009-09-28 03:19:43 +00:00
Sebastien Pouliot 6eb53dd31a 2009-09-27 Sebastien Pouliot <[email protected]>
* SocketAsyncEventArgs.cs: Don't use Socket.Poll for NET_2_1.
	Throw NIE for use of BufferList in Receive.
	* Socket.cs: Move Close(int) to Socket_2_1.cs. Remove NET_2_1
	defines since the file is not used by Moonlight
	* Socket_2_1.cs: Add Close(int) from Socket. Define out Poll
	and Blocking.
	[Backport r142722]


svn path=/branches/mono-2-6/mcs/; revision=142723
2009-09-27 14:52:09 +00:00
Sebastien Pouliot 329316a6c6 2009-09-27 Sebastien Pouliot <[email protected]>
* net_2_1_raw_System.Net.dll.sources: Add Timer_2_1.cs and 
	related classes from System.dll
	[Backport of r142720]


svn path=/branches/mono-2-6/mcs/; revision=142721
2009-09-27 14:40:19 +00:00
Sebastien Pouliot cb768e733f 2009-09-27 Sebastien Pouliot <[email protected]>
* Timer_2_1.cs: New. A smaller, internal subset of Timer for 
	Moonlight - needed for Socket.Close(int)
	[Backport of r142718]


svn path=/branches/mono-2-6/mcs/; revision=142719
2009-09-27 14:38:23 +00:00
Gonzalo Paniagua Javier d1973e174d from trunk
svn path=/branches/mono-2-6/mono/; revision=142706
2009-09-27 06:19:31 +00:00
Gonzalo Paniagua Javier fd3fd2455f 2009-09-27 Gonzalo Paniagua Javier <[email protected]>
* Timer.cs: account for the time spent sending jobs to the queue.


svn path=/branches/mono-2-6/mcs/; revision=142704
2009-09-27 05:48:26 +00:00
Gonzalo Paniagua Javier 7944cbd726 2009-09-27 Gonzalo Paniagua Javier <[email protected]>
* TermInfoDriver.cs: avoid segv if the pointer is not properly
	initialized.


svn path=/branches/mono-2-6/mcs/; revision=142701
2009-09-27 05:40:34 +00:00
Gonzalo Paniagua Javier ef0ea82263 2009-09-27 Gonzalo Paniagua Javier <[email protected]>
* marshal.c: don't create the handle when calling. It is created later
	if needed.


svn path=/branches/mono-2-6/mono/; revision=142700
2009-09-27 05:32:25 +00:00
Gonzalo Paniagua Javier 2de8607599 2009-09-27 Gonzalo Paniagua Javier <[email protected]>
* AsyncResult.cs: don't create the handle if we know the result is
	completed.


svn path=/branches/mono-2-6/mcs/; revision=142698
2009-09-27 05:29:16 +00:00
Gonzalo Paniagua Javier ca5715e665 2009-09-27 Gonzalo Paniagua Javier <[email protected]>
* RealProxy.cs: for a custom proxy, retrieve the OutArgs before
	allowing EndInvoke to proceed because after that, OutArgs will throw
	because there is no method. Fixes remoting2 and remoting3 tests.


svn path=/branches/mono-2-6/mcs/; revision=142696
2009-09-27 05:20:25 +00:00
Veerapuram Varadhan 774fd03e78 Test fix.
svn path=/branches/mono-2-6/mcs/; revision=142689
2009-09-26 21:01:35 +00:00
Veerapuram Varadhan 8b8d58705b backport of r142668
svn path=/branches/mono-2-6/mcs/; revision=142688
2009-09-26 21:01:10 +00:00
Ankit Jain c5cbb9cb4b Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild:
2009-09-27  Ankit Jain  <[email protected]>

	* SolutionParser.cs: Implement support for WebSite projects. These
	projects lack a project file, so properties like references are read
	from the .sln file, and targets are generated for build/clean etc.

2009-09-26  Ankit Jain  <[email protected]>

	* xbuild/Microsoft.Common.targets: Remove _ValidateEssentialProperties
	from BuildDependsOn, which was a hack. It will get invoked from the
	InitialTargets now.

In class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine:
2009-09-26  Ankit Jain  <[email protected]>

	* TargetTest.cs (TestOverridingTargets): New.

2009-09-26  Ankit Jain  <[email protected]>

	* ProjectTest.cs (TestInitialTargetsWithImports):
	(TestDefaultTargets):
	(TestDefaultTargetsWithImports):
	(TestNoDefaultTargetsWithImports):
	(TestNoDefaultTargets): New tests.

In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine:
2009-09-27  Ankit Jain  <[email protected]>

	* ConditionParser.cs: Show the condition being parsed in the
	exception message.

2009-09-26  Ankit Jain  <[email protected]>

	* Expression.cs: Allow '-' in item, property and metadata names.

2009-09-26  Ankit Jain  <[email protected]>

	* Project.cs (Evaluate): Split into this and ..
	(PrepareForEvaluate): .. this.
	(AddImport): Evaluate the current set of properties/items etc,
	before processing the imported project. Honor the Condition
	for the Import.
	(ProcessProjectAttributes): Update MSBuildProjectDefaultTargets
	property.
	* GroupingCollection.cs (Evaluate): Don't evaluate Imports here.
	* BuildItemGroup.cs (Evaluate): Evaluate only once.
	* BuildPropertyGroup.cs (Evaluate): Evaluate only once.

2009-09-26  Ankit Jain  <[email protected]>

	* Project.cs: Get InitialTargets from the imported projects also.
	The combined list of targets are executed, in the order they were
	found.
	DefaultTargets are also read in from imported projects, and the first
	non-empty DefaultTargets found is used.


svn path=/branches/mono-2-6/mcs/; revision=142686
2009-09-26 20:49:54 +00:00
Sebastien Pouliot 95ab6bc64d In Test/System.Net.Sockets:
2009-09-26  Sebastien Pouliot  <[email protected]>

	* SocketAsyncEventArgsTest.cs: New. Unit tests
	[Backport r142675]

In System.Net.Sockets:
2009-09-26  Sebastien Pouliot  <[email protected]>

	* SocketAsyncEventArgs.cs: Fix paramater validations and default 
	values
	[Backport r142675]

In .:
2009-09-26  Sebastien Pouliot  <[email protected]>

	* System_test.dll.sources: Add unit tests for SocketAsyncEventArgs
	[Backport r142675]


svn path=/branches/mono-2-6/mcs/; revision=142676
2009-09-26 15:29:25 +00:00
Andrew Jorgensen 2403930b66 version
svn path=/branches/mono-2-6/mono/; revision=142639
2009-09-25 14:53:05 +00:00
1464 changed files with 120397 additions and 31742 deletions

No files matched your search

+60 -1
View File
@@ -1,3 +1,62 @@
2009-12-22 Geoff Norton <[email protected]>
* configure.in: Fix invalid escaping. Patch from Spina from
www.slacky.eu.
2009-12-21 Zoltan Varga <[email protected]>
* configure.in: Add an LLVM_CFLAGS automake variable.
2009-12-11 Zoltan Varga <[email protected]>
* configure.in: Applied patch from Matt McClellan ([email protected]). Add a check
for 2 parameter sched_setaffinity in older glibc versions. Fixes
#564000.
2009-11-17 Marek Habersack <[email protected]>
* runtime/Makefile.am (TEST_SUPPORT_FILES): added bin/al2 - needed
for System.Web tests.
2009-11-17 Zoltan Varga <[email protected]>
* configure.in: Add a --enable-minimal=soft-debug option.
2009-11-12 Zoltan Varga <[email protected]>
* acinclude.m4 (dolt_supported): Handle 'i686-pc-cygwin' too.
2009-11-04 Zoltan Varga <[email protected]>
* acinclude.m4 (dolt_supported): Applied patch from Kornél Pál
<[email protected]>. Enable dolt on cygwin.
2009-11-03 Zoltan Varga <[email protected]>
* configure.in: Check for netinet/in.h.
2009-11-02 Gonzalo Paniagua Javier <[email protected]>
* configure.in: add a few missing header file checks.
2009-11-01 Zoltan Varga <[email protected]>
* configure.in: Make the LLVM warning a bit more up-to-date.
* configure.in: Pass -mno-cygwin to CXX too on windows. Enable AC_PROG_CXX
since it now works on windows too.
2009-10-12 Zoltan Varga <[email protected]>
* data/Makefile.am (gdb_DATA): Install mono-gdb.py alongside the mono executable.
* data/gdb-pre7.0: New directory, containing the mono support files for
gdb versions before 7.0.
2009-09-29 Ankit Jain <[email protected]>
* mono-core.spec.in: Add Microsoft.WebApplication.targets
2009-08-29 Jonathan Pryor <[email protected]>
* man/mdoc-export-html.1: Document --with-profile, --with-version.
@@ -17,7 +76,7 @@
2009-08-04 Miguel de Icaza <[email protected]>
* Start the split between PLATFORM_WIN32 and TARGET_WIN32.
* Start the split between PLATFORM_WIN32 and TARGET_WIN32.
PLATFORM_WIN32 should be used to configure the runtime while
building it. TARGET_WIN32 is used for target execution.
+3
View File
@@ -26,6 +26,9 @@ i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-linux* \
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*)
pic_options='-fPIC'
;;
?86-pc-cygwin*|i?86-pc-cygwin*)
pic_options='-DDLL_EXPORT'
;;
i?86-apple-darwin*)
pic_options='-fno-common'
;;
+74 -9
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.5)
AM_INIT_AUTOMAKE(mono,2.6.1)
AM_MAINTAINER_MODE
API_VER=1.0
@@ -40,6 +40,8 @@ fi
# libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
CPPFLAGS_FOR_LIBGC=$CPPFLAGS
CFLAGS_FOR_LIBGC=$CFLAGS
CPPFLAGS_FOR_EGLIB=$CPPFLAGS
CFLAGS_FOR_EGLIB=$CFLAGS
#
# These are the flags that need to be stored in the mono.pc file for
@@ -82,12 +84,15 @@ case "$host" in
AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
if test "x$cross_compiling" = "xno"; then
CC="gcc -mno-cygwin -g"
CXX="g++ -mno-cygwin -g"
# So libgc configure gets -mno-cygwin
export CC
export CXX
fi
HOST_CC="gcc"
# Windows 2000 is required that includes Internet Explorer 5.01
CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
LDFLAGS="$LDFLAGS -lmswsock"
libmono_cflags="-mno-cygwin -mms-bitfields -mwindows"
libmono_ldflags="-mno-cygwin -mms-bitfields -mwindows"
libdl=
@@ -214,6 +219,22 @@ case "$host" in
if test "x$cross_compiling" = "xyes"; then
has_broken_apple_cpp=yes
fi
dnl Snow Leopard is horribly broken -- it reports itself as i386-apple-darwin10.0.0, but
dnl its gcc defaults to 64-bit mode. They have also deprecated the usage of ucontext
dnl we need to set some flags to build our 32-bit binaries on 10.6 properly
case "$host" in
i*86-*-darwin10*)
BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE -mmacosx-version-min=10.5"
CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_FLAGS"
CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
CXXFLAGS="$CXXFLAGS $BROKEN_DARWIN_FLAGS"
CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS"
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
;;
esac
;;
*)
AC_MSG_WARN([*** Please add $host to configure.in checks!])
@@ -234,8 +255,7 @@ AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
# Disabled for now to fix the windows build
#AC_PROG_CXX
AC_PROG_CXX
AM_PROG_AS
AM_PROG_CC_STDC
AC_PROG_INSTALL
@@ -294,7 +314,7 @@ fi
AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h)
AC_CHECK_HEADERS(sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h)
AC_CHECK_HEADERS(sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h)
AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
@@ -479,6 +499,7 @@ embedded)
GMODULE_CFLAGS="$GLIB_CFLAGS"
GMODULE_LIBS="$GLIB_LIBS"
eglib_dir=eglib
ac_configure_args="$ac_configure_args \"CPPFLAGS_FOR_EGLIB=$EGLIB_CPPFLAGS\" \"CFLAGS_FOR_EGLIB=$CFLAGS_FOR_EGLIB\""
AC_CONFIG_SUBDIRS(eglib)
;;
system)
@@ -590,7 +611,7 @@ DISABLED_FEATURES=none
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd.],
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd,soft_debug.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
@@ -688,7 +709,6 @@ if test "x$mono_feature_disable_verifier" = "xyes"; then
AC_MSG_NOTICE([Disabled the metadata and IL verifiers])
fi
if test "x$mono_feature_disable_jit" = "xyes"; then
AC_DEFINE(DISABLE_JIT, 1, [Disable the JIT, only full-aot mode will be supported by the runtime.])
AC_MSG_NOTICE([Disabled the JIT engine, only full AOT will be supported])
@@ -701,6 +721,11 @@ if test "x$mono_feature_disable_simd" = "xyes"; then
AC_MSG_NOTICE([Disabled SIMD support])
fi
if test "x$mono_feature_disable_soft_debug" = "xyes"; then
AC_DEFINE(DISABLE_SOFT_DEBUG, 1, [Disable Soft Debugger Agent.])
AC_MSG_NOTICE([Disabled Soft Debugger.])
fi
AC_MSG_CHECKING(for visibility __attribute__)
AC_TRY_COMPILE([], [
void __attribute__ ((visibility ("hidden"))) doit (void) {}
@@ -887,6 +912,31 @@ if test x$platform_win32 = xno; then
AC_CHECK_FUNCS(sched_setaffinity)
dnl ****************************************************************
dnl *** Check for sched_setaffinity from glibc versions before ***
dnl *** 2.3.4. The older versions of the function only take 2 ***
dnl *** parameters, not 3. ***
dnl *** ***
dnl *** Because the interface change was not made in a minor ***
dnl *** version rev, the __GLIBC__ and __GLIBC_MINOR__ macros ***
dnl *** won't always indicate the interface sched_affinity has. ***
dnl ****************************************************************
AC_MSG_CHECKING(for sched_setaffinity from glibc < 2.3.4)
AC_TRY_COMPILE([#include <sched.h>], [
int main() {
int mask = 1;
sched_setaffinity(0, &mask);
}
], [
# Yes, we have it...
AC_MSG_RESULT(yes)
AC_DEFINE(GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY, 1, [Have GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY])
], [
# We have the new, three-parameter version
AC_MSG_RESULT(no)
])
dnl ******************************************************************
dnl *** Check for large file support ***
dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
@@ -1846,11 +1896,26 @@ if test "x$enable_llvm" = "xyes"; then
AC_MSG_ERROR([llvm-config not found.])
fi
LLVM_CXXFLAGS=`$LLVM_CONFIG --cflags`
# The output of --cflags seems to include optimizations flags too
LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags`
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit x86codegen`
LLVM_LIBS="$LLVM_LDFLAGS $LLVM_LIBS -lstdc++"
# Should be something like '2.6' or '2.7svn'
llvm_version=`$LLVM_CONFIG --version`
major_version=`echo $llvm_version | cut -c 1`
minor_version=`echo $llvm_version | cut -c 3`
AC_DEFINE_UNQUOTED(LLVM_MAJOR_VERSION, $major_version, [Major version of LLVM libraries])
AC_DEFINE_UNQUOTED(LLVM_MINOR_VERSION, $minor_version, [Minor version of LLVM libraries])
# Have to pass these on the command line since mini-llvm-cpp.h already includes
# llvm's config.h
LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_MAJOR_VERSION=$major_version -DLLVM_MINOR_VERSION=$minor_version"
AC_SUBST(LLVM_CFLAGS)
AC_SUBST(LLVM_CXXFLAGS)
AC_SUBST(LLVM_LIBS)
AC_SUBST(LLVM_LDFLAGS)
@@ -2378,7 +2443,7 @@ if test x$platform_win32 = xyes; then
if test "x$cross_compiling" = "xno"; then
mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
else
mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\\'`\\etc
mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\'`\\etc
fi
else
mono_cfg_dir=$mono_cfg_root/etc
@@ -2690,6 +2755,6 @@ fi
if test x$enable_llvm = xyes; then
echo IMPORTANT:
echo IMPORTANT: The LLVM Back End is experimental and does not work yet.
echo IMPORTANT: The LLVM Back End is experimental and has known problems.
echo IMPORTANT:
fi
+5 -1
View File
@@ -12,7 +12,8 @@ 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 \
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
dtrace-prelink.sh mono.web.pc.in system.web.mvc.pc.in
dtrace-prelink.sh mono.web.pc.in system.web.mvc.pc.in \
gdb/mono-gdb.py
pkgconfigdir = $(libdir)/pkgconfig
@@ -34,3 +35,6 @@ DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-
mono_DATA = config \
browscap.ini
gdbdir = $(bindir)
gdb_DATA = gdb/mono-gdb.py
+66
View File
@@ -0,0 +1,66 @@
2009-10-09 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoSupport.run_hook): Set MONO_XDEBUG to 'gdb' to activate
the GDB support mode in the runtime.
2009-04-14 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoClassPrinter.to_string): Add a MonoClass* pretty
printer.
2009-04-12 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoMethodPrinter.to_string): Add a MonoMethod* pretty
printer.
2009-04-10 Zoltan Varga <[email protected]>
* mono-gdb.py: Update to the latest archer api.
2009-04-07 Zoltan Varga <[email protected]>
* mono-gdb.py (ObjectPrinter.__init__): Update to latest archer api.
2009-04-06 Zoltan Varga <[email protected]>
* test-xdb.py: New file, tester script for xdb.
* mono-gdb.py (stringify_class_name): Handle classes without a namespace
correctly.
* mono-gdb.py: Update after the changes to dwarfwriter.c.
2009-04-05 Zoltan Varga <[email protected]>
* mono-gdb.py: Handle superclasses in the pretty printer.
2009-03-27 Zoltan Varga <[email protected]>
* mono-gdb.py (StringPrinter.to_string): Fix support for non-ascii characters.
2009-03-20 Zoltan Varga <[email protected]>
* mono-gdb.py: Update for the latest python API on the archer branch.
2009-02-03 Zoltan Varga <[email protected]>
* mono-gdb.py: Remove the --64 argument to as, it is not needed.
* mono-gdb.py (stringify_class_name): Helper function to print base types
using their short name. Also add a prototype implementation of registering
the hooks from python code instead of needing the mono-gdbinit file.
* gdb-python.diff: Changes against the gdb archer branch at
http://sourceware.org/gdb/wiki/PythonGdb to fix some problems/add functionality.
2009-02-03 Geoff Norton <[email protected]>
* mono-gdbinit: Hook into backtrace as hook-stop seems to crash gdb
* mono-gdb.py: Find the gdbinit name from the executable name instead of
hardcoding mono
2009-01-29 Zoltan Varga <[email protected]>
* mono-gdb.py mono-gdbinit: Support files to help debugging mono/mono apps
using a python enabled gdb.
+163
View File
@@ -0,0 +1,163 @@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 640998b..fb73e9d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-03 Zoltan Varga <[email protected]>
+
+ * cil-script.c python/python-cmd.c: Allow registration of pre/post hooks from
+ python.
+
+ * symfile.c (add_symbol_file_command): Comment out verbose messages.
+
2009-02-03 Thiago Jung Bauermann <[email protected]>
* gdb/c-lang.c (c_get_string): Remove superfluous parenthesis from
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 835d29c..3941aa5 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -299,6 +299,13 @@ execute_user_command (struct cmd_list_element *c, char *args)
static int user_call_depth = 0;
extern int max_user_call_depth;
+ /* Might be a user defined command implemented in Python */
+ if (!c->user_commands && c->func)
+ {
+ (*c->func) (c, args, FALSE);
+ return;
+ }
+
old_chain = setup_user_args (args);
cmdlines = c->user_commands;
diff --git a/gdb/python/python-cmd.c b/gdb/python/python-cmd.c
index 61d5e5d..a3fbc08 100644
--- a/gdb/python/python-cmd.c
+++ b/gdb/python/python-cmd.c
@@ -339,7 +339,8 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
/* Object initializer; sets up gdb-side structures for command.
- Use: __init__(NAME, CMDCLASS, [COMPLETERCLASS, [PREFIX]]).
+ Use: __init__(NAME, CMDCLASS, [completerclass=COMPLETERCLASS, prefix=PREFIX,
+ pre_hook_of=PREHOOK_OF, post_hook_of=POSTHOOK_OF]).
NAME is the name of the command. It may consist of multiple words,
in which case the final word is the name of the new command, and
@@ -354,6 +355,11 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
If PREFIX is True, then this command is a prefix command.
+ PREHOOK_OF is the name of a gdb command this command becomes a
+ pre-execution hook of, same as if this command was defined using
+ "define hook-<cmdname>"
+ POSTHOOK_OF is the same for post-execution hooks.
+
The documentation for the command is taken from the doc string for
the python class.
@@ -362,15 +368,18 @@ static int
cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
{
cmdpy_object *obj = (cmdpy_object *) self;
- char *name;
+ char *name, *pre_hook_of = NULL, *post_hook_of = NULL;
int cmdtype;
int completetype = -1;
char *docstring = NULL;
volatile struct gdb_exception except;
struct cmd_list_element **cmd_list;
+ struct cmd_list_element *pre_hookc = NULL, *post_hookc = NULL;
char *cmd_name, *pfx_name;
PyObject *is_prefix = NULL;
int cmp;
+ static char *kwlist[] = {"name", "cmdclass", "completerclass", "prefix",
+ "pre_hook_of", "post_hook_of", NULL};
if (obj->command)
{
@@ -381,8 +390,9 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
return -1;
}
- if (! PyArg_ParseTuple (args, "si|iO", &name, &cmdtype,
- &completetype, &is_prefix))
+ if (! PyArg_ParseTupleAndKeywords (args, kwds, "si|iOss", kwlist, &name, &cmdtype,
+ &completetype, &is_prefix, &pre_hook_of,
+ &post_hook_of))
return -1;
if (cmdtype != no_class && cmdtype != class_run
@@ -402,6 +412,30 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
return -1;
}
+ if (pre_hook_of)
+ {
+ char *text = pre_hook_of;
+
+ pre_hookc = lookup_cmd_1 (&text, cmdlist, NULL, 1);
+ if (! pre_hookc)
+ {
+ PyErr_Format (PyExc_RuntimeError, _("command name given by pre_hook argument not found"));
+ return -1;
+ }
+ }
+
+ if (post_hook_of)
+ {
+ char *text = post_hook_of;
+
+ post_hookc = lookup_cmd_1 (&text, cmdlist, NULL, 1);
+ if (! post_hookc)
+ {
+ PyErr_Format (PyExc_RuntimeError, _("command name given by post_hook argument not found"));
+ return -1;
+ }
+ }
+
cmd_name = gdbpy_parse_command_name (name, &cmd_list, &cmdlist);
if (! cmd_name)
return -1;
@@ -470,6 +504,18 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
cmd->func = cmdpy_function;
cmd->destroyer = cmdpy_destroyer;
+ if (pre_hookc)
+ {
+ pre_hookc->hook_pre = cmd;
+ cmd->hookee_pre = pre_hookc;
+ }
+
+ if (post_hookc)
+ {
+ post_hookc->hook_post = cmd;
+ cmd->hookee_post = post_hookc;
+ }
+
obj->command = cmd;
set_cmd_context (cmd, self);
set_cmd_completer (cmd, ((completetype == -1) ? cmdpy_completer
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 14cb7b8..6d0bb40 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2196,7 +2196,7 @@ add_symbol_file_command (char *args, int from_tty)
statements because hex_string returns a local static
string. */
- printf_unfiltered (_("add symbol table from file \"%s\" at\n"), filename);
+ /* printf_unfiltered (_("add symbol table from file \"%s\" at\n"), filename); */
section_addrs = alloc_section_addr_info (section_index);
make_cleanup (xfree, section_addrs);
for (i = 0; i < section_index; i++)
@@ -2211,7 +2211,7 @@ add_symbol_file_command (char *args, int from_tty)
entered on the command line. */
section_addrs->other[sec_num].name = sec;
section_addrs->other[sec_num].addr = addr;
- printf_unfiltered ("\t%s_addr = %s\n", sec, paddress (addr));
+ /* printf_unfiltered ("\t%s_addr = %s\n", sec, paddress (addr)); */
sec_num++;
/* The object's sections are initialized when a
+247
View File
@@ -0,0 +1,247 @@
#
# Author: Zoltan Varga ([email protected])
# License: MIT/X11
#
#
# This is a mono support mode for a python-enabled gdb:
# http://sourceware.org/gdb/wiki/PythonGdb
# Usage:
# - copy/symlink this file, plus mono-gdbinit to the directory where the mono
# executable lives.
# - run mono under gdb, or attach to a mono process using gdb
# - Type 'xdb' in gdb to load/reload the debugging info emitted by the runtime.
# - The debug info is emitted to a file called xdb.s in the current working directory.
# When attaching to a mono process, make sure you are in the same directory.
#
import os
class StringPrinter:
"Print a C# string"
def __init__(self, val):
self.val = val
def to_string(self):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "null"
obj = self.val.cast (gdb.lookup_type ("MonoString").pointer ()).dereference ()
len = obj ['length']
chars = obj ['chars']
i = 0
res = ['"']
while i < len:
val = (chars.cast(gdb.lookup_type ("gint64")) + (i * 2)).cast(gdb.lookup_type ("gunichar2").pointer ()).dereference ()
if val >= 256:
c = "\u%X" % val
else:
c = chr (val)
res.append (c)
i = i + 1
res.append ('"')
return ''.join (res)
def stringify_class_name(ns, name):
if ns == "System":
if name == "Byte":
return "byte"
if name == "String":
return "string"
if ns == "":
return name
else:
return "%s.%s" % (ns, name)
class ArrayPrinter:
"Print a C# array"
def __init__(self, val, class_ns, class_name):
self.val = val
self.class_ns = class_ns
self.class_name = class_name
def to_string(self):
obj = self.val.cast (gdb.lookup_type ("MonoArray").pointer ()).dereference ()
length = obj ['max_length']
return "%s [%d]" % (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length))
class ObjectPrinter:
"Print a C# object"
def __init__(self, val):
if str(val.type)[-1] == "&":
self.val = val.address.cast (gdb.lookup_type ("MonoObject").pointer ())
else:
self.val = val.cast (gdb.lookup_type ("MonoObject").pointer ())
class _iterator:
def __init__(self,obj):
self.obj = obj
self.iter = self.obj.type.fields ().__iter__ ()
pass
def __iter__(self):
return self
def next(self):
field = self.iter.next ()
try:
if str(self.obj [field.name].type) == "object":
# Avoid recursion
return (field.name, self.obj [field.name].cast (gdb.lookup_type ("void").pointer ()))
else:
return (field.name, self.obj [field.name])
except:
# Superclass
return (field.name, self.obj.cast (gdb.lookup_type ("%s" % (field.name))))
def children(self):
# FIXME: It would be easier if gdb.Value would support iteration itself
# It would also be better if we could return None
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return {}.__iter__ ()
try:
obj = self.val.dereference ()
class_ns = obj ['vtable'].dereference ()['klass'].dereference ()['name_space'].string ()
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
if class_name [-2:len(class_name)] == "[]":
return {}.__iter__ ()
gdb_type = gdb.lookup_type ("struct %s_%s" % (class_ns.replace (".", "_"), class_name))
return self._iterator(obj.cast (gdb_type))
except:
print sys.exc_info ()[0]
print sys.exc_info ()[1]
return {}.__iter__ ()
def to_string(self):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "null"
try:
obj = self.val.dereference ()
class_ns = obj ['vtable'].dereference ()['klass'].dereference ()['name_space'].string ()
class_name = obj ['vtable'].dereference ()['klass'].dereference ()['name'].string ()
if class_ns == "System" and class_name == "String":
return StringPrinter (self.val).to_string ()
if class_name [-2:len(class_name)] == "[]":
return ArrayPrinter (self.val,class_ns,class_name).to_string ()
if class_ns != "":
try:
gdb_type = gdb.lookup_type ("struct %s.%s" % (class_ns, class_name))
except:
# Maybe there is no debug info for that type
return "%s.%s" % (class_ns, class_name)
#return obj.cast (gdb_type)
return "%s.%s" % (class_ns, class_name)
return class_name
except:
print sys.exc_info ()[0]
print sys.exc_info ()[1]
# FIXME: This can happen because we don't have liveness information
return self.val.cast (gdb.lookup_type ("guint64"))
class MonoMethodPrinter:
"Print a MonoMethod structure"
def __init__(self, val):
self.val = val
def to_string(self):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "0x0"
val = self.val.dereference ()
klass = val ["klass"].dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
return "\"%s:%s ()\"" % (class_name, val ["name"].string ())
# This returns more info but requires calling into the inferior
#return "\"%s\"" % (gdb.parse_and_eval ("mono_method_full_name (%s, 1)" % (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ())
class MonoClassPrinter:
"Print a MonoClass structure"
def __init__(self, val):
self.val = val
def to_string(self):
if int(self.val.cast (gdb.lookup_type ("guint64"))) == 0:
return "0x0"
klass = self.val.dereference ()
class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
return "\"%s\"" % (class_name)
# This returns more info but requires calling into the inferior
#return "\"%s\"" % (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*)%s)->byval_arg)" % (str (int ((self.val).cast (gdb.lookup_type ("guint64")))))))
def lookup_pretty_printer(val):
t = str (val.type)
if t == "object":
return ObjectPrinter (val)
if t[0:5] == "class" and t[-1] == "&":
return ObjectPrinter (val)
if t == "string":
return StringPrinter (val)
if t == "MonoMethod *":
return MonoMethodPrinter (val)
if t == "MonoClass *":
return MonoClassPrinter (val)
return None
def register_csharp_printers(obj):
"Register C# pretty-printers with objfile Obj."
if obj == None:
obj = gdb
obj.pretty_printers.append (lookup_pretty_printer)
register_csharp_printers (gdb.current_objfile())
class MonoSupport(object):
def __init__(self):
self.s_size = 0
def run_hook(self):
if os.access ("xdb.s", os.F_OK):
os.remove ("xdb.s")
gdb.execute ("set environment MONO_XDEBUG gdb")
def stop_hook(self):
# Called when the program is stopped
# Need to recompile+reload the xdb.s file if needed
# FIXME: Need to detect half-written files created when the child is
# interrupted while executing the xdb.s writing code
# FIXME: Handle appdomain unload
if os.access ("xdb.s", os.F_OK):
new_size = os.stat ("xdb.s").st_size
if new_size > self.s_size:
sofile = "xdb.so"
gdb.execute ("shell as -o xdb.o xdb.s && ld -shared -o %s xdb.o" % sofile)
# FIXME: This prints messages which couldn't be turned off
gdb.execute ("add-symbol-file %s 0" % sofile)
self.s_size = new_size
class RunHook (gdb.Command):
def __init__ (self):
super (RunHook, self).__init__ ("hook-run", gdb.COMMAND_NONE,
gdb.COMPLETE_COMMAND, pre_hook_of="run")
def invoke(self, arg, from_tty):
mono_support.run_hook ()
print "Mono support loaded."
mono_support = MonoSupport ()
# This depends on the changes in gdb-python.diff to work
#RunHook ()
# Register our hooks
# This currently cannot be done from python code
exec_file = gdb.current_objfile ().filename
# FIXME: Is there a way to detect symbolic links ?
if os.stat (exec_file).st_size != os.lstat (exec_file).st_size:
exec_file = os.readlink (exec_file)
exec_dir = os.path.dirname (exec_file)
gdb.execute ("source %s/%s-gdbinit" % (exec_dir, os.path.basename (exec_file)))
File renamed without changes.
+19
View File
@@ -0,0 +1,19 @@
# Tester script for the xdb functionality
# Run using gdb -P test-xdb.py <NORMAL GDB COMMAND LINE>
import sys
gdb.execute ("file %s" % sys.argv [0])
gdb.execute ("r --break *:* %s" % " ".join (sys.argv[1:len(sys.argv)]))
while True:
try:
if gdb.threads () == None:
break
gdb.execute("xdb")
gdb.execute("bt")
gdb.execute("info args")
gdb.execute("info locals")
gdb.execute("c")
except:
gdb.execute ("quit")
+15
View File
@@ -1,3 +1,18 @@
2009-10-13 Zoltan Varga <[email protected]>
* mono-gdb.py: Add an 'xdb' command to flush the debugging info.
2009-10-12 Zoltan Varga <[email protected]>
* mono-gdb.py: Update this to gdb 7.0.
* mono-gdbinit: Removed, no longer needed.
2009-10-09 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoSupport.run_hook): Set MONO_XDEBUG to 'gdb' to activate
the GDB support mode in the runtime.
2009-04-14 Zoltan Varga <[email protected]>
* mono-gdb.py (MonoClassPrinter.to_string): Add a MonoClass* pretty
+14 -52
View File
@@ -4,15 +4,10 @@
#
#
# This is a mono support mode for a python-enabled gdb:
# http://sourceware.org/gdb/wiki/PythonGdb
# This is a mono support mode for gdb 7.0 and later
# Usage:
# - copy/symlink this file, plus mono-gdbinit to the directory where the mono
# executable lives.
# - run mono under gdb, or attach to a mono process using gdb
# - Type 'xdb' in gdb to load/reload the debugging info emitted by the runtime.
# - The debug info is emitted to a file called xdb.s in the current working directory.
# When attaching to a mono process, make sure you are in the same directory.
# - copy/symlink this file to the directory where the mono executable lives.
# - run mono under gdb, or attach to a mono process started with --debug=gdb using gdb.
#
import os
@@ -194,54 +189,21 @@ def register_csharp_printers(obj):
obj.pretty_printers.append (lookup_pretty_printer)
register_csharp_printers (gdb.current_objfile())
class MonoSupport(object):
def __init__(self):
self.s_size = 0
def run_hook(self):
if os.access ("xdb.s", os.F_OK):
os.remove ("xdb.s")
gdb.execute ("set environment MONO_XDEBUG 1")
def stop_hook(self):
# Called when the program is stopped
# Need to recompile+reload the xdb.s file if needed
# FIXME: Need to detect half-written files created when the child is
# interrupted while executing the xdb.s writing code
# FIXME: Handle appdomain unload
if os.access ("xdb.s", os.F_OK):
new_size = os.stat ("xdb.s").st_size
if new_size > self.s_size:
sofile = "xdb.so"
gdb.execute ("shell as -o xdb.o xdb.s && ld -shared -o %s xdb.o" % sofile)
# FIXME: This prints messages which couldn't be turned off
gdb.execute ("add-symbol-file %s 0" % sofile)
self.s_size = new_size
class RunHook (gdb.Command):
# This command will flush the debugging info collected by the runtime
class XdbCommand (gdb.Command):
def __init__ (self):
super (RunHook, self).__init__ ("hook-run", gdb.COMMAND_NONE,
gdb.COMPLETE_COMMAND, pre_hook_of="run")
super (XdbCommand, self).__init__ ("xdb", gdb.COMMAND_NONE,
gdb.COMPLETE_COMMAND)
def invoke(self, arg, from_tty):
mono_support.run_hook ()
gdb.execute ("call mono_xdebug_flush ()")
register_csharp_printers (gdb.current_objfile())
XdbCommand ()
gdb.execute ("set environment MONO_XDEBUG gdb")
print "Mono support loaded."
mono_support = MonoSupport ()
# This depends on the changes in gdb-python.diff to work
#RunHook ()
# Register our hooks
# This currently cannot be done from python code
exec_file = gdb.current_objfile ().filename
# FIXME: Is there a way to detect symbolic links ?
if os.stat (exec_file).st_size != os.lstat (exec_file).st_size:
exec_file = os.readlink (exec_file)
exec_dir = os.path.dirname (exec_file)
gdb.execute ("source %s/%s-gdbinit" % (exec_dir, os.path.basename (exec_file)))
Binary file not shown.
+13
View File
@@ -1,3 +1,16 @@
2009-12-22 Jo Shields <[email protected]>
* HtmlAgilityPack/LICENSE: Include upstream license (Ms-PL) since the
file headers don't specify it
2009-12-22 Jo Shields <[email protected]>
* HtmlAgilityPack/*: Bundle HtmlAgilityPack 1.4~beta2 from
http://www.codeplex.com/htmlagilitypack in source form.
* AgilityPack.dll: Remove binary assembly, use source instead.
* docs.make Makefile.am README: Reflect above changes
2009-02-12 Zoltan Varga <[email protected]>
* Makefile.am (EXTRA_DIST): Remove removed files.
@@ -0,0 +1,33 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.Text;
namespace HtmlAgilityPack
{
internal class EncodingFoundException : Exception
{
#region Fields
private Encoding _encoding;
#endregion
#region Constructors
internal EncodingFoundException(Encoding encoding)
{
_encoding = encoding;
}
#endregion
#region Properties
internal Encoding Encoding
{
get { return _encoding; }
}
#endregion
}
}
+260
View File
@@ -0,0 +1,260 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
#region
using System;
using System.Diagnostics;
#endregion
namespace HtmlAgilityPack
{
/// <summary>
/// Represents an HTML attribute.
/// </summary>
[DebuggerDisplay("Name: {OriginalName}, Value: {Value}")]
public class HtmlAttribute : IComparable
{
#region Fields
private int _line;
internal int _lineposition;
internal string _name;
internal int _namelength;
internal int _namestartindex;
internal HtmlDocument _ownerdocument; // attribute can exists without a node
internal HtmlNode _ownernode;
private AttributeValueQuote _quoteType = AttributeValueQuote.DoubleQuote;
internal int _streamposition;
internal string _value;
internal int _valuelength;
internal int _valuestartindex;
#endregion
#region Constructors
internal HtmlAttribute(HtmlDocument ownerdocument)
{
_ownerdocument = ownerdocument;
}
#endregion
#region Properties
/// <summary>
/// Gets the line number of this attribute in the document.
/// </summary>
public int Line
{
get { return _line; }
internal set { _line = value; }
}
/// <summary>
/// Gets the column number of this attribute in the document.
/// </summary>
public int LinePosition
{
get { return _lineposition; }
}
/// <summary>
/// Gets the qualified name of the attribute.
/// </summary>
public string Name
{
get
{
if (_name == null)
{
_name = _ownerdocument._text.Substring(_namestartindex, _namelength);
}
return _name.ToLower();
}
set
{
if (value == null)
{
throw new ArgumentNullException("value");
}
_name = value;
if (_ownernode != null)
{
_ownernode._innerchanged = true;
_ownernode._outerchanged = true;
}
}
}
/// <summary>
/// Name of attribute with original case
/// </summary>
public string OriginalName
{
get { return _name; }
}
/// <summary>
/// Gets the HTML document to which this attribute belongs.
/// </summary>
public HtmlDocument OwnerDocument
{
get { return _ownerdocument; }
}
/// <summary>
/// Gets the HTML node to which this attribute belongs.
/// </summary>
public HtmlNode OwnerNode
{
get { return _ownernode; }
}
/// <summary>
/// Specifies what type of quote the data should be wrapped in
/// </summary>
public AttributeValueQuote QuoteType
{
get { return _quoteType; }
set { _quoteType = value; }
}
/// <summary>
/// Gets the stream position of this attribute in the document, relative to the start of the document.
/// </summary>
public int StreamPosition
{
get { return _streamposition; }
}
/// <summary>
/// Gets or sets the value of the attribute.
/// </summary>
public string Value
{
get
{
if (_value == null)
{
_value = _ownerdocument._text.Substring(_valuestartindex, _valuelength);
}
return _value;
}
set
{
_value = value;
if (_ownernode != null)
{
_ownernode._innerchanged = true;
_ownernode._outerchanged = true;
}
}
}
internal string XmlName
{
get { return HtmlDocument.GetXmlName(Name); }
}
internal string XmlValue
{
get { return Value; }
}
/// <summary>
/// Gets a valid XPath string that points to this Attribute
/// </summary>
public string XPath
{
get
{
string basePath = (OwnerNode == null) ? "/" : OwnerNode.XPath + "/";
return basePath + GetRelativeXpath();
}
}
#endregion
#region IComparable Members
/// <summary>
/// Compares the current instance with another attribute. Comparison is based on attributes' name.
/// </summary>
/// <param name="obj">An attribute to compare with this instance.</param>
/// <returns>A 32-bit signed integer that indicates the relative order of the names comparison.</returns>
public int CompareTo(object obj)
{
HtmlAttribute att = obj as HtmlAttribute;
if (att == null)
{
throw new ArgumentException("obj");
}
return Name.CompareTo(att.Name);
}
#endregion
#region Public Methods
/// <summary>
/// Creates a duplicate of this attribute.
/// </summary>
/// <returns>The cloned attribute.</returns>
public HtmlAttribute Clone()
{
HtmlAttribute att = new HtmlAttribute(_ownerdocument);
att.Name = Name;
att.Value = Value;
return att;
}
/// <summary>
/// Removes this attribute from it's parents collection
/// </summary>
public void Remove()
{
_ownernode.Attributes.Remove(this);
}
#endregion
#region Private Methods
private string GetRelativeXpath()
{
if (OwnerNode == null)
return Name;
int i = 1;
foreach (HtmlAttribute node in OwnerNode.Attributes)
{
if (node.Name != Name) continue;
if (node == this)
break;
i++;
}
return "@" + Name + "[" + i + "]";
}
#endregion
}
/// <summary>
/// An Enum representing different types of Quotes used for surrounding attribute values
/// </summary>
public enum AttributeValueQuote
{
/// <summary>
/// A single quote mark '
/// </summary>
SingleQuote,
/// <summary>
/// A double quote mark "
/// </summary>
DoubleQuote
}
}
@@ -0,0 +1,394 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.Collections;
using System.Collections.Generic;
namespace HtmlAgilityPack
{
/// <summary>
/// Represents a combined list and collection of HTML nodes.
/// </summary>
public class HtmlAttributeCollection : IList<HtmlAttribute>
{
#region Fields
internal Dictionary<string, HtmlAttribute> Hashitems = new Dictionary<string, HtmlAttribute>();
private HtmlNode _ownernode;
private List<HtmlAttribute> items = new List<HtmlAttribute>();
#endregion
#region Constructors
internal HtmlAttributeCollection(HtmlNode ownernode)
{
_ownernode = ownernode;
}
#endregion
#region Properties
/// <summary>
/// Gets a given attribute from the list using its name.
/// </summary>
public HtmlAttribute this[string name]
{
get
{
if (name == null)
{
throw new ArgumentNullException("name");
}
return Hashitems.ContainsKey(name.ToLower()) ? Hashitems[name.ToLower()] : null;
}
set { Append(value); }
}
#endregion
#region IList<HtmlAttribute> Members
/// <summary>
/// Gets the number of elements actually contained in the list.
/// </summary>
public int Count
{
get { return items.Count; }
}
/// <summary>
/// Gets readonly status of colelction
/// </summary>
public bool IsReadOnly
{
get { return false; }
}
/// <summary>
/// Gets the attribute at the specified index.
/// </summary>
public HtmlAttribute this[int index]
{
get { return items[index]; }
set { items[index] = value; }
}
/// <summary>
/// Adds supplied item to collection
/// </summary>
/// <param name="item"></param>
public void Add(HtmlAttribute item)
{
Append(item);
}
/// <summary>
/// Explicit clear
/// </summary>
void ICollection<HtmlAttribute>.Clear()
{
items.Clear();
}
/// <summary>
/// Retreives existence of supplied item
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool Contains(HtmlAttribute item)
{
return items.Contains(item);
}
/// <summary>
/// Copies collection to array
/// </summary>
/// <param name="array"></param>
/// <param name="arrayIndex"></param>
public void CopyTo(HtmlAttribute[] array, int arrayIndex)
{
items.CopyTo(array, arrayIndex);
}
/// <summary>
/// Get Explicit enumerator
/// </summary>
/// <returns></returns>
IEnumerator<HtmlAttribute> IEnumerable<HtmlAttribute>.GetEnumerator()
{
return items.GetEnumerator();
}
/// <summary>
/// Explicit non-generic enumerator
/// </summary>
/// <returns></returns>
IEnumerator IEnumerable.GetEnumerator()
{
return items.GetEnumerator();
}
/// <summary>
/// Retrieves the index for the supplied item, -1 if not found
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public int IndexOf(HtmlAttribute item)
{
return items.IndexOf(item);
}
/// <summary>
/// Inserts given item into collection at supplied index
/// </summary>
/// <param name="index"></param>
/// <param name="item"></param>
public void Insert(int index, HtmlAttribute item)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
Hashitems[item.Name] = item;
item._ownernode = _ownernode;
items.Insert(index, item);
_ownernode._innerchanged = true;
_ownernode._outerchanged = true;
}
/// <summary>
/// Explicit collection remove
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
bool ICollection<HtmlAttribute>.Remove(HtmlAttribute item)
{
return items.Remove(item);
}
/// <summary>
/// Removes the attribute at the specified index.
/// </summary>
/// <param name="index">The index of the attribute to remove.</param>
public void RemoveAt(int index)
{
HtmlAttribute att = items[index];
Hashitems.Remove(att.Name);
items.RemoveAt(index);
_ownernode._innerchanged = true;
_ownernode._outerchanged = true;
}
#endregion
#region Public Methods
/// <summary>
/// Adds a new attribute to the collection with the given values
/// </summary>
/// <param name="name"></param>
/// <param name="value"></param>
public void Add(string name, string value)
{
Append(name, value);
}
/// <summary>
/// Inserts the specified attribute as the last attribute in the collection.
/// </summary>
/// <param name="newAttribute">The attribute to insert. May not be null.</param>
/// <returns>The appended attribute.</returns>
public HtmlAttribute Append(HtmlAttribute newAttribute)
{
if (newAttribute == null)
{
throw new ArgumentNullException("newAttribute");
}
Hashitems[newAttribute.Name] = newAttribute;
newAttribute._ownernode = _ownernode;
items.Add(newAttribute);
_ownernode._innerchanged = true;
_ownernode._outerchanged = true;
return newAttribute;
}
/// <summary>
/// Creates and inserts a new attribute as the last attribute in the collection.
/// </summary>
/// <param name="name">The name of the attribute to insert.</param>
/// <returns>The appended attribute.</returns>
public HtmlAttribute Append(string name)
{
HtmlAttribute att = _ownernode._ownerdocument.CreateAttribute(name);
return Append(att);
}
/// <summary>
/// Creates and inserts a new attribute as the last attribute in the collection.
/// </summary>
/// <param name="name">The name of the attribute to insert.</param>
/// <param name="value">The value of the attribute to insert.</param>
/// <returns>The appended attribute.</returns>
public HtmlAttribute Append(string name, string value)
{
HtmlAttribute att = _ownernode._ownerdocument.CreateAttribute(name, value);
return Append(att);
}
/// <summary>
/// Checks for existance of attribute with given name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public bool Contains(string name)
{
for (int i = 0; i < items.Count; i++)
{
if (items[i].Name.Equals(name.ToLower()))
return true;
}
return false;
}
/// <summary>
/// Inserts the specified attribute as the first node in the collection.
/// </summary>
/// <param name="newAttribute">The attribute to insert. May not be null.</param>
/// <returns>The prepended attribute.</returns>
public HtmlAttribute Prepend(HtmlAttribute newAttribute)
{
Insert(0, newAttribute);
return newAttribute;
}
/// <summary>
/// Removes a given attribute from the list.
/// </summary>
/// <param name="attribute">The attribute to remove. May not be null.</param>
public void Remove(HtmlAttribute attribute)
{
if (attribute == null)
{
throw new ArgumentNullException("attribute");
}
int index = GetAttributeIndex(attribute);
if (index == -1)
{
throw new IndexOutOfRangeException();
}
RemoveAt(index);
}
/// <summary>
/// Removes an attribute from the list, using its name. If there are more than one attributes with this name, they will all be removed.
/// </summary>
/// <param name="name">The attribute's name. May not be null.</param>
public void Remove(string name)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
string lname = name.ToLower();
for (int i = 0; i < items.Count; i++)
{
HtmlAttribute att = items[i];
if (att.Name == lname)
{
RemoveAt(i);
}
}
}
/// <summary>
/// Remove all attributes in the list.
/// </summary>
public void RemoveAll()
{
Hashitems.Clear();
items.Clear();
_ownernode._innerchanged = true;
_ownernode._outerchanged = true;
}
#endregion
#region LINQ Methods
/// <summary>
/// Returns all attributes with specified name. Handles case insentivity
/// </summary>
/// <param name="attributeName">Name of the attribute</param>
/// <returns></returns>
public IEnumerable<HtmlAttribute> AttributesWithName(string attributeName)
{
attributeName = attributeName.ToLower();
for (int i = 0; i < items.Count; i++)
{
if (items[i].Name.Equals(attributeName))
yield return items[i];
}
}
/// <summary>
/// Removes all attributes from the collection
/// </summary>
public void Remove()
{
foreach (HtmlAttribute item in items)
item.Remove();
}
#endregion
#region Internal Methods
/// <summary>
/// Clears the attribute collection
/// </summary>
internal void Clear()
{
Hashitems.Clear();
items.Clear();
}
internal int GetAttributeIndex(HtmlAttribute attribute)
{
if (attribute == null)
{
throw new ArgumentNullException("attribute");
}
for (int i = 0; i < items.Count; i++)
{
if ((items[i]) == attribute)
return i;
}
return -1;
}
internal int GetAttributeIndex(string name)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
string lname = name.ToLower();
for (int i = 0; i < items.Count; i++)
{
if ((items[i]).Name == lname)
return i;
}
return -1;
}
#endregion
}
}
+142
View File
@@ -0,0 +1,142 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
namespace HtmlAgilityPack
{
internal class HtmlCmdLine
{
#region Static Members
internal static bool Help;
#endregion
#region Constructors
static HtmlCmdLine()
{
Help = false;
ParseArgs();
}
#endregion
#region Internal Methods
internal static string GetOption(string name, string def)
{
string p = def;
string[] args = Environment.GetCommandLineArgs();
for (int i = 1; i < args.Length; i++)
{
GetStringArg(args[i], name, ref p);
}
return p;
}
internal static string GetOption(int index, string def)
{
string p = def;
string[] args = Environment.GetCommandLineArgs();
int j = 0;
for (int i = 1; i < args.Length; i++)
{
if (GetStringArg(args[i], ref p))
{
if (index == j)
return p;
else
p = def;
j++;
}
}
return p;
}
internal static bool GetOption(string name, bool def)
{
bool p = def;
string[] args = Environment.GetCommandLineArgs();
for (int i = 1; i < args.Length; i++)
{
GetBoolArg(args[i], name, ref p);
}
return p;
}
internal static int GetOption(string name, int def)
{
int p = def;
string[] args = Environment.GetCommandLineArgs();
for (int i = 1; i < args.Length; i++)
{
GetIntArg(args[i], name, ref p);
}
return p;
}
#endregion
#region Private Methods
private static void GetBoolArg(string Arg, string Name, ref bool ArgValue)
{
if (Arg.Length < (Name.Length + 1)) // -name is 1 more than name
return;
if (('/' != Arg[0]) && ('-' != Arg[0])) // not a param
return;
if (Arg.Substring(1, Name.Length).ToLower() == Name.ToLower())
ArgValue = true;
}
private static void GetIntArg(string Arg, string Name, ref int ArgValue)
{
if (Arg.Length < (Name.Length + 3)) // -name:12 is 3 more than name
return;
if (('/' != Arg[0]) && ('-' != Arg[0])) // not a param
return;
if (Arg.Substring(1, Name.Length).ToLower() == Name.ToLower())
{
try
{
ArgValue = Convert.ToInt32(Arg.Substring(Name.Length + 2, Arg.Length - Name.Length - 2));
}
catch
{
}
}
}
private static bool GetStringArg(string Arg, ref string ArgValue)
{
if (('/' == Arg[0]) || ('-' == Arg[0]))
return false;
ArgValue = Arg;
return true;
}
private static void GetStringArg(string Arg, string Name, ref string ArgValue)
{
if (Arg.Length < (Name.Length + 3)) // -name:x is 3 more than name
return;
if (('/' != Arg[0]) && ('-' != Arg[0])) // not a param
return;
if (Arg.Substring(1, Name.Length).ToLower() == Name.ToLower())
ArgValue = Arg.Substring(Name.Length + 2, Arg.Length - Name.Length - 2);
}
private static void ParseArgs()
{
string[] args = Environment.GetCommandLineArgs();
for (int i = 1; i < args.Length; i++)
{
// help
GetBoolArg(args[i], "?", ref Help);
GetBoolArg(args[i], "h", ref Help);
GetBoolArg(args[i], "help", ref Help);
}
}
#endregion
}
}
+76
View File
@@ -0,0 +1,76 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// Represents an HTML comment.
/// </summary>
public class HtmlCommentNode : HtmlNode
{
#region Fields
private string _comment;
#endregion
#region Constructors
internal HtmlCommentNode(HtmlDocument ownerdocument, int index)
:
base(HtmlNodeType.Comment, ownerdocument, index)
{
}
#endregion
#region Properties
/// <summary>
/// Gets or Sets the comment text of the node.
/// </summary>
public string Comment
{
get
{
if (_comment == null)
{
return base.InnerHtml;
}
return _comment;
}
set { _comment = value; }
}
/// <summary>
/// Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml.
/// </summary>
public override string InnerHtml
{
get
{
if (_comment == null)
{
return base.InnerHtml;
}
return _comment;
}
set { _comment = value; }
}
/// <summary>
/// Gets or Sets the object and its content in HTML.
/// </summary>
public override string OuterHtml
{
get
{
if (_comment == null)
{
return base.OuterHtml;
}
return "<!--" + _comment + "-->";
}
}
#endregion
}
}
@@ -0,0 +1,33 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.Diagnostics;
namespace HtmlAgilityPack
{
internal class HtmlConsoleListener : TraceListener
{
#region Public Methods
public override void Write(string Message)
{
Write(Message, "");
}
public override void Write(string Message, string Category)
{
Console.Write("T:" + Category + ": " + Message);
}
public override void WriteLine(string Message)
{
Write(Message + "\n");
}
public override void WriteLine(string Message, string Category)
{
Write(Message + "\n", Category);
}
#endregion
}
}
File diff suppressed because it is too large. Load diff
+32
View File
@@ -0,0 +1,32 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
namespace HtmlAgilityPack
{
/// <summary>
/// Flags that describe the behavior of an Element node.
/// </summary>
[Flags]
public enum HtmlElementFlag
{
/// <summary>
/// The node is a CDATA node.
/// </summary>
CData = 1,
/// <summary>
/// The node is empty. META or IMG are example of such nodes.
/// </summary>
Empty = 2,
/// <summary>
/// The node will automatically be closed during parsing.
/// </summary>
Closed = 4,
/// <summary>
/// The node can overlap.
/// </summary>
CanOverlap = 8
}
}
+826
View File
@@ -0,0 +1,826 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.Collections;
using System.Text;
namespace HtmlAgilityPack
{
/// <summary>
/// A utility class to replace special characters by entities and vice-versa.
/// Follows HTML 4.0 specification found at http://www.w3.org/TR/html4/sgml/entities.html
/// </summary>
public class HtmlEntity
{
#region Static Members
private static readonly int _maxEntitySize;
private static Hashtable _entityName;
private static Hashtable _entityValue;
/// <summary>
/// A collection of entities indexed by name.
/// </summary>
public static Hashtable EntityName
{
get { return _entityName; }
}
/// <summary>
/// A collection of entities indexed by value.
/// </summary>
public static Hashtable EntityValue
{
get { return _entityValue; }
}
#endregion
#region Constructors
static HtmlEntity()
{
_entityName = new Hashtable();
_entityValue = new Hashtable();
#region Entities Definition
_entityValue.Add("nbsp", 160); // no-break space = non-breaking space, U+00A0 ISOnum
_entityName.Add(160, "nbsp");
_entityValue.Add("iexcl", 161); // inverted exclamation mark, U+00A1 ISOnum
_entityName.Add(161, "iexcl");
_entityValue.Add("cent", 162); // cent sign, U+00A2 ISOnum
_entityName.Add(162, "cent");
_entityValue.Add("pound", 163); // pound sign, U+00A3 ISOnum
_entityName.Add(163, "pound");
_entityValue.Add("curren", 164); // currency sign, U+00A4 ISOnum
_entityName.Add(164, "curren");
_entityValue.Add("yen", 165); // yen sign = yuan sign, U+00A5 ISOnum
_entityName.Add(165, "yen");
_entityValue.Add("brvbar", 166); // broken bar = broken vertical bar, U+00A6 ISOnum
_entityName.Add(166, "brvbar");
_entityValue.Add("sect", 167); // section sign, U+00A7 ISOnum
_entityName.Add(167, "sect");
_entityValue.Add("uml", 168); // diaeresis = spacing diaeresis, U+00A8 ISOdia
_entityName.Add(168, "uml");
_entityValue.Add("copy", 169); // copyright sign, U+00A9 ISOnum
_entityName.Add(169, "copy");
_entityValue.Add("ordf", 170); // feminine ordinal indicator, U+00AA ISOnum
_entityName.Add(170, "ordf");
_entityValue.Add("laquo", 171);
// left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum
_entityName.Add(171, "laquo");
_entityValue.Add("not", 172); // not sign, U+00AC ISOnum
_entityName.Add(172, "not");
_entityValue.Add("shy", 173); // soft hyphen = discretionary hyphen, U+00AD ISOnum
_entityName.Add(173, "shy");
_entityValue.Add("reg", 174); // registered sign = registered trade mark sign, U+00AE ISOnum
_entityName.Add(174, "reg");
_entityValue.Add("macr", 175); // macron = spacing macron = overline = APL overbar, U+00AF ISOdia
_entityName.Add(175, "macr");
_entityValue.Add("deg", 176); // degree sign, U+00B0 ISOnum
_entityName.Add(176, "deg");
_entityValue.Add("plusmn", 177); // plus-minus sign = plus-or-minus sign, U+00B1 ISOnum
_entityName.Add(177, "plusmn");
_entityValue.Add("sup2", 178); // superscript two = superscript digit two = squared, U+00B2 ISOnum
_entityName.Add(178, "sup2");
_entityValue.Add("sup3", 179); // superscript three = superscript digit three = cubed, U+00B3 ISOnum
_entityName.Add(179, "sup3");
_entityValue.Add("acute", 180); // acute accent = spacing acute, U+00B4 ISOdia
_entityName.Add(180, "acute");
_entityValue.Add("micro", 181); // micro sign, U+00B5 ISOnum
_entityName.Add(181, "micro");
_entityValue.Add("para", 182); // pilcrow sign = paragraph sign, U+00B6 ISOnum
_entityName.Add(182, "para");
_entityValue.Add("middot", 183); // middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum
_entityName.Add(183, "middot");
_entityValue.Add("cedil", 184); // cedilla = spacing cedilla, U+00B8 ISOdia
_entityName.Add(184, "cedil");
_entityValue.Add("sup1", 185); // superscript one = superscript digit one, U+00B9 ISOnum
_entityName.Add(185, "sup1");
_entityValue.Add("ordm", 186); // masculine ordinal indicator, U+00BA ISOnum
_entityName.Add(186, "ordm");
_entityValue.Add("raquo", 187);
// right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum
_entityName.Add(187, "raquo");
_entityValue.Add("frac14", 188); // vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum
_entityName.Add(188, "frac14");
_entityValue.Add("frac12", 189); // vulgar fraction one half = fraction one half, U+00BD ISOnum
_entityName.Add(189, "frac12");
_entityValue.Add("frac34", 190); // vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum
_entityName.Add(190, "frac34");
_entityValue.Add("iquest", 191); // inverted question mark = turned question mark, U+00BF ISOnum
_entityName.Add(191, "iquest");
_entityValue.Add("Agrave", 192);
// latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1
_entityName.Add(192, "Agrave");
_entityValue.Add("Aacute", 193); // latin capital letter A with acute, U+00C1 ISOlat1
_entityName.Add(193, "Aacute");
_entityValue.Add("Acirc", 194); // latin capital letter A with circumflex, U+00C2 ISOlat1
_entityName.Add(194, "Acirc");
_entityValue.Add("Atilde", 195); // latin capital letter A with tilde, U+00C3 ISOlat1
_entityName.Add(195, "Atilde");
_entityValue.Add("Auml", 196); // latin capital letter A with diaeresis, U+00C4 ISOlat1
_entityName.Add(196, "Auml");
_entityValue.Add("Aring", 197);
// latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1
_entityName.Add(197, "Aring");
_entityValue.Add("AElig", 198); // latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
_entityName.Add(198, "AElig");
_entityValue.Add("Ccedil", 199); // latin capital letter C with cedilla, U+00C7 ISOlat1
_entityName.Add(199, "Ccedil");
_entityValue.Add("Egrave", 200); // latin capital letter E with grave, U+00C8 ISOlat1
_entityName.Add(200, "Egrave");
_entityValue.Add("Eacute", 201); // latin capital letter E with acute, U+00C9 ISOlat1
_entityName.Add(201, "Eacute");
_entityValue.Add("Ecirc", 202); // latin capital letter E with circumflex, U+00CA ISOlat1
_entityName.Add(202, "Ecirc");
_entityValue.Add("Euml", 203); // latin capital letter E with diaeresis, U+00CB ISOlat1
_entityName.Add(203, "Euml");
_entityValue.Add("Igrave", 204); // latin capital letter I with grave, U+00CC ISOlat1
_entityName.Add(204, "Igrave");
_entityValue.Add("Iacute", 205); // latin capital letter I with acute, U+00CD ISOlat1
_entityName.Add(205, "Iacute");
_entityValue.Add("Icirc", 206); // latin capital letter I with circumflex, U+00CE ISOlat1
_entityName.Add(206, "Icirc");
_entityValue.Add("Iuml", 207); // latin capital letter I with diaeresis, U+00CF ISOlat1
_entityName.Add(207, "Iuml");
_entityValue.Add("ETH", 208); // latin capital letter ETH, U+00D0 ISOlat1
_entityName.Add(208, "ETH");
_entityValue.Add("Ntilde", 209); // latin capital letter N with tilde, U+00D1 ISOlat1
_entityName.Add(209, "Ntilde");
_entityValue.Add("Ograve", 210); // latin capital letter O with grave, U+00D2 ISOlat1
_entityName.Add(210, "Ograve");
_entityValue.Add("Oacute", 211); // latin capital letter O with acute, U+00D3 ISOlat1
_entityName.Add(211, "Oacute");
_entityValue.Add("Ocirc", 212); // latin capital letter O with circumflex, U+00D4 ISOlat1
_entityName.Add(212, "Ocirc");
_entityValue.Add("Otilde", 213); // latin capital letter O with tilde, U+00D5 ISOlat1
_entityName.Add(213, "Otilde");
_entityValue.Add("Ouml", 214); // latin capital letter O with diaeresis, U+00D6 ISOlat1
_entityName.Add(214, "Ouml");
_entityValue.Add("times", 215); // multiplication sign, U+00D7 ISOnum
_entityName.Add(215, "times");
_entityValue.Add("Oslash", 216);
// latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1
_entityName.Add(216, "Oslash");
_entityValue.Add("Ugrave", 217); // latin capital letter U with grave, U+00D9 ISOlat1
_entityName.Add(217, "Ugrave");
_entityValue.Add("Uacute", 218); // latin capital letter U with acute, U+00DA ISOlat1
_entityName.Add(218, "Uacute");
_entityValue.Add("Ucirc", 219); // latin capital letter U with circumflex, U+00DB ISOlat1
_entityName.Add(219, "Ucirc");
_entityValue.Add("Uuml", 220); // latin capital letter U with diaeresis, U+00DC ISOlat1
_entityName.Add(220, "Uuml");
_entityValue.Add("Yacute", 221); // latin capital letter Y with acute, U+00DD ISOlat1
_entityName.Add(221, "Yacute");
_entityValue.Add("THORN", 222); // latin capital letter THORN, U+00DE ISOlat1
_entityName.Add(222, "THORN");
_entityValue.Add("szlig", 223); // latin small letter sharp s = ess-zed, U+00DF ISOlat1
_entityName.Add(223, "szlig");
_entityValue.Add("agrave", 224);
// latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1
_entityName.Add(224, "agrave");
_entityValue.Add("aacute", 225); // latin small letter a with acute, U+00E1 ISOlat1
_entityName.Add(225, "aacute");
_entityValue.Add("acirc", 226); // latin small letter a with circumflex, U+00E2 ISOlat1
_entityName.Add(226, "acirc");
_entityValue.Add("atilde", 227); // latin small letter a with tilde, U+00E3 ISOlat1
_entityName.Add(227, "atilde");
_entityValue.Add("auml", 228); // latin small letter a with diaeresis, U+00E4 ISOlat1
_entityName.Add(228, "auml");
_entityValue.Add("aring", 229);
// latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1
_entityName.Add(229, "aring");
_entityValue.Add("aelig", 230); // latin small letter ae = latin small ligature ae, U+00E6 ISOlat1
_entityName.Add(230, "aelig");
_entityValue.Add("ccedil", 231); // latin small letter c with cedilla, U+00E7 ISOlat1
_entityName.Add(231, "ccedil");
_entityValue.Add("egrave", 232); // latin small letter e with grave, U+00E8 ISOlat1
_entityName.Add(232, "egrave");
_entityValue.Add("eacute", 233); // latin small letter e with acute, U+00E9 ISOlat1
_entityName.Add(233, "eacute");
_entityValue.Add("ecirc", 234); // latin small letter e with circumflex, U+00EA ISOlat1
_entityName.Add(234, "ecirc");
_entityValue.Add("euml", 235); // latin small letter e with diaeresis, U+00EB ISOlat1
_entityName.Add(235, "euml");
_entityValue.Add("igrave", 236); // latin small letter i with grave, U+00EC ISOlat1
_entityName.Add(236, "igrave");
_entityValue.Add("iacute", 237); // latin small letter i with acute, U+00ED ISOlat1
_entityName.Add(237, "iacute");
_entityValue.Add("icirc", 238); // latin small letter i with circumflex, U+00EE ISOlat1
_entityName.Add(238, "icirc");
_entityValue.Add("iuml", 239); // latin small letter i with diaeresis, U+00EF ISOlat1
_entityName.Add(239, "iuml");
_entityValue.Add("eth", 240); // latin small letter eth, U+00F0 ISOlat1
_entityName.Add(240, "eth");
_entityValue.Add("ntilde", 241); // latin small letter n with tilde, U+00F1 ISOlat1
_entityName.Add(241, "ntilde");
_entityValue.Add("ograve", 242); // latin small letter o with grave, U+00F2 ISOlat1
_entityName.Add(242, "ograve");
_entityValue.Add("oacute", 243); // latin small letter o with acute, U+00F3 ISOlat1
_entityName.Add(243, "oacute");
_entityValue.Add("ocirc", 244); // latin small letter o with circumflex, U+00F4 ISOlat1
_entityName.Add(244, "ocirc");
_entityValue.Add("otilde", 245); // latin small letter o with tilde, U+00F5 ISOlat1
_entityName.Add(245, "otilde");
_entityValue.Add("ouml", 246); // latin small letter o with diaeresis, U+00F6 ISOlat1
_entityName.Add(246, "ouml");
_entityValue.Add("divide", 247); // division sign, U+00F7 ISOnum
_entityName.Add(247, "divide");
_entityValue.Add("oslash", 248);
// latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1
_entityName.Add(248, "oslash");
_entityValue.Add("ugrave", 249); // latin small letter u with grave, U+00F9 ISOlat1
_entityName.Add(249, "ugrave");
_entityValue.Add("uacute", 250); // latin small letter u with acute, U+00FA ISOlat1
_entityName.Add(250, "uacute");
_entityValue.Add("ucirc", 251); // latin small letter u with circumflex, U+00FB ISOlat1
_entityName.Add(251, "ucirc");
_entityValue.Add("uuml", 252); // latin small letter u with diaeresis, U+00FC ISOlat1
_entityName.Add(252, "uuml");
_entityValue.Add("yacute", 253); // latin small letter y with acute, U+00FD ISOlat1
_entityName.Add(253, "yacute");
_entityValue.Add("thorn", 254); // latin small letter thorn, U+00FE ISOlat1
_entityName.Add(254, "thorn");
_entityValue.Add("yuml", 255); // latin small letter y with diaeresis, U+00FF ISOlat1
_entityName.Add(255, "yuml");
_entityValue.Add("fnof", 402); // latin small f with hook = function = florin, U+0192 ISOtech
_entityName.Add(402, "fnof");
_entityValue.Add("Alpha", 913); // greek capital letter alpha, U+0391
_entityName.Add(913, "Alpha");
_entityValue.Add("Beta", 914); // greek capital letter beta, U+0392
_entityName.Add(914, "Beta");
_entityValue.Add("Gamma", 915); // greek capital letter gamma, U+0393 ISOgrk3
_entityName.Add(915, "Gamma");
_entityValue.Add("Delta", 916); // greek capital letter delta, U+0394 ISOgrk3
_entityName.Add(916, "Delta");
_entityValue.Add("Epsilon", 917); // greek capital letter epsilon, U+0395
_entityName.Add(917, "Epsilon");
_entityValue.Add("Zeta", 918); // greek capital letter zeta, U+0396
_entityName.Add(918, "Zeta");
_entityValue.Add("Eta", 919); // greek capital letter eta, U+0397
_entityName.Add(919, "Eta");
_entityValue.Add("Theta", 920); // greek capital letter theta, U+0398 ISOgrk3
_entityName.Add(920, "Theta");
_entityValue.Add("Iota", 921); // greek capital letter iota, U+0399
_entityName.Add(921, "Iota");
_entityValue.Add("Kappa", 922); // greek capital letter kappa, U+039A
_entityName.Add(922, "Kappa");
_entityValue.Add("Lambda", 923); // greek capital letter lambda, U+039B ISOgrk3
_entityName.Add(923, "Lambda");
_entityValue.Add("Mu", 924); // greek capital letter mu, U+039C
_entityName.Add(924, "Mu");
_entityValue.Add("Nu", 925); // greek capital letter nu, U+039D
_entityName.Add(925, "Nu");
_entityValue.Add("Xi", 926); // greek capital letter xi, U+039E ISOgrk3
_entityName.Add(926, "Xi");
_entityValue.Add("Omicron", 927); // greek capital letter omicron, U+039F
_entityName.Add(927, "Omicron");
_entityValue.Add("Pi", 928); // greek capital letter pi, U+03A0 ISOgrk3
_entityName.Add(928, "Pi");
_entityValue.Add("Rho", 929); // greek capital letter rho, U+03A1
_entityName.Add(929, "Rho");
_entityValue.Add("Sigma", 931); // greek capital letter sigma, U+03A3 ISOgrk3
_entityName.Add(931, "Sigma");
_entityValue.Add("Tau", 932); // greek capital letter tau, U+03A4
_entityName.Add(932, "Tau");
_entityValue.Add("Upsilon", 933); // greek capital letter upsilon, U+03A5 ISOgrk3
_entityName.Add(933, "Upsilon");
_entityValue.Add("Phi", 934); // greek capital letter phi, U+03A6 ISOgrk3
_entityName.Add(934, "Phi");
_entityValue.Add("Chi", 935); // greek capital letter chi, U+03A7
_entityName.Add(935, "Chi");
_entityValue.Add("Psi", 936); // greek capital letter psi, U+03A8 ISOgrk3
_entityName.Add(936, "Psi");
_entityValue.Add("Omega", 937); // greek capital letter omega, U+03A9 ISOgrk3
_entityName.Add(937, "Omega");
_entityValue.Add("alpha", 945); // greek small letter alpha, U+03B1 ISOgrk3
_entityName.Add(945, "alpha");
_entityValue.Add("beta", 946); // greek small letter beta, U+03B2 ISOgrk3
_entityName.Add(946, "beta");
_entityValue.Add("gamma", 947); // greek small letter gamma, U+03B3 ISOgrk3
_entityName.Add(947, "gamma");
_entityValue.Add("delta", 948); // greek small letter delta, U+03B4 ISOgrk3
_entityName.Add(948, "delta");
_entityValue.Add("epsilon", 949); // greek small letter epsilon, U+03B5 ISOgrk3
_entityName.Add(949, "epsilon");
_entityValue.Add("zeta", 950); // greek small letter zeta, U+03B6 ISOgrk3
_entityName.Add(950, "zeta");
_entityValue.Add("eta", 951); // greek small letter eta, U+03B7 ISOgrk3
_entityName.Add(951, "eta");
_entityValue.Add("theta", 952); // greek small letter theta, U+03B8 ISOgrk3
_entityName.Add(952, "theta");
_entityValue.Add("iota", 953); // greek small letter iota, U+03B9 ISOgrk3
_entityName.Add(953, "iota");
_entityValue.Add("kappa", 954); // greek small letter kappa, U+03BA ISOgrk3
_entityName.Add(954, "kappa");
_entityValue.Add("lambda", 955); // greek small letter lambda, U+03BB ISOgrk3
_entityName.Add(955, "lambda");
_entityValue.Add("mu", 956); // greek small letter mu, U+03BC ISOgrk3
_entityName.Add(956, "mu");
_entityValue.Add("nu", 957); // greek small letter nu, U+03BD ISOgrk3
_entityName.Add(957, "nu");
_entityValue.Add("xi", 958); // greek small letter xi, U+03BE ISOgrk3
_entityName.Add(958, "xi");
_entityValue.Add("omicron", 959); // greek small letter omicron, U+03BF NEW
_entityName.Add(959, "omicron");
_entityValue.Add("pi", 960); // greek small letter pi, U+03C0 ISOgrk3
_entityName.Add(960, "pi");
_entityValue.Add("rho", 961); // greek small letter rho, U+03C1 ISOgrk3
_entityName.Add(961, "rho");
_entityValue.Add("sigmaf", 962); // greek small letter final sigma, U+03C2 ISOgrk3
_entityName.Add(962, "sigmaf");
_entityValue.Add("sigma", 963); // greek small letter sigma, U+03C3 ISOgrk3
_entityName.Add(963, "sigma");
_entityValue.Add("tau", 964); // greek small letter tau, U+03C4 ISOgrk3
_entityName.Add(964, "tau");
_entityValue.Add("upsilon", 965); // greek small letter upsilon, U+03C5 ISOgrk3
_entityName.Add(965, "upsilon");
_entityValue.Add("phi", 966); // greek small letter phi, U+03C6 ISOgrk3
_entityName.Add(966, "phi");
_entityValue.Add("chi", 967); // greek small letter chi, U+03C7 ISOgrk3
_entityName.Add(967, "chi");
_entityValue.Add("psi", 968); // greek small letter psi, U+03C8 ISOgrk3
_entityName.Add(968, "psi");
_entityValue.Add("omega", 969); // greek small letter omega, U+03C9 ISOgrk3
_entityName.Add(969, "omega");
_entityValue.Add("thetasym", 977); // greek small letter theta symbol, U+03D1 NEW
_entityName.Add(977, "thetasym");
_entityValue.Add("upsih", 978); // greek upsilon with hook symbol, U+03D2 NEW
_entityName.Add(978, "upsih");
_entityValue.Add("piv", 982); // greek pi symbol, U+03D6 ISOgrk3
_entityName.Add(982, "piv");
_entityValue.Add("bull", 8226); // bullet = black small circle, U+2022 ISOpub
_entityName.Add(8226, "bull");
_entityValue.Add("hellip", 8230); // horizontal ellipsis = three dot leader, U+2026 ISOpub
_entityName.Add(8230, "hellip");
_entityValue.Add("prime", 8242); // prime = minutes = feet, U+2032 ISOtech
_entityName.Add(8242, "prime");
_entityValue.Add("Prime", 8243); // double prime = seconds = inches, U+2033 ISOtech
_entityName.Add(8243, "Prime");
_entityValue.Add("oline", 8254); // overline = spacing overscore, U+203E NEW
_entityName.Add(8254, "oline");
_entityValue.Add("frasl", 8260); // fraction slash, U+2044 NEW
_entityName.Add(8260, "frasl");
_entityValue.Add("weierp", 8472); // script capital P = power set = Weierstrass p, U+2118 ISOamso
_entityName.Add(8472, "weierp");
_entityValue.Add("image", 8465); // blackletter capital I = imaginary part, U+2111 ISOamso
_entityName.Add(8465, "image");
_entityValue.Add("real", 8476); // blackletter capital R = real part symbol, U+211C ISOamso
_entityName.Add(8476, "real");
_entityValue.Add("trade", 8482); // trade mark sign, U+2122 ISOnum
_entityName.Add(8482, "trade");
_entityValue.Add("alefsym", 8501); // alef symbol = first transfinite cardinal, U+2135 NEW
_entityName.Add(8501, "alefsym");
_entityValue.Add("larr", 8592); // leftwards arrow, U+2190 ISOnum
_entityName.Add(8592, "larr");
_entityValue.Add("uarr", 8593); // upwards arrow, U+2191 ISOnum
_entityName.Add(8593, "uarr");
_entityValue.Add("rarr", 8594); // rightwards arrow, U+2192 ISOnum
_entityName.Add(8594, "rarr");
_entityValue.Add("darr", 8595); // downwards arrow, U+2193 ISOnum
_entityName.Add(8595, "darr");
_entityValue.Add("harr", 8596); // left right arrow, U+2194 ISOamsa
_entityName.Add(8596, "harr");
_entityValue.Add("crarr", 8629); // downwards arrow with corner leftwards = carriage return, U+21B5 NEW
_entityName.Add(8629, "crarr");
_entityValue.Add("lArr", 8656); // leftwards double arrow, U+21D0 ISOtech
_entityName.Add(8656, "lArr");
_entityValue.Add("uArr", 8657); // upwards double arrow, U+21D1 ISOamsa
_entityName.Add(8657, "uArr");
_entityValue.Add("rArr", 8658); // rightwards double arrow, U+21D2 ISOtech
_entityName.Add(8658, "rArr");
_entityValue.Add("dArr", 8659); // downwards double arrow, U+21D3 ISOamsa
_entityName.Add(8659, "dArr");
_entityValue.Add("hArr", 8660); // left right double arrow, U+21D4 ISOamsa
_entityName.Add(8660, "hArr");
_entityValue.Add("forall", 8704); // for all, U+2200 ISOtech
_entityName.Add(8704, "forall");
_entityValue.Add("part", 8706); // partial differential, U+2202 ISOtech
_entityName.Add(8706, "part");
_entityValue.Add("exist", 8707); // there exists, U+2203 ISOtech
_entityName.Add(8707, "exist");
_entityValue.Add("empty", 8709); // empty set = null set = diameter, U+2205 ISOamso
_entityName.Add(8709, "empty");
_entityValue.Add("nabla", 8711); // nabla = backward difference, U+2207 ISOtech
_entityName.Add(8711, "nabla");
_entityValue.Add("isin", 8712); // element of, U+2208 ISOtech
_entityName.Add(8712, "isin");
_entityValue.Add("notin", 8713); // not an element of, U+2209 ISOtech
_entityName.Add(8713, "notin");
_entityValue.Add("ni", 8715); // contains as member, U+220B ISOtech
_entityName.Add(8715, "ni");
_entityValue.Add("prod", 8719); // n-ary product = product sign, U+220F ISOamsb
_entityName.Add(8719, "prod");
_entityValue.Add("sum", 8721); // n-ary sumation, U+2211 ISOamsb
_entityName.Add(8721, "sum");
_entityValue.Add("minus", 8722); // minus sign, U+2212 ISOtech
_entityName.Add(8722, "minus");
_entityValue.Add("lowast", 8727); // asterisk operator, U+2217 ISOtech
_entityName.Add(8727, "lowast");
_entityValue.Add("radic", 8730); // square root = radical sign, U+221A ISOtech
_entityName.Add(8730, "radic");
_entityValue.Add("prop", 8733); // proportional to, U+221D ISOtech
_entityName.Add(8733, "prop");
_entityValue.Add("infin", 8734); // infinity, U+221E ISOtech
_entityName.Add(8734, "infin");
_entityValue.Add("ang", 8736); // angle, U+2220 ISOamso
_entityName.Add(8736, "ang");
_entityValue.Add("and", 8743); // logical and = wedge, U+2227 ISOtech
_entityName.Add(8743, "and");
_entityValue.Add("or", 8744); // logical or = vee, U+2228 ISOtech
_entityName.Add(8744, "or");
_entityValue.Add("cap", 8745); // intersection = cap, U+2229 ISOtech
_entityName.Add(8745, "cap");
_entityValue.Add("cup", 8746); // union = cup, U+222A ISOtech
_entityName.Add(8746, "cup");
_entityValue.Add("int", 8747); // integral, U+222B ISOtech
_entityName.Add(8747, "int");
_entityValue.Add("there4", 8756); // therefore, U+2234 ISOtech
_entityName.Add(8756, "there4");
_entityValue.Add("sim", 8764); // tilde operator = varies with = similar to, U+223C ISOtech
_entityName.Add(8764, "sim");
_entityValue.Add("cong", 8773); // approximately equal to, U+2245 ISOtech
_entityName.Add(8773, "cong");
_entityValue.Add("asymp", 8776); // almost equal to = asymptotic to, U+2248 ISOamsr
_entityName.Add(8776, "asymp");
_entityValue.Add("ne", 8800); // not equal to, U+2260 ISOtech
_entityName.Add(8800, "ne");
_entityValue.Add("equiv", 8801); // identical to, U+2261 ISOtech
_entityName.Add(8801, "equiv");
_entityValue.Add("le", 8804); // less-than or equal to, U+2264 ISOtech
_entityName.Add(8804, "le");
_entityValue.Add("ge", 8805); // greater-than or equal to, U+2265 ISOtech
_entityName.Add(8805, "ge");
_entityValue.Add("sub", 8834); // subset of, U+2282 ISOtech
_entityName.Add(8834, "sub");
_entityValue.Add("sup", 8835); // superset of, U+2283 ISOtech
_entityName.Add(8835, "sup");
_entityValue.Add("nsub", 8836); // not a subset of, U+2284 ISOamsn
_entityName.Add(8836, "nsub");
_entityValue.Add("sube", 8838); // subset of or equal to, U+2286 ISOtech
_entityName.Add(8838, "sube");
_entityValue.Add("supe", 8839); // superset of or equal to, U+2287 ISOtech
_entityName.Add(8839, "supe");
_entityValue.Add("oplus", 8853); // circled plus = direct sum, U+2295 ISOamsb
_entityName.Add(8853, "oplus");
_entityValue.Add("otimes", 8855); // circled times = vector product, U+2297 ISOamsb
_entityName.Add(8855, "otimes");
_entityValue.Add("perp", 8869); // up tack = orthogonal to = perpendicular, U+22A5 ISOtech
_entityName.Add(8869, "perp");
_entityValue.Add("sdot", 8901); // dot operator, U+22C5 ISOamsb
_entityName.Add(8901, "sdot");
_entityValue.Add("lceil", 8968); // left ceiling = apl upstile, U+2308 ISOamsc
_entityName.Add(8968, "lceil");
_entityValue.Add("rceil", 8969); // right ceiling, U+2309 ISOamsc
_entityName.Add(8969, "rceil");
_entityValue.Add("lfloor", 8970); // left floor = apl downstile, U+230A ISOamsc
_entityName.Add(8970, "lfloor");
_entityValue.Add("rfloor", 8971); // right floor, U+230B ISOamsc
_entityName.Add(8971, "rfloor");
_entityValue.Add("lang", 9001); // left-pointing angle bracket = bra, U+2329 ISOtech
_entityName.Add(9001, "lang");
_entityValue.Add("rang", 9002); // right-pointing angle bracket = ket, U+232A ISOtech
_entityName.Add(9002, "rang");
_entityValue.Add("loz", 9674); // lozenge, U+25CA ISOpub
_entityName.Add(9674, "loz");
_entityValue.Add("spades", 9824); // black spade suit, U+2660 ISOpub
_entityName.Add(9824, "spades");
_entityValue.Add("clubs", 9827); // black club suit = shamrock, U+2663 ISOpub
_entityName.Add(9827, "clubs");
_entityValue.Add("hearts", 9829); // black heart suit = valentine, U+2665 ISOpub
_entityName.Add(9829, "hearts");
_entityValue.Add("diams", 9830); // black diamond suit, U+2666 ISOpub
_entityName.Add(9830, "diams");
_entityValue.Add("quot", 34); // quotation mark = APL quote, U+0022 ISOnum
_entityName.Add(34, "quot");
_entityValue.Add("amp", 38); // ampersand, U+0026 ISOnum
_entityName.Add(38, "amp");
_entityValue.Add("lt", 60); // less-than sign, U+003C ISOnum
_entityName.Add(60, "lt");
_entityValue.Add("gt", 62); // greater-than sign, U+003E ISOnum
_entityName.Add(62, "gt");
_entityValue.Add("OElig", 338); // latin capital ligature OE, U+0152 ISOlat2
_entityName.Add(338, "OElig");
_entityValue.Add("oelig", 339); // latin small ligature oe, U+0153 ISOlat2
_entityName.Add(339, "oelig");
_entityValue.Add("Scaron", 352); // latin capital letter S with caron, U+0160 ISOlat2
_entityName.Add(352, "Scaron");
_entityValue.Add("scaron", 353); // latin small letter s with caron, U+0161 ISOlat2
_entityName.Add(353, "scaron");
_entityValue.Add("Yuml", 376); // latin capital letter Y with diaeresis, U+0178 ISOlat2
_entityName.Add(376, "Yuml");
_entityValue.Add("circ", 710); // modifier letter circumflex accent, U+02C6 ISOpub
_entityName.Add(710, "circ");
_entityValue.Add("tilde", 732); // small tilde, U+02DC ISOdia
_entityName.Add(732, "tilde");
_entityValue.Add("ensp", 8194); // en space, U+2002 ISOpub
_entityName.Add(8194, "ensp");
_entityValue.Add("emsp", 8195); // em space, U+2003 ISOpub
_entityName.Add(8195, "emsp");
_entityValue.Add("thinsp", 8201); // thin space, U+2009 ISOpub
_entityName.Add(8201, "thinsp");
_entityValue.Add("zwnj", 8204); // zero width non-joiner, U+200C NEW RFC 2070
_entityName.Add(8204, "zwnj");
_entityValue.Add("zwj", 8205); // zero width joiner, U+200D NEW RFC 2070
_entityName.Add(8205, "zwj");
_entityValue.Add("lrm", 8206); // left-to-right mark, U+200E NEW RFC 2070
_entityName.Add(8206, "lrm");
_entityValue.Add("rlm", 8207); // right-to-left mark, U+200F NEW RFC 2070
_entityName.Add(8207, "rlm");
_entityValue.Add("ndash", 8211); // en dash, U+2013 ISOpub
_entityName.Add(8211, "ndash");
_entityValue.Add("mdash", 8212); // em dash, U+2014 ISOpub
_entityName.Add(8212, "mdash");
_entityValue.Add("lsquo", 8216); // left single quotation mark, U+2018 ISOnum
_entityName.Add(8216, "lsquo");
_entityValue.Add("rsquo", 8217); // right single quotation mark, U+2019 ISOnum
_entityName.Add(8217, "rsquo");
_entityValue.Add("sbquo", 8218); // single low-9 quotation mark, U+201A NEW
_entityName.Add(8218, "sbquo");
_entityValue.Add("ldquo", 8220); // left double quotation mark, U+201C ISOnum
_entityName.Add(8220, "ldquo");
_entityValue.Add("rdquo", 8221); // right double quotation mark, U+201D ISOnum
_entityName.Add(8221, "rdquo");
_entityValue.Add("bdquo", 8222); // double low-9 quotation mark, U+201E NEW
_entityName.Add(8222, "bdquo");
_entityValue.Add("dagger", 8224); // dagger, U+2020 ISOpub
_entityName.Add(8224, "dagger");
_entityValue.Add("Dagger", 8225); // double dagger, U+2021 ISOpub
_entityName.Add(8225, "Dagger");
_entityValue.Add("permil", 8240); // per mille sign, U+2030 ISOtech
_entityName.Add(8240, "permil");
_entityValue.Add("lsaquo", 8249); // single left-pointing angle quotation mark, U+2039 ISO proposed
_entityName.Add(8249, "lsaquo");
_entityValue.Add("rsaquo", 8250); // single right-pointing angle quotation mark, U+203A ISO proposed
_entityName.Add(8250, "rsaquo");
_entityValue.Add("euro", 8364); // euro sign, U+20AC NEW
_entityName.Add(8364, "euro");
_maxEntitySize = 8 + 1; // we add the # char
#endregion
}
private HtmlEntity()
{
}
#endregion
#region Public Methods
/// <summary>
/// Replace known entities by characters.
/// </summary>
/// <param name="text">The source text.</param>
/// <returns>The result text.</returns>
public static string DeEntitize(string text)
{
if (text == null)
return null;
if (text.Length == 0)
return text;
StringBuilder sb = new StringBuilder(text.Length);
ParseState state = ParseState.Text;
StringBuilder entity = new StringBuilder(10);
for (int i = 0; i < text.Length; i++)
{
switch (state)
{
case ParseState.Text:
switch (text[i])
{
case '&':
state = ParseState.EntityStart;
break;
default:
sb.Append(text[i]);
break;
}
break;
case ParseState.EntityStart:
switch (text[i])
{
case ';':
if (entity.Length == 0)
{
sb.Append("&;");
}
else
{
if (entity[0] == '#')
{
string e = entity.ToString();
try
{
int code = Convert.ToInt32(e.Substring(1, e.Length - 1));
sb.Append(Convert.ToChar(code));
}
catch
{
sb.Append("&#" + e + ";");
}
}
else
{
// named entity?
int code;
object o = _entityValue[entity.ToString()];
if (o == null)
{
// nope
sb.Append("&" + entity + ";");
}
else
{
// we found one
code = (int) o;
sb.Append(Convert.ToChar(code));
}
}
entity.Remove(0, entity.Length);
}
state = ParseState.Text;
break;
case '&':
// new entity start without end, it was not an entity...
sb.Append("&" + entity);
entity.Remove(0, entity.Length);
break;
default:
entity.Append(text[i]);
if (entity.Length > _maxEntitySize)
{
// unknown stuff, just don't touch it
state = ParseState.Text;
sb.Append("&" + entity);
entity.Remove(0, entity.Length);
}
break;
}
break;
}
}
// finish the work
if (state == ParseState.EntityStart)
{
sb.Append("&" + entity);
}
return sb.ToString();
}
/// <summary>
/// Clone and entitize an HtmlNode. This will affect attribute values and nodes' text. It will also entitize all child nodes.
/// </summary>
/// <param name="node">The node to entitize.</param>
/// <returns>An entitized cloned node.</returns>
public static HtmlNode Entitize(HtmlNode node)
{
if (node == null)
{
throw new ArgumentNullException("node");
}
HtmlNode result = node.CloneNode(true);
if (result.HasAttributes)
Entitize(result.Attributes);
if (result.HasChildNodes)
{
Entitize(result.ChildNodes);
}
else
{
if (result.NodeType == HtmlNodeType.Text)
{
((HtmlTextNode) result).Text = Entitize(((HtmlTextNode) result).Text, true, true);
}
}
return result;
}
/// <summary>
/// Replace characters above 127 by entities.
/// </summary>
/// <param name="text">The source text.</param>
/// <returns>The result text.</returns>
public static string Entitize(string text)
{
return Entitize(text, true);
}
/// <summary>
/// Replace characters above 127 by entities.
/// </summary>
/// <param name="text">The source text.</param>
/// <param name="useNames">If set to false, the function will not use known entities name. Default is true.</param>
/// <returns>The result text.</returns>
public static string Entitize(string text, bool useNames)
{
return Entitize(text, useNames, false);
}
/// <summary>
/// Replace characters above 127 by entities.
/// </summary>
/// <param name="text">The source text.</param>
/// <param name="useNames">If set to false, the function will not use known entities name. Default is true.</param>
/// <param name="entitizeQuotAmpAndLtGt">If set to true, the [quote], [ampersand], [lower than] and [greather than] characters will be entitized.</param>
/// <returns>The result text</returns>
public static string Entitize(string text, bool useNames, bool entitizeQuotAmpAndLtGt)
// _entityValue.Add("quot", 34); // quotation mark = APL quote, U+0022 ISOnum
// _entityName.Add(34, "quot");
// _entityValue.Add("amp", 38); // ampersand, U+0026 ISOnum
// _entityName.Add(38, "amp");
// _entityValue.Add("lt", 60); // less-than sign, U+003C ISOnum
// _entityName.Add(60, "lt");
// _entityValue.Add("gt", 62); // greater-than sign, U+003E ISOnum
// _entityName.Add(62, "gt");
{
if (text == null)
return null;
if (text.Length == 0)
return text;
StringBuilder sb = new StringBuilder(text.Length);
for (int i = 0; i < text.Length; i++)
{
int code = text[i];
if ((code > 127) ||
(entitizeQuotAmpAndLtGt && ((code == 34) || (code == 38) || (code == 60) || (code == 62))))
{
string entity = _entityName[code] as string;
if ((entity == null) || (!useNames))
{
sb.Append("&#" + code + ";");
}
else
{
sb.Append("&" + entity + ";");
}
}
else
{
sb.Append(text[i]);
}
}
return sb.ToString();
}
#endregion
#region Private Methods
private static void Entitize(HtmlAttributeCollection collection)
{
foreach (HtmlAttribute at in collection)
{
at.Value = Entitize(at.Value);
}
}
private static void Entitize(HtmlNodeCollection collection)
{
foreach (HtmlNode node in collection)
{
if (node.HasAttributes)
Entitize(node.Attributes);
if (node.HasChildNodes)
{
Entitize(node.ChildNodes);
}
else
{
if (node.NodeType == HtmlNodeType.Text)
{
((HtmlTextNode) node).Text = Entitize(((HtmlTextNode) node).Text, true, true);
}
}
}
}
#endregion
#region Nested type: ParseState
private enum ParseState
{
Text,
EntityStart
}
#endregion
}
}
+52
View File
@@ -0,0 +1,52 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System.Xml;
namespace HtmlAgilityPack
{
internal class HtmlNameTable : XmlNameTable
{
#region Fields
private NameTable _nametable = new NameTable();
#endregion
#region Public Methods
public override string Add(string array)
{
return _nametable.Add(array);
}
public override string Add(char[] array, int offset, int length)
{
return _nametable.Add(array, offset, length);
}
public override string Get(string array)
{
return _nametable.Get(array);
}
public override string Get(char[] array, int offset, int length)
{
return _nametable.Get(array, offset, length);
}
#endregion
#region Internal Methods
internal string GetOrAdd(string array)
{
string s = Get(array);
if (s == null)
{
return Add(array);
}
return s;
}
#endregion
}
}
File diff suppressed because it is too large. Load diff
+512
View File
@@ -0,0 +1,512 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.Collections;
using System.Collections.Generic;
namespace HtmlAgilityPack
{
/// <summary>
/// Represents a combined list and collection of HTML nodes.
/// </summary>
public class HtmlNodeCollection : IList<HtmlNode>
{
#region Fields
private readonly HtmlNode _parentnode;
private readonly List<HtmlNode> _items = new List<HtmlNode>();
#endregion
#region Constructors
/// <summary>
/// Initialize the HtmlNodeCollection with the base parent node
/// </summary>
/// <param name="parentnode">The base node of the collection</param>
public HtmlNodeCollection(HtmlNode parentnode)
{
_parentnode = parentnode; // may be null
}
#endregion
#region Properties
/// <summary>
/// Gets a given node from the list.
/// </summary>
public int this[HtmlNode node]
{
get
{
int index = GetNodeIndex(node);
if (index == -1)
{
throw new ArgumentOutOfRangeException("node",
"Node \"" + node.CloneNode(false).OuterHtml +
"\" was not found in the collection");
}
return index;
}
}
/// <summary>
/// Get node with tag name
/// </summary>
/// <param name="nodeName"></param>
/// <returns></returns>
public HtmlNode this[string nodeName]
{
get
{
nodeName = nodeName.ToLower();
for (int i = 0; i < _items.Count; i++)
if (_items[i].Equals(nodeName))
return _items[i];
return null;
}
}
#endregion
#region IList<HtmlNode> Members
/// <summary>
/// Gets the number of elements actually contained in the list.
/// </summary>
public int Count
{
get { return _items.Count; }
}
/// <summary>
/// Is collection read only
/// </summary>
public bool IsReadOnly
{
get { return false; }
}
/// <summary>
/// Gets the node at the specified index.
/// </summary>
public HtmlNode this[int index]
{
get { return _items[index]; }
set { _items[index] = value; }
}
/// <summary>
/// Add node to the collection
/// </summary>
/// <param name="node"></param>
public void Add(HtmlNode node)
{
_items.Add(node);
}
/// <summary>
/// Clears out the collection of HtmlNodes. Removes each nodes reference to parentnode, nextnode and prevnode
/// </summary>
public void Clear()
{
foreach (HtmlNode node in _items)
{
node.ParentNode = null;
node.NextSibling = null;
node.PreviousSibling = null;
}
_items.Clear();
}
/// <summary>
/// Gets existence of node in collection
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool Contains(HtmlNode item)
{
return _items.Contains(item);
}
/// <summary>
/// Copy collection to array
/// </summary>
/// <param name="array"></param>
/// <param name="arrayIndex"></param>
public void CopyTo(HtmlNode[] array, int arrayIndex)
{
_items.CopyTo(array, arrayIndex);
}
/// <summary>
/// Get Enumerator
/// </summary>
/// <returns></returns>
IEnumerator<HtmlNode> IEnumerable<HtmlNode>.GetEnumerator()
{
return _items.GetEnumerator();
}
/// <summary>
/// Get Explicit Enumerator
/// </summary>
/// <returns></returns>
IEnumerator IEnumerable.GetEnumerator()
{
return _items.GetEnumerator();
}
/// <summary>
/// Get index of node
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public int IndexOf(HtmlNode item)
{
return _items.IndexOf(item);
}
/// <summary>
/// Insert node at index
/// </summary>
/// <param name="index"></param>
/// <param name="node"></param>
public void Insert(int index, HtmlNode node)
{
HtmlNode next = null;
HtmlNode prev = null;
if (index > 0)
{
prev = _items[index - 1];
}
if (index < _items.Count)
{
next = _items[index];
}
_items.Insert(index, node);
if (prev != null)
{
if (node == prev)
{
throw new InvalidProgramException("Unexpected error.");
}
prev._nextnode = node;
}
if (next != null)
{
next._prevnode = node;
}
node._prevnode = prev;
if (next == node)
{
throw new InvalidProgramException("Unexpected error.");
}
node._nextnode = next;
node._parentnode = _parentnode;
}
/// <summary>
/// Remove node
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool Remove(HtmlNode item)
{
int i = _items.IndexOf(item);
RemoveAt(i);
return true;
}
/// <summary>
/// Remove <see cref="HtmlNode"/> at index
/// </summary>
/// <param name="index"></param>
public void RemoveAt(int index)
{
HtmlNode next = null;
HtmlNode prev = null;
HtmlNode oldnode = _items[index];
if (index > 0)
{
prev = _items[index - 1];
}
if (index < (_items.Count - 1))
{
next = _items[index + 1];
}
_items.RemoveAt(index);
if (prev != null)
{
if (next == prev)
{
throw new InvalidProgramException("Unexpected error.");
}
prev._nextnode = next;
}
if (next != null)
{
next._prevnode = prev;
}
oldnode._prevnode = null;
oldnode._nextnode = null;
oldnode._parentnode = null;
}
#endregion
#region Public Methods
/// <summary>
/// Get first instance of node in supplied collection
/// </summary>
/// <param name="items"></param>
/// <param name="name"></param>
/// <returns></returns>
public static HtmlNode FindFirst(HtmlNodeCollection items, string name)
{
foreach (HtmlNode node in items)
{
if (node.Name.ToLower().Contains(name))
return node;
if (node.HasChildNodes)
{
HtmlNode returnNode = FindFirst(node.ChildNodes, name);
if (returnNode != null)
return returnNode;
}
}
return null;
}
/// <summary>
/// Add node to the end of the collection
/// </summary>
/// <param name="node"></param>
public void Append(HtmlNode node)
{
HtmlNode last = null;
if (_items.Count > 0)
{
last = _items[_items.Count - 1];
}
_items.Add(node);
node._prevnode = last;
node._nextnode = null;
node._parentnode = _parentnode;
if (last != null)
{
if (last == node)
{
throw new InvalidProgramException("Unexpected error.");
}
last._nextnode = node;
}
}
/// <summary>
/// Get first instance of node with name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public HtmlNode FindFirst(string name)
{
return FindFirst(this, name);
}
/// <summary>
/// Get index of node
/// </summary>
/// <param name="node"></param>
/// <returns></returns>
public int GetNodeIndex(HtmlNode node)
{
// TODO: should we rewrite this? what would be the key of a node?
for (int i = 0; i < _items.Count; i++)
{
if (node == (_items[i]))
{
return i;
}
}
return -1;
}
/// <summary>
/// Add node to the beginning of the collection
/// </summary>
/// <param name="node"></param>
public void Prepend(HtmlNode node)
{
HtmlNode first = null;
if (_items.Count > 0)
{
first = _items[0];
}
_items.Insert(0, node);
if (node == first)
{
throw new InvalidProgramException("Unexpected error.");
}
node._nextnode = first;
node._prevnode = null;
node._parentnode = _parentnode;
if (first != null)
{
first._prevnode = node;
}
}
/// <summary>
/// Remove node at index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public bool Remove(int index)
{
RemoveAt(index);
return true;
}
/// <summary>
/// Replace node at index
/// </summary>
/// <param name="index"></param>
/// <param name="node"></param>
public void Replace(int index, HtmlNode node)
{
HtmlNode next = null;
HtmlNode prev = null;
HtmlNode oldnode = _items[index];
if (index > 0)
{
prev = _items[index - 1];
}
if (index < (_items.Count - 1))
{
next = _items[index + 1];
}
_items[index] = node;
if (prev != null)
{
if (node == prev)
{
throw new InvalidProgramException("Unexpected error.");
}
prev._nextnode = node;
}
if (next != null)
{
next._prevnode = node;
}
node._prevnode = prev;
if (next == node)
{
throw new InvalidProgramException("Unexpected error.");
}
node._nextnode = next;
node._parentnode = _parentnode;
oldnode._prevnode = null;
oldnode._nextnode = null;
oldnode._parentnode = null;
}
#endregion
#region LINQ Methods
/// <summary>
/// Get all node descended from this collection
/// </summary>
/// <returns></returns>
public IEnumerable<HtmlNode> DescendantNodes()
{
foreach (HtmlNode item in _items)
foreach (HtmlNode n in item.DescendantNodes())
yield return n;
}
/// <summary>
/// Get all node descended from this collection
/// </summary>
/// <returns></returns>
public IEnumerable<HtmlNode> Descendants()
{
foreach (HtmlNode item in _items)
foreach (HtmlNode n in item.Descendants())
yield return n;
}
/// <summary>
/// Get all node descended from this collection with matching name
/// </summary>
/// <returns></returns>
public IEnumerable<HtmlNode> Descendants(string name)
{
foreach (HtmlNode item in _items)
foreach (HtmlNode n in item.Descendants(name))
yield return n;
}
/// <summary>
/// Gets all first generation elements in collection
/// </summary>
/// <returns></returns>
public IEnumerable<HtmlNode> Elements()
{
foreach (HtmlNode item in _items)
foreach (HtmlNode n in item.ChildNodes)
yield return n;
}
/// <summary>
/// Gets all first generation elements matching name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public IEnumerable<HtmlNode> Elements(string name)
{
foreach (HtmlNode item in _items)
foreach (HtmlNode n in item.Elements(name))
yield return n;
}
/// <summary>
/// All first generation nodes in collection
/// </summary>
/// <returns></returns>
public IEnumerable<HtmlNode> Nodes()
{
foreach (HtmlNode item in _items)
foreach (HtmlNode n in item.ChildNodes)
yield return n;
}
#endregion
}
}
+768
View File
@@ -0,0 +1,768 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.XPath;
namespace HtmlAgilityPack
{
/// <summary>
/// Represents an HTML navigator on an HTML document seen as a data store.
/// </summary>
public class HtmlNodeNavigator : XPathNavigator
{
#region Fields
private int _attindex;
private HtmlNode _currentnode;
private HtmlDocument _doc = new HtmlDocument();
private HtmlNameTable _nametable = new HtmlNameTable();
internal bool Trace;
#endregion
#region Constructors
internal HtmlNodeNavigator()
{
Reset();
}
internal HtmlNodeNavigator(HtmlDocument doc, HtmlNode currentNode)
{
if (currentNode == null)
{
throw new ArgumentNullException("currentNode");
}
if (currentNode.OwnerDocument != doc)
{
throw new ArgumentException(HtmlDocument.HtmlExceptionRefNotChild);
}
InternalTrace(null);
_doc = doc;
Reset();
_currentnode = currentNode;
}
private HtmlNodeNavigator(HtmlNodeNavigator nav)
{
if (nav == null)
{
throw new ArgumentNullException("nav");
}
InternalTrace(null);
_doc = nav._doc;
_currentnode = nav._currentnode;
_attindex = nav._attindex;
_nametable = nav._nametable; // REVIEW: should we do this?
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
public HtmlNodeNavigator(Stream stream)
{
_doc.Load(stream);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the stream.</param>
public HtmlNodeNavigator(Stream stream, bool detectEncodingFromByteOrderMarks)
{
_doc.Load(stream, detectEncodingFromByteOrderMarks);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
/// <param name="encoding">The character encoding to use.</param>
public HtmlNodeNavigator(Stream stream, Encoding encoding)
{
_doc.Load(stream, encoding);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
/// <param name="encoding">The character encoding to use.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the stream.</param>
public HtmlNodeNavigator(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks)
{
_doc.Load(stream, encoding, detectEncodingFromByteOrderMarks);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
/// <param name="encoding">The character encoding to use.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the stream.</param>
/// <param name="buffersize">The minimum buffer size.</param>
public HtmlNodeNavigator(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize)
{
_doc.Load(stream, encoding, detectEncodingFromByteOrderMarks, buffersize);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a TextReader.
/// </summary>
/// <param name="reader">The TextReader used to feed the HTML data into the document.</param>
public HtmlNodeNavigator(TextReader reader)
{
_doc.Load(reader);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
public HtmlNodeNavigator(string path)
{
_doc.Load(path);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
public HtmlNodeNavigator(string path, bool detectEncodingFromByteOrderMarks)
{
_doc.Load(path, detectEncodingFromByteOrderMarks);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
/// <param name="encoding">The character encoding to use.</param>
public HtmlNodeNavigator(string path, Encoding encoding)
{
_doc.Load(path, encoding);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
/// <param name="encoding">The character encoding to use.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
public HtmlNodeNavigator(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks)
{
_doc.Load(path, encoding, detectEncodingFromByteOrderMarks);
Reset();
}
/// <summary>
/// Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
/// <param name="encoding">The character encoding to use.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
/// <param name="buffersize">The minimum buffer size.</param>
public HtmlNodeNavigator(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize)
{
_doc.Load(path, encoding, detectEncodingFromByteOrderMarks, buffersize);
Reset();
}
#endregion
#region Properties
/// <summary>
/// Gets the base URI for the current node.
/// Always returns string.Empty in the case of HtmlNavigator implementation.
/// </summary>
public override string BaseURI
{
get
{
InternalTrace(">");
return _nametable.GetOrAdd(string.Empty);
}
}
/// <summary>
/// Gets the current HTML document.
/// </summary>
public HtmlDocument CurrentDocument
{
get { return _doc; }
}
/// <summary>
/// Gets the current HTML node.
/// </summary>
public HtmlNode CurrentNode
{
get { return _currentnode; }
}
/// <summary>
/// Gets a value indicating whether the current node has child nodes.
/// </summary>
public override bool HasAttributes
{
get
{
InternalTrace(">" + (_currentnode.Attributes.Count > 0));
return (_currentnode.Attributes.Count > 0);
}
}
/// <summary>
/// Gets a value indicating whether the current node has child nodes.
/// </summary>
public override bool HasChildren
{
get
{
InternalTrace(">" + (_currentnode.ChildNodes.Count > 0));
return (_currentnode.ChildNodes.Count > 0);
}
}
/// <summary>
/// Gets a value indicating whether the current node is an empty element.
/// </summary>
public override bool IsEmptyElement
{
get
{
InternalTrace(">" + !HasChildren);
// REVIEW: is this ok?
return !HasChildren;
}
}
/// <summary>
/// Gets the name of the current HTML node without the namespace prefix.
/// </summary>
public override string LocalName
{
get
{
if (_attindex != -1)
{
InternalTrace("att>" + _currentnode.Attributes[_attindex].Name);
return _nametable.GetOrAdd(_currentnode.Attributes[_attindex].Name);
}
InternalTrace("node>" + _currentnode.Name);
return _nametable.GetOrAdd(_currentnode.Name);
}
}
/// <summary>
/// Gets the qualified name of the current node.
/// </summary>
public override string Name
{
get
{
InternalTrace(">" + _currentnode.Name);
return _nametable.GetOrAdd(_currentnode.Name);
}
}
/// <summary>
/// Gets the namespace URI (as defined in the W3C Namespace Specification) of the current node.
/// Always returns string.Empty in the case of HtmlNavigator implementation.
/// </summary>
public override string NamespaceURI
{
get
{
InternalTrace(">");
return _nametable.GetOrAdd(string.Empty);
}
}
/// <summary>
/// Gets the <see cref="XmlNameTable"/> associated with this implementation.
/// </summary>
public override XmlNameTable NameTable
{
get
{
InternalTrace(null);
return _nametable;
}
}
/// <summary>
/// Gets the type of the current node.
/// </summary>
public override XPathNodeType NodeType
{
get
{
switch (_currentnode.NodeType)
{
case HtmlNodeType.Comment:
InternalTrace(">" + XPathNodeType.Comment);
return XPathNodeType.Comment;
case HtmlNodeType.Document:
InternalTrace(">" + XPathNodeType.Root);
return XPathNodeType.Root;
case HtmlNodeType.Text:
InternalTrace(">" + XPathNodeType.Text);
return XPathNodeType.Text;
case HtmlNodeType.Element:
{
if (_attindex != -1)
{
InternalTrace(">" + XPathNodeType.Attribute);
return XPathNodeType.Attribute;
}
InternalTrace(">" + XPathNodeType.Element);
return XPathNodeType.Element;
}
default:
throw new NotImplementedException("Internal error: Unhandled HtmlNodeType: " +
_currentnode.NodeType);
}
}
}
/// <summary>
/// Gets the prefix associated with the current node.
/// Always returns string.Empty in the case of HtmlNavigator implementation.
/// </summary>
public override string Prefix
{
get
{
InternalTrace(null);
return _nametable.GetOrAdd(string.Empty);
}
}
/// <summary>
/// Gets the text value of the current node.
/// </summary>
public override string Value
{
get
{
InternalTrace("nt=" + _currentnode.NodeType);
switch (_currentnode.NodeType)
{
case HtmlNodeType.Comment:
InternalTrace(">" + ((HtmlCommentNode) _currentnode).Comment);
return ((HtmlCommentNode) _currentnode).Comment;
case HtmlNodeType.Document:
InternalTrace(">");
return "";
case HtmlNodeType.Text:
InternalTrace(">" + ((HtmlTextNode) _currentnode).Text);
return ((HtmlTextNode) _currentnode).Text;
case HtmlNodeType.Element:
{
if (_attindex != -1)
{
InternalTrace(">" + _currentnode.Attributes[_attindex].Value);
return _currentnode.Attributes[_attindex].Value;
}
return _currentnode.InnerText;
}
default:
throw new NotImplementedException("Internal error: Unhandled HtmlNodeType: " +
_currentnode.NodeType);
}
}
}
/// <summary>
/// Gets the xml:lang scope for the current node.
/// Always returns string.Empty in the case of HtmlNavigator implementation.
/// </summary>
public override string XmlLang
{
get
{
InternalTrace(null);
return _nametable.GetOrAdd(string.Empty);
}
}
#endregion
#region Public Methods
/// <summary>
/// Creates a new HtmlNavigator positioned at the same node as this HtmlNavigator.
/// </summary>
/// <returns>A new HtmlNavigator object positioned at the same node as the original HtmlNavigator.</returns>
public override XPathNavigator Clone()
{
InternalTrace(null);
return new HtmlNodeNavigator(this);
}
/// <summary>
/// Gets the value of the HTML attribute with the specified LocalName and NamespaceURI.
/// </summary>
/// <param name="localName">The local name of the HTML attribute.</param>
/// <param name="namespaceURI">The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation.</param>
/// <returns>The value of the specified HTML attribute. String.Empty or null if a matching attribute is not found or if the navigator is not positioned on an element node.</returns>
public override string GetAttribute(string localName, string namespaceURI)
{
InternalTrace("localName=" + localName + ", namespaceURI=" + namespaceURI);
HtmlAttribute att = _currentnode.Attributes[localName];
if (att == null)
{
InternalTrace(">null");
return null;
}
InternalTrace(">" + att.Value);
return att.Value;
}
/// <summary>
/// Returns the value of the namespace node corresponding to the specified local name.
/// Always returns string.Empty for the HtmlNavigator implementation.
/// </summary>
/// <param name="name">The local name of the namespace node.</param>
/// <returns>Always returns string.Empty for the HtmlNavigator implementation.</returns>
public override string GetNamespace(string name)
{
InternalTrace("name=" + name);
return string.Empty;
}
/// <summary>
/// Determines whether the current HtmlNavigator is at the same position as the specified HtmlNavigator.
/// </summary>
/// <param name="other">The HtmlNavigator that you want to compare against.</param>
/// <returns>true if the two navigators have the same position, otherwise, false.</returns>
public override bool IsSamePosition(XPathNavigator other)
{
HtmlNodeNavigator nav = other as HtmlNodeNavigator;
if (nav == null)
{
InternalTrace(">false");
return false;
}
InternalTrace(">" + (nav._currentnode == _currentnode));
return (nav._currentnode == _currentnode);
}
/// <summary>
/// Moves to the same position as the specified HtmlNavigator.
/// </summary>
/// <param name="other">The HtmlNavigator positioned on the node that you want to move to.</param>
/// <returns>true if successful, otherwise false. If false, the position of the navigator is unchanged.</returns>
public override bool MoveTo(XPathNavigator other)
{
HtmlNodeNavigator nav = other as HtmlNodeNavigator;
if (nav == null)
{
InternalTrace(">false (nav is not an HtmlNodeNavigator)");
return false;
}
InternalTrace("moveto oid=" + nav.GetHashCode()
+ ", n:" + nav._currentnode.Name
+ ", a:" + nav._attindex);
if (nav._doc == _doc)
{
_currentnode = nav._currentnode;
_attindex = nav._attindex;
InternalTrace(">true");
return true;
}
// we don't know how to handle that
InternalTrace(">false (???)");
return false;
}
/// <summary>
/// Moves to the HTML attribute with matching LocalName and NamespaceURI.
/// </summary>
/// <param name="localName">The local name of the HTML attribute.</param>
/// <param name="namespaceURI">The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation.</param>
/// <returns>true if the HTML attribute is found, otherwise, false. If false, the position of the navigator does not change.</returns>
public override bool MoveToAttribute(string localName, string namespaceURI)
{
InternalTrace("localName=" + localName + ", namespaceURI=" + namespaceURI);
int index = _currentnode.Attributes.GetAttributeIndex(localName);
if (index == -1)
{
InternalTrace(">false");
return false;
}
_attindex = index;
InternalTrace(">true");
return true;
}
/// <summary>
/// Moves to the first sibling of the current node.
/// </summary>
/// <returns>true if the navigator is successful moving to the first sibling node, false if there is no first sibling or if the navigator is currently positioned on an attribute node.</returns>
public override bool MoveToFirst()
{
if (_currentnode.ParentNode == null)
{
InternalTrace(">false");
return false;
}
if (_currentnode.ParentNode.FirstChild == null)
{
InternalTrace(">false");
return false;
}
_currentnode = _currentnode.ParentNode.FirstChild;
InternalTrace(">true");
return true;
}
/// <summary>
/// Moves to the first HTML attribute.
/// </summary>
/// <returns>true if the navigator is successful moving to the first HTML attribute, otherwise, false.</returns>
public override bool MoveToFirstAttribute()
{
if (!HasAttributes)
{
InternalTrace(">false");
return false;
}
_attindex = 0;
InternalTrace(">true");
return true;
}
/// <summary>
/// Moves to the first child of the current node.
/// </summary>
/// <returns>true if there is a first child node, otherwise false.</returns>
public override bool MoveToFirstChild()
{
if (!_currentnode.HasChildNodes)
{
InternalTrace(">false");
return false;
}
_currentnode = _currentnode.ChildNodes[0];
InternalTrace(">true");
return true;
}
/// <summary>
/// Moves the XPathNavigator to the first namespace node of the current element.
/// Always returns false for the HtmlNavigator implementation.
/// </summary>
/// <param name="scope">An XPathNamespaceScope value describing the namespace scope.</param>
/// <returns>Always returns false for the HtmlNavigator implementation.</returns>
public override bool MoveToFirstNamespace(XPathNamespaceScope scope)
{
InternalTrace(null);
return false;
}
/// <summary>
/// Moves to the node that has an attribute of type ID whose value matches the specified string.
/// </summary>
/// <param name="id">A string representing the ID value of the node to which you want to move. This argument does not need to be atomized.</param>
/// <returns>true if the move was successful, otherwise false. If false, the position of the navigator is unchanged.</returns>
public override bool MoveToId(string id)
{
InternalTrace("id=" + id);
HtmlNode node = _doc.GetElementbyId(id);
if (node == null)
{
InternalTrace(">false");
return false;
}
_currentnode = node;
InternalTrace(">true");
return true;
}
/// <summary>
/// Moves the XPathNavigator to the namespace node with the specified local name.
/// Always returns false for the HtmlNavigator implementation.
/// </summary>
/// <param name="name">The local name of the namespace node.</param>
/// <returns>Always returns false for the HtmlNavigator implementation.</returns>
public override bool MoveToNamespace(string name)
{
InternalTrace("name=" + name);
return false;
}
/// <summary>
/// Moves to the next sibling of the current node.
/// </summary>
/// <returns>true if the navigator is successful moving to the next sibling node, false if there are no more siblings or if the navigator is currently positioned on an attribute node. If false, the position of the navigator is unchanged.</returns>
public override bool MoveToNext()
{
if (_currentnode.NextSibling == null)
{
InternalTrace(">false");
return false;
}
InternalTrace("_c=" + _currentnode.CloneNode(false).OuterHtml);
InternalTrace("_n=" + _currentnode.NextSibling.CloneNode(false).OuterHtml);
_currentnode = _currentnode.NextSibling;
InternalTrace(">true");
return true;
}
/// <summary>
/// Moves to the next HTML attribute.
/// </summary>
/// <returns></returns>
public override bool MoveToNextAttribute()
{
InternalTrace(null);
if (_attindex >= (_currentnode.Attributes.Count - 1))
{
InternalTrace(">false");
return false;
}
_attindex++;
InternalTrace(">true");
return true;
}
/// <summary>
/// Moves the XPathNavigator to the next namespace node.
/// Always returns falsefor the HtmlNavigator implementation.
/// </summary>
/// <param name="scope">An XPathNamespaceScope value describing the namespace scope.</param>
/// <returns>Always returns false for the HtmlNavigator implementation.</returns>
public override bool MoveToNextNamespace(XPathNamespaceScope scope)
{
InternalTrace(null);
return false;
}
/// <summary>
/// Moves to the parent of the current node.
/// </summary>
/// <returns>true if there is a parent node, otherwise false.</returns>
public override bool MoveToParent()
{
if (_currentnode.ParentNode == null)
{
InternalTrace(">false");
return false;
}
_currentnode = _currentnode.ParentNode;
InternalTrace(">true");
return true;
}
/// <summary>
/// Moves to the previous sibling of the current node.
/// </summary>
/// <returns>true if the navigator is successful moving to the previous sibling node, false if there is no previous sibling or if the navigator is currently positioned on an attribute node.</returns>
public override bool MoveToPrevious()
{
if (_currentnode.PreviousSibling == null)
{
InternalTrace(">false");
return false;
}
_currentnode = _currentnode.PreviousSibling;
InternalTrace(">true");
return true;
}
/// <summary>
/// Moves to the root node to which the current node belongs.
/// </summary>
public override void MoveToRoot()
{
_currentnode = _doc.DocumentNode;
InternalTrace(null);
}
#endregion
#region Internal Methods
[Conditional("TRACE")]
internal void InternalTrace(object traceValue)
{
if (!Trace)
{
return;
}
StackFrame sf = new StackFrame(1, true);
string name = sf.GetMethod().Name;
string nodename = _currentnode == null ? "(null)" : _currentnode.Name;
string nodevalue;
if (_currentnode == null)
{
nodevalue = "(null)";
}
else
{
switch (_currentnode.NodeType)
{
case HtmlNodeType.Comment:
nodevalue = ((HtmlCommentNode) _currentnode).Comment;
break;
case HtmlNodeType.Document:
nodevalue = "";
break;
case HtmlNodeType.Text:
nodevalue = ((HtmlTextNode) _currentnode).Text;
break;
default:
nodevalue = _currentnode.CloneNode(false).OuterHtml;
break;
}
}
System.Diagnostics.Trace.WriteLine(string.Format("oid={0},n={1},a={2},v={3},{4}", GetHashCode(), nodename, _attindex, nodevalue, traceValue), "N!" + name);
}
#endregion
#region Private Methods
private void Reset()
{
InternalTrace(null);
_currentnode = _doc.DocumentNode;
_attindex = -1;
}
#endregion
}
}
+29
View File
@@ -0,0 +1,29 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// Represents the type of a node.
/// </summary>
public enum HtmlNodeType
{
/// <summary>
/// The root of a document.
/// </summary>
Document,
/// <summary>
/// An HTML element.
/// </summary>
Element,
/// <summary>
/// An HTML comment.
/// </summary>
Comment,
/// <summary>
/// A text node is always the child of an element or a document node.
/// </summary>
Text,
}
}
+92
View File
@@ -0,0 +1,92 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// Represents a parsing error found during document parsing.
/// </summary>
public class HtmlParseError
{
#region Fields
private HtmlParseErrorCode _code;
private int _line;
private int _linePosition;
private string _reason;
private string _sourceText;
private int _streamPosition;
#endregion
#region Constructors
internal HtmlParseError(
HtmlParseErrorCode code,
int line,
int linePosition,
int streamPosition,
string sourceText,
string reason)
{
_code = code;
_line = line;
_linePosition = linePosition;
_streamPosition = streamPosition;
_sourceText = sourceText;
_reason = reason;
}
#endregion
#region Properties
/// <summary>
/// Gets the type of error.
/// </summary>
public HtmlParseErrorCode Code
{
get { return _code; }
}
/// <summary>
/// Gets the line number of this error in the document.
/// </summary>
public int Line
{
get { return _line; }
}
/// <summary>
/// Gets the column number of this error in the document.
/// </summary>
public int LinePosition
{
get { return _linePosition; }
}
/// <summary>
/// Gets a description for the error.
/// </summary>
public string Reason
{
get { return _reason; }
}
/// <summary>
/// Gets the the full text of the line containing the error.
/// </summary>
public string SourceText
{
get { return _sourceText; }
}
/// <summary>
/// Gets the absolute stream position of this error in the document, relative to the start of the document.
/// </summary>
public int StreamPosition
{
get { return _streamPosition; }
}
#endregion
}
}
@@ -0,0 +1,34 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// Represents the type of parsing error.
/// </summary>
public enum HtmlParseErrorCode
{
/// <summary>
/// A tag was not closed.
/// </summary>
TagNotClosed,
/// <summary>
/// A tag was not opened.
/// </summary>
TagNotOpened,
/// <summary>
/// There is a charset mismatch between stream and declared (META) encoding.
/// </summary>
CharsetMismatch,
/// <summary>
/// An end tag was not required.
/// </summary>
EndTagNotRequired,
/// <summary>
/// An end tag is invalid at this position.
/// </summary>
EndTagInvalidHere
}
}
+69
View File
@@ -0,0 +1,69 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// Represents an HTML text node.
/// </summary>
public class HtmlTextNode : HtmlNode
{
#region Fields
private string _text;
#endregion
#region Constructors
internal HtmlTextNode(HtmlDocument ownerdocument, int index)
:
base(HtmlNodeType.Text, ownerdocument, index)
{
}
#endregion
#region Properties
/// <summary>
/// Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml.
/// </summary>
public override string InnerHtml
{
get { return OuterHtml; }
set { _text = value; }
}
/// <summary>
/// Gets or Sets the object and its content in HTML.
/// </summary>
public override string OuterHtml
{
get
{
if (_text == null)
{
return base.OuterHtml;
}
return _text;
}
}
/// <summary>
/// Gets or Sets the text of the node.
/// </summary>
public string Text
{
get
{
if (_text == null)
{
return base.OuterHtml;
}
return _text;
}
set { _text = value; }
}
#endregion
}
}
+907
View File
@@ -0,0 +1,907 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Xsl;
using Microsoft.Win32;
namespace HtmlAgilityPack
{
/// <summary>
/// A utility class to get HTML document from HTTP.
/// </summary>
public class HtmlWeb
{
#region Delegates
/// <summary>
/// Represents the method that will handle the PostResponse event.
/// </summary>
public delegate void PostResponseHandler(HttpWebRequest request, HttpWebResponse response);
/// <summary>
/// Represents the method that will handle the PreHandleDocument event.
/// </summary>
public delegate void PreHandleDocumentHandler(HtmlDocument document);
/// <summary>
/// Represents the method that will handle the PreRequest event.
/// </summary>
public delegate bool PreRequestHandler(HttpWebRequest request);
#endregion
#region Fields
private bool _autoDetectEncoding = true;
private bool _cacheOnly;
private string _cachePath;
private bool _fromCache;
private int _requestDuration;
private Uri _responseUri;
private HttpStatusCode _statusCode = HttpStatusCode.OK;
private int _streamBufferSize = 1024;
private bool _useCookies;
private bool _usingCache;
/// <summary>
/// Occurs after an HTTP request has been executed.
/// </summary>
public PostResponseHandler PostResponse;
/// <summary>
/// Occurs before an HTML document is handled.
/// </summary>
public PreHandleDocumentHandler PreHandleDocument;
/// <summary>
/// Occurs before an HTTP request is executed.
/// </summary>
public PreRequestHandler PreRequest;
#endregion
#region Properties
/// <summary>
/// Gets or Sets a value indicating if document encoding must be automatically detected.
/// </summary>
public bool AutoDetectEncoding
{
get { return _autoDetectEncoding; }
set { _autoDetectEncoding = value; }
}
/// <summary>
/// Gets or Sets a value indicating whether to get document only from the cache.
/// If this is set to true and document is not found in the cache, nothing will be loaded.
/// </summary>
public bool CacheOnly
{
get { return _cacheOnly; }
set
{
if ((value) && !UsingCache)
{
throw new HtmlWebException("Cache is not enabled. Set UsingCache to true first.");
}
_cacheOnly = value;
}
}
/// <summary>
/// Gets or Sets the cache path. If null, no caching mechanism will be used.
/// </summary>
public string CachePath
{
get { return _cachePath; }
set { _cachePath = value; }
}
/// <summary>
/// Gets a value indicating if the last document was retrieved from the cache.
/// </summary>
public bool FromCache
{
get { return _fromCache; }
}
/// <summary>
/// Gets the last request duration in milliseconds.
/// </summary>
public int RequestDuration
{
get { return _requestDuration; }
}
/// <summary>
/// Gets the URI of the Internet resource that actually responded to the request.
/// </summary>
public Uri ResponseUri
{
get { return _responseUri; }
}
/// <summary>
/// Gets the last request status.
/// </summary>
public HttpStatusCode StatusCode
{
get { return _statusCode; }
}
/// <summary>
/// Gets or Sets the size of the buffer used for memory operations.
/// </summary>
public int StreamBufferSize
{
get { return _streamBufferSize; }
set
{
if (_streamBufferSize <= 0)
{
throw new ArgumentException("Size must be greater than zero.");
}
_streamBufferSize = value;
}
}
/// <summary>
/// Gets or Sets a value indicating if cookies will be stored.
/// </summary>
public bool UseCookies
{
get { return _useCookies; }
set { _useCookies = value; }
}
/// <summary>
/// Gets or Sets a value indicating whether the caching mechanisms should be used or not.
/// </summary>
public bool UsingCache
{
get
{
if (_cachePath == null)
{
return false;
}
return _usingCache;
}
set
{
if ((value) && (_cachePath == null))
{
throw new HtmlWebException("You need to define a CachePath first.");
}
_usingCache = value;
}
}
#endregion
#region Public Methods
/// <summary>
/// Gets the MIME content type for a given path extension.
/// </summary>
/// <param name="extension">The input path extension.</param>
/// <param name="def">The default content type to return if any error occurs.</param>
/// <returns>The path extension's MIME content type.</returns>
public static string GetContentTypeForExtension(string extension, string def)
{
if (string.IsNullOrEmpty(extension))
{
return def;
}
string contentType = "";
try
{
RegistryKey reg = Registry.ClassesRoot;
reg = reg.OpenSubKey(extension, false);
if (reg != null) contentType = (string)reg.GetValue("", def);
}
catch (Exception)
{
contentType = def;
}
return contentType;
}
/// <summary>
/// Gets the path extension for a given MIME content type.
/// </summary>
/// <param name="contentType">The input MIME content type.</param>
/// <param name="def">The default path extension to return if any error occurs.</param>
/// <returns>The MIME content type's path extension.</returns>
public static string GetExtensionForContentType(string contentType, string def)
{
if (string.IsNullOrEmpty(contentType))
{
return def;
}
string ext = "";
try
{
RegistryKey reg = Registry.ClassesRoot;
reg = reg.OpenSubKey(@"MIME\Database\Content Type\" + contentType, false);
if (reg != null) ext = (string)reg.GetValue("Extension", def);
}
catch (Exception)
{
ext = def;
}
return ext;
}
/// <summary>
/// Creates an instance of the given type from the specified Internet resource.
/// </summary>
/// <param name="url">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="type">The requested type.</param>
/// <returns>An newly created instance.</returns>
public object CreateInstance(string url, Type type)
{
return CreateInstance(url, null, null, type);
}
/// <summary>
/// Creates an instance of the given type from the specified Internet resource.
/// </summary>
/// <param name="htmlUrl">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="xsltUrl">The URL that specifies the XSLT stylesheet to load.</param>
/// <param name="xsltArgs">An <see cref="XsltArgumentList"/> containing the namespace-qualified arguments used as input to the transform.</param>
/// <param name="type">The requested type.</param>
/// <returns>An newly created instance.</returns>
public object CreateInstance(string htmlUrl, string xsltUrl, XsltArgumentList xsltArgs, Type type)
{
return CreateInstance(htmlUrl, xsltUrl, xsltArgs, type, null);
}
/// <summary>
/// Creates an instance of the given type from the specified Internet resource.
/// </summary>
/// <param name="htmlUrl">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="xsltUrl">The URL that specifies the XSLT stylesheet to load.</param>
/// <param name="xsltArgs">An <see cref="XsltArgumentList"/> containing the namespace-qualified arguments used as input to the transform.</param>
/// <param name="type">The requested type.</param>
/// <param name="xmlPath">A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes.</param>
/// <returns>An newly created instance.</returns>
public object CreateInstance(string htmlUrl, string xsltUrl, XsltArgumentList xsltArgs, Type type,
string xmlPath)
{
StringWriter sw = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(sw);
if (xsltUrl == null)
{
LoadHtmlAsXml(htmlUrl, writer);
}
else
{
if (xmlPath == null)
{
LoadHtmlAsXml(htmlUrl, xsltUrl, xsltArgs, writer);
}
else
{
LoadHtmlAsXml(htmlUrl, xsltUrl, xsltArgs, writer, xmlPath);
}
}
writer.Flush();
StringReader sr = new StringReader(sw.ToString());
XmlTextReader reader = new XmlTextReader(sr);
XmlSerializer serializer = new XmlSerializer(type);
object o;
try
{
o = serializer.Deserialize(reader);
}
catch (InvalidOperationException ex)
{
throw new Exception(ex + ", --- xml:" + sw);
}
return o;
}
/// <summary>
/// Gets an HTML document from an Internet resource and saves it to the specified file.
/// </summary>
/// <param name="url">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="path">The location of the file where you want to save the document.</param>
public void Get(string url, string path)
{
Get(url, path, "GET");
}
/// <summary>
/// Gets an HTML document from an Internet resource and saves it to the specified file. - Proxy aware
/// </summary>
/// <param name="url">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="path">The location of the file where you want to save the document.</param>
/// <param name="proxy"></param>
/// <param name="credentials"></param>
public void Get(string url, string path, WebProxy proxy, NetworkCredential credentials)
{
Get(url, path, proxy, credentials, "GET");
}
/// <summary>
/// Gets an HTML document from an Internet resource and saves it to the specified file.
/// </summary>
/// <param name="url">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="path">The location of the file where you want to save the document.</param>
/// <param name="method">The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND.</param>
public void Get(string url, string path, string method)
{
Uri uri = new Uri(url);
if ((uri.Scheme == Uri.UriSchemeHttps) ||
(uri.Scheme == Uri.UriSchemeHttp))
{
Get(uri, method, path, null, null, null);
}
else
{
throw new HtmlWebException("Unsupported uri scheme: '" + uri.Scheme + "'.");
}
}
/// <summary>
/// Gets an HTML document from an Internet resource and saves it to the specified file. Understands Proxies
/// </summary>
/// <param name="url">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="path">The location of the file where you want to save the document.</param>
/// <param name="credentials"></param>
/// <param name="method">The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND.</param>
/// <param name="proxy"></param>
public void Get(string url, string path, WebProxy proxy, NetworkCredential credentials, string method)
{
Uri uri = new Uri(url);
if ((uri.Scheme == Uri.UriSchemeHttps) ||
(uri.Scheme == Uri.UriSchemeHttp))
{
Get(uri, method, path, null, proxy, credentials);
}
else
{
throw new HtmlWebException("Unsupported uri scheme: '" + uri.Scheme + "'.");
}
}
/// <summary>
/// Gets the cache file path for a specified url.
/// </summary>
/// <param name="uri">The url fo which to retrieve the cache path. May not be null.</param>
/// <returns>The cache file path.</returns>
public string GetCachePath(Uri uri)
{
if (uri == null)
{
throw new ArgumentNullException("uri");
}
if (!UsingCache)
{
throw new HtmlWebException("Cache is not enabled. Set UsingCache to true first.");
}
string cachePath;
if (uri.AbsolutePath == "/")
{
cachePath = Path.Combine(_cachePath, ".htm");
}
else
{
cachePath = Path.Combine(_cachePath, (uri.Host + uri.AbsolutePath).Replace('/', '\\'));
}
return cachePath;
}
/// <summary>
/// Gets an HTML document from an Internet resource.
/// </summary>
/// <param name="url">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <returns>A new HTML document.</returns>
public HtmlDocument Load(string url)
{
return Load(url, "GET");
}
/// <summary>
/// Gets an HTML document from an Internet resource.
/// </summary>
/// <param name="url">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="proxyHost">Host to use for Proxy</param>
/// <param name="proxyPort">Port the Proxy is on</param>
/// <param name="userId">User Id for Authentication</param>
/// <param name="password">Password for Authentication</param>
/// <returns>A new HTML document.</returns>
public HtmlDocument Load(string url, string proxyHost, int proxyPort, string userId, string password)
{
//Create my proxy
WebProxy myProxy = new WebProxy(proxyHost, proxyPort);
myProxy.BypassProxyOnLocal = true;
//Create my credentials
NetworkCredential myCreds = null;
if ((userId != null) && (password != null))
{
myCreds = new NetworkCredential(userId, password);
CredentialCache credCache = new CredentialCache();
//Add the creds
credCache.Add(myProxy.Address, "Basic", myCreds);
credCache.Add(myProxy.Address, "Digest", myCreds);
}
return Load(url, "GET", myProxy, myCreds);
}
/// <summary>
/// Loads an HTML document from an Internet resource.
/// </summary>
/// <param name="url">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="method">The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND.</param>
/// <returns>A new HTML document.</returns>
public HtmlDocument Load(string url, string method)
{
Uri uri = new Uri(url);
HtmlDocument doc;
if ((uri.Scheme == Uri.UriSchemeHttps) ||
(uri.Scheme == Uri.UriSchemeHttp))
{
doc = LoadUrl(uri, method, null, null);
}
else
{
if (uri.Scheme == Uri.UriSchemeFile)
{
doc = new HtmlDocument();
doc.OptionAutoCloseOnEnd = false;
doc.OptionAutoCloseOnEnd = true;
doc.DetectEncodingAndLoad(url, _autoDetectEncoding);
}
else
{
throw new HtmlWebException("Unsupported uri scheme: '" + uri.Scheme + "'.");
}
}
if (PreHandleDocument != null)
{
PreHandleDocument(doc);
}
return doc;
}
/// <summary>
/// Loads an HTML document from an Internet resource.
/// </summary>
/// <param name="url">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="method">The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND.</param>
/// <param name="proxy">Proxy to use with this request</param>
/// <param name="credentials">Credentials to use when authenticating</param>
/// <returns>A new HTML document.</returns>
public HtmlDocument Load(string url, string method, WebProxy proxy, NetworkCredential credentials)
{
Uri uri = new Uri(url);
HtmlDocument doc;
if ((uri.Scheme == Uri.UriSchemeHttps) ||
(uri.Scheme == Uri.UriSchemeHttp))
{
doc = LoadUrl(uri, method, proxy, credentials);
}
else
{
if (uri.Scheme == Uri.UriSchemeFile)
{
doc = new HtmlDocument();
doc.OptionAutoCloseOnEnd = false;
doc.OptionAutoCloseOnEnd = true;
doc.DetectEncodingAndLoad(url, _autoDetectEncoding);
}
else
{
throw new HtmlWebException("Unsupported uri scheme: '" + uri.Scheme + "'.");
}
}
if (PreHandleDocument != null)
{
PreHandleDocument(doc);
}
return doc;
}
/// <summary>
/// Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter.
/// </summary>
/// <param name="htmlUrl">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="writer">The XmlTextWriter to which you want to save.</param>
public void LoadHtmlAsXml(string htmlUrl, XmlTextWriter writer)
{
HtmlDocument doc = Load(htmlUrl);
doc.Save(writer);
}
/// <summary>
/// Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation.
/// </summary>
/// <param name="htmlUrl">The requested URL, such as "http://Myserver/Mypath/Myfile.asp".</param>
/// <param name="xsltUrl">The URL that specifies the XSLT stylesheet to load.</param>
/// <param name="xsltArgs">An XsltArgumentList containing the namespace-qualified arguments used as input to the transform.</param>
/// <param name="writer">The XmlTextWriter to which you want to save.</param>
public void LoadHtmlAsXml(string htmlUrl, string xsltUrl, XsltArgumentList xsltArgs, XmlTextWriter writer)
{
LoadHtmlAsXml(htmlUrl, xsltUrl, xsltArgs, writer, null);
}
/// <summary>
/// Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation.
/// </summary>
/// <param name="htmlUrl">The requested URL, such as "http://Myserver/Mypath/Myfile.asp". May not be null.</param>
/// <param name="xsltUrl">The URL that specifies the XSLT stylesheet to load.</param>
/// <param name="xsltArgs">An XsltArgumentList containing the namespace-qualified arguments used as input to the transform.</param>
/// <param name="writer">The XmlTextWriter to which you want to save.</param>
/// <param name="xmlPath">A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes.</param>
public void LoadHtmlAsXml(string htmlUrl, string xsltUrl, XsltArgumentList xsltArgs, XmlTextWriter writer,
string xmlPath)
{
if (htmlUrl == null)
{
throw new ArgumentNullException("htmlUrl");
}
HtmlDocument doc = Load(htmlUrl);
if (xmlPath != null)
{
XmlTextWriter w = new XmlTextWriter(xmlPath, doc.Encoding);
doc.Save(w);
w.Close();
}
if (xsltArgs == null)
{
xsltArgs = new XsltArgumentList();
}
// add some useful variables to the xslt doc
xsltArgs.AddParam("url", "", htmlUrl);
xsltArgs.AddParam("requestDuration", "", RequestDuration);
xsltArgs.AddParam("fromCache", "", FromCache);
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(xsltUrl);
xslt.Transform(doc, xsltArgs, writer);
}
#endregion
#region Private Methods
private static void FilePreparePath(string target)
{
if (File.Exists(target))
{
FileAttributes atts = File.GetAttributes(target);
File.SetAttributes(target, atts & ~FileAttributes.ReadOnly);
}
else
{
string dir = Path.GetDirectoryName(target);
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
}
}
private static DateTime RemoveMilliseconds(DateTime t)
{
return new DateTime(t.Year, t.Month, t.Day, t.Hour, t.Minute, t.Second, 0);
}
// ReSharper disable UnusedMethodReturnValue.Local
private static long SaveStream(Stream stream, string path, DateTime touchDate, int streamBufferSize)
// ReSharper restore UnusedMethodReturnValue.Local
{
FilePreparePath(path);
FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write);
BinaryReader br = null;
BinaryWriter bw = null;
long len = 0;
try
{
br = new BinaryReader(stream);
bw = new BinaryWriter(fs);
byte[] buffer;
do
{
buffer = br.ReadBytes(streamBufferSize);
len += buffer.Length;
if (buffer.Length > 0)
{
bw.Write(buffer);
}
} while (buffer.Length > 0);
}
finally
{
if (br != null)
{
br.Close();
}
if (bw != null)
{
bw.Flush();
bw.Close();
}
if (fs != null)
{
fs.Close();
}
}
File.SetLastWriteTime(path, touchDate);
return len;
}
private HttpStatusCode Get(Uri uri, string method, string path, HtmlDocument doc, IWebProxy proxy,
ICredentials creds)
{
string cachePath = null;
HttpWebRequest req;
bool oldFile = false;
req = WebRequest.Create(uri) as HttpWebRequest;
req.Method = method;
if (proxy != null)
{
if (creds != null)
{
proxy.Credentials = creds;
req.Credentials = creds;
}
else
{
proxy.Credentials = CredentialCache.DefaultCredentials;
req.Credentials = CredentialCache.DefaultCredentials;
}
req.Proxy = proxy;
}
_fromCache = false;
_requestDuration = 0;
int tc = Environment.TickCount;
if (UsingCache)
{
cachePath = GetCachePath(req.RequestUri);
if (File.Exists(cachePath))
{
req.IfModifiedSince = File.GetLastAccessTime(cachePath);
oldFile = true;
}
}
if (_cacheOnly)
{
if (!File.Exists(cachePath))
{
throw new HtmlWebException("File was not found at cache path: '" + cachePath + "'");
}
if (path != null)
{
IOLibrary.CopyAlways(cachePath, path);
// touch the file
File.SetLastWriteTime(path, File.GetLastWriteTime(cachePath));
}
_fromCache = true;
return HttpStatusCode.NotModified;
}
if (_useCookies)
{
req.CookieContainer = new CookieContainer();
}
if (PreRequest != null)
{
// allow our user to change the request at will
if (!PreRequest(req))
{
return HttpStatusCode.ResetContent;
}
// dump cookie
// if (_useCookies)
// {
// foreach(Cookie cookie in req.CookieContainer.GetCookies(req.RequestUri))
// {
// HtmlLibrary.Trace("Cookie " + cookie.Name + "=" + cookie.Value + " path=" + cookie.Path + " domain=" + cookie.Domain);
// }
// }
}
HttpWebResponse resp;
try
{
resp = req.GetResponse() as HttpWebResponse;
}
catch (WebException we)
{
_requestDuration = Environment.TickCount - tc;
resp = (HttpWebResponse)we.Response;
if (resp == null)
{
if (oldFile)
{
if (path != null)
{
IOLibrary.CopyAlways(cachePath, path);
// touch the file
File.SetLastWriteTime(path, File.GetLastWriteTime(cachePath));
}
return HttpStatusCode.NotModified;
}
throw;
}
}
catch (Exception)
{
_requestDuration = Environment.TickCount - tc;
throw;
}
// allow our user to get some info from the response
if (PostResponse != null)
{
PostResponse(req, resp);
}
_requestDuration = Environment.TickCount - tc;
_responseUri = resp.ResponseUri;
bool html = IsHtmlContent(resp.ContentType);
Encoding respenc;
if ((resp.ContentEncoding != null) && (resp.ContentEncoding.Length > 0))
{
respenc = Encoding.GetEncoding(resp.ContentEncoding);
}
else
{
respenc = null;
}
if (resp.StatusCode == HttpStatusCode.NotModified)
{
if (UsingCache)
{
_fromCache = true;
if (path != null)
{
IOLibrary.CopyAlways(cachePath, path);
// touch the file
File.SetLastWriteTime(path, File.GetLastWriteTime(cachePath));
}
return resp.StatusCode;
}
else
{
// this should *never* happen...
throw new HtmlWebException("Server has send a NotModifed code, without cache enabled.");
}
}
Stream s = resp.GetResponseStream();
if (s != null)
{
if (UsingCache)
{
// NOTE: LastModified does not contain milliseconds, so we remove them to the file
SaveStream(s, cachePath, RemoveMilliseconds(resp.LastModified), _streamBufferSize);
// save headers
SaveCacheHeaders(req.RequestUri, resp);
if (path != null)
{
// copy and touch the file
IOLibrary.CopyAlways(cachePath, path);
File.SetLastWriteTime(path, File.GetLastWriteTime(cachePath));
}
}
else
{
// try to work in-memory
if ((doc != null) && (html))
{
if (respenc != null)
{
doc.Load(s, respenc);
}
else
{
doc.Load(s, true);
}
}
}
resp.Close();
}
return resp.StatusCode;
}
private string GetCacheHeader(Uri requestUri, string name, string def)
{
// note: some headers are collection (ex: www-authenticate)
// we don't handle that here
XmlDocument doc = new XmlDocument();
doc.Load(GetCacheHeadersPath(requestUri));
XmlNode node =
doc.SelectSingleNode("//h[translate(@n, 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')='" +
name.ToUpper() + "']");
if (node == null)
{
return def;
}
// attribute should exist
return node.Attributes[name].Value;
}
private string GetCacheHeadersPath(Uri uri)
{
//return Path.Combine(GetCachePath(uri), ".h.xml");
return GetCachePath(uri) + ".h.xml";
}
private bool IsCacheHtmlContent(string path)
{
string ct = GetContentTypeForExtension(Path.GetExtension(path), null);
return IsHtmlContent(ct);
}
private bool IsHtmlContent(string contentType)
{
return contentType.ToLower().StartsWith("text/html");
}
private HtmlDocument LoadUrl(Uri uri, string method, WebProxy proxy, NetworkCredential creds)
{
HtmlDocument doc = new HtmlDocument();
doc.OptionAutoCloseOnEnd = false;
doc.OptionFixNestedTags = true;
_statusCode = Get(uri, method, null, doc, proxy, creds);
if (_statusCode == HttpStatusCode.NotModified)
{
// read cached encoding
doc.DetectEncodingAndLoad(GetCachePath(uri));
}
return doc;
}
private void SaveCacheHeaders(Uri requestUri, HttpWebResponse resp)
{
// we cache the original headers aside the cached document.
string file = GetCacheHeadersPath(requestUri);
XmlDocument doc = new XmlDocument();
doc.LoadXml("<c></c>");
XmlNode cache = doc.FirstChild;
foreach (string header in resp.Headers)
{
XmlNode entry = doc.CreateElement("h");
XmlAttribute att = doc.CreateAttribute("n");
att.Value = header;
entry.Attributes.Append(att);
att = doc.CreateAttribute("v");
att.Value = resp.Headers[header];
entry.Attributes.Append(att);
cache.AppendChild(entry);
}
doc.Save(file);
}
#endregion
}
}
+24
View File
@@ -0,0 +1,24 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
namespace HtmlAgilityPack
{
/// <summary>
/// Represents an exception thrown by the HtmlWeb utility class.
/// </summary>
public class HtmlWebException : Exception
{
#region Constructors
/// <summary>
/// Creates an instance of the HtmlWebException.
/// </summary>
/// <param name="message">The exception's message.</param>
public HtmlWebException(string message)
: base(message)
{
}
#endregion
}
}
+28
View File
@@ -0,0 +1,28 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System.IO;
namespace HtmlAgilityPack
{
internal struct IOLibrary
{
#region Internal Methods
internal static void CopyAlways(string source, string target)
{
if (!File.Exists(source))
return;
Directory.CreateDirectory(Path.GetDirectoryName(target));
MakeWritable(target);
File.Copy(source, target, true);
}
internal static void MakeWritable(string path)
{
if (!File.Exists(path))
return;
File.SetAttributes(path, File.GetAttributes(path) & ~FileAttributes.ReadOnly);
}
#endregion
}
}
+27
View File
@@ -0,0 +1,27 @@
Microsoft Permissive License (Ms-PL)
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law.
A “contribution” is the original software, or any additions or changes to the software.
A “contributor” is any person that distributes its contribution under this license.
“Licensed patents” are a contributor’s patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors’ name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
(F) If you distribute the software or derivative works with programs you develop, you agree to indemnify, defend, and hold harmless all contributors from any claims, including attorneys’ fees, related to the distribution or use of your programs. For clarity, you have no such obligations to a contributor for any claims based solely on the unmodified contributions of that contributor.
(G) If you make any additions or changes to the original software, you may only distribute them under a new namespace. In addition, you will clearly identify your changes or additions as your own.
+453
View File
@@ -0,0 +1,453 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.IO;
using System.Text;
namespace HtmlAgilityPack
{
/// <summary>
/// Represents a document with mixed code and text. ASP, ASPX, JSP, are good example of such documents.
/// </summary>
public class MixedCodeDocument
{
#region Fields
private int _c;
internal MixedCodeDocumentFragmentList _codefragments;
private MixedCodeDocumentFragment _currentfragment;
internal MixedCodeDocumentFragmentList _fragments;
private int _index;
private int _line;
private int _lineposition;
private ParseState _state;
private Encoding _streamencoding;
internal string _text;
internal MixedCodeDocumentFragmentList _textfragments;
/// <summary>
/// Gets or sets the token representing code end.
/// </summary>
public string TokenCodeEnd = "%>";
/// <summary>
/// Gets or sets the token representing code start.
/// </summary>
public string TokenCodeStart = "<%";
/// <summary>
/// Gets or sets the token representing code directive.
/// </summary>
public string TokenDirective = "@";
/// <summary>
/// Gets or sets the token representing response write directive.
/// </summary>
public string TokenResponseWrite = "Response.Write ";
private string TokenTextBlock = "TextBlock({0})";
#endregion
#region Constructors
/// <summary>
/// Creates a mixed code document instance.
/// </summary>
public MixedCodeDocument()
{
_codefragments = new MixedCodeDocumentFragmentList(this);
_textfragments = new MixedCodeDocumentFragmentList(this);
_fragments = new MixedCodeDocumentFragmentList(this);
}
#endregion
#region Properties
/// <summary>
/// Gets the code represented by the mixed code document seen as a template.
/// </summary>
public string Code
{
get
{
string s = "";
int i = 0;
foreach (MixedCodeDocumentFragment frag in _fragments)
{
switch (frag._type)
{
case MixedCodeDocumentFragmentType.Text:
s += TokenResponseWrite + string.Format(TokenTextBlock, i) + "\n";
i++;
break;
case MixedCodeDocumentFragmentType.Code:
s += ((MixedCodeDocumentCodeFragment) frag).Code + "\n";
break;
}
}
return s;
}
}
/// <summary>
/// Gets the list of code fragments in the document.
/// </summary>
public MixedCodeDocumentFragmentList CodeFragments
{
get { return _codefragments; }
}
/// <summary>
/// Gets the list of all fragments in the document.
/// </summary>
public MixedCodeDocumentFragmentList Fragments
{
get { return _fragments; }
}
/// <summary>
/// Gets the encoding of the stream used to read the document.
/// </summary>
public Encoding StreamEncoding
{
get { return _streamencoding; }
}
/// <summary>
/// Gets the list of text fragments in the document.
/// </summary>
public MixedCodeDocumentFragmentList TextFragments
{
get { return _textfragments; }
}
#endregion
#region Public Methods
/// <summary>
/// Create a code fragment instances.
/// </summary>
/// <returns>The newly created code fragment instance.</returns>
public MixedCodeDocumentCodeFragment CreateCodeFragment()
{
return (MixedCodeDocumentCodeFragment) CreateFragment(MixedCodeDocumentFragmentType.Code);
}
/// <summary>
/// Create a text fragment instances.
/// </summary>
/// <returns>The newly created text fragment instance.</returns>
public MixedCodeDocumentTextFragment CreateTextFragment()
{
return (MixedCodeDocumentTextFragment) CreateFragment(MixedCodeDocumentFragmentType.Text);
}
/// <summary>
/// Loads a mixed code document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
public void Load(Stream stream)
{
Load(new StreamReader(stream));
}
/// <summary>
/// Loads a mixed code document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
public void Load(Stream stream, bool detectEncodingFromByteOrderMarks)
{
Load(new StreamReader(stream, detectEncodingFromByteOrderMarks));
}
/// <summary>
/// Loads a mixed code document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
/// <param name="encoding">The character encoding to use.</param>
public void Load(Stream stream, Encoding encoding)
{
Load(new StreamReader(stream, encoding));
}
/// <summary>
/// Loads a mixed code document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
/// <param name="encoding">The character encoding to use.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
public void Load(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks)
{
Load(new StreamReader(stream, encoding, detectEncodingFromByteOrderMarks));
}
/// <summary>
/// Loads a mixed code document from a stream.
/// </summary>
/// <param name="stream">The input stream.</param>
/// <param name="encoding">The character encoding to use.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
/// <param name="buffersize">The minimum buffer size.</param>
public void Load(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize)
{
Load(new StreamReader(stream, encoding, detectEncodingFromByteOrderMarks, buffersize));
}
/// <summary>
/// Loads a mixed code document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
public void Load(string path)
{
Load(new StreamReader(path));
}
/// <summary>
/// Loads a mixed code document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
public void Load(string path, bool detectEncodingFromByteOrderMarks)
{
Load(new StreamReader(path, detectEncodingFromByteOrderMarks));
}
/// <summary>
/// Loads a mixed code document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
/// <param name="encoding">The character encoding to use.</param>
public void Load(string path, Encoding encoding)
{
Load(new StreamReader(path, encoding));
}
/// <summary>
/// Loads a mixed code document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
/// <param name="encoding">The character encoding to use.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
public void Load(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks)
{
Load(new StreamReader(path, encoding, detectEncodingFromByteOrderMarks));
}
/// <summary>
/// Loads a mixed code document from a file.
/// </summary>
/// <param name="path">The complete file path to be read.</param>
/// <param name="encoding">The character encoding to use.</param>
/// <param name="detectEncodingFromByteOrderMarks">Indicates whether to look for byte order marks at the beginning of the file.</param>
/// <param name="buffersize">The minimum buffer size.</param>
public void Load(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize)
{
Load(new StreamReader(path, encoding, detectEncodingFromByteOrderMarks, buffersize));
}
/// <summary>
/// Loads the mixed code document from the specified TextReader.
/// </summary>
/// <param name="reader">The TextReader used to feed the HTML data into the document.</param>
public void Load(TextReader reader)
{
_codefragments.Clear();
_textfragments.Clear();
// all pseudo constructors get down to this one
StreamReader sr = reader as StreamReader;
if (sr != null)
{
_streamencoding = sr.CurrentEncoding;
}
_text = reader.ReadToEnd();
reader.Close();
Parse();
}
/// <summary>
/// Loads a mixed document from a text
/// </summary>
/// <param name="html">The text to load.</param>
public void LoadHtml(string html)
{
Load(new StringReader(html));
}
/// <summary>
/// Saves the mixed document to the specified stream.
/// </summary>
/// <param name="outStream">The stream to which you want to save.</param>
public void Save(Stream outStream)
{
StreamWriter sw = new StreamWriter(outStream, GetOutEncoding());
Save(sw);
}
/// <summary>
/// Saves the mixed document to the specified stream.
/// </summary>
/// <param name="outStream">The stream to which you want to save.</param>
/// <param name="encoding">The character encoding to use.</param>
public void Save(Stream outStream, Encoding encoding)
{
StreamWriter sw = new StreamWriter(outStream, encoding);
Save(sw);
}
/// <summary>
/// Saves the mixed document to the specified file.
/// </summary>
/// <param name="filename">The location of the file where you want to save the document.</param>
public void Save(string filename)
{
StreamWriter sw = new StreamWriter(filename, false, GetOutEncoding());
Save(sw);
}
/// <summary>
/// Saves the mixed document to the specified file.
/// </summary>
/// <param name="filename">The location of the file where you want to save the document.</param>
/// <param name="encoding">The character encoding to use.</param>
public void Save(string filename, Encoding encoding)
{
StreamWriter sw = new StreamWriter(filename, false, encoding);
Save(sw);
}
/// <summary>
/// Saves the mixed document to the specified StreamWriter.
/// </summary>
/// <param name="writer">The StreamWriter to which you want to save.</param>
public void Save(StreamWriter writer)
{
Save((TextWriter) writer);
}
/// <summary>
/// Saves the mixed document to the specified TextWriter.
/// </summary>
/// <param name="writer">The TextWriter to which you want to save.</param>
public void Save(TextWriter writer)
{
writer.Flush();
}
#endregion
#region Internal Methods
internal MixedCodeDocumentFragment CreateFragment(MixedCodeDocumentFragmentType type)
{
switch (type)
{
case MixedCodeDocumentFragmentType.Text:
return new MixedCodeDocumentTextFragment(this);
case MixedCodeDocumentFragmentType.Code:
return new MixedCodeDocumentCodeFragment(this);
default:
throw new NotSupportedException();
}
}
internal Encoding GetOutEncoding()
{
if (_streamencoding != null)
return _streamencoding;
return Encoding.Default;
}
#endregion
#region Private Methods
private void IncrementPosition()
{
_index++;
if (_c == 10)
{
_lineposition = 1;
_line++;
}
else
_lineposition++;
}
private void Parse()
{
_state = ParseState.Text;
_index = 0;
_currentfragment = CreateFragment(MixedCodeDocumentFragmentType.Text);
while (_index < _text.Length)
{
_c = _text[_index];
IncrementPosition();
switch (_state)
{
case ParseState.Text:
if (_index + TokenCodeStart.Length < _text.Length)
{
if (_text.Substring(_index - 1, TokenCodeStart.Length) == TokenCodeStart)
{
_state = ParseState.Code;
_currentfragment.Length = _index - 1 - _currentfragment.Index;
_currentfragment = CreateFragment(MixedCodeDocumentFragmentType.Code);
SetPosition();
continue;
}
}
break;
case ParseState.Code:
if (_index + TokenCodeEnd.Length < _text.Length)
{
if (_text.Substring(_index - 1, TokenCodeEnd.Length) == TokenCodeEnd)
{
_state = ParseState.Text;
_currentfragment.Length = _index + TokenCodeEnd.Length - _currentfragment.Index;
_index += TokenCodeEnd.Length;
_lineposition += TokenCodeEnd.Length;
_currentfragment = CreateFragment(MixedCodeDocumentFragmentType.Text);
SetPosition();
continue;
}
}
break;
}
}
_currentfragment.Length = _index - _currentfragment.Index;
}
private void SetPosition()
{
_currentfragment.Line = _line;
_currentfragment._lineposition = _lineposition;
_currentfragment.Index = _index - 1;
_currentfragment.Length = 0;
}
#endregion
#region Nested type: ParseState
private enum ParseState
{
Text,
Code
}
#endregion
}
}
@@ -0,0 +1,51 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// Represents a fragment of code in a mixed code document.
/// </summary>
public class MixedCodeDocumentCodeFragment : MixedCodeDocumentFragment
{
#region Fields
private string _code;
#endregion
#region Constructors
internal MixedCodeDocumentCodeFragment(MixedCodeDocument doc)
:
base(doc, MixedCodeDocumentFragmentType.Code)
{
}
#endregion
#region Properties
/// <summary>
/// Gets the fragment code text.
/// </summary>
public string Code
{
get
{
if (_code == null)
{
_code = FragmentText.Substring(Doc.TokenCodeStart.Length,
FragmentText.Length - Doc.TokenCodeEnd.Length -
Doc.TokenCodeStart.Length - 1).Trim();
if (_code.StartsWith("="))
{
_code = Doc.TokenResponseWrite + _code.Substring(1, _code.Length - 1);
}
}
return _code;
}
set { _code = value; }
}
#endregion
}
}
@@ -0,0 +1,95 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// Represents a base class for fragments in a mixed code document.
/// </summary>
public abstract class MixedCodeDocumentFragment
{
#region Fields
internal MixedCodeDocument Doc;
private string _fragmentText;
internal int Index;
internal int Length;
private int _line;
internal int _lineposition;
internal MixedCodeDocumentFragmentType _type;
#endregion
#region Constructors
internal MixedCodeDocumentFragment(MixedCodeDocument doc, MixedCodeDocumentFragmentType type)
{
Doc = doc;
_type = type;
switch (type)
{
case MixedCodeDocumentFragmentType.Text:
Doc._textfragments.Append(this);
break;
case MixedCodeDocumentFragmentType.Code:
Doc._codefragments.Append(this);
break;
}
Doc._fragments.Append(this);
}
#endregion
#region Properties
/// <summary>
/// Gets the fragement text.
/// </summary>
public string FragmentText
{
get
{
if (_fragmentText == null)
{
_fragmentText = Doc._text.Substring(Index, Length);
}
return FragmentText;
}
internal set { _fragmentText = value; }
}
/// <summary>
/// Gets the type of fragment.
/// </summary>
public MixedCodeDocumentFragmentType FragmentType
{
get { return _type; }
}
/// <summary>
/// Gets the line number of the fragment.
/// </summary>
public int Line
{
get { return _line; }
internal set { _line = value; }
}
/// <summary>
/// Gets the line position (column) of the fragment.
/// </summary>
public int LinePosition
{
get { return _lineposition; }
}
/// <summary>
/// Gets the fragment position in the document's stream.
/// </summary>
public int StreamPosition
{
get { return Index; }
}
#endregion
}
}
@@ -0,0 +1,236 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.Collections;
namespace HtmlAgilityPack
{
/// <summary>
/// Represents a list of mixed code fragments.
/// </summary>
public class MixedCodeDocumentFragmentList : IEnumerable
{
#region Fields
private MixedCodeDocument _doc;
private ArrayList _items = new ArrayList();
#endregion
#region Constructors
internal MixedCodeDocumentFragmentList(MixedCodeDocument doc)
{
_doc = doc;
}
#endregion
#region Properties
///<summary>
/// Gets the Document
///</summary>
public MixedCodeDocument Doc
{
get { return _doc; }
}
/// <summary>
/// Gets the number of fragments contained in the list.
/// </summary>
public int Count
{
get { return _items.Count; }
}
/// <summary>
/// Gets a fragment from the list using its index.
/// </summary>
public MixedCodeDocumentFragment this[int index]
{
get { return _items[index] as MixedCodeDocumentFragment; }
}
#endregion
#region IEnumerable Members
/// <summary>
/// Gets an enumerator that can iterate through the fragment list.
/// </summary>
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
#endregion
#region Public Methods
/// <summary>
/// Appends a fragment to the list of fragments.
/// </summary>
/// <param name="newFragment">The fragment to append. May not be null.</param>
public void Append(MixedCodeDocumentFragment newFragment)
{
if (newFragment == null)
{
throw new ArgumentNullException("newFragment");
}
_items.Add(newFragment);
}
/// <summary>
/// Gets an enumerator that can iterate through the fragment list.
/// </summary>
public MixedCodeDocumentFragmentEnumerator GetEnumerator()
{
return new MixedCodeDocumentFragmentEnumerator(_items);
}
/// <summary>
/// Prepends a fragment to the list of fragments.
/// </summary>
/// <param name="newFragment">The fragment to append. May not be null.</param>
public void Prepend(MixedCodeDocumentFragment newFragment)
{
if (newFragment == null)
{
throw new ArgumentNullException("newFragment");
}
_items.Insert(0, newFragment);
}
/// <summary>
/// Remove a fragment from the list of fragments. If this fragment was not in the list, an exception will be raised.
/// </summary>
/// <param name="fragment">The fragment to remove. May not be null.</param>
public void Remove(MixedCodeDocumentFragment fragment)
{
if (fragment == null)
{
throw new ArgumentNullException("fragment");
}
int index = GetFragmentIndex(fragment);
if (index == -1)
{
throw new IndexOutOfRangeException();
}
RemoveAt(index);
}
/// <summary>
/// Remove all fragments from the list.
/// </summary>
public void RemoveAll()
{
_items.Clear();
}
/// <summary>
/// Remove a fragment from the list of fragments, using its index in the list.
/// </summary>
/// <param name="index">The index of the fragment to remove.</param>
public void RemoveAt(int index)
{
//MixedCodeDocumentFragment frag = (MixedCodeDocumentFragment) _items[index];
_items.RemoveAt(index);
}
#endregion
#region Internal Methods
internal void Clear()
{
_items.Clear();
}
internal int GetFragmentIndex(MixedCodeDocumentFragment fragment)
{
if (fragment == null)
{
throw new ArgumentNullException("fragment");
}
for (int i = 0; i < _items.Count; i++)
{
if ((_items[i]) == fragment)
{
return i;
}
}
return -1;
}
#endregion
#region Nested type: MixedCodeDocumentFragmentEnumerator
/// <summary>
/// Represents a fragment enumerator.
/// </summary>
public class MixedCodeDocumentFragmentEnumerator : IEnumerator
{
#region Fields
private int _index;
private ArrayList _items;
#endregion
#region Constructors
internal MixedCodeDocumentFragmentEnumerator(ArrayList items)
{
_items = items;
_index = -1;
}
#endregion
#region Properties
/// <summary>
/// Gets the current element in the collection.
/// </summary>
public MixedCodeDocumentFragment Current
{
get { return (MixedCodeDocumentFragment) (_items[_index]); }
}
#endregion
#region IEnumerator Members
/// <summary>
/// Gets the current element in the collection.
/// </summary>
object IEnumerator.Current
{
get { return (Current); }
}
/// <summary>
/// Advances the enumerator to the next element of the collection.
/// </summary>
/// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
public bool MoveNext()
{
_index++;
return (_index < _items.Count);
}
/// <summary>
/// Sets the enumerator to its initial position, which is before the first element in the collection.
/// </summary>
public void Reset()
{
_index = -1;
}
#endregion
}
#endregion
}
}
@@ -0,0 +1,19 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// Represents the type of fragment in a mixed code document.
/// </summary>
public enum MixedCodeDocumentFragmentType
{
/// <summary>
/// The fragment contains code.
/// </summary>
Code,
/// <summary>
/// The fragment contains text.
/// </summary>
Text,
}
}
@@ -0,0 +1,32 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// Represents a fragment of text in a mixed code document.
/// </summary>
public class MixedCodeDocumentTextFragment : MixedCodeDocumentFragment
{
#region Constructors
internal MixedCodeDocumentTextFragment(MixedCodeDocument doc)
:
base(doc, MixedCodeDocumentFragmentType.Text)
{
}
#endregion
#region Properties
/// <summary>
/// Gets the fragment text.
/// </summary>
public string Text
{
get { return FragmentText; }
set { FragmentText = value; }
}
#endregion
}
}
+35
View File
@@ -0,0 +1,35 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
internal class NameValuePair
{
#region Fields
internal readonly string Name;
internal string Value;
#endregion
#region Constructors
internal NameValuePair()
{
}
internal NameValuePair(string name)
:
this()
{
Name = name;
}
internal NameValuePair(string name, string value)
:
this(name)
{
Value = value;
}
#endregion
}
}
+101
View File
@@ -0,0 +1,101 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
using System;
using System.Collections;
namespace HtmlAgilityPack
{
internal class NameValuePairList
{
#region Fields
internal readonly string Text;
private ArrayList _allPairs;
private Hashtable _pairsWithName;
#endregion
#region Constructors
internal NameValuePairList() :
this(null)
{
}
internal NameValuePairList(string text)
{
Text = text;
_allPairs = new ArrayList();
_pairsWithName = new Hashtable();
Parse(text);
}
#endregion
#region Internal Methods
internal static string GetNameValuePairsValue(string text, string name)
{
NameValuePairList l = new NameValuePairList(text);
return l.GetNameValuePairValue(name);
}
internal ArrayList GetNameValuePairs(string name)
{
if (name == null)
return _allPairs;
return _pairsWithName[name] as ArrayList;
}
internal string GetNameValuePairValue(string name)
{
if (name == null)
throw new ArgumentNullException();
ArrayList al = GetNameValuePairs(name);
if (al == null)
return null;
// return first item
NameValuePair nvp = al[0] as NameValuePair;
return nvp != null ? nvp.Value : string.Empty;
}
#endregion
#region Private Methods
private void Parse(string text)
{
_allPairs.Clear();
_pairsWithName.Clear();
if (text == null)
return;
string[] p = text.Split(';');
foreach (string pv in p)
{
if (pv.Length == 0)
continue;
string[] onep = pv.Split(new char[] {'='}, 2);
if (onep.Length==0)
continue;
NameValuePair nvp = new NameValuePair(onep[0].Trim().ToLower());
nvp.Value = onep.Length < 2 ? "" : onep[1];
_allPairs.Add(nvp);
// index by name
ArrayList al = _pairsWithName[nvp.Name] as ArrayList;
if (al == null)
{
al = new ArrayList();
_pairsWithName[nvp.Name] = al;
}
al.Add(nvp);
}
}
#endregion
}
}
+156
View File
@@ -0,0 +1,156 @@
// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
namespace HtmlAgilityPack
{
/// <summary>
/// A utility class to compute CRC32.
/// </summary>
public class Crc32
{
#region Fields
private uint _crc32;
#endregion
#region Static Members
private static uint[] crc_32_tab = // CRC polynomial 0xedb88320
{
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
};
#endregion
#region Properties
internal uint CheckSum
{
get { return _crc32; }
set { _crc32 = value; }
}
#endregion
#region Public Methods
/// <summary>
/// Compute a checksum for a given array of bytes.
/// </summary>
/// <param name="bytes">The array of bytes to compute the checksum for.</param>
/// <returns>The computed checksum.</returns>
public static uint CRC32Bytes(byte[] bytes)
{
uint oldcrc32;
oldcrc32 = 0xFFFFFFFF;
int len = bytes.Length;
for (int i = 0; len > 0; i++)
{
--len;
oldcrc32 = UPDC32(bytes[len], oldcrc32);
}
return ~oldcrc32;
}
/// <summary>
/// Compute a checksum for a given string.
/// </summary>
/// <param name="text">The string to compute the checksum for.</param>
/// <returns>The computed checksum.</returns>
public static uint CRC32String(string text)
{
uint oldcrc32;
oldcrc32 = 0xFFFFFFFF;
int len = text.Length;
ushort uCharVal;
byte lowByte, hiByte;
for (int i = 0; len > 0; i++)
{
--len;
uCharVal = text[len];
unchecked
{
lowByte = (byte) (uCharVal & 0x00ff);
hiByte = (byte) (uCharVal >> 8);
}
oldcrc32 = UPDC32(hiByte, oldcrc32);
oldcrc32 = UPDC32(lowByte, oldcrc32);
}
return ~oldcrc32;
}
#endregion
#region Internal Methods
internal uint AddToCRC32(int c)
{
return AddToCRC32((ushort) c);
}
internal uint AddToCRC32(ushort c)
{
byte lowByte, hiByte;
lowByte = (byte) (c & 0x00ff);
hiByte = (byte) (c >> 8);
_crc32 = UPDC32(hiByte, _crc32);
_crc32 = UPDC32(lowByte, _crc32);
return ~_crc32;
}
#endregion
#region Private Methods
private static uint UPDC32(byte octet, uint crc)
{
return (crc_32_tab[((crc) ^ (octet)) & 0xff] ^ ((crc) >> 8));
}
#endregion
}
}
+6 -3
View File
@@ -13,7 +13,6 @@ ASSEMBLED_DOCS = \
EXTRA_DIST = \
abc-removal.txt \
AgilityPack.dll \
api-style.css \
assembly-bundle \
check-exports \
@@ -68,12 +67,14 @@ EXTRA_DIST = \
dist-hook:
$(mkdir_p) $(distdir)/sources
$(mkdir_p) $(distdir)/svgs
$(mkdir_p) $(distdir)/HtmlAgilityPack
cp sources/* $(distdir)/sources
cp svgs/* $(distdir)/svgs
cp HtmlAgilityPack/* $(distdir)/HtmlAgilityPack
clean-local:
-rm -Rf $(srcdir)/html
-rm -f $(srcdir)/deploy/* $(srcdir)/convert.exe*
-rm -f $(srcdir)/deploy/* $(srcdir)/convert.exe* $(srcdir)/AgilityPack.dll*
-cd $(srcdir) && rm -f $(ASSEMBLED_DOCS)
monoapi.zip: monoapi.tree
@@ -101,5 +102,7 @@ $(srcdir)/deploy/.stamp: convert.exe Makefile.am
extract: $(srcdir)/deploy/.stamp
convert.exe: convert.cs AgilityPack.dll
cd $(srcdir) && $(MAKE) PROFILE=net_1_1 -f docs.make topdir=$(mcs_topdir_from_srcdir) convert.exe
cd $(srcdir) && $(MAKE) PROFILE=net_2_0 -f docs.make topdir=$(mcs_topdir_from_srcdir) convert.exe
AgilityPack.dll:
cd $(srcdir) && $(MAKE) PROFILE=net_2_0 -f docs.make topdir=$(mcs_topdir_from_srcdir) AgilityPack.dll
+2 -4
View File
@@ -64,10 +64,8 @@ PROGRAMS
* convert.cs
Converts an HTML file into a valid XML document, uses the
AgilityPack.dll. The sources to this DLL live in GNOME CVS
module beagle/Filters/AgilityPack.
A binary is shipped for our convenience.
AgilityPack.dll. The sources to this DLL live in the
HtmlAgilityPack folder, and are a prerequisite for convert.exe.
DATAFILES:
---------
+3
View File
@@ -10,6 +10,9 @@ ASSEMBLED_DOCS = \
convert.exe: convert.cs AgilityPack.dll
$(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
AgilityPack.dll:
$(CSCOMPILE) -target:library -out:$@ HtmlAgilityPack/*.cs
monoapi.zip: monoapi.tree
@test -f $@ || { rm -f $< && $(MAKE) $<; }
monoapi.tree: toc.xml docs.make
+20
View File
@@ -1,3 +1,23 @@
2009-12-03 Zoltan Varga <[email protected]>
* src/gmisc-unix.c (g_get_user_name): Avoid returning NULL if the env
var is not set.
2009-10-15 Andreia Gaita <[email protected]>
* src/gptrarray.c: implement g_ptr_array_remove_index_fast
* src/glib.h: fix g_ptr_array_remove_index_fast declaration
* test/ptrarray.c: new tests
2009-09-26 Gonzalo Paniagua Javier <[email protected]>
* test/queue.c: new tests.
* src/gqueue.c: fixed pop_head.
2009-09-26 Gonzalo Paniagua Javier <[email protected]>
* src/gqueue.c: add g_queue_push_tail.
2009-06-20 Zoltan Varga <[email protected]>
* src/glib.h: Add GUINT32_FROM/TO_BE macros.
+13 -1
View File
@@ -24,9 +24,17 @@ AC_SUBST(GNUC_UNUSED)
AC_SUBST(GNUC_NORETURN)
AC_SUBST(BREAKPOINT)
# We use a separate variable to pass down CPPFLAGS and CFLAGS from the main mono
# configure, because of autoconf brokeness
if test "x$CPPFLAGS_FOR_EGLIB" != "x"; then
CPPFLAGS=$CPPFLAGS_FOR_EGLIB
fi
if test "x$CFLAGS_FOR_EGLIB" != "x"; then
CFLAGS=$CFLAGS_FOR_EGLIB
fi
AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
AC_SUBST(ORDER)
case $host in
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
@@ -45,8 +53,12 @@ case $target in
arm*-darwin*)
CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
;;
i*86-*-darwin*)
ORDER=G_LITTLE_ENDIAN
;;
esac
AC_SUBST(ORDER)
AC_SUBST(CFLAGS)
AC_SUBST(PATHSEP)
AC_SUBST(SEARCHSEP)
+3 -1
View File
@@ -449,7 +449,7 @@ void g_ptr_array_add (GPtrArray *array, gpointer data);
gboolean g_ptr_array_remove (GPtrArray *array, gpointer data);
gpointer g_ptr_array_remove_index (GPtrArray *array, guint index);
gboolean g_ptr_array_remove_fast (GPtrArray *array, gpointer data);
gpointer g_ptr_array_remove_index_fast (GPtrArray *array, gpointer data);
gpointer g_ptr_array_remove_index_fast (GPtrArray *array, guint index);
void g_ptr_array_sort (GPtrArray *array, GCompareFunc compare_func);
void g_ptr_array_sort_with_data (GPtrArray *array, GCompareDataFunc compare_func, gpointer user_data);
void g_ptr_array_set_size (GPtrArray *array, gint length);
@@ -469,6 +469,8 @@ typedef struct {
gpointer g_queue_pop_head (GQueue *queue);
void g_queue_push_head (GQueue *queue,
gpointer data);
void g_queue_push_tail (GQueue *queue,
gpointer data);
gboolean g_queue_is_empty (GQueue *queue);
GQueue *g_queue_new (void);
void g_queue_free (GQueue *queue);
+2
View File
@@ -110,6 +110,8 @@ const char *
g_get_user_name (void)
{
const char *retName = g_getenv ("USER");
if (!retName)
retName = "somebody";
return retName;
}
+21
View File
@@ -139,6 +139,27 @@ g_ptr_array_remove_index(GPtrArray *array, guint index)
return removed_node;
}
gpointer
g_ptr_array_remove_index_fast(GPtrArray *array, guint index)
{
gpointer removed_node;
g_return_val_if_fail(array != NULL, NULL);
g_return_val_if_fail(index >= 0 || index < array->len, NULL);
removed_node = array->pdata[index];
if(index != array->len - 1) {
g_memmove(array->pdata + index, array->pdata + array->len - 1,
sizeof(gpointer));
}
array->len--;
array->pdata[array->len] = NULL;
return removed_node;
}
gboolean
g_ptr_array_remove(GPtrArray *array, gpointer data)
{
+31 -15
View File
@@ -3,6 +3,7 @@
*
* Author:
* Duncan Mak ([email protected])
* Gonzalo Paniagua Javier ([email protected])
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -23,7 +24,7 @@
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* (C) 2006 Novell, Inc.
* Copyright (c) 2006-2009 Novell, Inc.
*
*/
@@ -33,19 +34,23 @@
gpointer
g_queue_pop_head (GQueue *queue)
{
gpointer head = NULL;
gpointer result;
GList *old_head;
if (queue->length != 0){
GList *old_head;
if (!queue || queue->length == 0)
return NULL;
old_head = queue->head;
head = old_head->data;
queue->head = old_head->next;
queue->length--;
g_list_free_1 (old_head);
}
result = queue->head->data;
old_head = queue->head;
queue->head = old_head->next;
g_list_free_1 (old_head);
return head;
if (--queue->length)
queue->head->prev = NULL;
else
queue->tail = NULL;
return result;
}
gboolean
@@ -71,13 +76,24 @@ g_queue_push_head (GQueue *queue, gpointer head)
queue->length ++;
}
void
g_queue_push_tail (GQueue *queue, gpointer data)
{
if (!queue)
return;
queue->tail = g_list_append (queue->tail, data);
if (queue->head == NULL)
queue->head = queue->tail;
else
queue->tail = queue->tail->next;
queue->length++;
}
GQueue *
g_queue_new (void)
{
GQueue *queue = g_new0 (GQueue, 1);
queue->length = 0;
return queue;
return g_new0 (GQueue, 1);
}
void
+25
View File
@@ -170,6 +170,30 @@ RESULT ptrarray_remove_index()
return OK;
}
RESULT ptrarray_remove_index_fast()
{
GPtrArray *array;
guint i;
array = ptrarray_alloc_and_fill(&i);
g_ptr_array_remove_index_fast(array, 0);
if(array->pdata[0] != items[array->len]) {
return FAILED("First item is not %s, it is %s", items[array->len],
array->pdata[0]);
}
g_ptr_array_remove_index_fast(array, array->len - 1);
if(array->pdata[array->len - 1] != items[array->len - 1]) {
return FAILED("Last item is not %s, it is %s",
items[array->len - 1], array->pdata[array->len - 1]);
}
g_ptr_array_free(array, TRUE);
return OK;
}
RESULT ptrarray_remove()
{
GPtrArray *array;
@@ -235,6 +259,7 @@ static Test ptrarray_tests [] = {
{"foreach_iterate", ptrarray_foreach_iterate},
{"set_size", ptrarray_set_size},
{"remove_index", ptrarray_remove_index},
{"remove_index_fast", ptrarray_remove_index_fast},
{"remove", ptrarray_remove},
{"sort", ptrarray_sort},
{NULL, NULL}
+85
View File
@@ -15,6 +15,66 @@ test_queue_push ()
if (queue->length != 3)
return FAILED ("push failed");
if (NULL != queue->head->prev)
return FAILED ("HEAD: prev is wrong");
if (strcmp ("baz", queue->head->data))
return FAILED ("HEAD: First element is wrong");
if (strcmp ("bar", queue->head->next->data))
return FAILED ("HEAD: Second element is wrong");
if (strcmp ("foo", queue->head->next->next->data))
return FAILED ("HEAD: Third element is wrong");
if (NULL != queue->head->next->next->next)
return FAILED ("HEAD: End is wrong");
if (NULL != queue->tail->next)
return FAILED ("TAIL: next is wrong");
if (strcmp ("foo", queue->tail->data))
return FAILED ("TAIL: Third element is wrong");
if (strcmp ("bar", queue->tail->prev->data))
return FAILED ("TAIL: Second element is wrong");
if (strcmp ("baz", queue->tail->prev->prev->data))
return FAILED ("TAIL: First element is wrong");
if (NULL != queue->tail->prev->prev->prev)
return FAILED ("TAIL: End is wrong");
g_queue_free (queue);
return OK;
}
RESULT
test_queue_push_tail ()
{
GQueue *queue = g_queue_new ();
g_queue_push_tail (queue, "baz");
g_queue_push_tail (queue, "bar");
g_queue_push_tail (queue, "foo");
if (queue->length != 3)
return FAILED ("push failed");
if (NULL != queue->head->prev)
return FAILED ("HEAD: prev is wrong");
if (strcmp ("baz", queue->head->data))
return FAILED ("HEAD: First element is wrong");
if (strcmp ("bar", queue->head->next->data))
return FAILED ("HEAD: Second element is wrong");
if (strcmp ("foo", queue->head->next->next->data))
return FAILED ("HEAD: Third element is wrong");
if (NULL != queue->head->next->next->next)
return FAILED ("HEAD: End is wrong");
if (NULL != queue->tail->next)
return FAILED ("TAIL: next is wrong");
if (strcmp ("foo", queue->tail->data))
return FAILED ("TAIL: Third element is wrong");
if (strcmp ("bar", queue->tail->prev->data))
return FAILED ("TAIL: Second element is wrong");
if (strcmp ("baz", queue->tail->prev->prev->data))
return FAILED ("TAIL: First element is wrong");
if (NULL != queue->tail->prev->prev->prev)
return FAILED ("TAIL: End is wrong");
g_queue_free (queue);
return OK;
}
@@ -47,6 +107,30 @@ test_queue_pop ()
if (queue->length != 0)
return FAILED ("expect 0 length .");
g_queue_push_head (queue, "foo");
g_queue_push_head (queue, "bar");
g_queue_push_head (queue, "baz");
g_queue_pop_head (queue);
if (NULL != queue->head->prev)
return FAILED ("HEAD: prev is wrong");
if (strcmp ("bar", queue->head->data))
return FAILED ("HEAD: Second element is wrong");
if (strcmp ("foo", queue->head->next->data))
return FAILED ("HEAD: Third element is wrong");
if (NULL != queue->head->next->next)
return FAILED ("HEAD: End is wrong");
if (NULL != queue->tail->next)
return FAILED ("TAIL: next is wrong");
if (strcmp ("foo", queue->tail->data))
return FAILED ("TAIL: Second element is wrong");
if (strcmp ("bar", queue->tail->prev->data))
return FAILED ("TAIL: First element is wrong");
if (NULL != queue->tail->prev->prev)
return FAILED ("TAIL: End is wrong");
g_queue_free (queue);
return OK;
}
@@ -89,6 +173,7 @@ test_queue_is_empty ()
static Test queue_tests [] = {
{ "push", test_queue_push},
{"push_tail", test_queue_push_tail},
{ "pop", test_queue_pop},
{ "new", test_queue_new},
{"is_empty", test_queue_is_empty},
+5
View File
@@ -1,3 +1,8 @@
2009-10-25 Zoltan Varga <[email protected]>
* misc.c (GC_get_suspend_signal): New API function to return the suspend signal
used by libgc.
2009-07-20 Geoff Norton <[email protected]>
* darwin_stop_world.c: Fix the x86 version guards to use Apple's
+4
View File
@@ -424,6 +424,10 @@ GC_API size_t GC_get_bytes_since_gc GC_PROTO((void));
/* Never decreases, except due to wrapping. */
GC_API size_t GC_get_total_bytes GC_PROTO((void));
/* Return the signal used by the gc to suspend threads on posix platforms. */
/* Return -1 otherwise. */
int GC_get_suspend_signal GC_PROTO((void));
/* Disable garbage collection. Even GC_gcollect calls will be */
/* ineffective. */
GC_API void GC_disable GC_PROTO((void));
+9
View File
@@ -468,6 +468,15 @@ size_t GC_get_total_bytes GC_PROTO(())
return ((size_t) WORDS_TO_BYTES(GC_words_allocd+GC_words_allocd_before_gc));
}
int GC_get_suspend_signal GC_PROTO(())
{
#if defined(SIG_SUSPEND) && defined(GC_PTHREADS) && !defined(GC_MACOSX_THREADS)
return SIG_SUSPEND;
#else
return -1;
#endif
}
GC_bool GC_is_initialized = FALSE;
void GC_init()
+8
View File
@@ -1,3 +1,11 @@
2009-10-11 Ankit Jain <[email protected]>
* xbuild.1: Add info about env var XBUILD_COLORS.
2009-10-09 Zoltan Varga <[email protected]>
* mono.1: Document --debug=gdb option.
2009-09-24 Ankit Jain <[email protected]>
* xbuild.1: Add info about env var XBUILD_EMIT_SOLUTION.
+1
View File
@@ -11,6 +11,7 @@ man_MANS = \
genxs.1 \
httpcfg.1 \
ilasm.1 \
lc.1 \
macpack.1 \
makecert.1 \
mconfig.1 \
+87
View File
@@ -0,0 +1,87 @@
.\"
.\" lc manual page.
.\" (C) 2009 Carlo Kok
.\"
.\" Author:
.\" Carlo Kok ([email protected])
.\"
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.TH lc "Mono 2.6"
.SH NAME
lc \- Mono License Compiler
.SH SYNOPSIS
.PP
.B lc -c filename -t targetassembly [-i reference...] [-v] [-o outputpath] [-nologo]
.SH DESCRIPTION
\fIlc\fP tool is a license compiler for Mono. It's used to convert a
licenses.licx file to a resource that can be embedded into an executable.
.PP
When using commercial components for .NET they often require a license
resource at runtime to make sure the developer was licensed to use this
control. The most common way of making sure the component was properly
licensed is by using license resources. At compile time the developer
uses the \fIlc\fP tool to convert a licenses.licx file to a
programname.exe.resources file and embed that as a managed resource
during compilation.
.SH RUNTIME OPTIONS
The following options are available:
.TP
\fB--complist=filename\fR, \fB-c filename\fR
This option is used to specify the input file, the licenses.licx file
to create a license reesource for. This option is required. The license
compiler will read each line in this file and try to load the types
specified on that line.
.TP
\fB--target=assemblyname\fR, \fB-t targetassembly\fR
full assembly name with file extension for the target assembly. The
license compiler uses this as a key when compiling the licenses. It
has to match the assembly the resource will be embedded in. This option
is required.
.TP
\fB--load=reference\fR, \fB-i reference\fR
Assembly reference to load before trying to compile a license. This
option is needed for assemblies where the references are not in the
gac. Compilers should pass all references to the license compiler.
.TP
\fB--verbose,\fR, \fB-v\fR
Gives more verbose output about the license compiling process.
.TP
\fB--help\fR, \fB-h\fR
Displays usage instructions.
.TP
\fB--output=path\fR, \fB-o path\fR
Target path file the licenses resource. By default the license
compiler emits the resource in the current directory. The filename
will always match the target assembly passed to --target with .licenses
added.
.TP
\fB--nologo\fR
Do not emit the "Mono License Compiler" logo on stdout while compilng.
.SH LICENSE FILES
The format for the license files (licenses.licx) is the following:
.nf
# comment
namespace.type, assemblyname
namespace.type, full-assemblyname
.fi
.Sp
All lines starting with a # are ignored. the first form requires
that the assembly was loaded through the --load,-i option but
does not require the full assembly name, only the first part.
The second form requires the full assembly name including locale,
version and publickeytoken.
.SH MAILING LISTS
Mailing lists are listed at the
http://www.mono-project.com/Mailing_Lists
.SH WEB SITE
http://www.mono-project.com
.SH SEE ALSO
.PP
mono(1), mcs(1)
+4
View File
@@ -299,6 +299,10 @@ execution time.
Disable some JIT optimizations which are usually only disabled when
running inside the debugger. This can be helpful if you want to attach
to the running process with mdb.
.TP
.I gdb
Generate and register debugging information with gdb. This is only supported on some
platforms, and only when using gdb 7.0 or later.
.ne
.RE
.TP
+30
View File
@@ -48,6 +48,36 @@ Display xbuild version
.I "XBUILD_EMIT_SOLUTION"
If this variable is set, then the project file generated from a solution
file is emitted.
.TP
.I "XBUILD_COLORS"
If this variable is set, it contains a string of the form
"type=foreground,type=.." that specifies which color to use to display
errors/warnings etc on some terminals. Type here can be:
.nf
errors, warnings, messages or events
events: These are project/target/task start and end event
messages.
.fi
.Sp
The possible colors for foreground are:
.B black, red, brightred, green, brightgreen, yellow, brightyellow,
blue, brightblue, magenta, brightmagenta, cyan, brightcyan, grey,
white and brightwhite.
.Sp
For example, you could set this variable from your shell:
.nf
export XBUILD_COLORS
XBUILD_COLORS=errors=brightred,warnings=blue
.fi
.Sp
You can disable the built-in color scheme by setting this variable to
"disable".
.SH SEE ALSO
.BR mono(1), mcs(1)
.SH COPYRIGHT
+3 -1
View File
@@ -10,6 +10,7 @@ net_2_1_bootstrap_SUBDIRS := build mcs class
net_2_1_raw_SUBDIRS := build mcs class tools
net_2_1_SUBDIRS := tools tests errors
monotouch_SUBDIRS := build mcs class
monotouch_bootstrap_SUBDIRS := build mcs class
net_3_5_SUBDIRS := build class
net_4_0_bootstrap_SUBDIRS := build mcs class tools
net_4_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors
@@ -106,7 +107,8 @@ $(_boot_:%=profile-do--net_4_0--%): profile-do--net_4_0--%:
$(_boot_:%=profile-do--net_4_0_bootstrap--%): profile-do--net_4_0_bootstrap--%: profile-do--net_2_0--%
$(_boot_:%=profile-do--net_3_5--%): profile-do--net_3_5--%: profile-do--net_2_0--%
$(_boot_:%=profile-do--net_2_1--%): profile-do--net_2_1--%: profile-do--net_2_1_raw--%
$(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--net_2_1_bootstrap--%
$(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--monotouch_bootstrap--%
$(_boot_:%=profile-do--monotouch_bootstrap--%): profile-do--monotouch_bootstrap--%: profile-do--net_2_0--%
$(_boot_:%=profile-do--net_2_1_raw--%): profile-do--net_2_1_raw--%: profile-do--net_2_1_bootstrap--%
$(_boot_:%=profile-do--net_2_1_bootstrap--%): profile-do--net_2_1_bootstrap--%: profile-do--net_2_0--%
$(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--net_2_0_bootstrap--%
+9
View File
@@ -1,3 +1,12 @@
2010-01-12 Zoltan Varga <[email protected]>
* profiles/basic.make: Document that mono 2.6 can't be compiled with mono SVN HEAD.
2009-11-17 Marek Habersack <[email protected]>
* tests.make (TEST_RUNTIME_WRAPPERS_PATH): added - used to set up
correct PATH for tests
2008-09-11 Marek Safar <[email protected]>
* library.make: Add NO_BUILD to ignore assembly during build.
+15
View File
@@ -1,3 +1,18 @@
2010-01-07 Sebastien Pouliot <[email protected]>
* Consts.cs.in: Update FX version for SL3 latest released version
[Backport r149187]
2009-11-12 Jb Evain <[email protected]>
* Consts.cs.in: add a AssemblySystem_Core constant.
2009-10-26 Sebastien Pouliot <[email protected]>
* Consts.cs.in: Update SL2 FX version to the second (and last)
released version.
[Backport r144843]
2009-08-11 Jérémie Laval <[email protected]>
* Consts.cs.in: Add BOOTSTRAP_NET_4_0.
+10 -5
View File
@@ -69,11 +69,11 @@ internal
public const string FxFileVersion = "3.0.4506.648";
public const string VsFileVersion = "6.0.6001.17014";
#elif NET_2_1
// Versions of .NET Framework for SilverLight
// Versions of .NET Framework for Silverlight 3.0
public const string FxVersion = "2.0.5.0";
public const string VsVersion = "9.0.0.0"; // TODO:
public const string FxFileVersion = "2.0.31005.0";
public const string VsFileVersion = "9.0.50727.42"; // TODO:
public const string VsVersion = "9.0.0.0"; // unused, but needed for compilation
public const string FxFileVersion = "3.0.40818.0";
public const string VsFileVersion = "9.0.50727.42"; // unused, but needed for compilation
#elif NET_2_0 || BOOTSTRAP_NET_2_0
// Versions of .NET Framework 2.0 RTM
public const string FxVersion = "2.0.0.0";
@@ -124,5 +124,10 @@ internal
public const string AssemblySystem_Windows_Forms = "System.Windows.Forms, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089";
#if NET_4_0 || BOOTSTRAP_NET_4_0
public const string AssemblySystemCore_3_5 = "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
#endif
public const string AssemblySystem_Core = "System.Core, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089";
#elif NET_2_1
public const string AssemblySystem_Core = "System.Core, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089";
#elif NET_2_0
public const string AssemblySystem_Core = "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
#endif
}
+6 -3
View File
@@ -47,17 +47,20 @@ PROFILE_CS = $(depsdir)/basic-profile-check.cs
PROFILE_EXE = $(PROFILE_CS:.cs=.exe)
PROFILE_OUT = $(PROFILE_CS:.cs=.out)
MAKE_Q=$(if $(V),,-s)
do-profile-check:
@ok=:; \
rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
$(MAKE) -s $(PROFILE_OUT) > /dev/null || ok=false; \
$(MAKE) $(MAKE_Q) $(PROFILE_OUT) || ok=false; \
rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
if $$ok; then :; else \
if test -f $(topdir)/class/lib/monolite/mcs.exe; then \
$(MAKE) -s do-profile-check-monolite ; \
else \
echo "*** The compiler '$(BOOTSTRAP_MCS)' doesn't appear to be usable." 1>&2; \
echo "*** You need a C# compiler installed to build MCS (make sure mcs works from the command line)" 1>&2 ; \
echo "*** You need a C# 1.0 compiler installed to build MCS (make sure mcs works from the command line)" 1>&2 ; \
echo "*** mcs/gmcs from mono > 2.6 will not work, since they target NET 2.0." 1>&2 ; \
echo "*** Read INSTALL.txt for information on how to bootstrap a Mono installation." 1>&2 ; \
exit 1; fi; fi
@@ -81,7 +84,7 @@ do-profile-check-monolite: $(depsdir)/.stamp
endif
$(PROFILE_CS): $(topdir)/build/profiles/basic.make $(depsdir)/.stamp
echo 'class X { static int Main () { return 0; } }' > $@
echo 'class X { static int Main () { try { System.Activator.CreateInstance ("mscorlib", "System.Runtime.CompilerServices.CompilerGeneratedAttribute"); return 1; } catch { return 0; } } }' > $@
$(PROFILE_EXE): $(PROFILE_CS)
$(BOOTSTRAP_MCS) /out:$@ $<
+1 -1
View File
@@ -3,7 +3,7 @@
my_runtime = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack
INTERNAL_SMCS = $(my_runtime) $(topdir)/class/lib/$(PROFILE)/smcs.exe
BOOTSTRAP_PROFILE = net_2_1_bootstrap
BOOTSTRAP_PROFILE = monotouch_bootstrap
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(my_runtime) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/smcs.exe
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
@@ -0,0 +1,17 @@
#! -*- makefile -*-
INTERNAL_SMCS = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack $(topdir)/class/lib/$(PROFILE)/smcs.exe
BOOTSTRAP_PROFILE = net_2_0
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
profile-check:
@:
PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MONOTOUCH
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
# the tuner takes care of the install
NO_INSTALL = yes
+3 -1
View File
@@ -14,6 +14,8 @@ ifndef TEST_COMPILE
TEST_COMPILE = $(CSCOMPILE)
endif
TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
## Unit test support
ifndef NO_TEST
test_nunit_lib = nunit.framework.dll nunit.core.dll nunit.util.dll nunit.mocks.dll
@@ -82,7 +84,7 @@ endif
## FIXME: i18n problem in the 'sed' command below
run-test-lib: test-local
ok=:; \
MONO_REGISTRY_PATH="$(HOME)/.mono/registry" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) $(test_assemblies) -noshadow $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) -xml=TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) $(test_assemblies) -noshadow $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) -xml=TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
$(TEST_HARNESS_POSTPROC) ; $$ok
run-test-ondotnet-lib: test-local
+25
View File
@@ -1,3 +1,28 @@
2010-01-11 Sebastien Pouliot <[email protected]>
* Makefile: For 2.1 build System.Core.dll before System.Net.dll
2009-11-07 Zoltan Varga <[email protected]>
* Makefile (net_2_0_dirs): Add System.Data.Services.
2009-11-02 Zoltan Varga <[email protected]>
* Makefile: Move Mono.Debugger.Soft to net_2_0_dirs for 2.6.
2009-11-02 Zoltan Varga <[email protected]>
* Makefile: Add Mono.Debugger.Soft.
2009-10-14 Jonathan Pryor <[email protected]>
* Makefile: Add Mono.Data.Tds, System.Transactions, System.Data, and
Mono.Data.Sqlite to the MonoTouch build.
2009-10-08 Jb Evain <[email protected]>
* Makefile: build the i18n assemblies on MonoTouch.
2009-09-24 Marek Safar <[email protected]>
* Makefile: Removed System.Json from net_4_0 profile.
+5
View File
@@ -1,3 +1,8 @@
2009-10-09 Atsushi Enomoto <[email protected]>
* ISO2022JP.cs : simply output wrong escape sequence bytes to the
output (like .NET does).
2009-04-15 Atsushi Enomoto <[email protected]>
* jis.table : regenerated. Fixed bug #491799.
+16 -8
View File
@@ -438,8 +438,10 @@ namespace I18N.CJK
wide = true;
else if (bytes [i] == 0x28)
wide = false;
else
throw new ArgumentException ("Unexpected ISO-2022-JP escape sequence.");
else {
ret += 2;
continue;
}
i++;
if (bytes [i] == 0x42)
m = wide ? ISO2022JPMode.JISX0208 : ISO2022JPMode.ASCII;
@@ -448,7 +450,7 @@ namespace I18N.CJK
else if (bytes [i] == 0x49)
m = ISO2022JPMode.JISX0201;
else
throw new ArgumentException (String.Format ("Unexpected ISO-2022-JP escape sequence. Ended with 0x{0:X04}", bytes [i]));
ret += 3;
}
}
return ret;
@@ -457,7 +459,7 @@ namespace I18N.CJK
private int ToChar (int value)
{
value <<= 1;
return value + 1 >= convert.jisx0208ToUnicode.Length ?
return value + 1 >= convert.jisx0208ToUnicode.Length || value < 0 ?
-1 :
((int) (convert.jisx0208ToUnicode [value])) |
(((int) (convert.jisx0208ToUnicode [value + 1])) << 8);
@@ -523,8 +525,11 @@ namespace I18N.CJK
wide = true;
else if (bytes [i] == 0x28)
wide = false;
else
throw new ArgumentException ("Unexpected ISO-2022-JP escape sequence.");
else {
chars [charIndex++] = '\x1B';
chars [charIndex++] = (char) bytes [i];
continue;
}
i++;
if (bytes [i] == 0x42)
m = wide ? ISO2022JPMode.JISX0208 : ISO2022JPMode.ASCII;
@@ -532,8 +537,11 @@ namespace I18N.CJK
m = ISO2022JPMode.ASCII;
else if (bytes [i] == 0x49)
m = ISO2022JPMode.JISX0201;
else
throw new ArgumentException (String.Format ("Unexpected ISO-2022-JP escape sequence. Ended with 0x{0:X04}", bytes [i]));
else {
chars [charIndex++] = '\x1B';
chars [charIndex++] = (char) bytes [i - 1];
chars [charIndex++] = (char) bytes [i];
}
}
}
+8
View File
@@ -1,3 +1,11 @@
2009-12-18 Atsushi Enomoto <[email protected]>
* I18N.CJK.Test.cs : add NET_2_0 condition. fix 1.1 test.
2009-10-09 Atsushi Enomoto <[email protected]>
* I18N.CJK.Test.cs : added test for iso-2022-jp wrong esc sequences.
2009-04-15 Atsushi Enomoto <[email protected]>
* I18N.CJK.Test.cs : added test for bug #491799.
+22
View File
@@ -192,6 +192,28 @@ namespace MonoTests.I18N.CJK
AssertDecode ("Test/texts/japanese-utf8.txt", "Test/texts/japanese-50222.txt", 50222);
}
[Test]
public void CP50220BrokenESC ()
{
Assert.AreEqual ("\u001B$0", Encoding.GetEncoding (50220).GetString (new byte [] {0x1B, 0x24, 0x30}), "#1");
}
#if NET_2_0
[Test]
public void CP50220BrokenESC2 ()
{
// it does not really invoke fallback ...
Assert.AreEqual ("\u001B$0", Encoding.GetEncoding (50220, new EncoderReplacementFallback (), new DecoderReplacementFallback ("")).GetString (new byte [] {0x1B, 0x24, 0x30}), "#1");
}
[Test]
public void CP50220BrokenESC3 ()
{
// neither ...
Assert.AreEqual ("\u001B$0", Encoding.GetEncoding (50220, new EncoderExceptionFallback (), new DecoderExceptionFallback ()).GetString (new byte [] {0x1B, 0x24, 0x30}), "#2");
}
#endif
[Test]
#if !NET_2_0
[Category ("NotDotNet")] // MS bug
+16 -6
View File
@@ -121,7 +121,9 @@ net_2_0_dirs := \
Mono.Options \
Mono.Simd \
Mono.Tasklets \
WindowsBase
WindowsBase \
Mono.Debugger.Soft \
System.Data.Services
net_2_0_only_dirs := \
System.Web.Extensions_1.0 \
@@ -131,9 +133,9 @@ net_2_1_dirs := \
corlib \
Mono.CompilerServices.SymbolWriter \
System \
System.Net \
System.XML \
System.Core \
System.Net \
System.Xml.Linq \
System.Runtime.Serialization \
System.ServiceModel \
@@ -146,9 +148,18 @@ monotouch_dirs := \
System.XML \
Mono.Security \
System \
I18N \
System.Core \
System.Json \
System.Xml.Linq
System.Xml.Linq \
System.Runtime.Serialization \
System.ServiceModel \
System.ServiceModel.Web \
System.Web.Services \
Mono.Data.Tds \
System.Transactions \
System.Data \
Mono.Data.Sqlite
net_3_5_dirs := \
Microsoft.Build.Framework \
@@ -167,6 +178,7 @@ net_2_0_bootstrap_SUBDIRS := $(bootstrap_dirs) PEAPI
net_2_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs)
net_2_1_bootstrap_SUBDIRS := corlib System Mono.CompilerServices.SymbolWriter
net_2_1_raw_SUBDIRS := $(net_2_1_dirs)
monotouch_bootstrap_SUBDIRS := corlib System Mono.CompilerServices.SymbolWriter
monotouch_SUBDIRS := $(monotouch_dirs)
net_3_5_SUBDIRS := $(net_3_5_dirs)
net_4_0_bootstrap_SUBDIRS := $(bootstrap_dirs) PEAPI Mono.Posix System.Core
@@ -176,9 +188,7 @@ include ../build/rules.make
SUBDIRS = $(common_dirs) $(net_1_1_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs) $(net_2_1_dirs) $(net_3_5_dirs) $(net_4_0_dirs)
# These libraries below are either unimplemented or don't compile, but
#BROKEN_SUBDIRS =
#DIST_ONLY_SUBDIRS = $(BROKEN_SUBDIRS)
DIST_ONLY_SUBDIRS = dlr
# No new makefiles for: System.Messaging, System.Web.Mobile,
# System.ServiceProcess
@@ -630,8 +630,12 @@ namespace System.Windows.Forms {
}
if (ClientRectangle.Contains (mevent.Location))
if (!ValidationFailed)
if (!ValidationFailed) {
OnClick (EventArgs.Empty);
#if NET_2_0
OnMouseClick (mevent);
#endif
}
}
base.OnMouseUp (mevent);
@@ -1,3 +1,233 @@
2010-01-21 Carlos Alberto Cortez <[email protected]>
* ComboBox.cs: When the normal drop down window is closed, make sure
that the auto complete list -if any- is closed as well, instead of
stay open without need.
2010-01-21 Carlos Alberto Cortez <[email protected]>
* TextBox.cs: When showing the autocomplete listbox, make sure it's on
top, by calling the raw XplatUI.SetZOrder for it, since we can't
properly call BringToFront on it as it is parentless. This fixes an
issue when using this feature with ComboBox's own parentless listbox.
Fixes the remaining bits of #489339.
2010-01-21 Carlos Alberto Cortez <[email protected]>
* XplatUI.cs:
* XplatUIDriver:
* XplatUICarbon:
* XplatUIWin32:
* XplatUIX11.cs:
* XplatUIStructs: Implement support for different kind of audible
alerts in Windows, and update the requiered classes.
* MessageBox.cs:
* TextBoxBase.cs: Update calls to XplatUI.AudibleAlert.
Fixes #473725.
2010-01-21 Carlos Alberto Cortez <[email protected]>
* ComboBox.cs: When use manually setting DropDownHeight, ignore the
MaxDropDownHeight property - also rename our field 'count' to
'visible_items_count' to avoid confusion as much as possible.
Fixes an issue with several items, showing an incorrect layout.
2010-01-21 Carlos Alberto Cortez <[email protected]>
* RichTextBox.cs: SelectedText should set Modified to true. Observe
that this is happening just here, not for the Text property, and
neither for the TextBoxBase impl.
Fixes #569950.
2010-01-10 Carlos Alberto Cortez <[email protected]>
* ToolStripMenuItem.cs: Put the Checked/CheckState logic in a single
place and synchronize the events properly. Fixes a lack of
coordination between the events - which should be fired together.
2010-01-09 Carlos Alberto Cortez <[email protected]>
* TrackBar.cs: Move our events code to a single method, allowing it to
optionally fire the Scroll event. This way we both avoid the
duplicated calls to OnScroll and also will be able to fire Scroll
*before* OnValueChanged in other places.
Fixes #568026.
2010-01-04 Carlos Alberto Cortez <[email protected]>
* RadioButton.cs: When drawing, if Appearance is Button use the old
normal routine in the theme engine, instead of using the one in 2.0,
since this last one doesn't support proper rendering of the control as
a button.
Fixes #567904.
2010-01-03 Carlos Alberto Cortez <[email protected]>
* GroupBoxRenderer.cs: Properly use SystemColors.GrayText to draw to
text of the group box if it is disabled.
Fixes #567847.
2009-12-31 Carlos Alberto Cortez <[email protected]>
* XplatUICarbon.cs: Implement the overriden AudibleAlert
function in XplatUICarbon. Currently it throws
NotImplementedException which will kill a WinForms application showing
a dialog box.
Patch by Erik Ylvisaker ([email protected]).
2009-11-12 Carlos Alberto Cortez <[email protected]>
[merge the very last changes from trunk, -r 144884:145790]
2009-11-09 Carlos Alberto Cortez <[email protected]>
* DataGridTextBoxColumn.cs:
* DataGrid.cs: Position the cursor in the add row should *not* show
yet another new row - that will happen till we get any real input data
from the user. When that happens, we will also mark the new row as
ready to commit - otherwise, when the cursor moves to a different row,
the just added row will be discarded. This is exactly what .Net seems
to do.
2009-11-09 Carlos Alberto Cortez <[email protected]>
* DataGrid.cs: The large value for our vertical scrollbar should
depend on the number of visible rows, instead of trying to re-use the
value of VisibleRowCount, which is the value of *current* visible
rows, and can easily end messed up if new rows are added/removed.
2009-11-09 Carlos Alberto Cortez <[email protected]>
* DataGrid.cs: When moving the scroll, *dont* ever end the current
edit - this could seriously mess up our current edit cycle, specially
when adding new rows.
2009-11-02 Carlos Alberto Cortez <[email protected]>
* TabControl.cs: In OnKeyDown call the base implementation first -
this way we let the user tell us whether we should handle the key or
not.
Fixes #543717.
2009-11-02 Carlos Alberto Cortez <[email protected]>
* DataGrid.cs: Implement removal of rows the Correct Way by creating a
copy of the indexes, as any direct write access to the source will cause to
reset the entire selection - also, do the linear de-selection in
reverse order to avoid any index mismatch in the source, due to out of
synchronization removing the rows.
2009-11-02 Carlos Alberto Cortez <[email protected]>
* DataGridTextBoxColumn.cs:
* DataGrid.cs: Don't use this add-pending behaviour to try to add a
new row until we have the first input char - it was helping us to fix
other issues we have/had, but it's not matching .net.
2009-10-30 Carlos Alberto Cortez <[email protected]>
* TextBoxBase.cs: When returning the preferred height, and we are
supposed to be borderless, return the TopMargin value - usually in
borderless mode it has a value of 0, but in the ToolStrip controls we
need to set the margin manually.
Fixes #551214.
2009-10-29 Carlos Alberto Cortez <[email protected]>
* ToolTip.cs: ShowAlways works at the form level, not at the control
level. Fixes #544565.
2009-10-28 Carlos Alberto Cortez <[email protected]>
* ButtonBase.cs: Usually the click routines are handled in Control,
but in this class we are handling it ourselved, thus we need to have
the same calls, and we were missing the call to MouseClick.
Patch by Eric Petit <[email protected]>.
2009-10-26 Carlos Alberto Cortez <[email protected]>
* ComboBox.cs: When setting Text and data source is being used, if the
passed value is not matching any of the items in the source, don't
pass it to GetItemText, since it's useless, as GetItemText expects a
valid item.
Fixes #546009.
2009-11-12 Carlos Alberto Cortez <[email protected]>
[backport the improvements and speedups for ListView from trunk,
-r 142738:144115]
2009-10-14 Carlos Alberto Cortez <[email protected]>
* ListView.cs: When retrieving the top item, take into account the
offset represented by the header control, to retrieve the proper
value. Patch by Christoph von Wittich (Christoph at ApiViewer.de)
Fixes the remaining bits of #543773.
2009-10-14 Carlos Alberto Cortez <[email protected]>
* ListView.cs: TopItem setter should set the value as the top, not
only ensuring its visibility.
Fixes part of #543773.
2009-10-12 Carlos Alberto Cortez <[email protected]>
* ListView.cs: For virtual mode, when navigating the items using keyboard,
don't use the matrix of positions, and instead calculate the positions
based on the number of cols and rows, taking advantage of the fixed
positions of items. Use the same idea to implement FirstVisibleIndex,
so we avoid iterating over all the items. Patch by Stephen Robinson
mono at esar.org.uk.
Fixes part of #467418.
2009-10-07 Carlos Alberto Cortez <[email protected]>
* ListView.cs: When computing the value for groups height don't use
text_size field, since in LargeIcon view it sometimes contains a
double height value - use Font.Height directly, and also improve the
padding value.
* ThemeWin32Classic: The same as above.
This way the space between the group header, the line, and the items
area is not that big in LargeIcon view.
2009-10-04 Carlos Alberto Cortez <[email protected]>
* ListView.cs: When retrieving the fixed positions for the items in
virtual mode, use the row value to compute the coords of the item,
instead of the col value, as opposed to SmallIcon/LargeIcon views.
2009-09-29 Carlos Alberto Cortez <[email protected]>
* ListView.cs: The location of the items should be computed on the fly
in virtual mode - that decreased speed overall, but reduces the load
time.that decreased speed overall, but reduces the load time. Also,
handle the cases where we were using data structures we don't need to
use/create for this mode.
Fixes part of #467418.
2009-09-28 Carlos Alberto Cortez <[email protected]>
* ListView.cs: Tile view and VirtualMode can't be applied together.
Patch by Stephen Robinson <[email protected]>.
2009-09-28 Carlos Alberto Cortez <[email protected]>
* ListView.cs: When calculating the layout for Details view, don't ask
for the items *at all* in case we are in virtual mode. This should
re-enable the proper behaviour of virtual mode.
2009-10-12 Dick Porter <[email protected]>
* Splitter.cs: Adjust offsets when more than one splitter is
present in a control. Fixes bug 509472.
2009-09-26 Jonathan Pobst <[email protected]>
[Backport]
* TreeNode.cs: When we invalidate a node, make sure we start at
0, instead of the node's Bounds.Left, which does not include
the +/-, checkbox, or stateimages.
[Fixes bug #542481]
2009-09-24 Ivan N. Zlatev <[email protected]>
* DataGridView.cs: Compare the name and not displayname of properties
@@ -809,8 +809,9 @@ namespace System.Windows.Forms
return;
}
// set directly the passed value, since we already know it's not matching any item
if (dropdown_style != ComboBoxStyle.DropDownList)
textbox_ctrl.Text = GetItemText (value);
textbox_ctrl.Text = value;
}
}
@@ -1597,6 +1598,12 @@ namespace System.Windows.Forms
listbox_ctrl.Dispose ();
listbox_ctrl = null;
}
#if NET_2_0
// The auto complete list could have been shown after the listbox,
// so make sure it's hidden.
if (textbox_ctrl != null)
textbox_ctrl.HideAutoCompleteList ();
#endif
}
private int FindStringCaseInsensitive (string search)
@@ -2521,11 +2528,11 @@ namespace System.Windows.Forms
else { // DropDown or DropDownList
width = owner.DropDownWidth;
int count = (owner.Items.Count <= owner.MaxDropDownItems) ? owner.Items.Count : owner.MaxDropDownItems;
int visible_items_count = (owner.Items.Count <= owner.MaxDropDownItems) ? owner.Items.Count : owner.MaxDropDownItems;
if (owner.DrawMode == DrawMode.OwnerDrawVariable) {
height = 0;
for (int i = 0; i < count; i++) {
for (int i = 0; i < visible_items_count; i++) {
height += owner.GetItemHeight (i);
}
@@ -2534,14 +2541,15 @@ namespace System.Windows.Forms
} else {
#if NET_2_0
if (owner.DropDownHeight == default_drop_down_height) { // ignore DropDownHeight
height = owner.ItemHeight * count;
height = owner.ItemHeight * visible_items_count;
show_scrollbar = owner.Items.Count > owner.MaxDropDownItems;
} else {
// ignore visible items count, and use manual height instead
height = owner.DropDownHeight;
show_scrollbar = (count * owner.ItemHeight) > height;
show_scrollbar = (owner.Items.Count * owner.ItemHeight) > height;
}
#else
height = owner.ItemHeight * count;
height = owner.ItemHeight * visible_items_count;
show_scrollbar = owner.Items.Count > owner.MaxDropDownItems;
#endif
}
@@ -266,11 +266,12 @@ namespace System.Windows.Forms
bool from_positionchanged_handler;
/* editing state */
internal bool pending_new_row;
bool cursor_in_add_row;
bool add_row_changed;
internal bool is_editing; // Current cell is edit mode
bool is_changing;
bool commit_row_changes = true; // Whether to commit current edit or cancel it
bool adding_new_row; // Used to temporary ignore the new row added by CurrencyManager.AddNew in CurrentCell
internal Stack data_source_stack;
@@ -514,7 +515,10 @@ namespace System.Windows.Forms
if (value.RowNumber != current_cell.RowNumber) {
if (!from_positionchanged_handler) {
try {
ListManager.EndCurrentEdit ();
if (commit_row_changes)
ListManager.EndCurrentEdit ();
else
ListManager.CancelCurrentEdit ();
}
catch (Exception e) {
DialogResult r = MessageBox.Show (String.Format ("{0} Do you wish to correct the value?", e.Message),
@@ -542,14 +546,20 @@ namespace System.Windows.Forms
EnsureCellVisibility (value);
// by default, edition in existing rows is commited, and for new ones is discarded, unless
// we receive actual input data from the user
if (CurrentRow == RowsCount && ListManager.AllowNew) {
commit_row_changes = false;
cursor_in_add_row = true;
add_row_changed = false;
pending_new_row = true;
adding_new_row = true;
AddNewRow ();
adding_new_row = false;
}
else {
cursor_in_add_row = false;
pending_new_row = false;
commit_row_changes = true;
}
InvalidateRowHeader (old_row);
@@ -566,6 +576,16 @@ namespace System.Windows.Forms
}
}
internal void EditRowChanged (DataGridColumnStyle column_style)
{
if (cursor_in_add_row) {
if (!commit_row_changes) { // first change in add row, time to show another row in the ui
commit_row_changes = true;
RecreateDataGridRows (true);
}
}
}
int CurrentRow {
get { return current_cell.RowNumber; }
set { CurrentCell = new DataGridCell (value, current_cell.ColumnNumber); }
@@ -2011,9 +2031,15 @@ namespace System.Windows.Forms
if (is_editing)
return false;
else if (selected_rows.Keys.Count > 0) {
foreach (int row in selected_rows.Keys)
ListManager.RemoveAt (row);
selected_rows.Clear ();
// the removal of the items in the source will cause to
// reset the selection, so we need a copy of it.
int [] rows = new int [selected_rows.Keys.Count];
selected_rows.Keys.CopyTo (rows, 0);
// reverse order to keep index sanity
for (int i = rows.Length - 1; i >= 0; i--)
ListManager.RemoveAt (rows [i]);
CalcAreasAndInvalidate ();
}
@@ -2501,6 +2527,10 @@ namespace System.Windows.Forms
private void OnListManagerItemChanged (object sender, ItemChangedEventArgs e)
{
// if it was us who created the new row in CurrentCell, ignore it and don't recreate the rows yet.
if (adding_new_row)
return;
if (e.Index == -1) {
ResetSelection ();
if (rows == null || RowsCount != rows.Length - (ShowEditRow ? 1 : 0))
@@ -2549,7 +2579,7 @@ namespace System.Windows.Forms
CalcAreasAndInvalidate ();
}
internal void AddNewRow ()
private void AddNewRow ()
{
ListManager.EndCurrentEdit ();
ListManager.AddNew ();
@@ -2657,8 +2687,6 @@ namespace System.Windows.Forms
if (pixels == 0)
return;
EndEdit ();
Rectangle rows_area = cells_area; // Cells area - partial rows space
if (RowHeadersVisible) {
@@ -3316,7 +3344,10 @@ namespace System.Windows.Forms
}
int VLargeChange {
get { return VisibleRowCount; }
get {
// the possible number of visible rows
return cells_area.Height / RowHeight;
}
}
#endregion Instance Properties
@@ -206,14 +206,8 @@ namespace System.Windows.Forms
void textbox_TextChanged (object o, EventArgs e)
{
// when the focus goes to the add row, the first TextChanged event
// should actually add the new row.
if (grid.pending_new_row) {
grid.pending_new_row = false;
grid.AddNewRow ();
}
textbox.IsInEditOrNavigateMode = false;
grid.EditRowChanged (this);
}
protected void EndEdit ()
@@ -111,7 +111,8 @@ namespace System.Windows.Forms
if (groupBoxText != String.Empty) {
if (textColor == Color.Empty)
textColor = SystemColors.ControlText;
textColor = state == GroupBoxState.Normal ? SystemColors.ControlText :
SystemColors.GrayText;
TextRenderer.DrawText (g, groupBoxText, font, new Point (bounds.Left + 8, bounds.Top), textColor, flags);
}
}
@@ -1027,9 +1027,10 @@ namespace System.Windows.Forms
return this.items [0];
// do a hit test for the scrolled position
else {
int header_offset = header_control.Height;
for (int i = 0; i < items.Count; i++) {
Point item_loc = GetItemLocation (i);
if (item_loc.X >= 0 && item_loc.Y >= 0)
if (item_loc.X >= 0 && item_loc.Y - header_offset >= 0)
return items [i];
}
return null;
@@ -1044,7 +1045,8 @@ namespace System.Windows.Forms
if (value == null || value.ListView != this)
return;
EnsureVisible (value.Index);
// Take advantage this property is only valid for Details view.
SetScrollValue (v_scroll, item_size.Height * value.Index);
}
#endif
}
@@ -1077,6 +1079,10 @@ namespace System.Windows.Forms
throw new NotSupportedException ("CheckBoxes are not"
+ " supported in Tile view. Choose a different"
+ " view or set CheckBoxes to false.");
if (VirtualMode && value == View.Tile)
throw new NotSupportedException ("VirtualMode is"
+ " not supported in Tile view. Choose a different"
+ " view or set ViewMode to false.");
#endif
h_scroll.Value = v_scroll.Value = 0;
@@ -1104,6 +1110,10 @@ namespace System.Windows.Forms
if (!virtual_mode && items.Count > 0)
throw new InvalidOperationException ();
if (value && view == View.Tile)
throw new NotSupportedException ("VirtualMode is"
+ " not supported in Tile view. Choose a different"
+ " view or set ViewMode to false.");
virtual_mode = value;
Redraw (true);
@@ -1145,6 +1155,29 @@ namespace System.Windows.Forms
return 0;
Size item_size = ItemSize;
#if NET_2_0
// In virtual mode we always have fixed positions, and we can infer the positon easily
if (virtual_mode) {
int first = 0;
switch (view) {
case View.Details:
first = v_marker / item_size.Height;
break;
case View.LargeIcon:
case View.SmallIcon:
first = (v_marker / (item_size.Height + y_spacing)) * cols;
break;
case View.List:
first = (h_marker / (item_size.Width * x_spacing)) * rows;
break;
}
if (first >= items.Count)
first = items.Count;
return first;
}
#endif
for (int i = 0; i < items.Count; i++) {
Rectangle item_rect = new Rectangle (GetItemLocation (i), item_size);
if (item_rect.Right >= 0 && item_rect.Bottom >= 0)
@@ -1344,25 +1377,30 @@ namespace System.Windows.Forms
text_size.Height += 2;
}
private void Scroll (ScrollBar scrollbar, int delta)
private void SetScrollValue (ScrollBar scrollbar, int val)
{
if (delta == 0 || !scrollbar.Visible)
return;
int max;
if (scrollbar == h_scroll)
max = h_scroll.Maximum - item_control.Width;
else
max = v_scroll.Maximum - item_control.Height;
int val = scrollbar.Value + delta;
if (val > max)
val = max;
else if (val < scrollbar.Minimum)
val = scrollbar.Minimum;
scrollbar.Value = val;
}
private void Scroll (ScrollBar scrollbar, int delta)
{
if (delta == 0 || !scrollbar.Visible)
return;
SetScrollValue (scrollbar, scrollbar.Value + delta);
}
private void CalculateScrollBars ()
{
Rectangle client_area = ClientRectangle;
@@ -1719,6 +1757,11 @@ namespace System.Windows.Forms
}
#endif
#if NET_2_0
// cache the spacing to let virtualmode compute the positions on the fly
int x_spacing;
int y_spacing;
#endif
int rows;
int cols;
int[,] item_index_matrix;
@@ -1804,21 +1847,29 @@ namespace System.Windows.Forms
item_control.Visible = true;
item_control.Location = Point.Empty;
ItemSize = item_size; // Cache item size
#if NET_2_0
this.x_spacing = x_spacing;
this.y_spacing = y_spacing;
#endif
if (items.Count == 0)
return;
Size sz = item_size;
#if NET_2_0
bool using_groups = UsingGroups;
#endif
CalculateRowsAndCols (sz, left_aligned, x_spacing, y_spacing);
layout_wd = UseCustomColumnWidth ? cols * custom_column_width : cols * (sz.Width + x_spacing) - x_spacing;
layout_ht = rows * (sz.Height + y_spacing) - y_spacing;
#if NET_2_0
if (using_groups)
if (virtual_mode) { // no actual assignment is needed on items for virtual mode
item_control.Size = new Size (layout_wd, layout_ht);
return;
}
bool using_groups = UsingGroups;
if (using_groups) // the groups layout will override layout_ht
CalculateGroupsLayout (sz, y_spacing, 0);
#endif
@@ -1827,9 +1878,10 @@ namespace System.Windows.Forms
int display_index = 0;
for (int i = 0; i < items.Count; i++) {
ListViewItem item = items [i];
#if NET_2_0
if (using_groups) {
ListViewGroup group = items [i].Group;
ListViewGroup group = item.Group;
if (group == null)
group = groups.DefaultGroup;
@@ -1871,19 +1923,12 @@ namespace System.Windows.Forms
}
}
}
#if NET_2_0
if (!virtual_mode)
#endif
{
ListViewItem item = items [i];
item.Layout ();
item.DisplayIndex = display_index;
item.Layout ();
item.DisplayIndex = display_index;
#if NET_2_0
item.SetPosition (new Point (x, y));
item.SetPosition (new Point (x, y));
#endif
}
}
item_control.Size = new Size (layout_wd, layout_ht);
@@ -1909,7 +1954,7 @@ namespace System.Windows.Forms
int LayoutGroupHeader (ListViewGroup group, int y_origin, int item_height, int y_spacing, int rows)
{
Rectangle client_area = ClientRectangle;
int header_height = text_size.Height + 10;
int header_height = Font.Height + 15; // one line height + some padding
group.HeaderBounds = new Rectangle (0, y_origin, client_area.Width - v_scroll.Width, header_height);
group.items_area_location = new Point (0, y_origin + header_height);
@@ -1982,17 +2027,28 @@ namespace System.Windows.Forms
int item_height = GetDetailsItemHeight ();
ItemSize = new Size (0, item_height); // We only cache Height for details view
int y = header_control.Height;
layout_ht = y + (item_height * items.Count);
if (items.Count > 0 && grid_lines) // some space for bottom gridline
layout_ht += 2;
#if NET_2_0
bool using_groups = UsingGroups;
if (using_groups) {
// Observe that this routines will override our layout_ht value
CalculateDetailsGroupItemsCount ();
CalculateGroupsLayout (ItemSize, 2, y);
}
if (virtual_mode) // no assgination on items is needed
return;
#endif
for (int i = 0; i < items.Count; i++) {
ListViewItem item = items [i];
int display_index;
int item_y;
#if NET_2_0
if (using_groups) {
ListViewGroup group = item.Group;
@@ -2003,42 +2059,33 @@ namespace System.Windows.Forms
Point group_items_loc = group.items_area_location;
display_index = group.starting_item + current_item;
y = current_item * (item_height + 2) + group_items_loc.Y;
SetItemLocation (display_index, 0, y, 0, 0);
y = item_y = current_item * (item_height + 2) + group_items_loc.Y;
SetItemLocation (display_index, 0, item_y, 0, 0);
SetItemAtDisplayIndex (display_index, i);
item.SetPosition (new Point (0, y));
} else
#endif
{
display_index = i;
SetItemLocation (i, 0, y, 0, 0);
#if NET_2_0
item.SetPosition (new Point (0, y));
#endif
item_y = y;
SetItemLocation (i, 0, item_y, 0, 0);
y += item_height;
}
#if NET_2_0
if (!virtual_mode) // Virtual mode sets Layout until draw time
#endif
{
item.Layout ();
item.DisplayIndex = display_index;
}
item.Layout ();
item.DisplayIndex = display_index;
#if NET_2_0
item.SetPosition (new Point (0, item_y));
#endif
}
// some space for bottom gridline
if (items.Count > 0 && grid_lines)
y += 2;
#if NET_2_0
if (!using_groups) // With groups it has been previously computed
#endif
layout_ht = y;
}
private void AdjustItemsPositionArray (int count)
{
#if NET_2_0
// In virtual mode we compute the positions on the fly.
if (virtual_mode)
return;
#endif
if (items_location.Length >= count)
return;
@@ -2092,20 +2139,60 @@ namespace System.Windows.Forms
internal Point GetItemLocation (int index)
{
Point loc = items_location [index];
Point loc = Point.Empty;
#if NET_2_0
if (virtual_mode)
loc = GetFixedItemLocation (index);
else
#endif
loc = items_location [index];
loc.X -= h_marker; // Adjust to scroll
loc.Y -= v_marker;
return loc;
}
#if NET_2_0
Point GetFixedItemLocation (int index)
{
Point loc = Point.Empty;
switch (view) {
case View.LargeIcon:
case View.SmallIcon:
loc.X = index % cols * (item_size.Width + x_spacing);
loc.Y = index / cols * (item_size.Height + y_spacing);
break;
case View.List:
loc.X = index / rows * (item_size.Width + x_spacing);
loc.Y = index % rows * (item_size.Height + y_spacing);
break;
case View.Details:
loc.Y = header_control.Height + (index * item_size.Height);
break;
}
return loc;
}
#endif
internal int GetItemIndex (int display_index)
{
#if NET_2_0
if (virtual_mode)
return display_index; // no reordering in virtual mode.
#endif
return reordered_items_indices [display_index];
}
internal ListViewItem GetItemAtDisplayIndex (int display_index)
{
#if NET_2_0
// in virtual mode there's no reordering at all.
if (virtual_mode)
return items [display_index];
#endif
return items [reordered_items_indices [display_index]];
}
@@ -2199,6 +2286,11 @@ namespace System.Windows.Forms
return result;
}
#if NET_2_0
if (virtual_mode)
return GetFixedAdjustedIndex (key);
#endif
ItemMatrixLocation item_matrix_location = items_matrix_location [FocusedItem.DisplayIndex];
int row = item_matrix_location.Row;
int col = item_matrix_location.Col;
@@ -2252,6 +2344,49 @@ namespace System.Windows.Forms
return items [adjusted_index].DisplayIndex;
}
#if NET_2_0
// Used for virtual mode, where items *cannot* be re-arranged
int GetFixedAdjustedIndex (Keys key)
{
int result;
switch (key) {
case Keys.Left:
if (view == View.List)
result = focused_item_index - rows;
else
result = focused_item_index - 1;
break;
case Keys.Right:
if (view == View.List)
result = focused_item_index + rows;
else
result = focused_item_index + 1;
break;
case Keys.Up:
if (view != View.List)
result = focused_item_index - cols;
else
result = focused_item_index - 1;
break;
case Keys.Down:
if (view != View.List)
result = focused_item_index + cols;
else
result = focused_item_index + 1;
break;
default:
return -1;
}
if (result < 0 || result >= items.Count)
result = focused_item_index;
return result;
}
#endif
ListViewItem selection_start;
private bool SelectItems (ArrayList sel_items)
@@ -69,6 +69,7 @@ namespace System.Windows.Forms
string help_keyword;
HelpNavigator help_navigator;
object help_param;
AlertType alert_type;
#endregion // MessageBoxFrom Local Variables
#region MessageBoxForm Constructors
@@ -81,26 +82,31 @@ namespace System.Windows.Forms
switch (icon) {
case MessageBoxIcon.None: {
icon_image = null;
alert_type = AlertType.Default;
break;
}
case MessageBoxIcon.Error: { // Same as MessageBoxIcon.Hand and MessageBoxIcon.Stop
icon_image = SystemIcons.Error;
alert_type = AlertType.Error;
break;
}
case MessageBoxIcon.Question: {
icon_image = SystemIcons.Question;
alert_type = AlertType.Question;
break;
}
case MessageBoxIcon.Asterisk: { // Same as MessageBoxIcon.Information
icon_image = SystemIcons.Information;
alert_type = AlertType.Information;
break;
}
case MessageBoxIcon.Warning: { // Same as MessageBoxIcon.Exclamation:
icon_image = SystemIcons.Warning;
alert_type = AlertType.Warning;
break;
}
}
@@ -190,7 +196,7 @@ namespace System.Windows.Forms
if (Owner != null)
TopMost = Owner.TopMost;
XplatUI.AudibleAlert ();
XplatUI.AudibleAlert (alert_type);
this.ShowDialog ();
return this.DialogResult;
@@ -182,7 +182,7 @@ namespace System.Windows.Forms {
ThemeEngine.Current.CalculateRadioButtonTextAndImageLayout (this, Point.Empty, out glyph_rectangle, out text_rectangle, out image_rectangle);
// Draw our button
if (FlatStyle != FlatStyle.System)
if (FlatStyle != FlatStyle.System && Appearance != Appearance.Button)
ThemeEngine.Current.DrawRadioButton (pe.Graphics, this, glyph_rectangle, text_rectangle, image_rectangle, pe.ClipRectangle);
else
ThemeEngine.Current.DrawRadioButton (pe.Graphics, this.ClientRectangle, this);
@@ -443,6 +443,8 @@ namespace System.Windows.Forms {
}
set {
// TextBox/TextBoxBase don't set Modified in this same property
Modified = true;
base.SelectedText = value;
}
}
@@ -62,6 +62,7 @@ namespace System.Windows.Forms {
private int split_requested; // If the user requests a position before we have ever laid out the doc
private int splitter_prev_move;
private Rectangle splitter_rectangle_moving;
private int moving_offset;
#endregion // Local Variables
#region Constructors
@@ -266,25 +267,38 @@ namespace System.Windows.Forms {
int widths = 0;
int heights = 0;
int vert_offset = 0;
int horiz_offset = 0;
foreach (Control c in this.Parent.Controls) {
if (c != affected) {
switch (c.Dock) {
case DockStyle.Left:
case DockStyle.Right:
widths += c.Width;
if (c.Location.X < this.Location.X)
vert_offset += c.Width;
break;
case DockStyle.Top:
case DockStyle.Bottom:
heights += c.Height;
if (c.Location.Y < this.Location.Y)
horiz_offset += c.Height;
break;
}
}
}
if (horizontal)
if (horizontal) {
moving_offset = horiz_offset;
return Parent.ClientSize.Height - heights - MinExtra;
else
} else {
moving_offset = vert_offset;
return Parent.ClientSize.Width - widths - MinExtra;
}
}
}
@@ -448,8 +462,8 @@ namespace System.Windows.Forms {
int delta = currentMove - splitter_prev_move;
Rectangle prev_location = splitter_rectangle_moving;
bool moved = false;
int min = this.MinSize;
int max = max_size;
int min = this.MinSize + moving_offset;
int max = max_size + moving_offset;
if (horizontal) {
if (splitter_rectangle_moving.Y + delta > min && splitter_rectangle_moving.Y + delta < max) {
@@ -819,6 +819,10 @@ namespace System.Windows.Forms {
protected override void OnKeyDown (KeyEventArgs ke)
{
base.OnKeyDown (ke);
if (ke.Handled)
return;
if (ke.KeyCode == Keys.Tab && (ke.KeyData & Keys.Control) != 0) {
if ((ke.KeyData & Keys.Shift) == 0)
SelectedIndex = (SelectedIndex + 1) % TabCount;
@@ -833,8 +837,6 @@ namespace System.Windows.Forms {
ke.Handled = true;
} else if (NavigateTabs (ke.KeyCode))
ke.Handled = true;
base.OnKeyDown (ke);
}
protected override bool IsInputKey (Keys keyData)
@@ -996,6 +996,8 @@ namespace System.Windows.Forms {
HighlightedIndex = -1;
Show ();
// make sure we are on top - call the raw routine, since we are parentless
XplatUI.SetZOrder (Handle, IntPtr.Zero, true, false);
Invalidate ();
}
@@ -487,7 +487,12 @@ namespace System.Windows.Forms
[EditorBrowsable(EditorBrowsableState.Advanced)]
public int PreferredHeight {
get {
return Font.Height + (BorderStyle == BorderStyle.None ? 0 : 7);
if (BorderStyle != BorderStyle.None)
return Font.Height + 7;
// usually in borderless mode the top margin is 0, but
// try to access it, in case it was set manually, as ToolStrip* controls do
return Font.Height + TopMargin;
}
}
@@ -1592,7 +1597,7 @@ namespace System.Windows.Forms
OnTextChanged(EventArgs.Empty);
} else {
XplatUI.AudibleAlert();
XplatUI.AudibleAlert(AlertType.Default);
}
return;
} else if (ch == 8) {
@@ -3179,7 +3179,7 @@ namespace System.Windows.Forms
Rectangle header_bounds = group.HeaderBounds;
text_bounds.Offset (8, 0);
text_bounds.Inflate (-8, 0);
Size text_size = control.text_size;
int text_height = control.Font.Height + 2; // add a tiny padding between the text and the group line
Font font = new Font (control.Font, control.Font.Style | FontStyle.Bold);
Brush brush = new LinearGradientBrush (new Point (header_bounds.Left, 0), new Point (header_bounds.Left + ListViewGroupLineWidth, 0),
@@ -3201,8 +3201,8 @@ namespace System.Windows.Forms
sformat.LineAlignment = StringAlignment.Near;
dc.DrawString (group.Header, font, SystemBrushes.ControlText, text_bounds, sformat);
dc.DrawLine (pen, header_bounds.Left, header_bounds.Top + text_size.Height, header_bounds.Left + ListViewGroupLineWidth,
header_bounds.Top + text_size.Height);
dc.DrawLine (pen, header_bounds.Left, header_bounds.Top + text_height, header_bounds.Left + ListViewGroupLineWidth,
header_bounds.Top + text_height);
sformat.Dispose ();
font.Dispose ();
@@ -109,11 +109,7 @@ namespace System.Windows.Forms
}
}
set {
if (this.checked_state != (value ? CheckState.Checked : CheckState.Unchecked)) {
this.checked_state = value ? CheckState.Checked : CheckState.Unchecked;
this.Invalidate ();
this.OnCheckedChanged (EventArgs.Empty);
}
CheckState = value ? CheckState.Checked : CheckState.Unchecked;
}
}
@@ -138,8 +134,12 @@ namespace System.Windows.Forms
if (!Enum.IsDefined (typeof (CheckState), value))
throw new InvalidEnumArgumentException (string.Format ("Enum argument value '{0}' is not valid for CheckState", value));
if (value == checked_state)
return;
this.checked_state = value;
this.Invalidate ();
this.OnCheckedChanged (EventArgs.Empty);
this.OnCheckStateChanged (EventArgs.Empty);
}
}
@@ -895,17 +895,11 @@ namespace System.Windows.Forms {
if (!is_active)
return;
// Display tooltips only for the controls in the active form
if (control.FindForm () != Form.ActiveForm)
// ShowAlways controls whether the controls in non-active forms
// can display its tooltips, even if they are not current active control.
if (!show_always && control.FindForm () != Form.ActiveForm)
return;
if (!show_always) {
IContainerControl cc = last_control.GetContainerControl ();
if ((cc == null) || (cc.ActiveControl == null)) {
return;
}
}
string text = (string)tooltip_strings[control];
if (text != null && text.Length > 0) {
if (active_control == null) {
@@ -537,23 +537,33 @@ namespace System.Windows.Forms
public int Value {
get { return position; }
set {
if (value < Minimum || value > Maximum)
throw new ArgumentException(
string.Format("'{0}' is not a valid value for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'", value));
if (position != value) {
position = value;
// XXX any reason we don't call OnValueChanged here?
EventHandler eh = (EventHandler)(Events [ValueChangedEvent]);
if (eh != null)
eh (this, EventArgs.Empty);
Invalidate (thumb_area);
}
SetValue (value, false);
}
}
void SetValue (int value, bool fire_onscroll)
{
if (value < Minimum || value > Maximum)
throw new ArgumentException(
String.Format ("'{0}' is not a valid value for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'", value));
if (position == value)
return;
position = value;
// OnScroll goes before OnValueChanged
if (fire_onscroll)
OnScroll (EventArgs.Empty);
// XXX any reason we don't call OnValueChanged here?
EventHandler eh = (EventHandler)(Events [ValueChangedEvent]);
if (eh != null)
eh (this, EventArgs.Empty);
Invalidate (thumb_area);
}
#endregion //Public Properties
#region Public Methods
@@ -695,14 +705,14 @@ namespace System.Windows.Forms
private void UpdatePos (int newPos, bool update_trumbpos)
{
if (newPos < minimum){
Value = minimum;
SetValue (minimum, true);
}
else {
if (newPos > maximum) {
Value = maximum;
SetValue (maximum, true);
}
else {
Value = newPos;
SetValue (newPos, true);
}
}
}
@@ -712,7 +722,6 @@ namespace System.Windows.Forms
{
UpdatePos (position + LargeChange, true);
Invalidate (thumb_area);
OnScroll (new EventArgs ());
}
// Used by UIA implementation, so making internal
@@ -720,21 +729,18 @@ namespace System.Windows.Forms
{
UpdatePos (position - LargeChange, true);
Invalidate (thumb_area);
OnScroll (new EventArgs ());
}
private void SmallIncrement ()
{
UpdatePos (position + SmallChange, true);
Invalidate (thumb_area);
OnScroll (new EventArgs ());
}
private void SmallDecrement ()
{
UpdatePos (position - SmallChange, true);
Invalidate (thumb_area);
OnScroll (new EventArgs ());
}
private void OnMouseUpTB (object sender, MouseEventArgs e)
@@ -821,13 +827,9 @@ namespace System.Windows.Forms
mouse_moved = true;
/* Moving the thumb */
if (thumb_pressed) {
int old_value = Value;
Value = ThemeEngine.Current.TrackBarValueFromMousePosition (e.X, e.Y, this);
if (Value != old_value)
OnScroll (EventArgs.Empty);
}
if (thumb_pressed)
SetValue (ThemeEngine.Current.TrackBarValueFromMousePosition (e.X, e.Y, this), true);
ThumbEntered = GetRealThumbRectangle ().Contains (e.Location);
}
@@ -892,16 +894,16 @@ namespace System.Windows.Forms
case Keys.Home:
if (horiz)
Value = Minimum;
SetValue (Minimum, true);
else
Value = Maximum;
SetValue (Maximum, true);
break;
case Keys.End:
if (horiz)
Value = Maximum;
SetValue (Maximum, true);
else
Value = Minimum;
SetValue (Minimum, true);
break;
default:
@@ -1072,11 +1072,8 @@ namespace System.Windows.Forms
TreeView tv = TreeView;
if (tv == null)
return;
// Use actual TreeView width to invalidate total prev/new area
Rectangle bounds = Bounds;
bounds.Width = tv.ClientSize.Width;
tv.Invalidate (bounds);
tv.UpdateNode (this);
}
internal void InvalidateWidth ()
@@ -464,11 +464,11 @@ namespace System.Windows.Forms {
driver.Activate(handle);
}
internal static void AudibleAlert() {
internal static void AudibleAlert(AlertType alert) {
#if DriverDebug
Console.WriteLine("AudibleAlert(): Called");
#endif
driver.AudibleAlert();
driver.AudibleAlert(alert);
}
internal static bool CalculateWindowRect(ref Rectangle ClientRect, CreateParams cp, Menu menu, out Rectangle WindowRect) {
@@ -791,8 +791,8 @@ namespace System.Windows.Forms {
ActiveWindow = handle;
}
internal override void AudibleAlert() {
throw new NotImplementedException();
internal override void AudibleAlert(AlertType alert) {
AlertSoundPlay ();
}
internal override void CaretVisible (IntPtr hwnd, bool visible) {
@@ -2369,6 +2369,9 @@ namespace System.Windows.Forms {
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
extern static short GetMBarHeight ();
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
extern static void AlertSoundPlay ();
#region Cursor imports
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
extern static Carbon.HIRect CGDisplayBounds (IntPtr displayID);
@@ -274,7 +274,7 @@ namespace System.Windows.Forms {
internal abstract event EventHandler Idle;
#region XplatUI Driver Methods
internal abstract void AudibleAlert();
internal abstract void AudibleAlert(AlertType alert);
internal abstract void EnableThemes();
@@ -874,5 +874,13 @@ namespace System.Windows.Forms {
SC_MONITORPOWER = 0xF170,
SC_CONTEXTHELP = 0xF180
}
internal enum AlertType {
Default = 1,
Error = 2,
Question = 3,
Warning = 4,
Information = 5
}
}
@@ -1568,8 +1568,24 @@ namespace System.Windows.Forms {
Console.WriteLine("Xplat version $revision: $");
}
internal override void AudibleAlert() {
Win32PlaySound("Default", IntPtr.Zero, SndFlags.SND_ALIAS | SndFlags.SND_ASYNC | SndFlags.SND_NOSTOP | SndFlags.SND_NOWAIT);
string GetSoundAlias (AlertType alert)
{
switch (alert) {
case AlertType.Error:
return "SystemHand";
case AlertType.Question:
return "SystemQuestion";
case AlertType.Warning:
return "SystemExclamation";
case AlertType.Information:
return "SystemAsterisk";
default:
return "SystemDefault";
}
}
internal override void AudibleAlert(AlertType alert) {
Win32PlaySound(GetSoundAlias (alert), IntPtr.Zero, SndFlags.SND_ALIAS_ID | SndFlags.SND_ASYNC | SndFlags.SND_NOSTOP | SndFlags.SND_NOWAIT);
}
internal override void GetDisplaySize(out Size size) {
Loaded 100 of 1464 files, more files were not shown because too many files have changed in this diff. Show more