Added missing attributes to relevent classes and corrected coding style mistakes...
authorRavindra <ravindra@mono-cvs.ximian.com>
Sat, 10 Jan 2004 09:05:31 +0000 (09:05 -0000)
committerRavindra <ravindra@mono-cvs.ximian.com>
Sat, 10 Jan 2004 09:05:31 +0000 (09:05 -0000)
svn path=/trunk/mcs/; revision=21895

23 files changed:
mcs/class/System.Drawing/System.Drawing/ChangeLog
mcs/class/System.Drawing/System.Drawing/ContentAlignment.cs
mcs/class/System.Drawing/System.Drawing/FontStyle.cs
mcs/class/System.Drawing/System.Drawing/GraphicsUnit.cs
mcs/class/System.Drawing/System.Drawing/Image.cs
mcs/class/System.Drawing/System.Drawing/KnownColor.cs
mcs/class/System.Drawing/System.Drawing/Pen.cs
mcs/class/System.Drawing/System.Drawing/PointConverter.cs
mcs/class/System.Drawing/System.Drawing/PointF.cs
mcs/class/System.Drawing/System.Drawing/RectangleConverter.cs
mcs/class/System.Drawing/System.Drawing/RectangleF.cs
mcs/class/System.Drawing/System.Drawing/RotateFlipType.cs
mcs/class/System.Drawing/System.Drawing/SizeF.cs
mcs/class/System.Drawing/System.Drawing/SolidBrush.cs
mcs/class/System.Drawing/System.Drawing/StringAligment.cs
mcs/class/System.Drawing/System.Drawing/StringDigitSubstitute.cs
mcs/class/System.Drawing/System.Drawing/StringFormat.cs
mcs/class/System.Drawing/System.Drawing/StringFormatFlags.cs
mcs/class/System.Drawing/System.Drawing/StringTrimming.cs
mcs/class/System.Drawing/System.Drawing/StringUnit.cs
mcs/class/System.Drawing/System.Drawing/SystemBrushes.cs
mcs/class/System.Drawing/System.Drawing/SystemPens.cs
mcs/class/System.Drawing/System.Drawing/ToolboxBitmapAttribute.cs

index 7bf0d00a13fd2e19945544993618c230cc2d8a2f..09405a720a8c18b07d436202dbbb957962e6d5ce 100644 (file)
@@ -1,4 +1,22 @@
+2004-01-10  Ravindra  <rkumar@novell.com>
+
+       * All Enums: Made serializable.
+
+       * Image.cs: Corrected signature of Dispose(bool) method.
+
+       * Pen.cs, SolidBrush.cs, SystemPens.cs, SystemBrushes.cs: 
+       Corrected coding style mistakes of my previous commit.
+
+       * PointConverter.cs, RectangleConverter.cs: Inherit TypeConverter.
+
+       * PointF.cs, RectangleF.cs, SizeF.cs: Made serializable.
+
+       * StringFormat.cs: Inherits MarshalByRefObject.
+
+       * ToolboxBitmapAttribute.cs: Added missing attribute [AttributeUsage].
+
 2004-01-08  Ravindra  <rkumar@novell.com>
+
        * Pen.cs: Added isModifiable (bool) variable. It is required to
        make Pens created by SystemPens.cs unmodifiable. All property
        setters are modified for this.
index 3227fbb26707556c3501621fcfc7bd201f8f0613..04913bab787c5793b59d3f22a7c0f978e6776a15 100644 (file)
@@ -10,6 +10,7 @@ using System.ComponentModel;
 
 namespace System.Drawing 
 {
+       [Serializable]
        [Editor ("System.Drawing.Design.ContentAlignmentEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
        public enum ContentAlignment {
                TopLeft      = 0x001,
index ab019be9ee9fefb5e195d083860e7c33817ac8d7..5d36043127830cd2f0bc591b88246346ecf8193a 100644 (file)
@@ -10,6 +10,7 @@ using System;
 namespace System.Drawing 
 {
        [Flags]
+       [Serializable]
        public enum FontStyle {
                Regular   = 0,
                Bold      = 1,
index 0b8f239ebcb2505e9b9ba08953a675a1ee3e15fe..1b9cc27f4aaf2f3010070932b4e1a0378f24f123 100644 (file)
@@ -8,6 +8,7 @@
 using System;
 namespace System.Drawing 
 {
+       [Serializable]
        public enum GraphicsUnit {
                World      = 0,
                Display    = 1,
index 258d5177a07414254dcda7b59418e412c7638ea2..1be86bf13b2d0429857959ab1299d0fa152e66f4 100644 (file)
@@ -351,7 +351,7 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
                GDIPlus.GdipDisposeImage (nativeObject);
        }
        
-       void Dispose (bool disposing)
+       protected virtual void Dispose (bool disposing)
        {
                if (nativeObject != (IntPtr) 0){
                        DisposeResources ();
index 53d325c394325596ed380caf7dd2c4cd870f2346..0ab320ee563b5490d2be6bc9734aa288ddf16fb6 100644 (file)
@@ -10,6 +10,7 @@
 using System;
 namespace System.Drawing 
 {
+       [Serializable]
        public enum KnownColor {
                ActiveBorder = 1,
                ActiveCaption = 2,
index 3359f30f8f805f91b6ca93921980cc6cbd00ab85..3b412223f7f5e0c79682d263ee5cfd7440a0ccdd 100755 (executable)
@@ -61,7 +61,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenMode (nativeObject, value);
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
 
                        }
                }
@@ -80,7 +80,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenBrushFill (nativeObject, value.nativeObject);
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                        }
                }
 
@@ -96,7 +96,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenColor (nativeObject, value.ToArgb ());
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                        }
                }
 
@@ -128,7 +128,7 @@ namespace System.Drawing {
 //                                 Marshal.FreeHGlobal (tmp);
 //                              }
 //                              else
-//                                throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+//                                throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                         }
                 }
 
@@ -170,7 +170,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenDashCap (nativeObject, value);
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                         }
                 }
 
@@ -187,7 +187,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenDashOffset (nativeObject, value);
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                         }
                 }
 
@@ -217,7 +217,7 @@ namespace System.Drawing {
                                        Marshal.FreeHGlobal (tmp);
                                }
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                         }
                 }
 
