Ver Fonte

2004-02-07 Andreas Nahr <[email protected]>

	* 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
Andreas N há 22 anos atrás
pai
commit
ccad7900c6

+ 60 - 39
mcs/class/System.Drawing/System.Drawing.Printing/Margins.cs

@@ -1,52 +1,46 @@
 //
 // System.Drawing.Margins.cs
 //
-// Author:
+// Authors:
 //   Dennis Hayes ([email protected])
+//   Andreas Nahr ([email protected])
 //
 // (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);
 		}
 	}
 }

+ 21 - 19
mcs/class/System.Drawing/System.Drawing.Printing/PageSettings.cs

@@ -1,24 +1,26 @@
 //
 // System.Drawing.PageSettings.cs
 //
-// Author:
+// Authors:
 //   Dennis Hayes ([email protected])
 //   Herve Poussineau ([email protected])
+//   Andreas Nahr ([email protected])
 //
 // (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}";

+ 12 - 6
mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs

@@ -4,10 +4,12 @@
 // (C) 2002 Ximian, Inc.  http://www.ximian.com
 // Author: Dennis Hayes ([email protected])
 //
-using System;
+using System;
+
 namespace System.Drawing.Printing 
 {
-	public enum PaperKind {
+	public enum PaperKind
+	{
 		A2 = 66,
 		A3 = 8,
 		A3Extra = 63,
@@ -29,8 +31,10 @@ namespace System.Drawing.Printing
 		APlus = 57,
 		B4 = 12,
 		B4Envelope = 33,
-		B4JisRotated = 79,
-		B5Extra,
+		B4JisRotated = 79,
+		B5 = 13,
+		B5Envelope = 34,
+		B5Extra = 65,
 		B5JisRotated = 80,
 		B5Transverse = 61,
 		B6Envelope = 35,
@@ -40,7 +44,8 @@ namespace System.Drawing.Printing
 		C3Envelope = 29,
 		C4Envelope = 30,
 		C5Envelope = 34,
-		C65Envelope = 32,
+		C65Envelope = 32,
+		C6Envelope = 31,
 		CSheet = 24,
 		Custom = 0,
 		DLEnvelope = 27,
@@ -51,7 +56,8 @@ namespace System.Drawing.Printing
 		GermanLegalFanfold = 41,
 		GermanStandardFanfold = 40,
 		InviteEnvelope = 47,
-		IsoB4 = 42,
+		IsoB4 = 42,
+		ItalyEnvelope = 36,
 		JapaneseDoublePostcard = 69,
 		JapaneseDoublePostcardRotated = 81,
 		JapaneseEnvelopeChouNumber3 = 73,

+ 27 - 23
mcs/class/System.Drawing/System.Drawing.Printing/PreviewPrintController.cs

@@ -5,37 +5,40 @@
 //   Dennis Hayes ([email protected])
 //
 // (C) 2002 Ximian, Inc
-//
+//
+
 using System;
 
 namespace System.Drawing.Printing
 {
-	/// <summary>
-	/// Summary description for PreviewPrintController.
-	/// </summary>
 	public class PreviewPrintController : PrintController
 	{
-		private bool useantialias;
+		private bool useantialias;
+
 		public PreviewPrintController()
 		{
 			useantialias = false;
+		}
+
+		[MonoTODO]
+		public override void OnEndPage(PrintDocument document, PrintPageEventArgs e){
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public override void OnStartPrint(PrintDocument document, PrintEventArgs e){
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public override void OnEndPrint(PrintDocument document, PrintEventArgs e){
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e){
+			throw new NotImplementedException ();
 		}
-//		//[MonoTODO]
-//		public override void OnEndPage(PrintDocument document, PrintPageEventArgs e){
-//			throw new NotImplementedException ();
-//		}
-//		//[MonoTODO]
-//		public override void OnStartPrint(PrintDocument document, PrintPageEventArgs e){
-//			throw new NotImplementedException ();
-//		}
-//		//[MonoTODO]
-//		public override void OnEndPrint(PrintDocument document, PrintPageEventArgs e){
-//			throw new NotImplementedException ();
-//		}
-		//[MonoTODO]
-		//public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e){
-		//	throw new NotImplementedException ();
-		//}
 		
 		public bool UseAntiAlias {
 			get{
@@ -44,8 +47,9 @@ namespace System.Drawing.Printing
 			set{
 				useantialias = value;
 			}
-		}
-		//[MonoTODO]
+		}
+
+		[MonoTODO]
 		public PreviewPageInfo [] GetPreviewPageInfo(){
 			throw new NotImplementedException ();
 		}

+ 21 - 7
mcs/class/System.Drawing/System.Drawing.Printing/PrintController.cs

@@ -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;
 		}
 	}
 }

+ 45 - 17
mcs/class/System.Drawing/System.Drawing.Printing/PrintDocument.cs

@@ -1,19 +1,24 @@
 //
 // System.Drawing.PrintDocument.cs
 //
-// Author:
+// Authors:
 //   Dennis Hayes ([email protected])
 //   Herve Poussineau ([email protected])
+//   Andreas Nahr ([email protected])
 //
 // (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;
 	}
 }

+ 5 - 0
mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolution.cs

@@ -46,6 +46,11 @@ namespace System.Drawing.Printing
 			get {
 				return kind;
 			}
+		}
+
+		public override string ToString ()
+		{
+			return "[PrinterResolution X=" + x + " Y=" + y + "]";
 		}
 	}
 }

+ 213 - 182
mcs/class/System.Drawing/System.Drawing.Printing/PrinterSettings.cs

@@ -1,33 +1,33 @@
 //
 // System.Drawing.PrinterSettings.cs
 //
-// Author:
+// Authors:
 //   Dennis Hayes ([email protected])
 //   Herve Poussineau ([email protected])
+//   Andreas Nahr ([email protected])
 //
 // (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();
+		}
 	}
 }

+ 7 - 3
mcs/class/System.Drawing/System.Drawing.Printing/PrinterUnitConvert.cs

@@ -1,9 +1,9 @@
 //
-// System.Drawing.Printing.PrinterUnitConvert
+// System.Drawing.Printing.PrinterUnitConvert.cs
 //
 // Authors:
-//      Martin Willemoes Hansen ([email protected])
-//      Herve Poussineau ([email protected])
+//   Martin Willemoes Hansen ([email protected])
+//   Herve Poussineau ([email protected])
 //
 // (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)

+ 19 - 12
mcs/class/System.Drawing/System.Drawing.Printing/StandardPrintController.cs

@@ -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