public void Validate(ValidationEventHandler validationEventHandler, XmlNode nodeToValidate)
{
if (_schemas == null || _schemas.Count == 0)
{ //Should we error
throw new InvalidOperationException(SR.XmlDocument_NoSchemaInfo);
}
XmlDocument parentDocument = nodeToValidate.Document;
if (parentDocument != this)
{
throw new ArgumentException(SR.Format(SR.XmlDocument_NodeNotFromDocument, nameof(nodeToValidate)));
}
if (nodeToValidate == this)
{
_reportValidity = false;
}
DocumentSchemaValidator validator = new DocumentSchemaValidator(this, _schemas, validationEventHandler);
validator.Validate(nodeToValidate);
if (nodeToValidate == this)
{
_reportValidity = true;
}
}