TextViewPageControl中实例化了protected PrintPageCollection myPages = new PrintPageCollection();
public PrintPageCollection()
{
this.PageSettings = new XPageSettings();
}
这儿相当于调用了它的setPageSettings 函数
set
{
this.intPaperKind = value.Kind;
XPaperSize size = null;
if (value.Kind != System.Drawing.Printing.PaperKind.Custom)
size = XPaperSizeCollection.StdInstance[value.Kind];
if (size == null)
size = value;
double rate = XPaperSize.GetRate(this.intGraphicsUnit);
if (this.bolLanscape == false)
{
this.intPaperWidth = (int)(size.Width / rate);
this.intPaperHeight = (int)(size.Height / rate);
}
else
{
this.intPaperWidth = (int)(size.Height / rate);
this.intPaperHeight = (int)(size.Width / rate);
}
}
public class XPageSettings
{
private XPaperSize myPaperSize = new XPaperSize();//System.Drawing.Printing.PaperKind.Custom, 776, 1068);
它构建了XPaperSize
}
public class XPaperSize
{
private System.Drawing.Printing.PaperKind intKind = System.Drawing.Printing.PaperKind.A4;
public System.Drawing.Printing.PaperKind Kind
{
get { return intKind; }
set { intKind = value; }
}
pageSizeli制定了kind为a4纸