Author: jackson
Date: 2005-04-01 13:36:22 -0500 (Fri, 01 Apr 2005)
New Revision: 42473

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyManager.cs
Log:
        * Binding.cs: Handle null data members when pulling data.
        * PropertyManager.cs: Handle the data member being a property 
that
        does not exist.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs       
2005-04-01 17:52:35 UTC (rev 42472)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs       
2005-04-01 18:36:22 UTC (rev 42473)
@@ -165,9 +165,14 @@
                                }
                        }
 
-                       PropertyDescriptor pd = TypeDescriptor.GetProperties 
(manager.Current).Find (data_member, true);
-                       object pulled = pd.GetValue (manager.Current);
-                       data = ParseData (pulled, pd.PropertyType);
+                       if (data_member != null) {
+                               PropertyDescriptor pd = 
TypeDescriptor.GetProperties (manager.Current).Find (data_member, true);
+                               object pulled = pd.GetValue (manager.Current);
+                               data = ParseData (pulled, pd.PropertyType);
+                       } else {
+                               object pulled = manager.Current;
+                               data = ParseData (pulled, pulled.GetType ());
+                       }
 
                        data = FormatData (data);
                        SetControlValue (data);

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-01 17:52:35 UTC (rev 42472)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-01 18:36:22 UTC (rev 42473)
@@ -1,3 +1,9 @@
+2005-04-01  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * Binding.cs: Handle null data members when pulling data.
+       * PropertyManager.cs: Handle the data member being a property that
+       does not exist.
+
 2005-04-01  Jordi Mas i Hernandez <[EMAIL PROTECTED]>
 
        * DataGridTextBoxColumn.cs: fixes signature

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyManager.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyManager.cs   
    2005-04-01 17:52:35 UTC (rev 42472)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyManager.cs   
    2005-04-01 18:36:22 UTC (rev 42473)
@@ -34,7 +34,7 @@
                private string property_name;
                private PropertyDescriptor prop_desc;
                private bool binding_suspended;
-               
+
                internal PropertyManager (object data_source, string 
property_name)
                {
                        this.data_source = data_source;
@@ -43,7 +43,8 @@
                        prop_desc = TypeDescriptor.GetProperties 
(data_source).Find (property_name, true);
 
                        if (prop_desc == null)
-                               throw new ArgumentException ("Property does not 
exist");
+                               return;
+
                        prop_desc.AddValueChanged (data_source, new 
EventHandler (PropertyChangedHandler));
                }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to