System.Xml.Schema.XmlSchemaValidator.ThrowDeclNotFoundWarningOrError C# (CSharp) Method

ThrowDeclNotFoundWarningOrError() private method

private ThrowDeclNotFoundWarningOrError ( bool declFound ) : void
declFound bool
return void
        private void ThrowDeclNotFoundWarningOrError(bool declFound)
        {
            if (declFound)
            { //But invalid, so discontinue processing of children
                _processContents = _context.ProcessContents = XmlSchemaContentProcessing.Skip;
                _context.NeedValidateChildren = false;
            }
            else if (HasSchema && _processContents == XmlSchemaContentProcessing.Strict)
            { //Error and skip validation for children
                _processContents = _context.ProcessContents = XmlSchemaContentProcessing.Skip;
                _context.NeedValidateChildren = false;
                SendValidationEvent(SR.Sch_UndeclaredElement, QNameString(_context.LocalName, _context.Namespace));
            }
            else
            {
                SendValidationEvent(SR.Sch_NoElementSchemaFound, QNameString(_context.LocalName, _context.Namespace), XmlSeverityType.Warning);
            }
        }