コード例 #1
0
ファイル: DocOpValidator.cs プロジェクト: Stephanvs/Wave.NET
        private static ValidationResult Validate(ViolationCollector collector, IDocumentSchema schema, IAutomatonDocument document, IDocOp docOp)
        {
            if (schema == null)
            {
                schema = DocumentSchema.NoSchemaConstraints;
            }

            var automation = new DocOpAutomaton(document, schema);
            var accu = new ValidationResult[] { ValidationResult.Valid };
            try
            {
                docOp.Apply(new ValidationDocOpCursor(collector, automation, accu));
            }
            catch (IllFormedException illFormed)
            {
                return ValidationResult.IllFormed;
            }

            accu[0] = accu[0].MergeWith(automation.CheckFinish(collector));
            return accu[0];
        }
コード例 #2
0
ファイル: DocOpAutomaton.cs プロジェクト: Stephanvs/Wave.NET
 internal ValidationResult NotClosed(DocOpAutomaton automaton, ViolationCollector collector)
 {
     return automaton.MismatchedInsertStart(collector);
 }