Commit Graph
339 Commits
Author SHA1 Message Date
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
Jb Evain ee31590daa 2008-04-26 Jb Evain <[email protected]>
* PropertyTabAttribute.cs, BindingList.cs: replace
	usages of new Type [0] with Type.EmptyTypes.
	Found with Gendarme.


svn path=/trunk/mcs/; revision=101929
2008-04-26 16:02:13 +00:00
Marek Habersack 7fff97b791 2008-04-16 Marek Habersack <[email protected]>
* ReferenceConverter.cs: fix ConvertFrom and ConvertTo when
	converting from/to string - base must be called only if the
	conversion target type is NOT string, otherwise the result of the
	conversion will be the value type name.
2008-04-16  Marek Habersack  <[email protected]>

	* ComponentConverterTests.cs: added tests for
	{Component, Reference}Converter ConvertFrom/ConvertTo changes.
2008-04-16  Marek Habersack  <[email protected]>

	* System_test.dll.sources: added
	System.ComponentModel/ComponentConverterTests.cs

	* Makefile (TEST_MCS_FLAGS): reference -r:System.Data for new
	tests.

svn path=/trunk/mcs/; revision=100952
2008-04-16 21:52:54 +00:00
Jb Evain 963ccb4ef8 merge back ml2 into trunk
svn path=/trunk/mcs/; revision=100557
2008-04-13 13:47:01 +00:00
Ivan Zlatev 2fdd83da1f 2008-04-07 Ivan N. Zlatev <[email protected]>
* ReflectionPropertyDescriptor.cs: ReadOnlyAttribute has a Default,
	so there is no need for a null reference check. Fixes the attr_ro unused
	value warning during compilation.

