Author: calberto
Date: 2008-02-07 22:39:18 -0500 (Thu, 07 Feb 2008)
New Revision: 95218

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
Log:
2008-02-08  Carlos Alberto Cortez <[EMAIL PROTECTED]>

        * Binding.cs: Implement 2.0 ReadValue method and ControlUpdateMode
        property, as well as stubbing DataSourceUpdateMode.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs       
2008-02-08 02:55:26 UTC (rev 95217)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs       
2008-02-08 03:39:18 UTC (rev 95218)
@@ -50,7 +50,8 @@
                private Type data_type;
 
 #if NET_2_0
-               //private DataSourceUpdateMode datasource_update_mode;
+               private DataSourceUpdateMode datasource_update_mode;
+               private ControlUpdateMode control_update_mode;
                //private object null_value;
                //private string format_string;
                //private IFormatProvider format_info;
@@ -89,7 +90,7 @@
                        data_source = dataSource;
                        data_member = dataMember;
                        binding_member_info = new BindingMemberInfo 
(dataMember);
-                       //datasource_update_mode = dataSourceUpdateMode;
+                       datasource_update_mode = dataSourceUpdateMode;
                        //null_value = nullValue;
                        //format_string = formatString;
                        //format_info = formatInfo;
@@ -132,6 +133,18 @@
                        }
                }
 
+#if NET_2_0
+               [DefaultValue (ControlUpdateMode.OnPropertyChanged)]
+               public ControlUpdateMode ControlUpdateMode {
+                       get {
+                               return control_update_mode;
+                       }
+                       set {
+                               control_update_mode = value;
+                       }
+               }
+#endif
+
                public object DataSource {
                        get {
                                return data_source;
@@ -139,6 +152,16 @@
                }
 
 #if NET_2_0
+               [DefaultValue (DataSourceUpdateMode.OnValidation)]
+               public DataSourceUpdateMode DataSourceUpdateMode {
+                       get {
+                               return datasource_update_mode;
+                       }
+                       set {
+                               datasource_update_mode = value;
+                       }
+               }
+
                [DefaultValue (false)]
                public bool FormattingEnabled {
                        get {
@@ -167,6 +190,13 @@
                }
                #endregion      // Public Instance Properties
 
+#if NET_2_0
+               public void ReadValue ()
+               {
+                       PushData (true);
+               }
+#endif
+
                #region Protected Instance Methods
 #if NET_2_0
                protected virtual void OnBindingComplete 
(BindingCompleteEventArgs args)
@@ -260,8 +290,17 @@
 
                internal void PushData ()
                {
+                       PushData (false);
+               }
+
+               void PushData (bool force)
+               {
                        if (manager == null || manager.IsSuspended || 
manager.Current == null)
                                return;
+#if NET_2_0
+                       if (!force && control_update_mode == 
ControlUpdateMode.Never)
+                               return;
+#endif
 
                        if (is_null_desc != null) {
                                bool is_null = (bool) is_null_desc.GetValue 
(manager.Current);

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-08 02:55:26 UTC (rev 95217)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-08 03:39:18 UTC (rev 95218)
@@ -1,3 +1,8 @@
+2008-02-08  Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
+       * Binding.cs: Implement 2.0 ReadValue method and ControlUpdateMode
+       property, as well as stubbing DataSourceUpdateMode.
+
 2008-02-08  Andreia Gaita <[EMAIL PROTECTED]>
 
        * Form.cs: When closing forms, get focus back to the active control of 
the

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

Reply via email to