Example #1
0
        /// <summary>
        /// Dumps check results into writer in on of the supported formats
        /// </summary>
        public string Report(TextWriter writer, string format)
        {
            var contentType = "text/xml";

            format = (format ?? string.Empty).Trim().ToLower();

            Reporter reporter = null;

            switch (format)
            {
            case "html":
            case "htm":
            {
                contentType = "text/html";
                reporter    = new HTMLReporter(this);
                break;
            }

            case "text":
            case "txt":
            {
                contentType = "text/plain";
                reporter    = new TextReporter(this);
                break;
            }

            default:  //xml
                reporter = new XMLReporter(this); break;
            }

            reporter.Report(writer);

            return(contentType);
        }
Example #2
0
        /// <summary>
        /// Dumps check results into writer in on of the supported formats
        /// </summary>
        public string Report(TextWriter writer, string format)
        {
           var contentType = "text/xml";
           
           format = (format ?? string.Empty).Trim().ToLower();

           Reporter reporter = null;
           switch (format)
           {
             case "html": 
             case "htm":
                          {
                             contentType = "text/html";
                             reporter = new HTMLReporter(this); 
                             break;
                          }

             case "text":
             case "txt":
                          {
                             contentType = "text/plain";
                             reporter = new TextReporter(this); 
                             break;
                          }

             default: //xml
               reporter = new XMLReporter(this); break;
           }

           reporter.Report(writer);

           return contentType;
        }