svn path=/trunk/mcs/; revision=100000
2008-04-07 01:25:00 +00:00
Ivan Zlatev 389a0cfbb0 2008-03-28 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs: Do not return parent type properties, where the child
        has used "new" and also changed the property return type. The problem was that
        Type.GetProperties returns both the child and parent property in this case.
        * TypeDescriptorTests.cs: Add an unit test.
        [Fixes bug #374334]


svn path=/trunk/mcs/; revision=99235
2008-03-28 19:29:09 +00:00
Ivan Zlatev e4d5f4fd7f 2008-03-19 Ivan N. Zlatev <[email protected]>
* PropertyTabAttribute.cs: Implement Equals, bugfixes and refactorings.


svn path=/trunk/mcs/; revision=98641
2008-03-19 22:47:42 +00:00
Gert Driesen 186fc79213 * DesignerAttribute.cs: To match MS, throw NRE when designerTypeName argument
is null in ctors. 
 * System_test.dll.sources: Added DesignerAttributeTest.cs.
* DesignerAttributeTest.cs: Added ctor tests.

svn path=/trunk/mcs/; revision=98385
2008-03-15 07:34:51 +00:00
Ivan Zlatev d4d51de52e 2008-03-13 Ivan N. Zlatev <[email protected]>
* DesignerAttribute.cs: For the TypeId strip type name only 
	of the base type to prevent AssemblyQualifiedName and not clashes.
	* TypeDescriptor.cs: GetAttributes should ask for the inherited
	attributes. I was wrong.


svn path=/trunk/mcs/; revision=98113
2008-03-13 01:31:07 +00:00
Ivan Zlatev 4999d6348c 2008-03-10 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs: GetAttributes should not ask the Type
        for the inherited attributes. Until recently it didn't 
        make a difference if we did or not, because 
        Type.GetCustomAttributes never returned inherited such.


svn path=/trunk/mcs/; revision=97827
2008-03-09 23:56:14 +00:00
Ivan Zlatev 5336a0e898 2008-03-06 Ivan N. Zlatev <[email protected]>
* Container.cs: On disposal unsite the component first before 
	disposing in order to prevent it from asking us to remove it 
	through the Site property.
	[Fixes bugs #367653 and #367583]


svn path=/trunk/mcs/; revision=97611
2008-03-06 19:20:09 +00:00
Ivan Zlatev be577e6514 2008-03-01 Ivan N. Zlatev <[email protected]>
* Component.cs: Do not set the Site to null on disposing as this
        is the Containers job. Instead try to remove from Container if sited.


svn path=/trunk/mcs/; revision=97093
2008-03-01 21:40:48 +00:00
Ivan Zlatev 18e9712b24 2008-02-26 Ivan N. Zlatev <[email protected]>
* PropertyDescriptor.cs: 
         - Implement CreateInstance and GetTypeFromName
         and refactor GetEditor and Converter use them.
         - Drop TypeDescriptor.GetTypeFromName as we also want to check the
         ComponentType assembly, which it doesn't do.
        * TypeDescriptor.cs: Make GetTypeFromName private as it is no longer
        used from the outside.
        * PropertyDescriptorTests.cs: Add Converter tests. Based on a 
        patch by Andy Hume <[email protected]> under the MIT/X11 
        license.
        * System_test.dll.sources: Add Consts.cs so that tests can use it
        (e.g for specifying assembly qualified type names in attributes).


svn path=/trunk/mcs/; revision=96687
2008-02-26 20:39:05 +00:00
Gert Driesen 15d9f261e9 * CharConverter.cs: Use trimmed value in FormatException.
* CharConverterTest.cs: Fixed test to pass on MS.
* PropertyDescriptorTest.cs: Added test for Attributes.

svn path=/trunk/mcs/; revision=96683
2008-02-26 19:27:46 +00:00
Ivan Zlatev 37fe380bcc 2008-02-26 Ivan N. Zlatev <[email protected]>
* ReflectionPropertyDescriptor.cs: Use Attribute.GetCustomAttributes
	instead of PropertyInfo.GetCustomAttributes as the latter will not 
	retrieve inherited attributes.
	[Fixes bug #322464]


svn path=/trunk/mcs/; revision=96633
2008-02-26 13:09:43 +00:00
Gert Driesen 21d318379c * CharConverterTest.cs: Added tests for ConvertFrom and ConvertTo.
* CultureInfoConverterTest.cs: Added tests for ConvertFrom and
ConvertTo.
* CharConverter.cs (ConvertFrom): Avoid NRE when value is null.
Provide more info when left of value > 1.
* CultureInfoConverter.cs (ConvertFrom): Avoid NRE when value is null.
On 2.0 profile, use case-sensitive comparison for (Default) value.
Use case-insensitive comparing when value is considered as displayname.
Provide more info in exception message.
(ConvertTo): Use '(Default)' instead of '(default)' for invariant
culture.
* System_test.dll.sources: Added CharConverterTest.cs and
CultureInfoConverterTest.cs.

svn path=/trunk/mcs/; revision=95995
2008-02-17 19:08:47 +00:00
Ivan Zlatev 5c4ba113af 2008-02-16 Ivan N. Zlatev <[email protected]>
* CharConverter.cs: 
	 - Handle \0 char.
	 - Trim the ConvertFrom string
	 - Handle null string in ConvertFrom as \0 char.
	 [Fixes bug #362112]


svn path=/trunk/mcs/; revision=95930
2008-02-16 21:54:53 +00:00
Ivan Zlatev 8dc5fa3bc4 2008-02-16 Ivan N. Zlatev <[email protected]>
* CultureInfoConverter.cs:
	 - Handle "(default)" to and from conversion
	 - Sort cultures alphabetically and also cache them.
	 [Fixes bug #362113]


svn path=/trunk/mcs/; revision=95916
2008-02-16 20:18:47 +00:00
Ivan Zlatev 48d09aa40c 2008-02-16 Ivan N. Zlatev <[email protected]>
* TypeDescriptor.cs, PropertyDescriptor.cs: 
	Do not throw when can't find Type from string.
	* ReferenceConverter.cs: Convert null value from and to string.
	Return an empty StandardValueCollection.
	[Part of fix for bugs #360666 and #358332]


svn path=/trunk/mcs/; revision=95874
2008-02-16 14:29:53 +00:00
Ivan Zlatev a00d95a1a7 2008-02-04 Ivan N. Zlatev <[email protected]>
* DateTimeConverter.cs: handle empty strings in ConvertFrom.
	 * DateTimeConverterTests.cs: Test ConvertFrom with empty string.


svn path=/trunk/mcs/; revision=94810
2008-02-04 23:03:36 +00:00
Rolf Bjarne Kvinge 35211604e6 * System.ComponentModel/MaskedTextProvider.cs,
Test/System.ComponentModel/MaskedTextProviderTest.cs: Fix
  IsPassword (found by Gendarme)

svn path=/trunk/mcs/; revision=93313
2008-01-19 11:26:12 +00:00
Sebastien Pouliot e80a8e2e77 2008-01-07 Sebastien Pouliot <[email protected]>
* CultureInfoConverter.cs: Gendarme's AvoidToStringOnStringsRule in
	ConvertFrom method.
	* DesignerAttribute.cs: Gendarme's AvoidToStringOnStringsRule in 
	TypeId getter.


svn path=/trunk/mcs/; revision=92423
2008-01-07 23:24:10 +00:00
Ivan Zlatev 73ade2bcd4 2008-01-04 Ivan N. Zlatev <[email protected]>
* ReflectionPropertyDescriptor.cs: Create Transactions with 
        descriptions when setting/resetting the property.


svn path=/trunk/mcs/; revision=92223
2008-01-04 00:30:05 +00:00
Gert Driesen 9e100ebe8f * Component.cs: Moved Site property before Container to match MS. This
allows a unit test for ordered result of TypeDescriptor.GetProperties
to pass.
* TypeDescriptorProperties.cs: added test for order of 
PropertyDescriptor instances returned by GetProperties.

svn path=/trunk/mcs/; revision=92200
2008-01-03 18:53:19 +00:00
Vladimir Krasnov ae83bfe05f * TypeDescriptor.cs: fixed properties order in returning collections in PropertyDescriptorCollection
svn path=/trunk/mcs/; revision=92187
2008-01-03 16:25:53 +00:00
Vladimir Krasnov 697eb249dc * PropertyDescriptorCollection.cs: optimized Find method, removed culture sensitive string comparison
* PropertyDescriptorCollectionTests.cs: added test for Find method

svn path=/trunk/mcs/; revision=91873
2007-12-25 10:17:47 +00:00
Dick Porter 6ffa6c9dbc 2007-12-19 Dick Porter <[email protected]>
* Process.cs: Check that the process has been started before
	getting or setting the priority class.  Fixes bug 348415.

2007-12-19  Dick Porter  <[email protected]>

	* Win32Exception.cs: Add text for error 5, Access denied.



svn path=/trunk/mcs/; revision=91629
2007-12-19 14:25:14 +00:00
Arina Itkes 7c81b3ab52 Changes in ChangeLog moved to their place
svn path=/trunk/mcs/; revision=90650
2007-12-04 11:01:39 +00:00
Gert Driesen d904080ad7 * System_test.dll.sources: Added Win32ExceptionTest.cs.
* Win32Exception.cs: Do not pass native error to base ctors.
* Win32ExceptionTest.cs: Added ctor tests.

svn path=/trunk/mcs/; revision=90633
2007-12-04 10:43:32 +00:00
Gert Driesen 9150d90702 * MemberDescriptor.cs: Spaces to tabs, code formatting.
* PropertyDescriptor.cs: When adding or removing a new handler for an 
existing component, update the hashtable. In GetValueChangedHandler,
return null if component is null.
* PropertyDescriptorTests.cs: Added tests for AddValueChanged,
GetInvocationTarget, GetValueChangedHandler and RemoveValueChanged.

svn path=/trunk/mcs/; revision=89659
2007-11-15 09:25:50 +00:00
Atsushi Eno 4e7b243d6f 2007-11-12 Atsushi Enomoto <[email protected]>
* PropertyDescriptor.cs : implement GetValueChangedHandler().
	* ToolboxItemFilterAttribute.cs : implement ToString().


svn path=/trunk/mcs/; revision=89453
2007-11-12 09:40:14 +00:00
Gert Driesen 93905517cd * InvalidEnumArgumentExceptionTest.cs: Added ctor tests.
* InvalidEnumArgumentException.cs: Fixed default ctor. Modified
message on 2.0 profile for ctor (string, int, Type) to match MS.
* System_test.dll.sources: Added InvalidEnumArgumentExceptionTest.cs.

svn path=/trunk/mcs/; revision=88787
2007-11-03 14:13:27 +00:00
Atsushi Eno 6d007bebd8 2007-10-29 Atsushi Enomoto <[email protected]>
* AttributeCollection.cs : implemented FromExisting().
	* Container.cs : implemented ValidateName() support.
	* ContainerFilterService.cs : FilterComponents() does nothing.
	* InstanceCreationEditor.cs : implemented get_Text().

	* ContainerTest.cs : added test for ValidateName().


svn path=/trunk/mcs/; revision=88388
2007-10-29 15:30:55 +00:00
Atsushi Eno fb6c6bc52c 2007-09-27 Atsushi Enomoto <[email protected]>
* TypeDescriptor.cs : added missing ObsoleteAttribute.
	* MemberDescriptor.cs, PropertyDescriptor.cs :
	  implemented GetInvocationTarget().


svn path=/trunk/mcs/; revision=86524
2007-09-27 18:10:32 +00:00
Jonathan Pobst 7dc885163c 2007-09-25 Jonathan Pobst <[email protected]>
* SynchronizationContext.cs: Implement SetSynchronizationContext.

2007-09-25  Jonathan Pobst  <[email protected]>

	* AsyncOperationManager.cs: Tie the SynchronizationContext here to
	SynchronizationContext.Current.

2007-09-25  Jonathan Pobst  <[email protected]>

	* AsyncOperationManagerTest.cs: Add test for SynchronizationContext.

2007-09-25  Jonathan Pobst  <[email protected]>

	* System_test.dll.sources: Added AsyncOperationManagerTest.cs.

svn path=/trunk/mcs/; revision=86329
2007-09-25 14:38:37 +00:00
Gert Driesen ff7a12fe63 * System_test.dll.sources: Added ComponentResourceManagerTest.cs.
* ComponentResourceManager.cs: In ApplyResources, when culture is
null use CurrentUICulture. Use hashtable, which is case-insensitive
when IgnoreCase is true, to store the resources of the specified
culture and its parent(s). When IgnoreCase is set, perform a
case-insensitive lookup of property. Ignore resources that have no
value, or where the value is not an instance of the property type.
Fixes bug #82674.
* ComponentResourceManagerTest.cs: Added tests for ctors,
ApplyResources and IgnoreCase.

svn path=/trunk/mcs/; revision=85910
2007-09-17 17:24:04 +00:00
Gert Driesen 2593ef8f9a * EnumConverterTest.cs: Enabled test for converting flag enum from
string. Made tests less strict.
* EnumConverter.cs: Added support for converting flag enum from
string.
* System_test.dll.sources: Added EnumConverterTest.cs.

svn path=/trunk/mcs/; revision=85365
2007-09-05 14:48:28 +00:00
Gert Driesen b24bda0e8b * TypeConverter.cs: Fixed GetConvertFromException and
GetConvertToException to match MS, and use these in ConvertFrom and
ConvertTo.
* EnumConverter.cs: Use IsFlags instead of duplicating code that 
checks for FlagsAttribute. When converting to InstanceDescriptor and
no corresponding enum field is found, then let base class throw a
NotSupportedException.
* TypeConverterTest.cs: Added tests for GetConvertFromException and
GetConvertToException.
* EnumConverterTest.cs: Enabled test for converting flag enums to
InstanceDescriptor. 

svn path=/trunk/mcs/; revision=85092
2007-08-31 09:10:28 +00:00
Ivan Zlatev e503bc3377 2007-08-30 Ivan N. Zlatev <[email protected]>
* EnumConverter.cs: Implemented conversion to InstanceDescriptor
        for enums with a FlagsAttribute. Fixes #82118.


svn path=/trunk/mcs/; revision=85069
2007-08-30 19:40:43 +00:00
Ivan Zlatev 03db1d8407 2007-08-29 Ivan N. Zlatev <[email protected]>
* ParentControlDesigner.cs: implemented.
	* IUISelectionService.cs: implemented.
	* WndProcRouter.cs: implemented.
	* SelectionFrame.cs: implemented.
	* ControlDesigner.cs: implemented.
	* ControlDataObject.cs: implemented.
	* ComponentTray.cs: implemented.
	* ScrollableControlDesigner.cs: implemented.
	* UISelectionService.cs: implemented.
	* SplitContainerDesigner.cs: implemented.
	* IMessageReceiver.cs: implemented.
	* Native.cs: implemented.
	* DocumentDesigner.cs: implemented.
	* DefaultSerializationProviderAttribute.cs: implemented.
	* ComponentSerializationService.cs: implemented.
	* MemberRelationship.cs: implemented.
        * SerializationStore.cs: implemented.
	* DesignSurfaceManager.cs: implemented.
	* DesignerEventService.cs: implemented.
	* ComponentDesigner.cs: implemented.
	* ActiveDesignSurfaceChangedEventHandler.cs: implemented.
	* LoadedEventHandler.cs: implemented.
	* DesignSurfaceCollection.cs: implemented.
	* DesignerHost.cs: implemented.
	* ExtenderService.cs: implemented.
	* DesignModeSite.cs: implemented.
	* SelectionService.cs: implemented.
	* DesignSurfaceServiceContainer.cs: implemented.
	* DesignerActionListCollection.cs: implemented.
	* ActiveDesignSurfaceChangedEventArgs.cs: implemented.
	* LoadedEventArgs.cs: implemented.
	* TypeDescriptorFilterService.cs: implemented.
	* ReferenceService.cs: implemented.
	* DesignSurface.cs: implemented.
	* DesignSurfaceEventHandler.cs: implemented.
	* DesignModeNestedContainer.cs: implemented.
	* EventBindingService.cs: implemented.
	* DesignSurfaceEventArgs.cs: implemented.
	* DesignerOptionService.cs: implemented.
	* ITreeDesigner.cs: implemented.
	* CodeDomComponentSerializationService.cs: implemented.
	* CollectionCodeDomSerializer.cs: implemented.
	* CodeDomDesignerLoader.cs: implemented.
	* CodeDomSerializationProvider.cs: implemented.
	* ComponentCodeDomSerializer.cs: implemented.
	* RootContext.cs: implemented.
	* BasicDesignerLoader.cs: implemented.
	* DesignerSerializationManager.cs: implemented.
	* EnumCodeDomSerializer.cs: implemented.
	* SerializeAbsoluteContext.cs: implemented.
	* MemberCodeDomSerializer.cs: implemented.
	* PrimitiveCodeDomSerializer.cs: implemented.
	* CodeDomSerializerBase.cs: implemented.
	* CodeDomSerializer.cs: implemented.
	* ExpressionContext.cs: implemented.
	* EventCodeDomSerializer.cs: implemented.
	* TypeCodeDomSerializer.cs: implemented.
	* ObjectStatementCollection.cs: implemented.
	* RootCodeDomSerializer.cs: implemented.
	* PropertyCodeDomSerializer.cs: implemented.
	* StatementContext.cs: implemented.


svn path=/trunk/mcs/; revision=85023
2007-08-29 19:19:04 +00:00