コード例 #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);
     if (other.EvaluatedPropertyNames.Any())
     {
         Log.Schema($"Indices through [{other.LastEvaluatedIndex}] 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()
        {
            Local           = source.Local;
            Root            = source.Root;
            RecursiveAnchor = source.RecursiveAnchor;
            Instance        = source.Instance;
            EvaluatedPropertyNames.AddRange(source.EvaluatedPropertyNames);
            LocallyEvaluatedPropertyNames.AddRange(source.LocallyEvaluatedPropertyNames);
            LastEvaluatedIndex          = source.LastEvaluatedIndex;
            LocalTierLastEvaluatedIndex = source.LocalTierLastEvaluatedIndex;
            BaseUri                = source.BaseUri;
            InstanceLocation       = source.InstanceLocation;
            RelativeLocation       = source.RelativeLocation;
            BaseRelativeLocation   = source.BaseRelativeLocation;
            IsMetaSchemaValidation = source.IsMetaSchemaValidation;

            LocalRegistry = source.LocalRegistry;
        }