예제 #1
0
 /// <summary>
 /// Updates the <see cref="EvaluatedPropertyNames"/>, <see cref="LocallyEvaluatedPropertyNames"/>,
 /// <see cref="LastEvaluatedIndex"/>, and <see cref="LocalTierLastEvaluatedIndex"/> properties based
 /// on another context that processed a subschema.
 /// </summary>
 /// <param name="other">Another context object.</param>
 public void UpdateEvaluatedPropertiesAndItemsFromSubschemaValidation(SchemaValidationContext other)
 {
     EvaluatedPropertyNames.UnionWith(other.EvaluatedPropertyNames);
     EvaluatedPropertyNames.UnionWith(other.LocallyEvaluatedPropertyNames);
     if (other.EvaluatedPropertyNames.Any())
     {
         Log.Schema($"Properties [{EvaluatedPropertyNames.ToStringList()}] have now been validated");
     }
     LastEvaluatedIndex = Math.Max(LastEvaluatedIndex, other.LastEvaluatedIndex);
     LastEvaluatedIndex = Math.Max(LastEvaluatedIndex, other.LocalTierLastEvaluatedIndex);
     ValidatedIndices.UnionWith(other.ValidatedIndices);
     ValidatedIndices.UnionWith(other.LocallyValidatedIndices);
     if (other.EvaluatedPropertyNames.Any())
     {
         Log.Schema($"Indices [{EvaluatedPropertyNames.ToStringList()}] have now been validated");
     }
 }
예제 #2
0
        /// <summary>
        /// Creates a new instance of the <see cref="SchemaValidationContext"/> class by copying values from another instance.
        /// </summary>
        public SchemaValidationContext(SchemaValidationContext source)
            : this(source.Root, source.Instance, source.BaseRelativeLocation, source.RelativeLocation, source.InstanceLocation)
        {
            Local           = source.Local;
            Root            = source.Root;
            RecursiveAnchor = source.RecursiveAnchor;
            Instance        = source.Instance;
            EvaluatedPropertyNames.UnionWith(source.EvaluatedPropertyNames);
            LocallyEvaluatedPropertyNames.UnionWith(source.LocallyEvaluatedPropertyNames);
            ValidatedIndices.UnionWith(source.ValidatedIndices);
            LocallyValidatedIndices.UnionWith(source.LocallyValidatedIndices);
            LastEvaluatedIndex          = source.LastEvaluatedIndex;
            LocalTierLastEvaluatedIndex = source.LocalTierLastEvaluatedIndex;
            BaseUri                = source.BaseUri;
            InstanceLocation       = source.InstanceLocation;
            RelativeLocation       = source.RelativeLocation;
            BaseRelativeLocation   = source.BaseRelativeLocation;
            IsMetaSchemaValidation = source.IsMetaSchemaValidation;

            LocalRegistry = source.LocalRegistry;
        }