After reading a fw articles , i made this printEngine class that
derives from PrintDocument. The print engine takes any class that
exposes the IPrintableDocument interface. This interface defines a
method that supplies a PrintablePage to the exposing class which
should fill the page with classes that expose IPrintableSection. Its
not very complicated but it does have a few flaws. Like although it
_can_ handle pagination , it does'nt do it very well.
Could someone please check the code and tell me if the design is ok?
And if it needs any improvements?
I should mention that i'm a self taught newbie!
Heres the code:
This is how the print engine is used with the printTest class:
PrintEngine pDoc = new PrintEngine();
pDoc.PrintableDocument = new PrintTest();
PrintDialog prt = new PrintDialog();
prt.Document = pDoc;
PrintPreviewDialog prev = new PrintPreviewDialog();
prev.Document = pDoc;
Thanks so much