2004-02-07 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
authorAndreas N <andreas@mono-cvs.ximian.com>
Sun, 8 Feb 2004 07:59:06 +0000 (07:59 -0000)
committerAndreas N <andreas@mono-cvs.ximian.com>
Sun, 8 Feb 2004 07:59:06 +0000 (07:59 -0000)
* Margins.cs: Restyled, implemented missing members
* PageSettings.cs: Added missing attributes, stubbed,
  fixed a few small issues
* PreviewPrintController.cs: Stubbed, small issues fixed
* PrintController.cs: Marked unfinished, restyled
* PrintDocument.cs: Added attributes
* PrinterResolution.cs: Added missing method
* PrinterSettings.cs: Mono-stylyzed, fixed signatures,
  removed commented out values
* PrinterUnitConvert.cs: Added private constructor
* StandardPrintController.cs: Little restyling
* PaperKind.cs: Added missing enum values

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

mcs/class/System.Drawing/System.Drawing.Printing/Margins.cs
mcs/class/System.Drawing/System.Drawing.Printing/PageSettings.cs
mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs
mcs/class/System.Drawing/System.Drawing.Printing/PreviewPrintController.cs
mcs/class/System.Drawing/System.Drawing.Printing/PrintController.cs
mcs/class/System.Drawing/System.Drawing.Printing/PrintDocument.cs
mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolution.cs
mcs/class/System.Drawing/System.Drawing.Printing/PrinterSettings.cs
mcs/class/System.Drawing/System.Drawing.Printing/PrinterUnitConvert.cs
mcs/class/System.Drawing/System.Drawing.Printing/StandardPrintController.cs

index e97148cc1ab964607262f61f88fbc608a036542f..f5d6bb6edf70b3d6cfa5a217e70b3cbcd4d4cf8d 100644 (file)
@@ -1,52 +1,46 @@
 //
 // System.Drawing.Margins.cs
 //
-// Author:
+// Authors:
 //   Dennis Hayes (dennish@Raytek.com)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
 //
 // (C) 2002 Ximian, Inc
 //
-using System;
 
