[Managed.Windows.Forms] Verify that DataMember is valid when setting DataSource
commitf71a3c2683d88d358139d95f9d9ab298ac002bcf
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Fri, 20 Jun 2014 14:35:47 +0000 (20 16:35 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Fri, 20 Jun 2014 14:45:38 +0000 (20 16:45 +0200)
tree83a254e948e03a70abb2e6c1699998f4527e3c7f
parente385d1f039f6cf203c3d895c805631605862022c
[Managed.Windows.Forms] Verify that DataMember is valid when setting DataSource

When DataMember is already set before DataSource we need to verify that it refers to a valid property in the DataSource setter, otherwise we'd get an exception in ResetList ().
This fixes the following failing tests: BindingSourceTest.DataMemberBeforeDataSource and BindingSourceTest.DataSourceAssignToDefaultType.

Commit licensed under MIT/X11.
mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingSource.cs