System.Xml.Schema.XmlSchemaValidator.CompleteValidationError C# (CSharp) Méthode

CompleteValidationError() static private méthode

static private CompleteValidationError ( ValidationState context, ValidationEventHandler eventHandler, object sender, string sourceUri, int lineNo, int linePos, XmlSchemaSet schemaSet ) : void
context ValidationState
eventHandler ValidationEventHandler
sender object
sourceUri string
lineNo int
linePos int
schemaSet XmlSchemaSet
Résultat void
        internal static void CompleteValidationError(ValidationState context, ValidationEventHandler eventHandler, object sender, string sourceUri, int lineNo, int linePos, XmlSchemaSet schemaSet)
        {
            ArrayList names = null;
            bool getParticles = schemaSet != null;
            if (context.ElementDecl != null)
            {
                if (getParticles)
                {
                    names = context.ElementDecl.ContentValidator.ExpectedParticles(context, true, schemaSet);
                }
                else
                {
                    names = context.ElementDecl.ContentValidator.ExpectedElements(context, true);
                }
            }
            if (names == null || names.Count == 0)
            {
                if (context.TooComplex)
                {
                    SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException(SR.Sch_IncompleteContentComplex, new string[] { BuildElementName(context.LocalName, context.Namespace), SR.Sch_ComplexContentModel }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
                }
                SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException(SR.Sch_IncompleteContent, BuildElementName(context.LocalName, context.Namespace), sourceUri, lineNo, linePos), XmlSeverityType.Error);
            }
            else
            {
                Debug.Assert(names.Count > 0);
                if (context.TooComplex)
                {
                    SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException(SR.Sch_IncompleteContentExpectingComplex, new string[] { BuildElementName(context.LocalName, context.Namespace), PrintExpectedElements(names, getParticles), SR.Sch_ComplexContentModel }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
                }
                else
                {
                    SendValidationEvent(eventHandler, sender, new XmlSchemaValidationException(SR.Sch_IncompleteContentExpecting, new string[] { BuildElementName(context.LocalName, context.Namespace), PrintExpectedElements(names, getParticles) }, sourceUri, lineNo, linePos), XmlSeverityType.Error);
                }
            }
        }