@@ -233,7 +233,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenDashStyle (nativeObject, value);
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                        }
                }
 
@@ -251,7 +251,7 @@ namespace System.Drawing {
 //                     if (isModifiable)
 //                             GDIPlus.GdipSetPenStartCap (nativeObject, value);
 //                     else
-//                             throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+//                             throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                        }
                }
  
@@ -269,7 +269,7 @@ namespace System.Drawing {
 //                     if (isModifiable)
 //                             GDIPlus.GdipSetPenEndCap (nativeObject, value);
 //                     else
-//                             throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+//                             throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                        }
                }
  
@@ -285,7 +285,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenLineJoin (nativeObject, value);
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                         }
                                 
                 }
@@ -302,7 +302,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenMiterLimit (nativeObject, value);
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                         }
                                 
                 }
@@ -319,7 +319,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenTransform (nativeObject, value);
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                         }
                 }
 
@@ -333,7 +333,7 @@ namespace System.Drawing {
                                if (isModifiable)
                                        GDIPlus.GdipSetPenWidth (nativeObject, value);
                                else
-                                       throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                        }
                }
 
@@ -356,7 +356,7 @@ namespace System.Drawing {
                        if (isModifiable)
                                GDIPlus.GdipDeletePen (nativeObject);
                        else
-                               throw new ArgumentException("You may not change this Pen because it does not belong to you.");
+                               throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
                }
 
                ~Pen ()
index f9258ae15b5361da8a83c44b182a57b92e59e5b5..9c1f64f9e33aa5c9e18758368a9c9513c1e45cf6 100644 (file)
@@ -7,13 +7,14 @@
 // (C) 2002 Ximian, Inc\r
 //\r
 using System;\r
