System.Xml.Tests.TC_SchemaSet_ProhibitDTD.ValidationCallback C# (CSharp) Méthode

ValidationCallback() public méthode

public ValidationCallback ( object sender, ValidationEventArgs args ) : void
sender object
args System.Xml.Schema.ValidationEventArgs
Résultat void
        public void ValidationCallback(object sender, ValidationEventArgs args)
        {
            switch (args.Severity)
            {
                case XmlSeverityType.Warning:
                    _output.WriteLine("WARNING: ");
                    bWarningCallback = true;
                    warningCount++;
                    break;

                case XmlSeverityType.Error:
                    _output.WriteLine("ERROR: ");
                    bErrorCallback = true;
                    errorCount++;
                    break;
            }

            _output.WriteLine("Exception Message:" + args.Exception.Message + "\n");

            if (args.Exception.InnerException != null)
            {
                _output.WriteLine("InnerException Message:" + args.Exception.InnerException.Message + "\n");
            }
            else
            {
                _output.WriteLine("Inner Exception is NULL\n");
            }
        }