Exemple #1
0
        private static void DoViolation(XmlWriter writer, Violation violation)
        {
            writer.WriteStartElement("Violation");

            writer.WriteAttributeString("checkID", violation.CheckID);
            writer.WriteAttributeString("typeName", violation.TypeName);
            writer.WriteAttributeString("category", violation.Category);
            writer.WriteAttributeString("severity", violation.Severity.ToString());
            writer.WriteAttributeString("breaking", violation.Breaking ? "true" : "false");

            writer.WriteStartElement("Cause");
            writer.WriteString(BaseReport.Expand(Reformat.Text(violation.Cause)));
            writer.WriteEndElement();

            writer.WriteStartElement("Description");
            writer.WriteString(BaseReport.Expand(Reformat.Text(violation.Description)));
            writer.WriteEndElement();

            writer.WriteStartElement("Fix");
            writer.WriteString(BaseReport.Expand(Reformat.Text(violation.Fix)));
            writer.WriteEndElement();

            writer.WriteStartElement("CSharp");
            writer.WriteString(Reformat.Code(violation.Csharp));
            writer.WriteEndElement();

            writer.WriteEndElement();
        }
Exemple #2
0
        private static string DoMungeText(string text)
        {
            string result;

            result = Reformat.Text(text);
            result = Break.Lines(result, ms_consoleWidth);
            result = DoBulletedList(result);
            result = DoTable(result);
            result = BaseReport.Expand(result);

            return(result);
        }
Exemple #3
0
        private static string DoMungeText(string text)
        {
            string result;

            result = Reformat.Text(text);                               // don't have to do this for html, but it makes the html source look better
            result = Escape(result);
            result = DoParagraph(result);
            result = DoBulletedList(result);
            result = DoTable(result);
            result = ProcessLinks(result);

            return(result);
        }