-namespace System.Drawing.Printing {
-       /// <summary>
-       /// Summary description for Margins.
-       /// </summary>
+using System;
+using System.ComponentModel;
 
-       public class Margins : ICloneable {
-               /// <summary>
-               /// left margin in hundredths of an inch
-               /// </summary>
+namespace System.Drawing.Printing
+{
+       [TypeConverter (typeof (MarginsConverter))]
+       public class Margins : ICloneable
+       {
                int left;
-               /// <summary>
-               /// right margin in hundredths of an inch
-               /// </summary>
                int right;
-               /// <summary>
-               /// top margin in hundredths of an inch
-               /// </summary>
                int top;
-               /// <summary>
-               /// bottom margin in hundredths of an inch
-               /// </summary>
                int bottom;
 
-               public Margins() {
+               public Margins()
+               {
                        left = 100;
                        right = 100;
                        top = 100;
                        bottom = 100;
                }
-               public Margins(int left, int right, int top, int bottom) {
+
+               public Margins(int left, int right, int top, int bottom)
+               {
                        //Verify parameters
-                       if(left < 0)
+                       if (left < 0)
                                throw new System.ArgumentException("All Margins must be greater than 0", "left");
-                       if(right < 0)
+                       if (right < 0)
                                throw new System.ArgumentException("All Margins must be greater than 0", "right");
-                       if(top < 0)
+                       if (top < 0)
                                throw new System.ArgumentException("All Margins must be greater than 0", "top");
-                       if(bottom < 0)
+                       if (bottom < 0)
                                throw new System.ArgumentException("All Margins must be greater than 0", "bottom");
+
                        //Set proprities
                        this.left = left;
                        this.right = right;
@@ -54,51 +48,78 @@ namespace System.Drawing.Printing {
                        this.bottom = bottom;
                }
 
-               public int Left{
-                       get{
+               public int Left {
+                       get {
                                return left;
                        }
-                       set{
+                       set {
+                               if (left < 0)
+                                       throw new System.ArgumentException("All Margins must be greater than 0", "left");
                                left = value;
                        }
                }
 
-               public int Right{
-                       get{
+               public int Right {
+                       get {
                                return right;
                        }
-                       set{
+                       set {
+                               if (right < 0)
+                                       throw new System.ArgumentException("All Margins must be greater than 0", "left");
                                right = value;
                        }
                }
 
-               public int Top{
-                       get{
+               public int Top {
+                       get {
                                return top;
                        }
-                       set{
+                       set {
+                               if (top < 0)
+                                       throw new System.ArgumentException("All Margins must be greater than 0", "left");
                                top = value;
                        }
                }
 
-               public int Bottom{
-                       get{
+               public int Bottom {
+                       get {
                                return bottom;
                        }
-                       set{
+                       set {
+                               if (bottom < 0)
+                                       throw new System.ArgumentException("All Margins must be greater than 0", "left");
                                bottom = value;
                        }
                }
                
                public object Clone()
                {
-                       return new Margins(this.Left, this.Right, this.Top, this.Bottom);
+                       return new Margins (this.Left, this.Right, this.Top, this.Bottom);
+               }
+
+               public override bool Equals (object obj)
+               {       
+                       Margins m = obj as Margins;
+
+                       if (m == null)
+                               return false;
+                       if (m.Left == left && m.Right == right && m.Top == top && m.Bottom == bottom)
+                               return true;
+
+                       return false;
+               }
+
+               public override int GetHashCode ()
+               {
+                       // Try to create a somewhat meaningful hash
+                       int hash = left + right * 2^8 + top * 2^16 + bottom * 2^24;
+                       return hash;
                }
                
                public override string ToString()
                {
                        string ret = "[Margins Left={0} Right={1} Top={2} Bottom={3}]";
-                       return String.Format(ret, this.Left, this.Right, this.Top, this.Bottom);
+                       return String.Format (ret, this.Left, this.Right, this.Top, this.Bottom);
                }
        }
 }
index 55e2dd57417f9378958f7dccf31f90f27d0815ba..5931e62cc5bf166d81c7dba6f40dcdcf4c52fec1 100644 (file)
@@ -1,24 +1,26 @@
 //
 // System.Drawing.PageSettings.cs
 //
-// Author:
+// Authors:
 //   Dennis Hayes (dennish@Raytek.com)
 //   Herve Poussineau (hpoussineau@fr.st)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
 //
 // (C) 2002 Ximian, Inc
 //
+
 using System;
+using System.Runtime.InteropServices;
 
 namespace System.Drawing.Printing
 {
-       /// <summary>
-       /// Summary description for PageSettings.
-       /// </summary>
+       [ComVisible (false)]
        public class PageSettings : ICloneable
        {
                bool _Color;
                bool _Landscape;
-               Margins _Margins = new Margins(100, 100, 100, 100); // default margin: 1 inch for all margins
+               // create a new default Margins object (is 1 inch for all margins)
+               Margins _Margins = new Margins();
                PaperSize _PaperSize;
                PaperSource _PaperSource;
                PrinterResolution _PrinterResolution;
@@ -50,7 +52,8 @@ namespace System.Drawing.Printing
                        PaperSource = paperSource;
                        PrinterResolution = printerResolution;
                }
-//props
+
+               //props
                public Rectangle Bounds{
                        get{
                                int width = this.PaperSize.Width;
@@ -131,24 +134,23 @@ namespace System.Drawing.Printing
                                _PrinterSettings = value;
                        }
                }
-               //[ComVisible(false)]
+
                public object Clone(){
                        return new PageSettings(this.PrinterSettings);
                }
 
-               //[ComVisible(false)]
-               //[MonoTODO("PageSettings.CopyToHdevmode")]
-               //public void CopyToHdevmode(IntPtr hdevmode){
-               //      throw new NotImplementedException ();
-               //}
 
-               //[ComVisible(false)]
-               //[MonoTODO("PageSettings.SetHdevmode")]
-               //public void SetHdevmode(IntPtr hdevmode){
-               //      throw new NotImplementedException ();
-               //}
-       
-               //[ComVisible(false)]
+               [MonoTODO("PageSettings.CopyToHdevmode")]
+               public void CopyToHdevmode (IntPtr hdevmode){
+                       throw new NotImplementedException ();
+               }
+
+
+               [MonoTODO("PageSettings.SetHdevmode")]
+               public void SetHdevmode (IntPtr hdevmode){
+                       throw new NotImplementedException ();
+               }       
+
                public override string ToString(){
                        string ret = "[PageSettings: Color={0}";
                        ret += ", Landscape={1}";
index 137a0da4a9b0eb762a09a0edb9887b483389d471..88a02fc92a46744d0965484a5c9fd087c301a0f7 100644 (file)
@@ -4,10 +4,12 @@
 // (C) 2002 Ximian, Inc.  http://www.ximian.com\r
 // Author: Dennis Hayes (dennish@raytek.com)\r
 //\r
-using System;\r
+using System;
+\r
 namespace System.Drawing.Printing \r
 {\r
-       public enum PaperKind {\r
+       public enum PaperKind
+       {\r
                A2 = 66,\r
                A3 = 8,\r
                A3Extra = 63,\r
@@ -29,8 +31,10 @@ namespace System.Drawing.Printing
                APlus = 57,\r
                B4 = 12,\r
                B4Envelope = 33,\r
-               B4JisRotated = 79,\r
-               B5Extra,\r
+               B4JisRotated = 79,
+               B5 = 13,
+               B5Envelope = 34,\r
+               B5Extra = 65,\r
                B5JisRotated = 80,\r
                B5Transverse = 61,\r
                B6Envelope = 35,\r
@@ -40,7 +44,8 @@ namespace System.Drawing.Printing
                C3Envelope = 29,\r
                C4Envelope = 30,\r
                C5Envelope = 34,\r
-               C65Envelope = 32,\r
+               C65Envelope = 32,
+               C6Envelope = 31,\r
                CSheet = 24,\r
                Custom = 0,\r
                DLEnvelope = 27,\r
@@ -51,7 +56,8 @@ namespace System.Drawing.Printing
                GermanLegalFanfold = 41,\r
                GermanStandardFanfold = 40,\r
                InviteEnvelope = 47,\r
-               IsoB4 = 42,\r
+               IsoB4 = 42,
+               ItalyEnvelope = 36,\r
                JapaneseDoublePostcard = 69,\r
                JapaneseDoublePostcardRotated = 81,\r
                JapaneseEnvelopeChouNumber3 = 73,\r
index b67ca99df16f6aad98d128d22f5a33f32783120f..9a82f5c7fb63e5e5fb148e32bbfa6adf7e5c1e3e 100644 (file)
@@ -5,37 +5,40 @@
 //   Dennis Hayes (dennish@Raytek.com)\r
 //\r
 // (C) 2002 Ximian, Inc\r
-//\r
+//
+\r
 using System;\r
 \r
 namespace System.Drawing.Printing\r
 {\r
-       /// <summary>\r
-       /// Summary description for PreviewPrintController.\r
-       /// </summary>\r
        public class PreviewPrintController : PrintController\r
        {\r
-               private bool useantialias;\r
+               private bool useantialias;
+\r
                public PreviewPrintController()\r
                {\r
                        useantialias = false;\r
+               }
+\r
+               [MonoTODO]\r
+               public override void OnEndPage(PrintDocument document, PrintPageEventArgs e){\r
+                       throw new NotImplementedException ();\r
+               }
+\r
+               [MonoTODO]\r
+               public override void OnStartPrint(PrintDocument document, PrintEventArgs e){\r
+                       throw new NotImplementedException ();\r
+               }
+\r
+               [MonoTODO]\r
+               public override void OnEndPrint(PrintDocument document, PrintEventArgs e){\r
+                       throw new NotImplementedException ();\r
+               }
+\r
+               [MonoTODO]\r
+               public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e){\r
+                       throw new NotImplementedException ();\r
                }\r
-//             //[MonoTODO]\r
-//             public override void OnEndPage(PrintDocument document, PrintPageEventArgs e){\r
-//                     throw new NotImplementedException ();\r
-//             }\r
-//             //[MonoTODO]\r
-//             public override void OnStartPrint(PrintDocument document, PrintPageEventArgs e){\r
-//                     throw new NotImplementedException ();\r
-//             }\r
-//             //[MonoTODO]\r
-//             public override void OnEndPrint(PrintDocument document, PrintPageEventArgs e){\r
-//                     throw new NotImplementedException ();\r
-//             }\r
-               //[MonoTODO]\r
-               //public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e){\r
-               //      throw new NotImplementedException ();\r
-               //}\r
                \r
                public bool UseAntiAlias {\r
                        get{\r
@@ -44,8 +47,9 @@ namespace System.Drawing.Printing
                        set{\r
                                useantialias = value;\r
                        }\r
-               }\r
-               //[MonoTODO]\r
+               }
+\r
+               [MonoTODO]\r
                public PreviewPageInfo [] GetPreviewPageInfo(){\r
                        throw new NotImplementedException ();\r
                }\r
index 727b34a95a7a217d907b557b5bc1bb1ed293c670..70da3c606ead7a2e33ef82682ce820cd7f7214b4 100644 (file)
@@ -6,23 +6,37 @@
 //
 // (C) 2002 Ximian, Inc
 //
+
 using System;
 
 namespace System.Drawing.Printing
 {
-       /// <summary>
-       /// Summary description for PrintController.
-       /// </summary>
        public abstract class PrintController
        {
-               public virtual void OnEndPage(PrintDocument document, PrintPageEventArgs e){
+               public PrintController ()
+               {
+               }
+
+               [MonoTODO]
+               public virtual void OnEndPage (PrintDocument document, PrintPageEventArgs e)
+               {
                }
-               public virtual void OnStartPrint(PrintDocument document, PrintEventArgs e){
+
+               [MonoTODO]
+               public virtual void OnStartPrint (PrintDocument document, PrintEventArgs e)
+               {
                }
-               public virtual void OnEndPrint(PrintDocument document, PrintEventArgs e){
+
+               [MonoTODO]
+               public virtual void OnEndPrint (PrintDocument document, PrintEventArgs e)
+               {
                }
-               public virtual Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e){
+
+               [MonoTODO]
+               public virtual Graphics OnStartPage (PrintDocument document, PrintPageEventArgs e)
+               {
                        throw new NotImplementedException();
+                       return null;
                }
        }
 }
index 2218ae0ccfe87c3eec2d7e85e3a82ca2b37f4b34..36a97efed664afd248b411db1c3c40c8b1a5b93e 100644 (file)
@@ -1,19 +1,24 @@
 //
 // System.Drawing.PrintDocument.cs
 //
-// Author:
+// Authors:
 //   Dennis Hayes (dennish@Raytek.com)
 //   Herve Poussineau (hpoussineau@fr.st)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
 //
 // (C) 2002 Ximian, Inc
 //
+
 using System;
+using System.ComponentModel;
 
-namespace System.Drawing.Printing {
-       /// <summary>
-       /// Summary description for PrintDocument.
-       /// </summary>
-       public class PrintDocument : System.ComponentModel.Component {
+namespace System.Drawing.Printing
+{
+       [DefaultEvent ("PrintPage"), DefaultProperty ("DocumentName")]
+       [ToolboxItemFilter ("System.Drawing.Printing", ToolboxItemFilterType.Allow)]
+       [DesignerCategory ("Component")]
+       public class PrintDocument : System.ComponentModel.Component
+       {
                private PageSettings defaultpagesettings;
                private PrinterSettings printersettings;
                private PrintController printcontroller;
@@ -29,7 +34,10 @@ namespace System.Drawing.Printing {
                        printcontroller = new StandardPrintController();
                }
                
-// properties
+               // properties
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [SRDescription ("The settings for the current page.")]
                public PageSettings DefaultPageSettings{
                        get{
                                return defaultpagesettings;
@@ -38,9 +46,10 @@ namespace System.Drawing.Printing {
                                defaultpagesettings = value;
                        }
                }
-               /// <summary>
-               /// Name of the document, not the file!
-               /// </summary>
+
+               // Name of the document, not the file!
+               [DefaultValue ("document")]
+               [SRDescription ("The name of the document.")]
                public string DocumentName{
                        get{
                                return documentname;
@@ -49,6 +58,10 @@ namespace System.Drawing.Printing {
                                documentname = value;
                        }
                }
+
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [SRDescription ("The print controller object.")]
                public PrintController PrintController{
                        get{
                                return printcontroller;
@@ -57,6 +70,10 @@ namespace System.Drawing.Printing {
                                printcontroller = value;
                        }
                }
+
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [SRDescription ("The current settings for the active printer.")]
                public PrinterSettings PrinterSettings{
                        get{
                                return printersettings;
@@ -65,8 +82,11 @@ namespace System.Drawing.Printing {
                                printersettings = value;
                        }
                }
+
 #if !(NET_1_0)
-               public bool OriginAtMargins{// .NET V1.1 Beta
+               [DefaultValue (false)]
+               [SRDescription ("Determines if the origin is set at the specified margins.")]
+               public bool OriginAtMargins{
                        get{
                                return originAtMargins;
                        }
@@ -76,7 +96,7 @@ namespace System.Drawing.Printing {
                }
 #endif
 
-// methods
+               // methods
                public void Print(){
                        PrintEventArgs printArgs = new PrintEventArgs();
                        this.OnBeginPrint(printArgs);
@@ -113,11 +133,12 @@ namespace System.Drawing.Printing {
                        this.OnEndPrint(printArgs);
                        PrintController.OnEndPrint(this, printArgs);
                }
+
                public override string ToString(){
                        return "[PrintDocument " + this.DocumentName + "]";
                }
                
-// events
+               // events
                protected virtual void OnBeginPrint(PrintEventArgs e){
                        //fire the event
                        if (BeginPrint != null)
@@ -138,13 +159,20 @@ namespace System.Drawing.Printing {
                
                protected virtual void OnQueryPageSettings(QueryPageSettingsEventArgs e){
                        //fire the event
-                       if (QuerypageSettings != null)
-                               QuerypageSettings(this, e);
+                       if (QueryPageSettings != null)
+                               QueryPageSettings(this, e);
                }
-               
+
+               [SRDescription ("Raised when printing begins")]
                public event PrintEventHandler BeginPrint;
+
+               [SRDescription ("Raised when printing ends")]
                public event PrintEventHandler EndPrint;
+
+               [SRDescription ("Raised when printing of a new page begins")]
                public event PrintPageEventHandler PrintPage;
-               public event QueryPageSettingsEventHandler QuerypageSettings;
+
+               [SRDescription ("Raised before printing of a new page begins")]
+               public event QueryPageSettingsEventHandler QueryPageSettings;
        }
 }
index 9e33be961da84761f11b21e6c0680050509bbb07..3397fd890e8240c893bc1b4ab11bc7530548708f 100644 (file)
@@ -46,6 +46,11 @@ namespace System.Drawing.Printing
                        get {\r
                                return kind;\r
                        }\r
+               }
+
+               public override string ToString ()
+               {
+                       return "[PrinterResolution X=" + x + " Y=" + y + "]";
                }\r
        }\r
 }\r
index 495bdade6aae36f5592af66ff04a40885874dac8..8e8d64d12bc75cbc0c4b7b8eff2ab6147d33a1d5 100644 (file)
@@ -1,33 +1,33 @@
 //
 // System.Drawing.PrinterSettings.cs
 //
-// Author:
+// Authors:
 //   Dennis Hayes (dennish@Raytek.com)
 //   Herve Poussineau (hpoussineau@fr.st)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
 //
 // (C) 2002 Ximian, Inc
 //
+
 using System;
+using System.Runtime.InteropServices;
 using System.Collections;
 using System.Drawing.Printing;
 
 namespace System.Drawing.Printing
 {
-       /// <summary>
-       /// Summary description for PrinterSettings.
-       /// </summary>
-       /// 
        [Serializable]
-       //[ComVisible(false)]
-       public class PrinterSettings : ICloneable{
+       [ComVisible(false)]
+       public class PrinterSettings : ICloneable
+       {
                public PrinterSettings()
                {
                }
-               // SUBCLASS
-               /// <summary>
-               /// Summary description for PaperSourceCollection.
-               /// </summary>
-               public class PaperSourceCollection : ICollection, IEnumerable {
+
+               // Public subclasses
+
+               public class PaperSourceCollection : ICollection
+               {
                        ArrayList _PaperSources = new ArrayList();
                        
                        public PaperSourceCollection(PaperSource[] array) {
@@ -43,7 +43,7 @@ namespace System.Drawing.Printing
                                get { return _PaperSources[index] as PaperSource; }
                        }
                        
-                       IEnumerator IEnumerable.GetEnumerator()
+                       public IEnumerator GetEnumerator()
                        {
                                return _PaperSources.GetEnumerator();
                        }
@@ -53,10 +53,9 @@ namespace System.Drawing.Printing
                                _PaperSources.CopyTo(array, index);
                        }
                }
-               /// <summary>
-               /// Summary description for PaperSizeCollection.
-               /// </summary>
-               public class PaperSizeCollection : ICollection, IEnumerable {
+
+               public class PaperSizeCollection : ICollection
+               {
                        ArrayList _PaperSizes = new ArrayList();
                        
                        public PaperSizeCollection(PaperSize[] array) {
@@ -72,7 +71,7 @@ namespace System.Drawing.Printing
                                get { return _PaperSizes[index] as PaperSize; }
                        }
                        
-                       IEnumerator IEnumerable.GetEnumerator()
+                       public IEnumerator GetEnumerator()
                        {
                                return _PaperSizes.GetEnumerator();
                        }
@@ -82,10 +81,9 @@ namespace System.Drawing.Printing
                                _PaperSizes.CopyTo(array, index);
                        }
                }
-               /// <summary>
-               /// Summary description for PrinterResolutionCollection.
-               /// </summary>
-               public class PrinterResolutionCollection : ICollection, IEnumerable {
+
+               public class PrinterResolutionCollection : ICollection
+               {
                        ArrayList _PrinterResolutions = new ArrayList();
                        
                        public PrinterResolutionCollection(PrinterResolution[] array) {
@@ -101,7 +99,7 @@ namespace System.Drawing.Printing
                                get { return _PrinterResolutions[index] as PrinterResolution; }
                        }
                        
-                       IEnumerator IEnumerable.GetEnumerator()
+                       public IEnumerator GetEnumerator()
                        {
                                return _PrinterResolutions.GetEnumerator();
                        }
@@ -111,10 +109,9 @@ namespace System.Drawing.Printing
                                _PrinterResolutions.CopyTo(array, index);
                        }
                }
-               /// <summary>
-               /// Summary description for PrinterResolutionCollection.
-               /// </summary>
-               public class StringCollection : ICollection, IEnumerable {
+
+               public class StringCollection : ICollection
+               {
                        ArrayList _Strings = new ArrayList();
                        
                        public StringCollection(string[] array) {
@@ -122,11 +119,15 @@ namespace System.Drawing.Printing
                                        _Strings.Add(s);
                        }
                        
-                       int ICollection.Count { get { return _Strings.Count; } }
+                       public int Count { get { return _Strings.Count; } }
                        bool ICollection.IsSynchronized { get { return false; } }
                        object ICollection.SyncRoot { get { return this; } }
                        
-                       IEnumerator IEnumerable.GetEnumerator()
+                       public virtual string this[int index] {
+                               get { return _Strings[index] as string; }
+                       }
+
+                       public IEnumerator GetEnumerator()
                        {
                                return _Strings.GetEnumerator();
                        }
@@ -137,24 +138,28 @@ namespace System.Drawing.Printing
                        }
                }
                
-//props
-               //[MonoTODO("PrinterSettings.CanDuplex")]
-               //public bool CanDuplex
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.Collate")]
-               //public bool Collate
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.Copies")]
-               //public short Copies
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
+               //properties
+
+               [MonoTODO("PrinterSettings.CanDuplex")]
+               public bool CanDuplex
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.Collate")]
+               public bool Collate
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.Copies")]
+               public short Copies
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
                [MonoTODO("PrinterSettings.DefaultPageSettings")]
                public PageSettings DefaultPageSettings
                {
@@ -175,145 +180,171 @@ namespace System.Drawing.Printing
                                );
                        }
                }
-               //[MonoTODO("PrinterSettings.Duplex")]
-               //public Duplex Duplex
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.FromPage)]
-               //public int FromPage
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.InstalledPrinters")]
-               //public static PrinterSettings.StringCollection InstalledPrinters
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.IsDefaultPrinter")]
-               //public bool IsDefaultPrinter
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.IsPlotter")]
-               //public bool IsPlotter
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.IsValid")]
-               //public bool IsValid
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.LandscapeAngle")]
-               //public int LandscapeAngle
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.MaximumCopies")]
-               //public int MaximumCopies
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.MaximumPage")]
-               //public int MaximumPage
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.MinimumPage")]
-               //public int MinimumPage
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.PaperSizes")]
-               //public PrinterSettings.PaperSizeCollection PaperSizes
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.PaperSources")]
-               //public PrinterSettings.PaperSourceCollection PaperSources
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.PrinterName")]
-               //public string PrinterName
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.PrinterResolutions")]
-               //public PrinterSettings.PrinterResolutionCollection PrinterResolutions
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.PrintRange")]
-               //public PrintRange PrintRange
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.PrintToFile")]
-               //public bool PrintToFile
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.SupportsColor")]
-               //public bool SupportsColor
-               //{
-               //      get { throw new NotImplementedException(); }
-               //}
-               //[MonoTODO("PrinterSettings.ToPage")]
-               //public int ToPage
-               //{
-               //      get { throw new NotImplementedException(); }
-               //      set { throw new NotImplementedException(); }
-               //}
-
-//methods
+
+               [MonoTODO("PrinterSettings.Duplex")]
+               public Duplex Duplex
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.FromPage")]
+               public int FromPage
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.InstalledPrinters")]
+               public static PrinterSettings.StringCollection InstalledPrinters
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.IsDefaultPrinter")]
+               public bool IsDefaultPrinter
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.IsPlotter")]
+               public bool IsPlotter
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.IsValid")]
+               public bool IsValid
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.LandscapeAngle")]
+               public int LandscapeAngle
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.MaximumCopies")]
+               public int MaximumCopies
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.MaximumPage")]
+               public int MaximumPage
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.MinimumPage")]
+               public int MinimumPage
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.PaperSizes")]
+               public PrinterSettings.PaperSizeCollection PaperSizes
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.PaperSources")]
+               public PrinterSettings.PaperSourceCollection PaperSources
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.PrinterName")]
+               public string PrinterName
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.PrinterResolutions")]
+               public PrinterSettings.PrinterResolutionCollection PrinterResolutions
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.PrintRange")]
+               public PrintRange PrintRange
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.PrintToFile")]
+               public bool PrintToFile
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.SupportsColor")]
+               public bool SupportsColor
+               {
+                       get { throw new NotImplementedException(); }
+               }
+
+               [MonoTODO("PrinterSettings.ToPage")]
+               public int ToPage
+               {
+                       get { throw new NotImplementedException(); }
+                       set { throw new NotImplementedException(); }
+               }
+
+               //methods
+
                [MonoTODO("PrinterSettings.Clone")]
                public virtual object Clone()
                {
                        throw new NotImplementedException();
                }
-               //[MonoTODO("PrinterSettings.CreateMeasurementGraphics")]
-               //public Graphics CreateMeasurementGraphics()
-               //{
-               //      throw new NotImplementedException();
-               //}
-               //[MonoTODO("PrinterSettings.GetHdevmode")]
-               //public IntPtr GetHdevmode()
-               //{
-               //      throw new NotImplementedException();
-               //}
-               //[MonoTODO("PrinterSettings.GetHdevmode")]
-               //public IntPtr GetHdevmode(PageSettings pageSettings)
-               //{
-               //      throw new NotImplementedException();
-               //}
-               //[MonoTODO("PrinterSettings.GetHdevname")]
-               //public IntPtr GetHdevnames()
-               //{
-               //      throw new NotImplementedException();
-               //}
-               //[MonoTODO("PrinterSettings.SetHdevmode")]
-               //public void SetHdevmode(IntPtr hdevmode)
-               //{
-               //      throw new NotImplementedException();
-               //}
-               //[MonoTODO("PrinterSettings.SetHdevnames")]
-               //public void SetHdevnames(IntPtr hdevnames)
-               //{
-               //      throw new NotImplementedException();
-               //}
-               //[MonoTODO("PrinterSettings.ToString"]
-               //public override string ToString()
-               //{
-               //      throw new NotImplementedException();
-               //}
+
+               [MonoTODO("PrinterSettings.CreateMeasurementGraphics")]
+               public Graphics CreateMeasurementGraphics()
+               {
+                       throw new NotImplementedException();
+               }
+
+               [MonoTODO("PrinterSettings.GetHdevmode")]
+               public IntPtr GetHdevmode()
+               {
+                       throw new NotImplementedException();
+               }
+
+               [MonoTODO("PrinterSettings.GetHdevmode")]
+               public IntPtr GetHdevmode(PageSettings pageSettings)
+               {
+                       throw new NotImplementedException();
+               }
+
+               [MonoTODO("PrinterSettings.GetHdevname")]
+               public IntPtr GetHdevnames()
+               {
+                       throw new NotImplementedException();
+               }
+
+               [MonoTODO("PrinterSettings.SetHdevmode")]
+               public void SetHdevmode(IntPtr hdevmode)
+               {
+                       throw new NotImplementedException();
+               }
+
+               [MonoTODO("PrinterSettings.SetHdevnames")]
+               public void SetHdevnames(IntPtr hdevnames)
+               {
+                       throw new NotImplementedException();
+               }
+
+               [MonoTODO("PrinterSettings.ToString")]
+               public override string ToString()
+               {
+                       throw new NotImplementedException();
+               }
        }
 }
index b9f9cc7f084c0eed3697080976ef539dba3576fc..dff72a368f75c978548a72d800376ec4b4969154 100644 (file)
@@ -1,9 +1,9 @@
 //
-// System.Drawing.Printing.PrinterUnitConvert
+// System.Drawing.Printing.PrinterUnitConvert.cs
 //
 // Authors:
-//      Martin Willemoes Hansen (mwh@sysrq.dk)
-//      Herve Poussineau (hpoussineau@fr.st)
+//   Martin Willemoes Hansen (mwh@sysrq.dk)
+//   Herve Poussineau (hpoussineau@fr.st)
 //
 // (C) 2003 Martin Willemoes Hansen
 //
@@ -12,6 +12,10 @@ namespace System.Drawing.Printing
 {
        public sealed class PrinterUnitConvert
        {
+               private PrinterUnitConvert ()
+               {
+               }
+
                public static double Convert (double value,
                                              PrinterUnit fromUnit,
                                              PrinterUnit toUnit)
index 6885c4e97bde2b505d64e6f5cb0816d3a268f6a0..801fbb56aaa1822529b99647e161cadf36f1f33a 100644 (file)
@@ -7,20 +7,23 @@
 //
 // (C) 2002 Ximian, Inc
 //
+
 using System;
 
-namespace System.Drawing.Printing {
-       /// <summary>
-       /// Summary description for StandardPrintController.
-       /// </summary>
-       public class StandardPrintController : PrintController {
+namespace System.Drawing.Printing
+{
+       public class StandardPrintController : PrintController
+       {
                private int page;
                private Image image;
                
-               public StandardPrintController() {
+               public StandardPrintController()
+               {
                }
+
                [MonoTODO("StandardPrintController.OnEndPage")]
-               public override void OnEndPage(PrintDocument document, PrintPageEventArgs e){
+               public override void OnEndPage(PrintDocument document, PrintPageEventArgs e)
+               {
                        //TODO: print current page
                        // - image to print is this.image
                        // - page settings are in e.PageSettings
@@ -39,16 +42,20 @@ namespace System.Drawing.Printing {
                        if (e.Graphics != null)
                                e.Graphics.Dispose();
                }
+
                [MonoTODO("StandardPrintController.OnStartPrint")]
                public override void OnStartPrint(PrintDocument document, PrintEventArgs e){
                        page = 0;
                }
-               //[MonoTODO("StandardPrintController.OnEndPrint")]
-               //public override void OnEndPrint(PrintDocument document, PrintEventArgs e){
-               //      throw new NotImplementedException ();
-               //}
+
+               [MonoTODO("StandardPrintController.OnEndPrint")]
+               public override void OnEndPrint(PrintDocument document, PrintEventArgs e){
+                       return;
+               }
+
                [MonoTODO("StandardPrintController.OnStartPage")]
-               public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e){
+               public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e)
+               {
                        //FIXME: I'm not sure of what I'm doing
                        // I don't know what size to give to image
                        // and why I have to clear it