All pastes #261851 Raw Edit

Untitled

public text v1 · immutable
#261851 ·published 2006-11-29 22:25 UTC
rendered paste body
private void AnalyzeAssemblies ()
{
	AssemblyAnalyzer aa = new AssemblyAnalyzer ();

	string todo_defs = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "monotodo.txt");
	string nie_defs = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "exception.txt");
	string missing_defs = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "missing.txt");

	// Load the definition files
	aa.LoadDefinitions (todo_defs, nie_defs, missing_defs);

	// Scan user's assemblies for P/Invokes
	foreach (ListViewItem lvi in AssemblyListView.Items)
		aa.ScanAssemblyForPInvokes ((string)lvi.Tag);

	// Start the results reports
	if (!Directory.Exists (Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Reports")))
		Directory.CreateDirectory (Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Reports"));

	string output_path = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Reports");
	XhtmlTextWriter report = aa.BeginHtmlReport (new FileStream (Path.Combine (output_path, "output.html"), FileMode.Create));
	StreamWriter submit_report = aa.BeginTextReport (new FileStream (Path.Combine (output_path, "submit.txt"), FileMode.Create));

	// Scan user's assemblies for issues
	foreach (ListViewItem lvi in AssemblyListView.Items) {
		aa.AnalyzeAssembly ((string)lvi.Tag);

		report.WriteFullBeginTag ("h2");
		report.WriteEncodedText (Path.GetFileName ((string)lvi.Tag));
		report.WriteEndTag ("h2");

		aa.AddResultsToHtmlReport (report);
		aa.AddResultsToTextReport (submit_report);
	}

	// Finish up the reports
	aa.FinishHtmlReport (report);
	aa.FinishTextReport (submit_report);
}