Author: calberto
Date: 2008-02-11 15:07:58 -0500 (Mon, 11 Feb 2008)
New Revision: 95461

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-11  Carlos Alberto Cortez <[EMAIL PROTECTED]>

        * Binding.cs: Implement 2.0 DataSourceNullValue property.



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-11 19:47:56 UTC (rev 95460)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs       
2008-02-11 20:07:58 UTC (rev 95461)
@@ -52,6 +52,7 @@
 #if NET_2_0
                private DataSourceUpdateMode datasource_update_mode;
                private ControlUpdateMode control_update_mode;
+               private object datasource_null_value;
                //private object null_value;
                //private string format_string;
                //private IFormatProvider format_info;
@@ -170,6 +171,16 @@
                        }
                }
 
+               [DefaultValue (null)]
+               public object DataSourceNullValue {
+                       get {
+                               return datasource_null_value;
+                       }
+                       set {
+                               datasource_null_value = value;
+                       }
+               }
+
                [DefaultValue (false)]
                public bool FormattingEnabled {
                        get {
@@ -457,6 +468,10 @@
                                return e.Value;
                        if (e.Value == Convert.DBNull)
                                return e.Value;
+#if NET_2_0
+                       if (e.Value == null)
+                               return data_type.IsByRef ? null : 
Convert.DBNull;
+#endif
 
                        return ConvertData (e.Value, data_type);
                }

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-11 19:47:56 UTC (rev 95460)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-11 20:07:58 UTC (rev 95461)
@@ -1,3 +1,7 @@
+2008-02-11  Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
+       * Binding.cs: Implement 2.0 DataSourceNullValue property.
+
 2008-02-11  Ivan N. Zlatev  <[EMAIL PROTECTED]>
 
        * PropertyGridView.cs:

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

Reply via email to