2008-04-19 Ivan N. Zlatev <contact@i-nz.net>
authorIvan Zlatev <ivan@ivanz.com>
Sat, 19 Apr 2008 15:38:39 +0000 (15:38 -0000)
committerIvan Zlatev <ivan@ivanz.com>
Sat, 19 Apr 2008 15:38:39 +0000 (15:38 -0000)
* Form.cs: Add a ValidateChildren for the 1.1 profile. Fixes
the build.

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

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs

index b39022f52d6bc9c377a350d31f07723876fee53b..96fe516db1c3bd04310f32e0179d2969853f2f42 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-19  Ivan N. Zlatev  <contact@i-nz.net>
+
+       * Form.cs: Add a ValidateChildren for the 1.1 profile. Fixes 
+       the build.
+
 2008-04-19  Ivan N. Zlatev  <contact@i-nz.net>
 
        * ListView.cs: Move CalculateDetailsGroupItemsCount to the NET_2_0 
index 16332dd8c50eeba8588840ccf265634f8880ad26..351ed4f5c4a7909655023992a56e87945c1ab148 100644 (file)
@@ -1776,6 +1776,34 @@ namespace System.Windows.Forms {
                {
                        return base.ValidateChildren (validationConstraints);
                }
+#else
+               private bool ValidateChildren ()
+               {
+                       return ValidateChildren (this);
+               }
+
+               private bool ValidateChildren (Control c)
+               {
+                       if (!ValidateControl (c))
+                               return false;
+
+                       foreach (Control child in c.Controls) {
+                               if (!ValidateChildren (child))
+                                       return false;
+                       }
+
+                       return true;
+               }
+
+               private bool ValidateControl (Control c)
+               {
+                       CancelEventArgs e = new CancelEventArgs ();
+                       c.FireValidating (e);
+                       if (e.Cancel)
+                               return false;
+                       c.FireValidated ();
+                       return true;
+               }
 #endif
                #endregion      // Public Instance Methods