示例#1
0
        // The first thing to do before we try to print is build up the header and footer elements. We'll create default ones in the constructor: 
        public PrintEngine()
        {
            // create the header...
            Header = new PrintElement(null);
            Header.AddText("Report");
            Header.AddText("Page: [pagenum]");
            Header.AddHorizontalRule();
            Header.AddBlankLine();

            // create the footer...
            Footer = new PrintElement(null);
            Footer.AddBlankLine();
            Footer.AddHorizontalRule();
            Footer.AddText("Confidential");
        }
示例#2
0
        public void Print(PrintElement element)
        {
            // tell the engine to draw a header... 
            element.AddHeader("Customer");

            // now, draw the data... 
            element.AddData("Customer ID", Id.ToString());
            element.AddData("Name", FirstName + " " + LastName);
            element.AddData("Company", Company);
            element.AddData("E-mail", Email);
            element.AddData("Phone", Phone);

            // finally, add a blank line... 
            element.AddBlankLine(); 
            
        }
示例#3
0
        public void Print(PrintElement element)
        {
            // tell the engine to draw a header...
            element.AddHeader("Contents of List");

            // now, draw the data...
            element.AddData("Book Nbr", bookNumber);
            element.AddData("Title", title);
            element.AddData("ISBN", ISBN);
            element.AddData("Location", location);
            element.AddData("Price", price);
            element.AddData("Status", status);

            // finally, add a blank line...
            element.AddBlankLine();
        }