ReadChildren() публичный Метод

Reads the children of M:XmlReader.
public ReadChildren ( string tagName, object parent ) : void
tagName string Name of the tag.
parent object The parent.
Результат void
Пример #1
0
        private static void ReadFxCopReport(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineReport(reader.ReadAttributeString(SchemaStrings.AttributeVersion));
            reader.ReadChildren(SchemaStrings.ElementFxCopReport, parent);
            context.ClearReport();
        }
Пример #2
0
        private static void ReadMember(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineMember(reader.ReadAttributeString(SchemaStrings.AttributeName));
            reader.ReadChildren(SchemaStrings.ElementMember, parent);
            context.ClearMember();
        }
Пример #3
0
        private void ReadNamespace(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineNamespace(reader.ReadAttributeString(SchemaStrings.AttributeName));
            reader.ReadChildren(SchemaStrings.ElementNamespace, parent);
            context.ClearNamespace();
        }
        private static void ReadTarget(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineTarget(reader.ReadAttributeString(SchemaStrings.AttributeName));
            reader.ReadChildren(SchemaStrings.ElementTarget, parent);
            context.ClearTarget();
        }
        private static void ReadResource(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineResource(reader.ReadAttributeString(SchemaStrings.AttributeName));
            reader.ReadChildren(SchemaStrings.ElementResource, parent);
            context.ClearResource();
        }
Пример #6
0
        private static void ReadMessage(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            string messageId   = reader.ReadAttributeString(SchemaStrings.AttributeId);
            string typename    = reader.ReadAttributeString(SchemaStrings.AttributeTypeName);
            string category    = reader.ReadAttributeString(SchemaStrings.AttributeCategory);
            string checkId     = reader.ReadAttributeString(SchemaStrings.AttributeCheckId);
            string fixCategory = reader.ReadAttributeString(SchemaStrings.AttributeFixCategory);

            context.RefineMessage(checkId, typename, messageId, category, fixCategory);
            reader.ReadChildren(SchemaStrings.ElementMessage, parent);
            context.ClearMessage();
        }
Пример #7
0
        private static void ReadType(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            if (context.Exception)
            {
                ReadExceptionType(reader, parent);
            }
            else
            {
                context.RefineType(reader.ReadAttributeString(SchemaStrings.AttributeName));
                reader.ReadChildren(SchemaStrings.ElementType, parent);
                context.ClearType();
            }
        }
Пример #8
0
        private void ReadRule(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineRule(
                typeName: reader.ReadAttributeString(SchemaStrings.AttributeTypeName),
                category: reader.ReadAttributeString(SchemaStrings.AttributeCategory),
                checkId: reader.ReadAttributeString(SchemaStrings.AttributeCheckId));

            reader.ReadChildren(SchemaStrings.ElementRule, parent);

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

            context.ClearRule();
        }
Пример #9
0
        private void ReadException(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            string ruleId = reader.ReadAttributeString(SchemaStrings.AttributeKeyword);
            string kind = reader.ReadAttributeString(SchemaStrings.AttributeKind);
            string checkId = reader.ReadAttributeString(SchemaStrings.AttributeCheckId);
            string target = reader.ReadAttributeString(SchemaStrings.AttributeTarget);

            context.RefineException(true, ruleId, target);

            reader.ReadChildren(SchemaStrings.ElementException, parent);

            string exception = MakeExceptionMessage(kind, checkId, context.ExceptionType, context.ExceptionMessage, context.StackTrace, context.InnerExceptionType, context.InnerExceptionMessage, context.InnerStackTrace);
            context.RefineIssue(exception, null, null, null, null, null, null);

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

            context.ClearIssue();
            context.ClearException();
        }
Пример #10
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();
        }
Пример #11
0
 private static void ReadTypes(SparseReader reader, object parent)
 {
     reader.ReadChildren(SchemaStrings.ElementTypes, parent);
 }
Пример #12
0
 private static void ReadExceptions(SparseReader reader, object parent)
 {
     reader.ReadChildren(SchemaStrings.ElementExceptions, parent);
 }
Пример #13
0
 private static void ReadExceptions(SparseReader reader, object parent)
 {
     reader.ReadChildren(SchemaStrings.ElementExceptions, parent);
 }
