Beispiel #1
0
		private void ViewReportButtonClick (object sender, EventArgs e)
		{
			// open web browser on html report
			if (html_report_filename == null) {
				html_report_filename = Path.ChangeExtension (Path.GetTempFileName (), ".html");
				using (HtmlResultWriter writer = new HtmlResultWriter (Runner, html_report_filename)) {
					writer.Report ();
				}
			}
			Open (html_report_filename);
		}
Beispiel #2
0
		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 ();
			}
		}