Author: rolf
Date: 2007-07-20 13:48:34 -0400 (Fri, 20 Jul 2007)
New Revision: 82379

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
Log:
Committing patch from Ivan N. Zlatev <[EMAIL PROTECTED]>.



Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs    
2007-07-20 17:45:17 UTC (rev 82378)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs    
2007-07-20 17:48:34 UTC (rev 82379)
@@ -209,6 +209,11 @@
                        }
                }
 
+               internal bool ShouldSerializeImage ()
+               {
+                       return this.Image != null;
+               }
+
                [Localizable(true)]
                [DefaultValue(ContentAlignment.MiddleCenter)]
                [MWFDescription("Sets the alignment of the image to be 
displayed on button face"), MWFCategory("Appearance")]

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-07-20 17:45:17 UTC (rev 82378)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-07-20 17:48:34 UTC (rev 82379)
@@ -1,3 +1,9 @@
+2007-07-20  Ivan N. Zlatev  <[EMAIL PROTECTED]>
+
+       * Control.cs, Form.cs, ContainerControl.cs,
+       ScrollableControl.cs, ButtonBase.cs:  Added ShouldSerialize
+       for misc properties.
+
 2007-07-20  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * TreeNode.cs: Implement StateImageIndex and StateImageKey.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs  
    2007-07-20 17:45:17 UTC (rev 82378)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs  
    2007-07-20 17:48:34 UTC (rev 82379)
@@ -588,6 +588,11 @@
                        }
                }
 
+               internal bool ShouldSerializeAutoValidate ()
+               {
+                       return this.AutoValidate != AutoValidate.Inherit;
+               }
+
                static object OnValidateChanged = new object ();
 
                protected virtual void OnAutoValidateChanged (EventArgs e)

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-07-20 17:45:17 UTC (rev 82378)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-07-20 17:48:34 UTC (rev 82379)
@@ -2049,7 +2049,7 @@
 
 #if NET_2_0
                [Browsable (false)]
-               [DefaultValue ("{X=0,Y=0}")]
+               [DefaultValue (typeof (Point), "0, 0")]
                [EditorBrowsable (EditorBrowsableState.Advanced)]
                public virtual Point AutoScrollOffset {
                        get {
@@ -2102,6 +2102,11 @@
                        }
                }
 
+               internal bool ShouldSerializeMaximumSize ()
+               {
+                       return this.MaximumSize != DefaultMaximumSize;
+               }
+
                public virtual Size MinimumSize {
                        get {
                                return minimum_size;
@@ -2113,6 +2118,11 @@
                                }
                        }
                }
+
+               internal bool ShouldSerializeMinimumSize ()
+               {
+                       return this.MinimumSize != DefaultMinimumSize;
+               }
 #endif // NET_2_0
 
                [DispId(-501)]
@@ -2144,6 +2154,11 @@
                        }
                }
 
+               internal bool ShouldSerializeBackColor ()
+               {
+                       return this.BackColor != DefaultBackColor;
+               }
+
                [Localizable(true)]
                [DefaultValue(null)]
                [MWFCategory("Appearance")]
@@ -2460,6 +2475,10 @@
                        }
                }
 
+               internal bool ShouldSerializeCursor ()
+               {
+                       return this.Cursor != Cursors.Default;
+               }
 
                
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
                [ParenthesizePropertyName(true)]
@@ -2596,6 +2615,11 @@
                        }
                }
 
+               internal bool ShouldSerializeEnabled ()
+               {
+                       return this.Enabled != true;
+               }
+
                [EditorBrowsable(EditorBrowsableState.Advanced)]
                [Browsable(false)]
                
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -2635,6 +2659,11 @@
                        }
                }
 
+               internal bool ShouldSerializeFont ()
+               {
+                       return !this.Font.Equals (DefaultFont);
+               }
+
                [DispId(-513)]
                [MWFCategory("Appearance")]
                public virtual Color ForeColor {
@@ -2657,6 +2686,11 @@
                        }
                }
 
+               internal bool ShouldSerializeForeColor ()
+               {
+                       return this.ForeColor != DefaultForeColor;
+               }
+
                [DispId(-515)]
                [Browsable(false)]
                
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -2724,6 +2758,11 @@
                        }
                }
 
+               internal bool ShouldSerializeImeMode ()
+               {
+                       return this.ImeMode != ImeMode.NoControl;
+               }
+
                [EditorBrowsable(EditorBrowsableState.Advanced)]
                [Browsable(false)]
                
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -2822,6 +2861,11 @@
                        }
                }
 
