From 0e57ff8832e0480dd28d7d6bd49372d005f55068 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Fri, 7 Aug 2009 20:01:53 +0000 Subject: 2009-08-07 Rodrigo Kumpera * ListBindingHelper.cs: Fix the 1.0 build by making this type available under that profile. svn path=/trunk/mcs/; revision=139587 --- .../System.Windows.Forms/ChangeLog | 5 +++++ .../System.Windows.Forms/ListBindingHelper.cs | 25 ++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'mcs/class') diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index f4b6148ca1a..4721c24fcee 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2009-08-07 Rodrigo Kumpera + + * ListBindingHelper.cs: Fix the 1.0 build by making this type available + under that profile. + 2009-08-07 Ivan N. Zlatev * CurrencyManager.cs: Remove duplicate code. diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingHelper.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingHelper.cs index 6408eee43d0..2200779c5a4 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingHelper.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingHelper.cs @@ -29,12 +29,18 @@ using System.ComponentModel; using System.Reflection; #if NET_2_0 - using System.Collections.Generic; +#endif namespace System.Windows.Forms { - public static class ListBindingHelper + +#if NET_2_0 + public +#else + internal +#endif + static class ListBindingHelper { public static object GetList (object list) { @@ -100,7 +106,11 @@ namespace System.Windows.Forms if (enumerator.MoveNext () && enumerator.Current != null) return enumerator.Current.GetType (); - if (dataSource is IList || dataSource.GetType () == typeof (IList<>)) { + if (dataSource is IList +#if NET_2_0 + || dataSource.GetType () == typeof (IList<>) +#endif + ) { PropertyInfo property = GetPropertyByReflection (dataSource.GetType (), "Item"); if (property != null) // `Item' could be interface-explicit, and thus private return property.PropertyType; @@ -136,8 +146,11 @@ namespace System.Windows.Forms // Take into account only the first property Type property_type = listAccessors [0].PropertyType; - if (typeof (IList).IsAssignableFrom (property_type) || - typeof (IList<>).IsAssignableFrom (property_type)) { + if (typeof (IList).IsAssignableFrom (property_type) +#if NET_2_0 + || typeof (IList<>).IsAssignableFrom (property_type) +#endif + ) { PropertyInfo property = GetPropertyByReflection (property_type, "Item"); return TypeDescriptor.GetProperties (property.PropertyType); @@ -187,5 +200,3 @@ namespace System.Windows.Forms } } } - -#endif -- cgit v1.2.3