Use CoreFX sources for System.Printing (#5041)
authorFrederik Carlier <frederik.carlier@quamotion.mobi>
Thu, 15 Jun 2017 22:57:02 +0000 (00:57 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 15 Jun 2017 22:57:02 +0000 (00:57 +0200)
19 files changed:
mcs/class/System.Drawing/System.Drawing.Printing/Duplex.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/InvalidPrinterException.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/Margins.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PageSettings.cs
mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PaperSize.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PaperSource.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PaperSourceKind.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PrintRange.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolution.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolutionKind.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PrinterSettings.cs
mcs/class/System.Drawing/System.Drawing.Printing/PrinterUnitConvert.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermission.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermissionAttribute.cs [deleted file]
mcs/class/System.Drawing/System.Drawing.Printing/PrintingServices.cs
mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs
mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesWin32.cs
mcs/class/System.Drawing/System.Drawing.dll.sources

diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/Duplex.cs b/mcs/class/System.Drawing/System.Drawing.Printing/Duplex.cs
deleted file mode 100644 (file)
index bf54ea6..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//\r
-// System.Drawing.Duplex.cs\r
-//\r
-// (C) 2001 Ximian, Inc.  http://www.ximian.com\r
-// Author: Dennis Hayes (dennish@raytek.com)\r
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;\r
-namespace System.Drawing.Printing \r
-{
-       [Serializable]
-       public enum Duplex {\r
-               Default = -1,\r
-               Horizontal = 3,\r
-               Simplex = 1,\r
-               Vertical = 2\r
-       }\r
-}\r
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/InvalidPrinterException.cs b/mcs/class/System.Drawing/System.Drawing.Printing/InvalidPrinterException.cs
deleted file mode 100644 (file)
index 7fd127c..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.Drawing.InvalidPrinterExecption.cs
-//
-// Author:
-//   Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Drawing.Printing {
-
-       [Serializable]
-       public class InvalidPrinterException : SystemException {
-
-//             private PrinterSettings settings;
-
-               public InvalidPrinterException (PrinterSettings settings): base(InvalidPrinterException.GetMessage(settings))
-               {
-//                     this.settings = settings;
-               }
-
-#if !NETSTANDARD1_6
-               protected InvalidPrinterException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-
-               public override void GetObjectData (SerializationInfo info, StreamingContext context)
-               {
-                       if (info == null)
-                               throw new ArgumentNullException ("info");
-
-                       base.GetObjectData (info, context);
-               }
-#endif
-
-               private static string GetMessage(PrinterSettings settings)
-               {
-                       if (settings.PrinterName == null || settings.PrinterName == String.Empty)
-                               return "No Printers Installed";
-                       return String.Format("Tried to access printer '{0}' with invalid settings.", settings.PrinterName);                             
-               }
-       }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/Margins.cs b/mcs/class/System.Drawing/System.Drawing.Printing/Margins.cs
deleted file mode 100644 (file)
index c5bc069..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// System.Drawing.Margins.cs
-//
-// Authors:
-//   Dennis Hayes (dennish@Raytek.com)
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//   Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2002 Ximian, Inc
-// Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.ComponentModel;
-
-namespace System.Drawing.Printing
-{
-       [Serializable]
-       [TypeConverter (typeof (MarginsConverter))]
-       public class Margins : ICloneable {
-               int left;
-               int right;
-               int top;
-               int bottom;
-
-               public Margins ()
-               {
-                       left = 100;
-                       right = 100;
-                       top = 100;
-                       bottom = 100;
-               }
-
-               public Margins (int left, int right, int top, int bottom)
-               {
-                       Left = left;
-                       Right = right;
-                       Top = top;
-                       Bottom = bottom;
-               }
-
-               public int Left {
-                       get {
-                               return left;
-                       }
-                       set {
-                               if (value < 0)
-                                       InvalidMargin ("left");
-                               left = value;
-                       }
-               }
-
-               public int Right {
-                       get {
-                               return right;
-                       }
-                       set {
-                               if (value < 0)
-                                       InvalidMargin ("right");
-                               right = value;
-                       }
-               }
-
-               public int Top {
-                       get {
-                               return top;
-                       }
-                       set {
-                               if (value < 0)
-                                       InvalidMargin ("top");
-                               top = value;
-                       }
-               }
-
-               public int Bottom {
-                       get {
-                               return bottom;
-                       }
-                       set {
-                               if (value < 0)
-                                       InvalidMargin ("bottom");
-                               bottom = value;
-                       }
-               }
-
-               private void InvalidMargin (string property)
-               {
-                       string msg = Locale.GetText ("All Margins must be greater than 0");
-                       throw new System.ArgumentException (msg, property);
-               }
-               
-               public object Clone ()
-               {
-                       return new Margins (left, right, top, bottom);
-               }
-
-               public override bool Equals (object obj)
-               {       
-                       return Equals (obj as Margins);
-               }
-
-               private bool Equals (Margins m)
-               {
-                       // avoid recursion with == operator
-                       if ((object)m == null)
-                               return false;
-                       return ((m.Left == left) && (m.Right == right) && (m.Top == top) && (m.Bottom == bottom));
-               }
-
-               public override int GetHashCode ()
-               {
-                       return left | (right << 8) | (right >> 24) | (top << 16) | (top >> 16) | (bottom << 24) | (bottom >> 8);
-               }
-               
-               public override string ToString ()
-               {
-                       string ret = "[Margins Left={0} Right={1} Top={2} Bottom={3}]";
-                       return String.Format (ret, left, right, top, bottom);
-               }
-
-               public static bool operator == (Margins m1, Margins m2)
-               {
-                       // avoid recursion with == operator
-                       if ((object)m1 == null)
-                               return ((object)m2 == null);
-                       return m1.Equals (m2);
-               }
-
-               public static bool operator != (Margins m1, Margins m2)
-               {
-                       // avoid recursion with == operator
-                       if ((object)m1 == null)
-                               return ((object)m2 != null);
-                       return !m1.Equals (m2);
-               }
-       }
-}
index 00bb942e78b70b724d9ae7c5e2bb9e8dbccff6fc..330ba62a2d8e2053cf1b03aaa959f9e4236b595a 100644 (file)
@@ -199,10 +199,10 @@ namespace System.Drawing.Printing
                public object Clone ()
                {
                        // We do a deep copy
-                       PrinterResolution pres = new PrinterResolution (this.printerResolution.X, this.printerResolution.Y, this.printerResolution.Kind);
-                       PaperSource psource = new PaperSource (this.paperSource.SourceName, this.paperSource.Kind);
+                       PrinterResolution pres = new PrinterResolution (this.printerResolution.Kind, this.printerResolution.X, this.printerResolution.Y);
+                       PaperSource psource = new PaperSource (this.paperSource.Kind, this.paperSource.SourceName);
                        PaperSize psize = new PaperSize (this.paperSize.PaperName, this.paperSize.Width, this.paperSize.Height);
-                       psize.SetKind (this.paperSize.Kind);
+                       psize.RawKind = (int)this.paperSize.Kind;
 
                        PageSettings ps = new PageSettings (this.printerSettings, this.color, this.landscape,
                                        psize, psource, pres);
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs
deleted file mode 100644 (file)
index d9fb602..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-//\r
-// System.Drawing.PaperKind.cs\r
-//\r
-// (C) 2002 Ximian, Inc.  http://www.ximian.com\r
-// Author: Dennis Hayes (dennish@raytek.com)\r
-//\r
-\r
-//\r
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-using System;\r
-\r
-namespace System.Drawing.Printing \r
-{\r
-       [Serializable]\r
-       public enum PaperKind\r
-       {\r
-               A2 = 66,\r
-               A3 = 8,\r
-               A3Extra = 63,\r
-               A3ExtraTransverse = 68,\r
-               A3Rotated = 76,\r
-               A3Transverse = 67,\r
-               A4 = 9,\r
-               A4Extra = 53,\r
-               A4Plus = 60,\r
-               A4Rotated = 77,\r
-               A4Small = 10,\r
-               A4Transverse = 55,\r
-               A5 = 11,\r
-               A5Extra = 64,\r
-               A5Rotated = 78,\r
-               A5Transverse = 61,\r
-               A6 = 70,\r
-               A6Rotated = 83,\r
-               APlus = 57,\r
-               B4 = 12,\r
-               B4Envelope = 33,\r
-               B4JisRotated = 79,\r
-               B5 = 13,\r
-               B5Envelope = 34,\r
-               B5Extra = 65,\r
-               B5JisRotated = 80,\r
-               B5Transverse = 62,\r
-               B6Envelope = 35,\r
-               B6Jis = 88,\r
-               B6JisRotated = 89,\r
-               BPlus = 58,\r
-               C3Envelope = 29,\r
-               C4Envelope = 30,\r
-               C5Envelope = 28,\r
-               C65Envelope = 32,\r
-               C6Envelope = 31,\r
-               CSheet = 24,\r
-               Custom = 0,\r
-               DLEnvelope = 27,\r
-               DSheet = 25,\r
-               ESheet = 26,\r
-               Executive = 7,\r
-               Folio = 14,\r
-               GermanLegalFanfold = 41,\r
-               GermanStandardFanfold = 40,\r
-               InviteEnvelope = 47,\r
-               IsoB4 = 42,\r
-               ItalyEnvelope = 36,\r
-               JapaneseDoublePostcard = 69,\r
-               JapaneseDoublePostcardRotated = 82,\r
-               JapaneseEnvelopeChouNumber3 = 73,\r
-               JapaneseEnvelopeChouNumber3Rotated = 86,\r
-               JapaneseEnvelopeChouNumber4 = 74,\r
-               JapaneseEnvelopeChouNumber4Rotated = 87,\r
-               JapaneseEnvelopeKakuNumber2 = 71,\r
-               JapaneseEnvelopeKakuNumber2Rotated = 84,\r
-               JapaneseEnvelopeKakuNumber3 = 72,\r
-               JapaneseEnvelopeKakuNumber3Rotated = 85,\r
-               JapaneseEnvelopeYouNumber4 = 91,\r
-               JapaneseEnvelopeYouNumber4Rotated = 92,\r
-               JapanesePostcard = 43,\r
-               JapanesePostcardRotated = 81,\r
-               Ledger = 4,\r
-               Legal = 5,\r
-               LegalExtra = 51,\r
-               Letter = 1,\r
-               LetterExtra = 50,\r
-               LetterExtraTransverse = 56,\r
-               LetterPlus = 59,\r
-               LetterRotated = 75,\r
-               LetterSmall = 2,\r
-               LetterTransverse = 54,\r
-               MonarchEnvelope = 37,\r
-               Note = 18,\r
-               Number10Envelope = 20,\r
-               Number11Envelope = 21,\r
-               Number12Envelope = 22,\r
-               Number14Envelope = 23,\r
-               Number9Envelope = 19,\r
-               PersonalEnvelope = 38,\r
-               Prc16K = 93,\r
-               Prc16KRotated = 106,\r
-               Prc32K = 94,\r
-               Prc32KBig = 95,\r
-               Prc32KBigRotated = 108,\r
-               Prc32KRotated = 107,\r
-               PrcEnvelopeNumber1 = 96,\r
-               PrcEnvelopeNumber10 = 105,\r
-               PrcEnvelopeNumber10Rotated = 118,\r
-               PrcEnvelopeNumber1Rotated = 109,\r
-               PrcEnvelopeNumber2 = 97,\r
-               PrcEnvelopeNumber2Rotated = 110,\r
-               PrcEnvelopeNumber3 = 98,\r
-               PrcEnvelopeNumber3Rotated = 111,\r
-               PrcEnvelopeNumber4 = 99,\r
-               PrcEnvelopeNumber4Rotated = 112,\r
-               PrcEnvelopeNumber5 = 100,\r
-               PrcEnvelopeNumber5Rotated = 113,\r
-               PrcEnvelopeNumber6 = 101,\r
-               PrcEnvelopeNumber6Rotated = 114,\r
-               PrcEnvelopeNumber7 = 102,\r
-               PrcEnvelopeNumber7Rotated = 115,\r
-               PrcEnvelopeNumber8 = 103,\r
-               PrcEnvelopeNumber8Rotated = 116,\r
-               PrcEnvelopeNumber9 = 104,\r
-               PrcEnvelopeNumber9Rotated = 117,\r
-               Quarto = 15,\r
-               Standard10x11 = 45,\r
-               Standard10x14 = 16,\r
-               Standard11x17 = 17,\r
-               Standard12x11 = 90,\r
-               Standard15x11 = 46,\r
-               Standard9x11 = 44,\r
-               Statement = 6,\r
-               Tabloid = 3,\r
-               TabloidExtra = 52,\r
-               USStandardFanfold = 39\r
-       }\r
-}\r
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PaperSize.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PaperSize.cs
deleted file mode 100644 (file)
index d7d48e1..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// System.Drawing.PaperSize.cs
-//
-// Author:
-//   Dennis Hayes (dennish@Raytek.com)
-//   Herve Poussineau (hpoussineau@fr.st)
-//
-// (C) 2002 Ximian, Inc
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Drawing.Printing
-{
-       /// <summary>
-       /// Summary description for PaperSize.
-       /// </summary>
-       [Serializable]
-       public class PaperSize
-       {
-               string name;
-               int width;
-               int height;
-               PaperKind kind;
-               internal bool is_default;
-               
-               public PaperSize ()
-               {
-
-               }
-               public PaperSize(string name, int width, int height)
-               {
-                       this.width = width;
-                       this.height = height;
-                       this.name = name;
-               }
-
-               internal PaperSize(string name, int width, int height, PaperKind kind, bool isDefault)
-               {
-                       this.width = width;
-                       this.height = height;
-                       this.name = name;
-                       this.is_default = isDefault;
-               }
-
-               public int Width{
-                       get{
-                               return width;
-                       }set
-                        {
-                               if (kind != PaperKind.Custom)
-                                       throw new ArgumentException();
-                                width = value;
-                        }
-               }
-               public int Height{
-                       get{
-                               return height;
-                       }set
-                        {
-                               if (kind != PaperKind.Custom)
-                                       throw new ArgumentException();
-                                height = value;
-                        }
-               }
-
-               public string PaperName{
-                       get{
-                               return name;
-                       }
-                       set{
-                               if (kind != PaperKind.Custom)
-                                       throw new ArgumentException();
-                                name = value;
-                        }
-               }
-       
-               public PaperKind Kind{
-                       get{
-                               // .net ignores the values that are less than 0
-                               // the value returned is not used internally, however.
-                               if (kind > PaperKind.PrcEnvelopeNumber10Rotated)
-                                       return PaperKind.Custom;
-
-                               return kind;
-                       }
-               }
-               public int RawKind {
-                       get {
-                               return (int)kind;
-                       }
-                       set {
-                               kind = (PaperKind)value;
-                       }
-               }
-
-       
-               internal bool IsDefault {
-                       get { return this.is_default; }
-                       set { this.is_default = value; }
-               }
-
-
-               internal void SetKind (PaperKind k) {kind = k;}
-
-               public override string ToString(){
-                       string ret = "[PaperSize {0} Kind={1} Height={2} Width={3}]";
-                       return String.Format(ret, this.PaperName, this.Kind, this.Height, this.Width);
-               }
-       }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PaperSource.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PaperSource.cs
deleted file mode 100644 (file)
index a8db379..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// System.Drawing.PaperSource.cs
-//
-// Author:
-//   Dennis Hayes (dennish@Raytek.com)
-//   Herve Poussineau (hpoussineau@fr.st)
-//
-// (C) 2002 Ximian, Inc
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Drawing.Printing
-{
-       /// <summary>
-       /// Summary description for PaperSource.
-       /// </summary>
-       [Serializable]
-       public class PaperSource
-       {
-               private PaperSourceKind kind;
-               private string source_name;
-               internal bool is_default;
-               
-               public PaperSource ()
-               {
-                       
-               }
-
-               internal PaperSource(string sourceName, PaperSourceKind kind)
-               {
-                       this.source_name = sourceName;
-                       this.kind = kind;
-               }
-
-               internal PaperSource(string sourceName, PaperSourceKind kind, bool isDefault)
-               {
-                       this.source_name = sourceName;
-                       this.kind = kind;
-                       this.is_default = IsDefault;
-               }
-
-               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; 
-                       }
-               }
-               public string SourceName{
-                       get {
-                               return this.source_name;
-                       }
-               set {
-                               this.source_name = value;
-                       }
-               }
-               
-               public int RawKind {
-                       get {
-                               return (int)kind;
-                       }
-                       set {
-                               kind = (PaperSourceKind)value;
-                       }
-               }                 
-
-               internal bool IsDefault {
-                       get { return is_default;}
-                       set { is_default = value;}
-               }
-
-               public override string ToString(){
-                       string ret = "[PaperSource {0} Kind={1}]";
-                       return String.Format(ret, this.SourceName, this.Kind);
-               }
-               
-       }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PaperSourceKind.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PaperSourceKind.cs
deleted file mode 100644 (file)
index 911ae62..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//\r
-// System.Drawing.PaperSourceKind.cs\r
-//\r
-// (C) 2002 Ximian, Inc.  http://www.ximian.com\r
-// Author: Dennis Hayes (dennish@raytek.com)\r
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;\r
-namespace System.Drawing.Printing\r
-{\r
-       [Serializable]
-       public enum PaperSourceKind {\r
-               AutomaticFeed = 7,\r
-               Cassette = 14,\r
-               Custom = 257,\r
-               Envelope = 5,\r
-               FormSource = 15,\r
-               LargeCapacity = 11,\r
-               LargeFormat = 10,\r
-               Lower = 2,\r
-               Manual = 4,\r
-               ManualFeed = 6,\r
-               Middle = 3,\r
-               SmallFormat = 9,\r
-               TractorFeed = 8,\r
-               Upper = 1\r
-       }\r
-}\r
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrintRange.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrintRange.cs
deleted file mode 100644 (file)
index 4998732..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//\r
-// System.Drawing.PrintRange.cs\r
-//\r
-// (C) 2002 Ximian, Inc.  http://www.ximian.com\r
-// Author: Dennis Hayes (dennish@raytek.com)\r
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;\r
-namespace System.Drawing.Printing \r
-{
-       [Serializable]
-       public enum PrintRange {\r
-               AllPages = 0,\r
-               Selection = 1,\r
-               SomePages = 2,
-               CurrentPage = 0x400000
-       }\r
-}\r
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolution.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolution.cs
deleted file mode 100644 (file)
index 5f101cd..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-//\r
-// System.Drawing.Printing.PrinterResolution.cs\r
-//\r
-// Author:\r
-//   Dennis Hayes (dennish@Raytek.com)
-//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)\r
-//\r
-// (C) 2002 Ximian, Inc
-// (C) 2003 Andreas Nahr\r
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;\r
-\r
-namespace System.Drawing.Printing 
-{\r
-
-       [Serializable]
-       public class PrinterResolution 
-       {\r
-               private PrinterResolutionKind kind = PrinterResolutionKind.Custom;\r
-               private int x;\r
-               private int y;
-               
-               public PrinterResolution ()
-               {
-               }
-       
-               internal PrinterResolution (int x, int y, PrinterResolutionKind kind)
-               {
-                       this.x = x;
-                       this.y = y;
-                       this.kind = kind;
-               }
-\r
-               public int X {\r
-                       get {\r
-                               return x;\r
-                       }
-                       set {
-                               x = value;
-                       }
-               }
-\r
-               public int Y {\r
-                       get {\r
-                               return y;\r
-                       }
-                       set {
-                               y = value;
-                       }
-               }
-\r
-               public PrinterResolutionKind Kind {\r
-                       get {\r
-                               return kind;\r
-                       }
-                       set {
-                               kind = value;
-                       }
-               }
-
-               public override string ToString ()
-               {
-                       if (kind != PrinterResolutionKind.Custom)
-                               return "[PrinterResolution " + kind.ToString () +  "]";
-                       
-                       return "[PrinterResolution X=" + x + " Y=" + y + "]";
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolutionKind.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolutionKind.cs
deleted file mode 100644 (file)
index 167df84..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//\r
-// System.Drawing.PrinterResolutionKind.cs\r
-//\r
-// (C) 2002 Ximian, Inc.  http://www.ximian.com\r
-// Author: Dennis Hayes (dennish@raytek.com)\r
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;\r
-namespace System.Drawing.Printing \r
-{
-       [Serializable]
-       public enum PrinterResolutionKind {\r
-               Custom = 0,\r
-               Draft = -1,\r
-               High = -4,\r
-               Low = -2,\r
-               Medium = -3\r
-       }\r
-}\r
index 2f8c27de2eccfda7fbf83eaff9595231e2cc2547..2184fc2050ec4b243858667ae124f00846b3cc0e 100644 (file)
@@ -116,11 +116,11 @@ namespace System.Drawing.Printing
                                if (default_pagesettings == null) {
                                        default_pagesettings = new PageSettings (this,
                                                SupportsColor,
-                                               false,  
-                                               // Real defaults are set by LoadPrinterSettings                         
-                                               new PaperSize("A4", 827, 1169),                                         
-                                               new PaperSource("Tray", PaperSourceKind.FormSource),                                            
-                                               new PrinterResolution(200, 200, PrinterResolutionKind.Medium));
+                                               false,
+                                               // Real defaults are set by LoadPrinterSettings
+                                               new PaperSize("A4", 827, 1169),
+                                               new PaperSource(PaperSourceKind.FormSource, "Tray"),
+                                               new PrinterResolution(PrinterResolutionKind.Medium, 200, 200));
                                }
                                
                                return default_pagesettings;
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrinterUnitConvert.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrinterUnitConvert.cs
deleted file mode 100644 (file)
index 0045206..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// System.Drawing.Printing.PrinterUnitConvert.cs
-//
-// Authors:
-//   Martin Willemoes Hansen (mwh@sysrq.dk)
-//   Herve Poussineau (hpoussineau@fr.st)
-//
-// (C) 2003 Martin Willemoes Hansen
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Drawing.Printing
-{
-       public sealed class PrinterUnitConvert
-       {
-               private PrinterUnitConvert ()
-               {
-               }
-
-               public static double Convert (double value,
-                                             PrinterUnit fromUnit,
-                                             PrinterUnit toUnit)
-               {
-                       switch (fromUnit)
-                       {
-                               case PrinterUnit.Display:
-                                       switch (toUnit)
-                                       {
-                                               case PrinterUnit.Display: return value;
-                                               case PrinterUnit.ThousandthsOfAnInch: return value * 10;
-                                               case PrinterUnit.HundredthsOfAMillimeter: return value * 25.4;
-                                               case PrinterUnit.TenthsOfAMillimeter: return value * 2.54;
-                                       }
-                                       break;
-                               case PrinterUnit.ThousandthsOfAnInch:
-                                       switch (toUnit)
-                                       {
-                                               case PrinterUnit.Display: return value / 10;
-                                               case PrinterUnit.ThousandthsOfAnInch: return value;
-                                               case PrinterUnit.HundredthsOfAMillimeter: return value * 2.54;
-                                               case PrinterUnit.TenthsOfAMillimeter: return value * 0.254;
-                                       }
-                                       break;
-                               case PrinterUnit.HundredthsOfAMillimeter:
-                                       switch (toUnit)
-                                       {
-                                               case PrinterUnit.Display: return value / 25.4;
-                                               case PrinterUnit.ThousandthsOfAnInch: return value / 2.54;
-                                               case PrinterUnit.HundredthsOfAMillimeter: return value;
-                                               case PrinterUnit.TenthsOfAMillimeter: return value / 10;
-                                       }
-                                       break;
-                               case PrinterUnit.TenthsOfAMillimeter:
-                                       switch (toUnit)
-                                       {
-                                               case PrinterUnit.Display: return value / 2.54;
-                                               case PrinterUnit.ThousandthsOfAnInch: return value / 0.254;
-                                               case PrinterUnit.HundredthsOfAMillimeter: return value * 10;
-                                               case PrinterUnit.TenthsOfAMillimeter: return value;
-                                       }
-                                       break;
-                       }
-                       // should never happen
-                       throw new NotImplementedException();
-               }
-
-               public static int Convert (int value,
-                                          PrinterUnit fromUnit,
-                                          PrinterUnit toUnit)
-               {
-                       double rslt;
-                       rslt = Convert ((double) value, fromUnit, toUnit);
-                       return (int) Math.Round (rslt);                 
-
-               }
-
-               public static Margins Convert (Margins value,
-                                              PrinterUnit fromUnit,
-                                              PrinterUnit toUnit)
-               {
-                       return new Margins(
-                               Convert(value.Left, fromUnit, toUnit),
-                               Convert(value.Right, fromUnit, toUnit),
-                               Convert(value.Top, fromUnit, toUnit),
-                               Convert(value.Bottom, fromUnit, toUnit));
-               }
-
-               public static Point Convert (Point value,
-                                            PrinterUnit fromUnit,
-                                            PrinterUnit toUnit)
-               {
-                       return new Point(
-                               Convert(value.X, fromUnit, toUnit),
-                               Convert(value.Y, fromUnit, toUnit));
-               }
-
-               public static Rectangle Convert (Rectangle value,
-                                                PrinterUnit fromUnit,
-                                                PrinterUnit toUnit)
-               {
-                       return new Rectangle(
-                               Convert(value.X, fromUnit, toUnit),
-                               Convert(value.Y, fromUnit, toUnit),
-                               Convert(value.Width, fromUnit, toUnit),
-                               Convert(value.Height, fromUnit, toUnit));
-               }
-
-               public static Size Convert (Size value,
-                                           PrinterUnit fromUnit,
-                                           PrinterUnit toUnit)
-               {
-                       return new Size(
-                               Convert(value.Width, fromUnit, toUnit),
-                               Convert(value.Height, fromUnit, toUnit));
-               }
-       }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermission.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermission.cs
deleted file mode 100644 (file)
index 44e2171..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// System.Drawing.PrintingPermission.cs
-//
-// Authors:
-//     Dennis Hayes (dennish@Raytek.com)
-//     Herve Poussineau (hpoussineau@fr.st)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2002 Ximian, Inc
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Globalization;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Drawing.Printing {
-
-       [Serializable]
-       public sealed class PrintingPermission : CodeAccessPermission, IUnrestrictedPermission {
-
-               private const int version = 1;
-
-               private PrintingPermissionLevel _Level;
-               
-               public PrintingPermission (PermissionState state) 
-               {
-                       if (CheckPermissionState (state, true) == PermissionState.Unrestricted)
-                               _Level = PrintingPermissionLevel.AllPrinting;
-               }
-
-               public PrintingPermission (PrintingPermissionLevel printingLevel) 
-               {
-                       Level = printingLevel;
-               }
-               
-               // properties
-
-               public PrintingPermissionLevel Level{
-                       get { return _Level; }
-                       set {
-                               if (!Enum.IsDefined (typeof (PrintingPermissionLevel), value)) {
-                                       string msg = Locale.GetText ("Invalid enum {0}");
-                                       throw new ArgumentException (String.Format (msg, value), "Level");
-                               }
-                                _Level = value;
-                       }
-               }
-
-               // methods
-
-               public override IPermission Copy ()
-               {
-                       return new PrintingPermission (this.Level);
-               }
-               
-               public override void FromXml (SecurityElement esd)
-               {
-                       CheckSecurityElement (esd, "esd", version, version);
-                       // Note: we do not (yet) care about the return value 
-                       // as we only accept version 1 (min/max values)
-
-                       if (IsUnrestricted (esd))
-                               _Level = PrintingPermissionLevel.AllPrinting;
-                       else {
-                               string level = esd.Attribute ("Level");
-                               if (level != null) {
-                                       _Level = (PrintingPermissionLevel) Enum.Parse (
-                                               typeof (PrintingPermissionLevel), level);
-                               }
-                               else
-                                       _Level = PrintingPermissionLevel.NoPrinting;
-                       }
-               }
-               
-               public override IPermission Intersect (IPermission target)
-               {
-                       PrintingPermission pp = Cast (target);
-                       if ((pp == null) || IsEmpty () || pp.IsEmpty ())
-                               return null;
-
-                       PrintingPermissionLevel level = (_Level <= pp.Level) ? _Level : pp.Level;
-                       return new PrintingPermission (level);
-               }
-               
-               public override bool IsSubsetOf (IPermission target)
-               {
-                       PrintingPermission pp = Cast (target);
-                       if (pp == null)
-                               return IsEmpty ();
-                       
-                       return (_Level <= pp.Level);
-               }
-               
-               public bool IsUnrestricted ()
-               {
-                       return (_Level == PrintingPermissionLevel.AllPrinting);
-               }
-               
-               public override SecurityElement ToXml ()
-               {
-                       SecurityElement se = Element (version);
-                       if (IsUnrestricted ())
-                               se.AddAttribute ("Unrestricted", "true");
-                       else
-                               se.AddAttribute ("Level", _Level.ToString ());
-                       return se;
-               }
-               
-               public override IPermission Union (IPermission target)
-               {
-                       PrintingPermission pp = Cast (target);
-                       if (pp == null)
-                               return new PrintingPermission (_Level);
-                       if (IsUnrestricted () || pp.IsUnrestricted ())
-                               return new PrintingPermission (PermissionState.Unrestricted);
-                       if (IsEmpty () && pp.IsEmpty ())
-                               return null;
-
-                       PrintingPermissionLevel level = (_Level > pp.Level) ? _Level : pp.Level;
-                       return new PrintingPermission (level);
-               }
-
-               // Internal helpers methods
-
-               private bool IsEmpty ()
-               {
-                       return (_Level == PrintingPermissionLevel.NoPrinting);
-               }
-
-               private PrintingPermission Cast (IPermission target)
-               {
-                       if (target == null)
-                               return null;
-
-                       PrintingPermission pp = (target as PrintingPermission);
-                       if (pp == null) {
-                               ThrowInvalidPermission (target, typeof (PrintingPermission));
-                       }
-
-                       return pp;
-               }
-
-               // NOTE: The following static methods should be moved out to a (static?) class 
-               // if (ever) System.Drawing.dll gets more than one permission in it's assembly.
-
-               // snippet moved from FileIOPermission (nickd) to be reused in all derived classes
-               internal SecurityElement Element (int version) 
-               {
-                       SecurityElement se = new SecurityElement ("IPermission");
-                       Type type = this.GetType ();
-                       se.AddAttribute ("class", type.FullName + ", " + type.Assembly.ToString ().Replace ('\"', '\''));
-                       se.AddAttribute ("version", version.ToString ());
-                       return se;
-               }
-
-               internal static PermissionState CheckPermissionState (PermissionState state, bool allowUnrestricted)
-               {
-                       string msg;
-                       switch (state) {
-                       case PermissionState.None:
-                               break;
-                       case PermissionState.Unrestricted:
-                               if (!allowUnrestricted) {
-                                       msg = Locale.GetText ("Unrestricted isn't not allowed for identity permissions.");
-                                       throw new ArgumentException (msg, "state");
-                               }
-                               break;
-                       default:
-                               msg = String.Format (Locale.GetText ("Invalid enum {0}"), state);
-                               throw new ArgumentException (msg, "state");
-                       }
-                       return state;
-               }
-
-               // logic isn't identical to CodeAccessPermission.CheckSecurityElement - see unit tests
-               internal static int CheckSecurityElement (SecurityElement se, string parameterName, int minimumVersion, int maximumVersion) 
-               {
-                       if (se == null)
-                               throw new ArgumentNullException (parameterName);
-
-                       string c = se.Attribute ("class");
-                       if (c == null) {
-                               string msg = Locale.GetText ("Missing 'class' attribute.");
-                               throw new ArgumentException (msg, parameterName);
-                       }
-                       // we assume minimum version if no version number is supplied
-                       int version = minimumVersion;
-                       string v = se.Attribute ("version");
-                       if (v != null) {
-                               try {
-                                       version = Int32.Parse (v);
-                               }
-                               catch (Exception e) {
-                                       string msg = Locale.GetText ("Couldn't parse version from '{0}'.");
-                                       msg = String.Format (msg, v);
-                                       throw new ArgumentException (msg, parameterName, e);
-                               }
-                       }
-
-                       if ((version < minimumVersion) || (version > maximumVersion)) {
-                               string msg = Locale.GetText ("Unknown version '{0}', expected versions between ['{1}','{2}'].");
-                               msg = String.Format (msg, version, minimumVersion, maximumVersion);
-                               throw new ArgumentException (msg, parameterName);
-                       }
-                       return version;
-               }
-
-               // must be called after CheckSecurityElement (i.e. se != null)
-               internal static bool IsUnrestricted (SecurityElement se) 
-               {
-                       string value = se.Attribute ("Unrestricted");
-                       if (value == null)
-                               return false;
-                       return (String.Compare (value, Boolean.TrueString, true, CultureInfo.InvariantCulture) == 0);
-               }
-
-               internal static void ThrowInvalidPermission (IPermission target, Type expected) 
-               {
-                       string msg = Locale.GetText ("Invalid permission type '{0}', expected type '{1}'.");
-                       msg = String.Format (msg, target.GetType (), expected);
-                       throw new ArgumentException (msg, "target");
-               }
-       }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermissionAttribute.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermissionAttribute.cs
deleted file mode 100644 (file)
index 35ecd54..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.Drawing.PrintingPermissionAttribute.cs
-//
-// Authors:
-//     Dennis Hayes (dennish@Raytek.com)
-//     Herve Poussineau (hpoussineau@fr.st)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2002 Ximian, Inc
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Drawing.Printing {
-
-       [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
-       // strangely this class isn't [Serializable] like other permission classes
-       public sealed class PrintingPermissionAttribute : CodeAccessSecurityAttribute {
-
-               private PrintingPermissionLevel _level;
-               
-               public PrintingPermissionAttribute (SecurityAction action)
-                       : base (action)
-               {
-                       // seems to always assign PrintingPermissionLevel.NoPrinting ...
-               }
-               
-               public PrintingPermissionLevel Level {
-                       get { return _level; }
-                       set {
-                               if (!Enum.IsDefined (typeof (PrintingPermissionLevel), value)) {
-                                       string msg = Locale.GetText ("Invalid enum {0}");
-                                       throw new ArgumentException (String.Format (msg, value), "Level");
-                               }
-                               _level = value;
-                       }
-               }
-               
-               public override IPermission CreatePermission ()
-               {
-                       if (base.Unrestricted)
-                               return new PrintingPermission (PermissionState.Unrestricted);
-                       else
-                               return new PrintingPermission (_level);
-               }
-       }
-}
index 5eb31d5e1f0b985f11a110804173bbaab3af5203..762792395a313c83765324e971d203b0c674393d 100644 (file)
@@ -54,10 +54,10 @@ namespace System.Drawing.Printing
                
                internal void LoadDefaultResolutions (PrinterSettings.PrinterResolutionCollection col)
                {
-                       col.Add (new PrinterResolution ((int) PrinterResolutionKind.High, -1, PrinterResolutionKind.High));
-                       col.Add (new PrinterResolution ((int) PrinterResolutionKind.Medium, -1, PrinterResolutionKind.Medium));
-                       col.Add (new PrinterResolution ((int) PrinterResolutionKind.Low, -1, PrinterResolutionKind.Low));
-                       col.Add (new PrinterResolution ((int) PrinterResolutionKind.Draft, -1, PrinterResolutionKind.Draft));
+                       col.Add (new PrinterResolution (PrinterResolutionKind.High, (int) PrinterResolutionKind.High, -1));
+                       col.Add (new PrinterResolution (PrinterResolutionKind.Medium, (int) PrinterResolutionKind.Medium, -1));
+                       col.Add (new PrinterResolution (PrinterResolutionKind.Low, (int) PrinterResolutionKind.Low, -1));
+                       col.Add (new PrinterResolution (PrinterResolutionKind.Draft, (int) PrinterResolutionKind.Draft, -1));
                }
                #endregion
        }
index 3386004199ab9f792f69a9357c0d9020317beda5..859f726e7b4d2ee2f4197b49b964532faa11720a 100644 (file)
@@ -433,7 +433,7 @@ namespace System.Drawing.Printing
                                return null;
                        }
 
-                       return new PrinterResolution (x_resolution, y_resolution, PrinterResolutionKind.Custom);
+                       return new PrinterResolution (PrinterResolutionKind.Custom, x_resolution, y_resolution);
                }
 
                /// <summary>
@@ -452,7 +452,7 @@ namespace System.Drawing.Printing
                        PPD_SIZE size;
                        PaperSize ps;
 
-                       PaperSize defsize = new PaperSize ("A4", 827, 1169, GetPaperKind (827, 1169), true);
+                       PaperSize defsize = new PaperSize (GetPaperKind (827, 1169), "A4", 827, 1169);
                        ppd = (PPD_FILE) Marshal.PtrToStructure (ppd_handle, typeof (PPD_FILE));
                        ptr = ppd.sizes;
                        float w, h;
@@ -462,8 +462,8 @@ namespace System.Drawing.Printing
                                w = size.width * 100 / 72;
                                h = size.length * 100 / 72;
                                PaperKind kind = GetPaperKind ((int) w, (int) h);
-                               ps = new PaperSize (real_name, (int) w, (int) h, kind, def_size == kind.ToString ());
-                               ps.SetKind (kind);
+                               ps = new PaperSize (kind, real_name, (int) w, (int) h);
+                               ps.RawKind = (int)kind;
                                if (def_size == ps.Kind.ToString ())
                                        defsize = ps;
                                settings.paper_sizes.Add (ps);
@@ -507,7 +507,7 @@ namespace System.Drawing.Printing
                                                kind = PaperSourceKind.Custom;
                                                break;
                                }
-                               settings.paper_sources.Add (new PaperSource (paper_sources[source], kind, def_source == source));
+                               settings.paper_sources.Add (new PaperSource (kind, paper_sources[source]));
                                if (def_source == source)
                                        defsource = settings.paper_sources[settings.paper_sources.Count-1];
                        }
index 66c3a58e18e61ca508d93831be1d5b3d5af558ef..c070eb675995794fbefde7d3098ff256cb2f10ad 100644 (file)
@@ -139,7 +139,7 @@ namespace System.Drawing.Printing
                                        y = Marshal.ReadInt32 (ptr);
                                        ptr = new IntPtr (ptr.ToInt64 () + Marshal.SizeOf (y));
                                        settings.PrinterResolutions.Add (new PrinterResolution
-                                               (x,y, PrinterResolutionKind.Custom));
+                                               (PrinterResolutionKind.Custom, x, y));
                                }
                        }
                        Marshal.FreeHGlobal (buff);