+               internal bool ShouldSerializeLocation ()
+               {
+                       return this.Location != new Point (0, 0);
+               }
+
 #if NET_2_0
                [Localizable (true)]
                public Padding Margin {
@@ -2833,6 +2877,11 @@
                                }
                        }
                }
+
+               internal bool ShouldSerializeMargin ()
+               {
+                       return this.Margin != DefaultMargin;
+               }
 #endif
 
                [Browsable(false)]
@@ -2866,6 +2915,11 @@
                                }
                        }
                }
+
+               internal bool ShouldSerializePadding ()
+               {
+                       return this.Padding != DefaultPadding;
+               }
 #endif
 
                [Browsable(false)]
@@ -2996,6 +3050,11 @@
                        }
                }
 
+               internal bool ShouldSerializeRightToLeft ()
+               {
+                       return this.RightToLeft != RightToLeft.No;
+               }
+
                [EditorBrowsable(EditorBrowsableState.Advanced)]
                public override ISite Site {
                        get {
@@ -3017,6 +3076,11 @@
                        }
                }
 
+               internal bool ShouldSerializeSite ()
+               {
+                       return false;
+               }
+
                [Localizable(true)]
                [MWFCategory("Layout")]
                public Size Size {
@@ -3029,6 +3093,11 @@
                        }
                }
 
+               internal virtual bool ShouldSerializeSize ()
+               {
+                       return this.Size != DefaultSize;
+               }
+
                [Localizable(true)]
                [MergableProperty(false)]
                [MWFCategory("Behavior")]
@@ -3101,7 +3170,7 @@
                                }
                        }
                }
-               
+
                internal virtual void UpdateWindowText ()
                {
                        if (!IsHandleCreated) {
@@ -3177,6 +3246,11 @@
                        }
                }
 
+               internal bool ShouldSerializeVisible ()
+               {
+                       return this.Visible != true;
+               }
+
                [EditorBrowsable(EditorBrowsableState.Always)]
                [Browsable(false)]
                
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-07-20 17:45:17 UTC (rev 82378)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-07-20 17:48:34 UTC (rev 82379)
@@ -507,6 +507,11 @@
                        }
                }
 
+               internal bool ShouldSerializeAutoScroll ()
+               {
+                       return this.AutoScroll != false;
+               }
+
 #if NET_2_0
                [Browsable (true)]
                [EditorBrowsable (EditorBrowsableState.Always)]
@@ -520,6 +525,11 @@
                                }
                        }
                }
+
+               internal bool ShouldSerializeAutoSize ()
+               {
+                       return this.AutoSize != false;
+               }
                
                [Browsable (true)]
                [Localizable (true)]
@@ -693,6 +703,11 @@
                        }
                }
 
+               internal bool ShouldSerializeIcon ()
+               {
+                       return this.Icon != default_icon;
+               }
+
                [Browsable(false)]
                
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
                public bool IsMdiChild {
@@ -786,7 +801,7 @@
                        }
                }
 
-               [DefaultValue("{Width=0, Height=0}")]
+               [DefaultValue(typeof (Size),"0, 0")]
                [Localizable(true)]
                [RefreshProperties(RefreshProperties.Repaint)]
                [MWFCategory("Layout")]
@@ -1223,6 +1238,11 @@
                        }
                }
 
+               internal bool ShouldSerializeTransparencyKey ()
+               {
+                       return this.TransparencyKey != Color.Empty;
+               }
+
                [DefaultValue(FormWindowState.Normal)]
                [MWFCategory("Layout")]
                public FormWindowState WindowState {

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs 
    2007-07-20 17:45:17 UTC (rev 82378)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs 
    2007-07-20 17:48:34 UTC (rev 82379)
@@ -334,6 +334,11 @@
                        }
                }
 
+               internal bool ShouldSerializeAutoScrollMargin ()
+               {
+                       return this.AutoScrollMargin != new Size (0, 0);
+               }
+
                [Localizable(true)]
                [MWFCategory("Layout")]
                public Size AutoScrollMinSize {
@@ -349,6 +354,11 @@
                        }
                }
 
+               internal bool ShouldSerializeAutoScrollMinSize ()
+               {
+                       return this.AutoScrollMinSize != new Size (0, 0);
+               }
+
                [Browsable(false)]
                
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
                public Point AutoScrollPosition {

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

Reply via email to