Пример #14
0
        private static void ReadFxCopReport(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineReport(reader.ReadAttributeString(SchemaStrings.AttributeVersion));
            reader.ReadChildren(SchemaStrings.ElementFxCopReport, parent);
            context.ClearReport();
        }
Пример #15
0
        private void ReadNamespace(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineNamespace(reader.ReadAttributeString(SchemaStrings.AttributeName));
            reader.ReadChildren(SchemaStrings.ElementNamespace, parent);
            context.ClearNamespace();
        }
Пример #16
0
        private static void ReadTargets(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            reader.ReadChildren(SchemaStrings.ElementTargets, parent);
        }
Пример #17
0
        private void ReadMessage(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            string messageId = reader.ReadAttributeString(SchemaStrings.AttributeId);
            string typename = reader.ReadAttributeString(SchemaStrings.AttributeTypeName);
            string category = reader.ReadAttributeString(SchemaStrings.AttributeCategory);
            string checkId = reader.ReadAttributeString(SchemaStrings.AttributeCheckId);
            string fixCategory = reader.ReadAttributeString(SchemaStrings.AttributeFixCategory);
            string status = reader.ReadAttributeString(SchemaStrings.AttributeStatus);

            context.RefineMessage(checkId, typename, messageId, category, fixCategory, status);

            if ("Excluded".Equals(status) || "ExcludedInSource".Equals(status))
            {
                // FxCop doesn't actually emit message details for most excluded items
                // and so we must fire here for these items, as the scan for child
                // <Issue> elements may not produce anything. FxCop seems to emit
                // issues for excluded items which are at the namespace level only.
                if (ResultRead != null)
                {
                    ResultRead(context);
                }
            }

            reader.ReadChildren(SchemaStrings.ElementMessage, parent);

            context.ClearMessage();
        }
Пример #18
0
 private void ReadModules(SparseReader reader, object parent)
 {
     reader.ReadChildren(SchemaStrings.ElementModules, parent);
 }
Пример #19
0
        private static void ReadMember(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineMember(reader.ReadAttributeString(SchemaStrings.AttributeName));
            reader.ReadChildren(SchemaStrings.ElementMember, parent);
            context.ClearMember();
        }
Пример #20
0
 private void ReadModules(SparseReader reader, object parent)
 {
     reader.ReadChildren(SchemaStrings.ElementModules, parent);
 }
Пример #21
0
        private static void ReadType(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            if (context.Exception)
            {
                ReadExceptionType(reader, parent);
            }
            else
            {
                context.RefineType(reader.ReadAttributeString(SchemaStrings.AttributeName));
                reader.ReadChildren(SchemaStrings.ElementType, parent);
                context.ClearType();
            }
        }
Пример #22
0
        private static void ReadTarget(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineTarget(reader.ReadAttributeString(SchemaStrings.AttributeName));
            reader.ReadChildren(SchemaStrings.ElementTarget, parent);
            context.ClearTarget();
        }
Пример #23
0
        private static void ReadResource(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            context.RefineResource(reader.ReadAttributeString(SchemaStrings.AttributeName));
            reader.ReadChildren(SchemaStrings.ElementResource, parent);
            context.ClearResource();
        }
Пример #24
0
 private static void ReadTypes(SparseReader reader, object parent)
 {
     reader.ReadChildren(SchemaStrings.ElementTypes, parent);
 }
Пример #25
0
        private void ReadException(SparseReader reader, object parent)
        {
            Context context = (Context)parent;

            string ruleId = reader.ReadAttributeString(SchemaStrings.AttributeKeyword);
            string kind = reader.ReadAttributeString(SchemaStrings.AttributeKind);
            string checkId = reader.ReadAttributeString(SchemaStrings.AttributeCheckId);
            string target = reader.ReadAttributeString(SchemaStrings.AttributeTarget);

            context.RefineException(true, ruleId, target);

            reader.ReadChildren(SchemaStrings.ElementException, parent);

            string exception = MakeExceptionMessage(kind, checkId, context.ExceptionType, context.ExceptionMessage, context.StackTrace, context.InnerExceptionType, context.InnerExceptionMessage, context.InnerStackTrace);
            context.RefineIssue(exception, null, null, null, null, null, null);

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

            context.ClearIssue();
            context.ClearException();
        }