I have the following code regarding to XML validation:
var settings = new XmlReaderSettings();
settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
private static void ValidationCallBack(object sender, ValidationEventArgs args)
{
if (args.Severity == XmlSeverityType.Warning)
Console.WriteLine("\tWarning: Matching schema/DTD not found. No validation occurred." + args.Message);
else
Console.WriteLine("\tValidation error: " + args.Message);
}
So the point here is, I want to be able to check to see if settings.ValidationEventHandler
has any event delegate added it to it or not (I understand it is a reference to a method), but the only way I can use it on the left side of a statement is before -= or +=. So how do I check if any ValidationCallBack
had happened or not? I want to be able to set the return type to either false or true based on if any ValidationCallBack
happened or not.