Commit Graph
436 Commits
Author SHA1 Message Date
Gert Driesen c58d431a74 * Container.cs: Avoid NRE in Remove and RemoveWithoutUnsiting.
* ContainerTest.cs: Added tests for Remove and RemoveWithoutUnsiting.

svn path=/trunk/mcs/; revision=138175
2009-07-18 09:56:51 +00:00
Gert Driesen 506ae3239b * ContainerTest.cs: Added tests for Add, Dispose, ValidateName and
GetService.
* Container.cs: Changed Dispose(bool) behaviour to match .NET, based
on patch by Tom Hindle ([email protected]). Also use ValidateName
in Add overloads on 1.0 profile by making it available as private
method. Use case-insensitive comparison of component name.

svn path=/trunk/mcs/; revision=138174
2009-07-18 08:20:49 +00:00
Gonzalo Paniagua Javier c76e44451a 2009-06-29 Gonzalo Paniagua Javier <[email protected]>
* LicenseProviderAttribute.cs: avoid nullref when provider has not
	been set or cannot be loaded.


svn path=/trunk/mcs/; revision=137115
2009-06-29 22:02:41 +00:00
Marek Habersack d9f9fea847 2009-06-23 Marek Habersack <[email protected]>
* AssemblyInfo.cs: added InternalsVisibleTo for
	System.ComponentModel.DataAnnotations (needs
	ReflectionPropertyDescriptor)

2009-06-23  Marek Habersack  <[email protected]>

	* MetaTable.cs: constructor now takes ContextConfiguration instead
	of a boolean and uses the config to determine value of the
	ScaffoldAllTables property. Also, if context config is present,
	makes sure to register the associated type description provider
	(if any) with TypeDescriptor.

	* MetaModel.cs: no longer uses local cache for description
	providers. Uses TypeDescriptor.{Add,Get}Provider now.

	* MetaColumn.cs: fixed Scaffold to match tests - IsGenerated and
	IsCustomProperty take precedence over Table.ScaffoldAllTables.
	GetDataFieldAttribute doesn't use AttributeCollection indexer, as
	the latter would create a default instance of the requested
	attribute, which is not what we want here.

2009-06-23  Marek Habersack  <[email protected]>

	* ValidationAttribute.cs: error message must not ever be empty.

	* UIHintAttribute.cs: do not throw NIEX from the constructor.

	* DataTypeAttribute.cs: implemented correct DisplayFormat
	intialization for DataType.Time.

	* AssociatedMetadataTypeTypeDescriptor.cs: implemented retrieving
	attributes of the associated metadata type, as well as merging of
	attribute collections between metadata and main type properties.

	* AssociatedMetadataTypePropertyDescriptor.cs: added. Helper class
	which merges attributes from the metadata type (if any) with those
	associated with property from the "main" type.

2009-06-23  Marek Habersack  <[email protected]>

	* System.ComponentModel.DataAnnotations.dll.sources: added
	System.ComponentModel.DataAnnotations/AssociatedMetadataTypePropertyDescriptor.cs

2009-06-23  Marek Habersack  <[email protected]>

	* TypeDescriptor.cs: do not wrap DefaultTypeDescriptionProvider.
	Implemented GetAttributes and GetProperties in
	DefaultTypeDescriptor.

	* AttributeCollection.cs: make sure that attrList is never null.

svn path=/trunk/mcs/; revision=136732
2009-06-23 18:38:38 +00:00
Marek Habersack 1821e106c7 2009-06-22 Marek Habersack <[email protected]>
* WeakObjectWrapper.cs, WeakObjectWrapperComparer.cs: added - used
	by TypeDescriptor for storage of type description providers.

	* TypeDescriptor.cs: implemented part of the 2.0+ API which deals
	with adding/removing/getting type description providers.

	* AttributeCollection.cs: do not throw NREX when attrList is
	null in Count.

2009-06-22  Marek Habersack  <[email protected]>

	* TypeDescriptorTests.cs: added tests for 2.0+ APIs which deal
	with adding/removing/getting type description providers.

