/// <summary> /// Initializes a new instance of the OpenXmlValidator. /// </summary> /// <param name="fileFormat">The target file format to be validated against.</param> /// <remarks> /// Default to FileFormat.Office2007. /// </remarks> /// <exception cref="ArgumentOutOfRangeException">Thrown when the <paramref name="fileFormat"/> parameter is not a known format.</exception> public OpenXmlValidator(FileFormatVersions fileFormat) { fileFormat.ThrowExceptionIfFileFormatNotSupported(nameof(fileFormat)); _settings = new ValidationSettings(fileFormat); _cache = new ValidationCache(fileFormat); }
public ValidationContext(ValidationSettings settings, ValidationCache cache) { Cache = cache ?? throw new ArgumentNullException(nameof(cache)); Settings = settings ?? throw new ArgumentNullException(nameof(settings)); Errors = new List <ValidationErrorInfo>(); McContext = new MCContext(false); // Start off with a depth of 5 _elements = new Stack <CurrentElement>(5); _elements.Push(new CurrentElement(null, default, false, Errors.Add));
public ValidationContext(ValidationSettings settings, ValidationCache cache) { Cache = cache ?? throw new ArgumentNullException(nameof(cache)); Settings = settings ?? throw new ArgumentNullException(nameof(settings)); Errors = new List <ValidationErrorInfo>(); McContext = new MCContext(false); Stack = new ValidationStack(); Stack.Push(Errors.Add); }
public ValidationContext(ValidationSettings settings, ValidationCache cache, CancellationToken token) { _token = token; Cache = cache ?? throw new ArgumentNullException(nameof(cache)); Settings = settings ?? throw new ArgumentNullException(nameof(settings)); Errors = new List <ValidationErrorInfo>(); McContext = new MCContext(false); Stack = new ValidationStack(); State = new StateManager(this); Stack.Push(Errors.Add); }
/// <summary> /// Initializes a new instance of the DocumentValidator. /// </summary> /// <param name="schemaValidator">The schema validator to be used for schema validation.</param> /// <param name="semanticValidator">The semantic validator to be used for semantic validation.</param> /// <param name="cache">The shared validation cache.</param> public DocumentValidator(SchemaValidator schemaValidator, SemanticValidator semanticValidator, ValidationCache cache) { _cache = cache; _schemaValidator = schemaValidator; _semanticValidator = semanticValidator; }
/// <summary> /// Initializes a new instance of the DocumentValidator. /// </summary> /// <param name="cache">The shared validation cache.</param> public DocumentValidator(ValidationCache cache) { _cache = cache; }