コード例 #1
0
        internal DirectiveCollection(
            object source,
            IEnumerable <DirectiveDefinition> directiveDefinitions)
        {
            if (directiveDefinitions is null)
            {
                throw new ArgumentNullException(nameof(directiveDefinitions));
            }

            _source      = source ?? throw new ArgumentNullException(nameof(source));
            _definitions = directiveDefinitions.ToList();
            _location    = DirectiveHelper.InferDirectiveLocation(source);
        }
コード例 #2
0
        public DirectiveCollection(
            object source,
            IEnumerable <DirectiveDefinition> directiveDefinitions)
        {
            if (directiveDefinitions is null)
            {
                throw new ArgumentNullException(nameof(directiveDefinitions));
            }

            _source      = source ?? throw new ArgumentNullException(nameof(source));
            _definitions = directiveDefinitions.Any()
                ? directiveDefinitions.ToArray()
                : Array.Empty <DirectiveDefinition>();
            _location = DirectiveHelper.InferDirectiveLocation(source);
        }