svn path=/trunk/mcs/; revision=136634
2009-06-22 18:24:19 +00:00
Jonathan Pryor 2d87668646 * System_test.dll.sources: Add ListChangedEventArgsTest.cs.
* System.ComponentModel/ListChangedEventArgs.cs: Fix .NET compatibility
	  problems (discovered from trying to run the System.Data.Linq 
	  unit tests).
	* Test/System.ComponentModel/ListChangedEventArgsTest.cs: Added; tests
	  for ListChangedEventArgs.

svn path=/trunk/mcs/; revision=134138
2009-05-14 15:08:47 +00:00
Gonzalo Paniagua Javier 7a01b00781 2009-04-22 Gonzalo Paniagua Javier <[email protected]>
* Win32Exception.cs: made W32ErrorMessage internal.


svn path=/trunk/mcs/; revision=132394
2009-04-22 19:01:09 +00:00
Zoltan Varga 9818419d09 2009-02-28 Zoltan Varga <[email protected]>
* EventHandlerList.cs: Change this to use a linked list as stated by the
	MSDN docs.

svn path=/trunk/mcs/; revision=128272
2009-02-28 19:54:14 +00:00
Rodrigo Kumpera c4a81454fa 2009-02-27 Rodrigo Kumpera <[email protected]>
* ReflectionPropertyDescriptor.cs: Don't cache getter and
	setter properties. Cache instead the PropertyInfo objects
	that defined them.

	PropertyInfo::Get/SetValue is faster than calling the method
	throught reflection.

svn path=/trunk/mcs/; revision=128235
2009-02-27 18:07:36 +00:00
Gonzalo Paniagua Javier 411a7bbabf fix
svn path=/trunk/mcs/; revision=127645
2009-02-22 03:07:47 +00:00
Kornél Pál 2605f4d149 EventHandlerList.cs: Fix profile 1.x build by not using HandlerEntry.
svn path=/trunk/mcs/; revision=127620
2009-02-21 09:02:54 +00:00
Gonzalo Paniagua Javier b766293142 oops
svn path=/trunk/mcs/; revision=127617
2009-02-21 07:34:55 +00:00
Gonzalo Paniagua Javier 7ba0269b25 2009-02-21 Gonzalo Paniagua Javier <[email protected]>
* EventHandlerList.cs: there's no need for HandlerEntry here.
	Just store the delegate.


svn path=/trunk/mcs/; revision=127615
2009-02-21 07:32:46 +00:00
Marek Habersack f876f962ec 2009-02-19 Marek Habersack <[email protected]>
* AttributeCollection.cs: this [Type] shouldn't throw a NREX when
	attrList is null.

	* TypeDescriptor.cs: GetConverter (Type) must throw
	ArgumentNullException if the passed parameter is null.
	FindDefaultConverterType should gracefully cope with type being
	null.

2009-02-19  Marek Habersack  <[email protected]>

	* TypeDescriptorTests.cs: added a test for
	TypeDescriptor.GetConverter (null) case.

svn path=/trunk/mcs/; revision=127343
2009-02-18 23:08:26 +00:00
Ivan Zlatev 2bff0a751d 2009-01-09 Ivan N. Zlatev <[email protected]>
* BindingList.cs: Add calls InsertItem which raises OnListChanged, so
	don't raise a duplicate OnListChanged in AddNewCore.

