dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing Pen.cs,1.1,1.2


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing Pen.cs,1.1,1.2
Date: Mon, 04 Aug 2003 02:32:30 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Drawing
In directory subversions:/tmp/cvs-serv23447/System.Drawing

Modified Files:
        Pen.cs 
Log Message:


Get and set brush properties on pens.


Index: Pen.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing/Pen.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Pen.cs      7 Jun 2003 22:40:57 -0000       1.1
--- Pen.cs      4 Aug 2003 06:32:28 -0000       1.2
***************
*** 103,117 ****
                                }
                        }
-       [TODO]
        public Brush Brush
                        {
                                get
                                {
!                                       // TODO
                                        return brush;
                                }
                                set
                                {
!                                       // TODO
                                }
                        }
--- 103,123 ----
                                }
                        }
        public Brush Brush
                        {
                                get
                                {
!                                       if(brush == null)
!                                       {
!                                               brush = new SolidBrush(color);
!                                       }
                                        return brush;
                                }
                                set
                                {
!                                       if(brush != value)
!                                       {
!                                               Dispose();
!                                               brush = value;
!                                       }
                                }
                        }
***************
*** 120,123 ****
--- 126,133 ----
                                get
                                {
+                                       if(brush is SolidBrush)
+                                       {
+                                               return 
((SolidBrush)brush).Color;
+                                       }
                                        return color;
                                }
***************
*** 128,131 ****
--- 138,142 ----
                                                Dispose();
                                                color = value;
+                                               brush = null;
                                        }
                                }
***************
*** 269,279 ****
                                }
                        }
-       [TODO]
        public PenType PenType
                        {
                                get
                                {
!                                       // TODO
!                                       return PenType.SolidColor;
                                }
                        }
--- 280,311 ----
                                }
                        }
        public PenType PenType
                        {
                                get
                                {
!                                       if(brush == null || brush is SolidBrush)
!                                       {
!                                               return PenType.SolidColor;
!                                       }
!                                       else if(brush is TextureBrush)
!                                       {
!                                               return PenType.TextureFill;
!                                       }
!                                       else if(brush is HatchBrush)
!                                       {
!                                               return PenType.HatchFill;
!                                       }
!                                       else if(brush is PathGradientBrush)
!                                       {
!                                               return PenType.PathGradient;
!                                       }
!                                       else if(brush is LinearGradientBrush)
!                                       {
!                                               return PenType.LinearGradient;
!                                       }
!                                       else
!                                       {
!                                               return PenType.SolidColor;
!                                       }
                                }
                        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]