private void SaveReportButtonClick (object sender, EventArgs e) { if (save_file_dialog.ShowDialog () != DialogResult.OK) return; string filename = save_file_dialog.FileName; ResultWriter writer = null; switch (save_file_dialog.FilterIndex) { case 1: if (CouldCopyReport (ref html_report_filename, filename)) return; writer = new HtmlResultWriter (Runner, filename); break; case 2: if (CouldCopyReport (ref xml_report_filename, filename)) return; writer = new XmlResultWriter (Runner, filename); break; case 3: if (CouldCopyReport (ref text_report_filename, filename)) return; writer = new TextResultWriter (Runner, filename); break; } if (writer != null) { writer.Report (); writer.Dispose (); } }
protected override void Write() { using (XmlResultWriter writer = new XmlResultWriter (Runner, temp_filename)) { writer.Report (); } }