svn path=/trunk/mcs/; revision=122896
2009-01-09 14:51:41 +00:00
Marek Habersack 831e44e3c0 Fix the build
svn path=/trunk/mcs/; revision=122020
2008-12-22 23:57:49 +00:00
Ivan Zlatev 3993c9ddeb 2008-12-22 Ivan N. Zlatev <[email protected]>
* ReferenceConverter.cs: Implemented.
	* ReferenceConverterTest.cs: Added.
	[Fixes bug #381435]

svn path=/trunk/mcs/; revision=121997
2008-12-22 19:17:58 +00:00
Ivan Zlatev e074114716 2008-12-06 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs: Added support for NullableConverter.
	* TypeDescriptorTests.cs: Added a test for the NullableConverter support.

svn path=/trunk/mcs/; revision=120946
2008-12-06 16:35:57 +00:00
Ivan Zlatev bd41dbef49 2008-12-06 Ivan N. Zlatev <[email protected]>
* NullableConverter.cs: Implemented.
	* NullableConverterTest.cs: Added.
	* System_test.dll.sources: Addded NullableConverterTest.cs

svn path=/trunk/mcs/; revision=120945
2008-12-06 16:35:51 +00:00
Ivan Zlatev 0e79c51cb0 2008-12-06 Ivan N. Zlatev <[email protected]>
* ListSortDescriptionCollection.cs: Add the items supplied in the
	ctor to the internal list.

svn path=/trunk/mcs/; revision=120934
2008-12-06 02:15:44 +00:00
Rolf Bjarne Kvinge b0a37e0bf5 2008-11-21 Rolf Bjarne Kvinge <[email protected]>
* TypeConverter_2_1.cs: fix method signatures to match SL2 api.



svn path=/trunk/mcs/; revision=119590
2008-11-21 09:44:22 +00:00
Jb Evain 3be8af87b7 2008-11-20 Jb Evain <[email protected]>
* TypeConverter_2_1.cs: update to SL2 api.


svn path=/trunk/mcs/; revision=119430
2008-11-20 12:12:59 +00:00
Jb Evain d2e0a09257 2008-11-12 Jb Evain <[email protected]>
* IComponent.cs
	* ComponentCollection.cs
	* PropertyDescriptor.cs: adjust api for NET_2_1.


svn path=/trunk/mcs/; revision=118649
2008-11-12 21:16:43 +00:00
Jonathan Pobst 4b7f1da9de 2008-09-08 Jonathan Pobst <[email protected]>
* BackgroundWorker.cs: If the user sets Cancel to true, but then
	throws an exception in DoWork, we need to set Cancel back to false.
	[Fixes bug #328830]

svn path=/trunk/mcs/; revision=112520
2008-09-08 16:56:09 +00:00
Jb Evain 7119d6f741 simplify
svn path=/trunk/mcs/; revision=112057
2008-09-02 07:10:28 +00:00
Stephane Delcroix d13a0f2c10 replace the null colescent operator by a if-null mor mcs1. Fix the build
svn path=/trunk/mcs/; revision=112056
2008-09-02 06:44:42 +00:00
Rodrigo Kumpera 892f1f1e2f In Test/System.ComponentModel:
2008-09-01  Rodrigo Kumpera  <[email protected]>

	* PropertyDescriptorTest.cs: Tests for Get/Set Value of partial
	overrides of virtual properties.

In System.ComponentModel:
2008-09-01  Rodrigo Kumpera  <[email protected]>

	* ReflectionPropertyDescriptor.cs (SetValue, GetValue) : Lookup
	the MethodInfo for accessors in parent types in case of partial
	overrides of virtual properties.


svn path=/trunk/mcs/; revision=112052
2008-09-01 23:52:37 +00:00
Marek Safar 52df2fce97 Warnings cleanup
svn path=/trunk/mcs/; revision=111915
2008-08-29 13:07:43 +00:00
Sebastien Pouliot 4bbaa4b974 2008-08-07 Sebastien Pouliot <[email protected]>
* DefaultValueAttribute.cs: Fix Equals (wrt boxing) and 
	GetHashCode (wrt NRE on null Value).
	* PropertyChangedEventArgs.cs: Property PropertyName is not
	virtual for NET_2_1


svn path=/trunk/mcs/; revision=109853
2008-08-07 13:36:27 +00:00
Jb Evain e0e4361e63 cleanup System.ComponentModel for SL2
svn path=/trunk/mcs/; revision=109344
2008-07-31 13:49:49 +00:00
Marek Habersack 49b4be147a 2008-07-23 Marek Habersack <[email protected]>
* EventHandlerList.cs: optimize the implementation.

svn path=/trunk/mcs/; revision=108542
2008-07-23 12:27:21 +00:00
Ivan Zlatev 99ab4f4d63 2008-07-17 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs: Attributes precendence (higher to lower)
	should be type -> base types -> interfaces and not
	type -> interfaces -> base types.

svn path=/trunk/mcs/; revision=108190
2008-07-17 22:21:50 +00:00
Ivan Zlatev f7ded77f0b 2008-07-17 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs:
	 - Refactor the default converters table not to be a Hashtable,
	 because the order of the keys is not preserved.
	 - Fix FindDefaultConverterType to properly make use of the default
	 converters.

svn path=/trunk/mcs/; revision=108121
2008-07-17 10:47:23 +00:00
Ivan Zlatev 66c54b0696 2008-07-16 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs:
	 - Fix GetConverter (Type) overload to have same logic as the
	 object one.
	 - Object-ReferenceConverter should be the last entry in the predefined
	 converters table, so that when we look up we don't end up with the wrong
	 converter for derived types.
	* TypeDescriptorTests.cs: Add a test that both GetConverter
	overloads return the same converter.

svn path=/trunk/mcs/; revision=108087
2008-07-16 21:09:41 +00:00
Jonathan Pobst c2c1e06c8c 2008-07-16 Jonathan Pobst <[email protected]>
Apply patch from Achille Fouilleul (achille.fouilleul at gadz dot org)

	* BackgroundWorker.cs: Ensure the async object is set to null before
	calling RunWorkerCompleted, as IsBusy is based off the async object.
	[Fixes bug #394365]

2008-07-16  Jonathan Pobst  <[email protected]>

	* BackgroundWorkerTest.cs: Add some asserts for bug #364365.

svn path=/trunk/mcs/; revision=108053
2008-07-16 16:24:58 +00:00
Jonathan Pobst 7f29c4c77e 2008-07-16 Jonathan Pobst <[email protected]>
Apply patches from Jordan Callicoat (MonkeeSage at gmail dot com)

	* AsyncCompleteEventArgs.cs: RaiseExceptionIfNecessary should throw
	TargetInvocationException if there was an exception, and IOE if
	the operation was cancelled.
	* BackgroundWorker.cs: Do not call RunWorkerCompleted from CancelAsync,
	setting cancel_pending to true is enough.
	* RunWorkerCompletedEventArgs.cs: Raise exceptions when user tries
	to access the Result if there are any exceptions.
	[Fixes bugs #328830 and 373153]

2008-07-16  Jonathan Pobst  <[email protected]>

	* BackgroundWorkerTest.cs: Add tests for bugs 328830 and 373153.

svn path=/trunk/mcs/; revision=108039
2008-07-16 15:00:10 +00:00
Marek Safar bdd9de656e Fixed few warnings
svn path=/trunk/mcs/; revision=107455
2008-07-08 10:34:18 +00:00
Rodrigo Kumpera 1d942f150d In .:
2008-07-01  Rodrigo Kumpera  <[email protected]>

	* PropertyDescriptorCollection.cs : Kill some foreach loops.


svn path=/trunk/mcs/; revision=107032
2008-07-02 04:08:24 +00:00
Atsushi Eno 293fb62d31 too silly to document.
svn path=/trunk/mcs/; revision=106777
2008-06-27 20:56:26 +00:00
Gert Driesen f1f33477a9 * EventDescriptorCollectionTests.cs: Enabled tests for Empty, Find and
IList. Added test for String indexer.
* PropertyDescriptorCollectionTests.cs: Improved test for Find and
merged CultureInsensitiveFindTest. Improved test for Find with null 
name/key. Added test for String indexer.
* EventDescriptorCollection.cs: Fixed Empty to return read-only
collection. In a read-only collection, throw NotSupportedException
instead of InvalidOperationException when attempting to modify the
collection. Fixed find to use ordinal comparison on 2.0 profile.
Fixed IList's IsFixedSize and IsReadOnly.
* PropertyDescriptorCollection.cs (Find): Use key as argument name
when name is null. Silly compatiblity fix.

svn path=/trunk/mcs/; revision=106736
2008-06-27 13:26:19 +00:00
Gert Driesen daaaa7b89c * System_test.dll.sources: Added EventDescriptorCollectionTest.cs.
* EventDescriptorCollectionTests.cs: Added tests based on tests for
PropertyDescriptorCollection.
* PropertyDescriptorCollectionTests.cs: Added tests for Sort overloads.
Improved test for Find with null key.
* EventDescriptorCollection.cs: Fixed NRE in Sort overloads when order
string array is null.
* PropertyDescriptorCollection.cs: Fixed NRE in Sort overloads when
order string array is null.

svn path=/trunk/mcs/; revision=106733
2008-06-27 11:59:22 +00:00
Ivan Zlatev 881090cd44 2008-06-27 Ivan N. Zlatev <[email protected]>
* PropertyDescriptorCollection.cs, EventDescriptorCollection.cs, 
	MemberDescriptor.cs: Implement proper sorting of descriptors by 
	comparing their names.
	[Fixes bug #403882]


svn path=/trunk/mcs/; revision=106718
2008-06-27 01:35:01 +00:00
Ivan Zlatev 8b68984e0d 2008-06-25 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs: Fix a NRE.
	[Fixes bug #403880]


svn path=/trunk/mcs/; revision=106599
2008-06-25 19:37:54 +00:00
Atsushi Eno 90ccb040e6 2008-06-11 Atsushi Enomoto <[email protected]>
* DateTimeConverter.cs : use MM for month instead of mm.
	  Fixed bug #396649, patch by Andy Hume.

	* DateTimeConverterTest.cs : test for bug #396649 by Andy Hume.


svn path=/trunk/mcs/; revision=105573
2008-06-11 12:20:57 +00:00
Dick Porter 0cdd3ac3a2 2008-06-02 Dick Porter <[email protected]>
* Win32Exception.cs: Turn W32ErrorMessage into an icall so it can
	use the FormatMessage API.  Fixes bug 321827.



svn path=/trunk/mcs/; revision=104702
2008-06-02 18:15:48 +00:00
Ivan Zlatev bd7ef520cb 2008-06-02 Ivan N. Zlatev <[email protected]>
* MemberDescriptor.cs, PropertyDescriptor.cs, 
	ReflectionPropertyDescriptor.cs: Implement FillAttributes.
	* MemberDescriptor.cs: 
	 - Attributes should be checked for duplicates based on their 
	 TypeId and not Type.
	 - For duplicate attributes the last one added has higher precedence.
	* ReflectionPropertyDescriptor.cs: Use the property type supplied 
	in the ctor instead of using reflection, because this won't work if 
	there are more then one property with the same name.


svn path=/trunk/mcs/; revision=104696
2008-06-02 17:30:21 +00:00
Ivan Zlatev 4aeb7473ea 2008-05-29 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs: GetAttributes must retrieve the attributes of 
	the type, the base types and the interfaces the type implements.
	[Fix part of bug #394310]
	* TypeDescriptorTests.cs: Add test that verifies that GetAttributes 
	retrieves the attributes of the type, the base types and the 
	interfaces the type implements.


svn path=/trunk/mcs/; revision=104438
2008-05-29 16:40:27 +00:00
Atsushi Eno 3fcf874d00 2008-05-21 Atsushi Enomoto <[email protected]>
* System.dll.sources :
	  added INotifyPropertyChanging stuff (new in 2.0 SP1).

	* INotifyPropertyChanging.cs, PropertyChangingEventArgs.cs,
	  PropertyChangingEventHandler.cs : new types in 2.0 SP1.


svn path=/trunk/mcs/; revision=103637
2008-05-21 06:58:32 +00:00
Sebastien Pouliot 811d8073e7 2008-05-19 Sebastien Pouliot <[email protected]>
* CharConverter.cs,
	* DateTimeConverter.cs,
	* GuidConverter.cs,
	* TimeSpanConverter.cs: Avoid unboxing structs more than one time.
	[Found using Gendarme]


svn path=/trunk/mcs/; revision=103540
2008-05-20 01:24:26 +00:00
Ivan Zlatev 02473d74c9 2008-05-05 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs: GetProperties should not return write-only 
	properties. Patch by James Fitzsimons  <[email protected]>.
 	* TypeDescriptorTests.cs: Add test for handling write-only properties.


svn path=/trunk/mcs/; revision=102535
2008-05-05 15:48:48 +00:00