2009-04-12 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Sat, 12 Apr 2008 19:52:31 +0000 (19:52 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Sat, 12 Apr 2008 19:52:31 +0000 (19:52 -0000)
* Binding.cs: Call UpdateIsBinding when setting control - probably
Binding is already usable and we don't need to wait to check the
IsBinding state. Also for 1.1 profile use IsHandleCreated instead of
Created, just like 2.0 does.
* CurrencyManager.cs: I'm so lame - the previous check was wrong.

svn path=/trunk/mcs/; revision=100522

mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/CurrencyManager.cs

index 78929d5075fee6b7a98b6672db4570cdc630bcc8..31c4a8204d424bd05b142fa5eea5c0ad68f487f3 100644 (file)
@@ -337,6 +337,7 @@ namespace System.Windows.Forms {
                                prop_changed_event.AddEventHandler (control, new EventHandler (ControlPropertyChangedHandler));
 #endif
                        this.control = control;
+                       UpdateIsBinding ();
                }
 
                internal void Check ()
@@ -452,7 +453,7 @@ namespace System.Windows.Forms {
 #if NET_2_0
                        if (control == null || (control is Control && !((Control)control).IsHandleCreated))
 #else
-                       if (control == null && !control.Created)
+                       if (control == null && !control.IsHandleCreated)
 #endif
                                return;
 
index ab8bcaeabe58243bb9afdb785404264ca594eebb..946a12601305c410117b9d681ad23eea7ed5fd51 100644 (file)
@@ -1,3 +1,11 @@
+2009-04-12  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * Binding.cs: Call UpdateIsBinding when setting control - probably
+       Binding is already usable and we don't need to wait to check the
+       IsBinding state. Also for 1.1 profile use IsHandleCreated instead of
+       Created, just like 2.0 does.
+       * CurrencyManager.cs: I'm so lame - the previous check was wrong.
+
 2009-04-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
 
        * Binding.cs: Just realized we don't need to have a handler for
index 9202d37244b3b570df71ffee425a1c40f3ddc67b..b0fb3e7a3fc199e2b4b4c8c11079e987bcb223d9 100644 (file)
@@ -159,7 +159,10 @@ namespace System.Windows.Forms {
                 internal override bool IsSuspended {
                         get {
                                // Always return true if we don't have items
-                               return Count > 0 && binding_suspended;
+                               if (Count == 0)
+                                       return true;
+
+                               return binding_suspended;
                        }
                 }