Files
mono/mcs/class/System.Drawing/System.Drawing.Printing/PaperSize.cs
T
2003-09-21 02:13:45 +00:00

75 lines
1.3 KiB
C#

//
// System.Drawing.PaperSize.cs
//
// Author:
// Dennis Hayes ([email protected])
// Herve Poussineau ([email protected])
//
// (C) 2002 Ximian, Inc
//
using System;
namespace System.Drawing.Printing
{
/// <summary>
/// Summary description for PaperSize.
/// </summary>
public class PaperSize
{
string name;
int width;
int height;
PaperKind kind;
public PaperSize(string name, int width, int height)
{
this.width = width;
this.height = height;
this.name = name;
this.kind = PaperKind.Custom;
}
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{
return kind;
}
}
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);
}
}
}