@@ -197,7 +197,7 @@ namespace System.Drawing.Printing
                                        ptr_sizes_enum = new IntPtr (ptr_sizes_enum.ToInt64 () + 2);
 
                                        ps = new PaperSize (name, x,y);
-                                       ps.SetKind (kind);
+                                       ps.RawKind = (int)kind;
                                        settings.PaperSizes.Add (ps);
                                }
                        }
@@ -261,7 +261,7 @@ namespace System.Drawing.Printing
                                for (int i = 0; i < ret; i++) {
                                        name  = Marshal.PtrToStringUni (ptr_names);
                                        kind = (PaperSourceKind) Marshal.ReadInt16 (ptr_bins);
-                                       settings.PaperSources.Add (new PaperSource (name, kind));
+                                       settings.PaperSources.Add (new PaperSource (kind, name));
 
                                        ptr_names = new IntPtr (ptr_names.ToInt64 () + 24 * 2);
                                        ptr_bins = new IntPtr (ptr_bins.ToInt64 () + 2);
index 0516f278c95944977969c84b081fb08566b57502..097b6cabc982f3ce751de57e7f27406802fc4a89 100755 (executable)
@@ -176,36 +176,36 @@ System.Drawing.Imaging/MetaHeader.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Imaging/PropertyItem.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/PropertyItemInternal.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Imaging/WmfPlaceableFileHeader.cs
-System.Drawing.Printing/Duplex.cs
-System.Drawing.Printing/InvalidPrinterException.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/Duplex.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/InvalidPrinterException.cs
 System.Drawing.Printing/MarginsConverter.cs
-System.Drawing.Printing/Margins.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/Margins.cs
 System.Drawing.Printing/PrintingServices.cs
 System.Drawing.Printing/PrintingServicesWin32.cs
 System.Drawing.Printing/PrintingServicesUnix.cs
 System.Drawing.Printing/PageSettings.cs
-System.Drawing.Printing/PaperKind.cs
-System.Drawing.Printing/PaperSize.cs
-System.Drawing.Printing/PaperSource.cs
-System.Drawing.Printing/PaperSourceKind.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PaperKinds.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PaperSize.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PaperSource.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PaperSourceKind.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PreviewPageInfo.cs
 System.Drawing.Printing/PreviewPrintController.cs
 System.Drawing.Printing/PrintController.cs
 System.Drawing.Printing/PrintDocument.cs
-System.Drawing.Printing/PrinterResolution.cs
-System.Drawing.Printing/PrinterResolutionKind.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrinterResolution.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrinterResolutionKind.cs
 System.Drawing.Printing/PrinterSettings.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrinterUnit.cs
-System.Drawing.Printing/PrinterUnitConvert.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrinterUnitConvert.cs
 System.Drawing.Printing/PrintEventArgs.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrintEventHandler.cs
-System.Drawing.Printing/PrintingPermissionAttribute.cs
-System.Drawing.Printing/PrintingPermission.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrintingPermission.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrintingPermissionAttribute.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrintingPermissionLevel.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrintAction.cs
 System.Drawing.Printing/PrintPageEventArgs.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrintPageEventHandler.cs
-System.Drawing.Printing/PrintRange.cs
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/PrintRange.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/QueryPageSettingsEventArgs.cs
 ../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Printing/QueryPageSettingsEventHandler.cs
 System.Drawing.Printing/StandardPrintController.cs