+using System.ComponentModel;
 \r
 namespace System.Drawing\r
 {\r
        /// <summary>\r
        /// Summary description for PointConverter.\r
        /// </summary>\r
-       public class PointConverter\r
+       public class PointConverter : TypeConverter\r
        {\r
                public PointConverter()\r
                {\r
index 1a6c0f9fd080a2701cd404dcfa31ce78fa03cb69..d749d00ed5673f14c81fb193fc4b4ea7b9470852 100644 (file)
@@ -12,6 +12,7 @@ using System.Runtime.InteropServices;
 
 namespace System.Drawing {
        
+       [Serializable]
        [ComVisible (true)]
        public struct PointF { 
                
index a6f60dcbe13f761f029add8307d223af4595fcc7..058e1f7a721800bcce0294af0e88f67a0370f4c5 100644 (file)
@@ -7,13 +7,14 @@
 // (C) 2002 Ximian, Inc\r
 //\r
 using System;\r
+using System.ComponentModel;
 \r
 namespace System.Drawing\r
 {\r
        /// <summary>\r
        /// Summary description for RectangleConverter.\r
        /// </summary>\r
-       public class RectangleConverter\r
+       public class RectangleConverter : TypeConverter\r
        {\r
                public RectangleConverter()\r
                {\r
index cfe4a7313edc1ff02369490cc570f9468f607bd3..cebcc3de470b63ece9c0450454bc57bfa38fb552 100644 (file)
@@ -11,6 +11,7 @@ using System;
 
 namespace System.Drawing {
        
+       [Serializable]
        public struct RectangleF { 
                
                // Private position and size fields.
index 8ef9db4428420aa2d20ab47cf4fc581a53783c72..b2d2ca3f579587e743b9e504fa72966dacc80c4c 100644 (file)
@@ -8,6 +8,7 @@
 using System;
 namespace System.Drawing 
 {
+       [Serializable]
        public enum RotateFlipType {
                RotateNoneFlipNone = 0,
                Rotate180FlipXY    = 0,
index 1e51b4fb650e6c0643e5c861595b675162a2a0a0..6971b70d54171abe5c6e152225cae749730172b0 100644 (file)
@@ -12,6 +12,7 @@ using System.Runtime.InteropServices;
 
 namespace System.Drawing {
 
+       [Serializable]
        [ComVisible (true)]
        public struct SizeF { 
                
index eeda450c7580eb02de52fc10ce70453fa81d3e57..6131e52da6331d249bd879843c4e08349e91595b 100644 (file)
@@ -37,7 +37,7 @@ namespace System.Drawing
                                if (isModifiable)
                                        color = value;
                                else
-                                       throw new ArgumentException("You may not change this Brush because it does not belong to you.");
+                                       throw new ArgumentException ("You may not change this Brush because it does not belong to you.");
                        }
                }
                
@@ -51,7 +51,7 @@ namespace System.Drawing
                        if (isModifiable)
                                GDIPlus.GdipDeleteBrush (nativeObject);
                        else
-                               throw new ArgumentException("You may not change this Brush because it does not belong to you.");
+                               throw new ArgumentException ("You may not change this Brush because it does not belong to you.");
                }
        }
 }
index a3e4695bf71765b1fd1bc926b98b010fb2e87263..b26e8ee429a90afc500b63d6f09012a0b5c67683 100644 (file)
@@ -9,6 +9,7 @@
 using System;
 namespace System.Drawing 
 {
+       [Serializable]
        public enum StringAlignment {
                Center = 1,
                Far = 2,
index e15c748c8f7008aebb2d7033bb950d32a55a1a94..63fe5b103e9e7ffcdb0391cd2ae437c05a5a83bf 100644 (file)
@@ -9,6 +9,7 @@
 using System;
 namespace System.Drawing 
 {
+       [Serializable]
        public enum StringDigitSubstitute {
                User        = 0,
                None        = 1,
index 7614b8f24bdd4bb59ee445b4dcb3f508a46e1412..151aa93964a1282f8f4e5d29ef3f97ecf8dfb824 100644 (file)
@@ -16,7 +16,7 @@ namespace System.Drawing
        /// <summary>\r
        /// Summary description for StringFormat.\r
        /// </summary>\r
-       public sealed class StringFormat : IDisposable, ICloneable\r
+       public sealed class StringFormat : MarshalByRefObject, IDisposable, ICloneable\r
        {\r
                private static StringFormat genericDefault;\r
                StringAlignment alignment;\r
index 6a0f0adb7113694fec8e4b3d25c395b079cd738c..16caecf11389b53ca0386275e36619d1e06474b3 100644 (file)
@@ -10,6 +10,7 @@ using System;
 namespace System.Drawing 
 {
        [Flags]
+       [Serializable]
        public enum StringFormatFlags {
                DirectionRightToLeft  = 0x0001,
                DirectionVertical     = 0x0002,
index 24274401ca6dd9ce0e153910c3a21bad4be3d289..30bb3de983b5d24306be63f22978bc1cf6b3897f 100644 (file)
@@ -9,6 +9,7 @@
 using System;
 namespace System.Drawing 
 {
+       [Serializable]
        public enum  StringTrimming {
                None              = 0,
                Character         = 1,
index 2d5f95c98c5ff72a15e72bc28ec29dc4b33e9bb3..78bca64fe3b6a9c3dcad0044d64603fc134a8f11 100644 (file)
@@ -9,6 +9,7 @@
 using System;
 namespace System.Drawing 
 {
+       [Serializable]
        public enum  StringUnit{
                World      = 0x00,
                Display    = 0x01,
index 4be82cc43533778d33d3a08cc2796365ae0b38f2..dda60f68a7ee6009f025a64abac83badd16a35b3 100644 (file)
@@ -278,7 +278,7 @@ namespace System.Drawing
                public static Brush FromSystemColor (Color c) 
                {
                        if (c.IsSystemColor) {
-                               SolidBrush newBrush = new SolidBrush(c);
+                               SolidBrush newBrush = new SolidBrush (c);
                                newBrush.isModifiable = false;
                                return newBrush;
                        }
index c19b3077e056a9124e6c293f090528eabb3ff513..07293597feadb49589a157934b3fb2bba0c349d8 100644 (file)
@@ -208,8 +208,8 @@ namespace System.Drawing
                \r
                public static Pen FromSystemColor (Color c)\r
                {\r
-                       if(c.IsSystemColor) {\r
-                               Pen newPen = new Pen(c);\r
+                       if (c.IsSystemColor) {\r
+                               Pen newPen = new Pen (c);\r
                                newPen.isModifiable = false;\r
                                return newPen;\r
                        }\r
index b02abf40324f83181a2af2966b20cd25fa6ed563..1e0ba66c7f10130f7e2b9f0b71f7c607bd18557f 100644 (file)
@@ -13,6 +13,7 @@ namespace System.Drawing
        /// <summary>\r
        /// Summary description for ToolboxBitmapAttribute.\r
        /// </summary>\r
+       [AttributeUsage (AttributeTargets.Class)]\r
        public class ToolboxBitmapAttribute : Attribute\r
        {\r
                public ToolboxBitmapAttribute(string imageFile)\r