2009-07-08 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Wed, 8 Jul 2009 13:13:58 +0000 (13:13 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Wed, 8 Jul 2009 13:13:58 +0000 (13:13 -0000)
* PaperSource.cs: Implement RawKind.
Fixes the remaining bits of #507739.

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

mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog
mcs/class/System.Drawing/System.Drawing.Printing/PaperSource.cs

index e0a7dfdb258771921ee75aebc4cfbd3bc828876c..b15a05ff671e1e5b87b7df9f1229bf36c8114832 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-08  Carlos Alberto Cortez <calberto.cortez@gmail.com> 
+
+       * PaperSource.cs: Implement RawKind.
+       Fixes the remaining bits of #507739.
+
 2009-07-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
 
        * PaperSize.cs: Implement support for RawKind.
index b44db7bc5b911a991799b76de30cdd4e7319d84b..ffd339cac359aea16d7d1b3ab915eb8b06b6fe93 100644 (file)
@@ -68,6 +68,11 @@ namespace System.Drawing.Printing
 
                public PaperSourceKind Kind{
                        get {
+                               // Exactly at 256 (as opposed to Custom, which is 257 and the max value of PaperSourceKind),
+                               // we must return Custom always.
+                               if ((int)kind >= 256)
+                                       return PaperSourceKind.Custom;
+
                                return this.kind; 
                        }
                }
@@ -83,13 +88,12 @@ namespace System.Drawing.Printing
                }
                
 #if NET_2_0
-               [MonoTODO]
                public int RawKind {
                        get {
-                               throw new NotImplementedException ();
+                               return (int)kind;
                        }
                        set {
-                               throw new NotImplementedException ();
+                               kind = (PaperSourceKind)value;
                        }
                }                 
 #endif\r