Skip to content

Instantly share code, notes, and snippets.

@bgeihsgt
Last active August 29, 2015 14:14
Show Gist options
  • Save bgeihsgt/f83291de11fd439a162a to your computer and use it in GitHub Desktop.
Save bgeihsgt/f83291de11fd439a162a to your computer and use it in GitHub Desktop.
public class InvoiceGenerator
{
private readonly IConfigurationReader _configurationReader;
public InvoiceGenerator(IConfigurationReader configurationReader)
{
_configurationReader = configurationReader;
}
public Invoice GenerateInvoice()
{
// ...
// Invoicy things
// ...
var watermarkText = _configurationReader.Get<string>("invoiceWatermarkText");
if (!String.IsNullOrEmpty(watermarkText))
{
WriteWatermark(invoice, watermarkText);
}
// ...
// More Invoicy things
// ...
}
private void WriteWatermark(Invoice invoice, string watermarkText)
{
// ...
// Watermarky things
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment