protected override void OnBeginPrint(PrintEventArgs e) { _printElements = new ArrayList(); _pageNum = 0; _printIndex = 0; foreach (IPrintable printObject in _printObjects) { PrintElement element = new PrintElement(printObject); _printElements.Add(element); element.Print(); } }
public void Print(PrintElement element) { element.AddText(Text); }
private void InitializeControl(string filename) { _printObjects = new ArrayList(); Header = new PrintElement(null); Header.AddText("File: " + filename); Header.AddText("Page: [pagenum]"); Header.AddHorizontalRule(); Header.AddBlankLine(); Footer = new PrintElement(null); Footer.AddBlankLine(); Footer.AddHorizontalRule(); DateTime dt = DateTime.Now; Footer.AddText("Printed on " + String.Format("{0:f}", dt)); }