ReadElementContentAsString() public method

Reads the current element's content as a string and consumes the element.
public ReadElementContentAsString ( ) : string
return string
Esempio n. 1
0
        private void ReadItem(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.Items = context.Items ?? new List <string>();
            context.Items.Add(reader.ReadElementContentAsString());
        }
Esempio n. 2
0
        private static void ReadResolution(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineResolution(
                name: reader.ReadAttributeString(SchemaStrings.AttributeName),
                formatString: reader.ReadElementContentAsString());
        }
Esempio n. 3
0
        private static void ReadExceptionType(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            if (context.Exception)
            {
                context.RefineExceptionType(reader.ReadElementContentAsString());
            }
        }
Esempio n. 4
0
        private void ReadIssue(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            string name      = reader.ReadAttributeString(SchemaStrings.AttributeName);
            string certainty = reader.ReadAttributeString(SchemaStrings.AttributeCertainty);
            string level     = reader.ReadAttributeString(SchemaStrings.AttributeLevel);

            string path = reader.ReadAttributeString(SchemaStrings.AttributePath);
            string file = reader.ReadAttributeString(SchemaStrings.AttributeFile);
            int?   line = reader.ReadAttributeInt(SchemaStrings.AttributeLine);

            string message = reader.ReadElementContentAsString();

            context.RefineIssue(message, name, certainty, level, path, file, line);

            if (IssueRead != null)
            {
                IssueRead(context);
            }

            context.ClearIssue();
        }
Esempio n. 5
0
        private void ReadIssue(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            string resolutionName = reader.ReadAttributeString(SchemaStrings.AttributeName);
            string certainty      = reader.ReadAttributeString(SchemaStrings.AttributeCertainty);
            string level          = reader.ReadAttributeString(SchemaStrings.AttributeLevel);

            string path = reader.ReadAttributeString(SchemaStrings.AttributePath);
            string file = reader.ReadAttributeString(SchemaStrings.AttributeFile);
            int?   line = reader.ReadAttributeInt(SchemaStrings.AttributeLine);

            string message = null;

            if (_readingProjectFile)
            {
                // FxCop does not emit a resolution name attribute in cases where it is "Default"
                resolutionName = resolutionName ?? "Default";
                reader.ReadChildren(SchemaStrings.ElementIssue, parent, out message);
                context.RefineIssue(message, message == null ? resolutionName : null, certainty, level, path, file, line);
            }
            else
            {
                // An FxCop project file Issue has a fully-formed output
                // message as its element content.
                message = reader.ReadElementContentAsString();
                context.RefineIssue(message, resolutionName, certainty, level, path, file, line);
            }

            if (ResultRead != null)
            {
                ResultRead(context);
            }

            context.ClearIssue();
        }
Esempio n. 6
0
        private static void ReadInnerStackTrace(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineInnerStackTrace(reader.ReadElementContentAsString());
        }
Esempio n. 7
0
        private static void ReadInnerExceptionMessage(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineInnerExceptionMessage(reader.ReadElementContentAsString());
        }
Esempio n. 8
0
        private void ReadIssue(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            string name = reader.ReadAttributeString(SchemaStrings.AttributeName);
            string certainty = reader.ReadAttributeString(SchemaStrings.AttributeCertainty);
            string level = reader.ReadAttributeString(SchemaStrings.AttributeLevel);

            string path = reader.ReadAttributeString(SchemaStrings.AttributePath);
            string file = reader.ReadAttributeString(SchemaStrings.AttributeFile);
            int? line = reader.ReadAttributeInt(SchemaStrings.AttributeLine);

            string message = reader.ReadElementContentAsString();

            context.RefineIssue(message, name, certainty, level, path, file, line);

            if (ResultRead != null)
            {
                ResultRead(context);
            }

            context.ClearIssue();
        }
Esempio n. 9
0
        private void ReadInnerExceptionType(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineInnerExceptionType(reader.ReadElementContentAsString());
        }
Esempio n. 10
0
        private static void ReadStackTrace(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineStackTrace(reader.ReadElementContentAsString());
        }
Esempio n. 11
0
        private static void ReadExceptionType(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            if (context.Exception)
            {
                context.RefineExceptionType(reader.ReadElementContentAsString());
            }
        }
Esempio n. 12
0
        private static void ReadExceptionMessage(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineExceptionMessage(reader.ReadElementContentAsString());
        }