예제 #1
0
        /// <summary>
        /// Initialises an instance of <see cref="ManifestRuleInfo"/>.
        /// This is essentially a copy-constructor for a <see cref="ManifestRule"/>.
        /// </summary>
        /// <param name="manifestRule">The manifest rule from which to create this instance.</param>
        /// <exception cref="System.ArgumentNullException">If <paramref name="manifestRule"/> is <see langword="null" />.</exception>
        public ManifestRuleInfo(ManifestRule manifestRule)
        {
            if (manifestRule is null)
            {
                throw new System.ArgumentNullException(nameof(manifestRule));
            }

            Identifier      = manifestRule.Identifier;
            DependencyRules = new List <ManifestRuleIdentifier>(manifestRule.DependencyRules);
            ManifestValue   = new ManifestValueInfo(manifestRule.ManifestValue);
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of <see cref="ValueContext"/>.
        /// </summary>
        /// <param name="identity">The object identity associated with this ancestor context.</param>
        /// <param name="actualValue">The object being validated in this ancestor context.</param>
        /// <param name="manifestValue">The manifest value.</param>
        /// <param name="collectionItemOrder">The collection index by which you would traverse from this ancestor context to its immediate child (where applicable).</param>
        public ValueContext(object identity, object actualValue, IManifestItem manifestValue, long?collectionItemOrder = null)
        {
            if (manifestValue is null)
            {
                throw new ArgumentNullException(nameof(manifestValue));
            }

            ValueInfo           = new ManifestValueInfo(manifestValue);
            ObjectIdentity      = identity;
            ActualValue         = actualValue;
            CollectionItemOrder = collectionItemOrder;
        }