/// <summary> /// Initializes a new instance of the <see cref="PrintOptionsDialog"/> class. /// </summary> /// <param name="pto">The pto.</param> /// <param name="doc">The document.</param> /// <exception cref="System.ArgumentNullException">pto or doc</exception> public PrintOptionsDialog(PlanExportSettings pto, PrintDocument doc) { pto.ThrowIfNull(nameof(pto)); doc.ThrowIfNull(nameof(doc)); InitializeComponent(); string curPrinter = doc.PrinterSettings.PrinterName; m_pto = pto; foreach (String printer in PrinterSettings.InstalledPrinters) { int index = comboPrinters.Items.Add(printer); doc.PrinterSettings.PrinterName = printer; if (doc.PrinterSettings.IsDefaultPrinter) comboPrinters.SelectedIndex = index; } // If this dialog is cancelled, we dont want the name of the printer to have changed doc.PrinterSettings.PrinterName = curPrinter; EntryFinishDate = pto.EntryFinishDate; EntryNumber = pto.EntryNumber; EntryStartDate = pto.EntryStartDate; EntryTrainingTimes = pto.EntryTrainingTimes; EntryNotes = pto.EntryNotes; FooterCount = pto.FooterCount; FooterDate = pto.FooterDate; FooterTotalTime = pto.FooterTotalTime; IncludeHeader = pto.IncludeHeader; }