public string GenerateHtmlReport(string fileName) 
    {
		var riskAnalyzer = new ContentRiskAnalyzer();

		riskAnalyzer.ShowSummary = _bShow;

		riskAnalyzer.Analyse(fileName);

		string htmlReport = riskAnalyzer.GetHtmlContent();
	    _reportXml = string.Join("", riskAnalyzer.GetXml());
		
		return htmlReport;
	}
Exemplo n.º 2
0
        public string GenerateHtmlReportFile(string fileName, string displayName, out string xmlReport)
        {
            ContentRiskAnalyzer riskAnalyzer = new ContentRiskAnalyzer();

            riskAnalyzer.ShowSummary = true;
            riskAnalyzer.DisplayName = displayName;

            riskAnalyzer.Analyse(fileName);

            string htmlReportFile = riskAnalyzer.GenerateHtmlFile();
            xmlReport = string.Join("", riskAnalyzer.GetXml());

            return htmlReportFile;
        }
Exemplo n.º 3
0
        public string GenerateXmlReportFile(string fileName, string displayName)
        {
            ContentRiskAnalyzer riskAnalyzer = new ContentRiskAnalyzer();

            riskAnalyzer.ShowSummary = true;
            riskAnalyzer.DisplayName = displayName;

            riskAnalyzer.Analyse(fileName);

            
            string[] xml = riskAnalyzer.GetXml();
            string sXml = xml.Length > 0 ? xml[0] : "<?xml version=\"1.0\"?>\r\n<Metadata/>";
            string tempPath = null;
            using (StreamWriter sw = riskAnalyzer.GetWriterForTempFile(out tempPath, "xml"))
            {
                sw.Write(sXml);
            }
            return tempPath;

        }
Exemplo n.º 4
0
        public void TestAnalyze()
        {
            /// -------------------------------------------------------------------------
            string file2Analyse = TestConsole._analyseDir + TestConsole._analyseFile;

            Console.WriteLine(file2Analyse);
            Console.WriteLine(DateTime.Now);

            ContentRiskAnalyzer riskAnalyzer = new ContentRiskAnalyzer();

            riskAnalyzer.Analyse(file2Analyse);

            /*
            string _Html = riskAnalyzer.GetHtml();
            string _Xml = riskAnalyzer.GetXml();

            System.IO.File.WriteAllText(@"C:\Risk.html", _Html);
            System.IO.File.WriteAllText(@"C:\Risk.xml", _Xml);
            */

            riskAnalyzer.RenderHtml();
        }