Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. is my design ok!? (generic print engine)

is my design ok!? (generic print engine)

Scheduled Pinned Locked Moved Design and Architecture
comdesignquestion
2 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    giddy_guitarist
    wrote on last edited by
    #1

    hi , After reading a few 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: http://gidsfiles.googlepages.com/PrintingCore.cs[^] http://gidsfiles.googlepages.com/_PrintableSections.cs[^] http://gidsfiles.googlepages.com/PrintTest.cs[^] 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; prt.ShowDialog(); PrintPreviewDialog prev = new PrintPreviewDialog(); prev.Document = pDoc; prev.ShowDialog(); Thanks so much Gideon

    P 1 Reply Last reply
    0
    • G giddy_guitarist

      hi , After reading a few 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: http://gidsfiles.googlepages.com/PrintingCore.cs[^] http://gidsfiles.googlepages.com/_PrintableSections.cs[^] http://gidsfiles.googlepages.com/PrintTest.cs[^] 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; prt.ShowDialog(); PrintPreviewDialog prev = new PrintPreviewDialog(); prev.Document = pDoc; prev.ShowDialog(); Thanks so much Gideon

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Looks okay.

      "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups