Saturday, October 20, 2007

Printing in .Net - Class Design

I've been tasked with printing some reports in a windows application at work. There seems to be a lot of extra work associated with printing such as maintaining fonts, brushes, pagination, and wordwrap. Thus I decided to start with a printer helper class to keep track of pages, a style class to hold the Brush and Font, and another class to print to the Graphics object.

I first implemented the helper class as the PrintHelper has a PrintDocument; I've began to refactor my design and I'm now thinking that there should be a class that inherits from the PrintDocument instead.

I'll update as my design progresses.

Friday, October 12, 2007

fxCop

After a weekly meeting in which we decerned to enforce our coding standards more rigorously I remembered looking into fxCop a while back. It looks pretty flexible and should be an easy way to check conformance to our coding standards.

The included rules that ship with fxCop are extensive but some don't apply to our environment or conflict with our existing standards. I'm going to try to run fxCop on all my new developement for now and narrow down what needs to be excluded. If we could write some custom rules that conform to our coding standards they would be especially beneficial durring code review processes and for new developers.