Author: jackson
Date: 2005-03-07 16:51:54 -0500 (Mon, 07 Mar 2005)
New Revision: 41540

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
Log:
        * Binding.cs: Push data pushes from data -> property. Check if the
        property is readonly when attempting to set it.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs       
2005-03-07 21:05:24 UTC (rev 41539)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs       
2005-03-07 21:51:54 UTC (rev 41540)
@@ -150,7 +150,9 @@
 
                internal void PushData ()
                {
-                       SetControlValue (data);
+                       data = prop_desc.GetValue (control);
+                       data = FormatData (data);
+                       SetPropertyValue (data);
                }
 
                internal void PullData ()
@@ -181,6 +183,14 @@
                        prop_desc.SetValue (control, data);
                }
 
+               private void SetPropertyValue (object data)
+               {
+                       PropertyDescriptor pd = TypeDescriptor.GetProperties 
(manager.Current).Find (data_member, true);
+                       if (pd.IsReadOnly)
+                               return;
+                       pd.SetValue (manager.Current, data);
+               }
+
                private void CurrentChangedHandler ()
                {
                        if (changed_event != null) {

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-07 21:05:24 UTC (rev 41539)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-07 21:51:54 UTC (rev 41540)
@@ -1,5 +1,10 @@
 2005-03-07  Jackson Harper  <[EMAIL PROTECTED]>
 
+       * Binding.cs: Push data pushes from data -> property. Check if the
+       property is readonly when attempting to set it.
+
+2005-03-07  Jackson Harper  <[EMAIL PROTECTED]>
+
        * Binding.cs: Format and parse data correctly. Use ASsignableFrom
        instead of IsSubclassOf. Pulling data now sets the value on the
        control.

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

Reply via email to