Exemple #1
0
        private static DomDataCollection AddDomDataCollection(DomDocument domDocument)
        {
            Contract.Requires(domDocument != null);

            // Add data collection node.
            var domDataCollection = domDocument.CreateAndAddNode(() => DomDataCollection.Create());

            return(domDataCollection);
        }
        internal DomDataCollection SetDomDataCollectionEmpty()
        {
            // Validation
            this.ValidateDataDoesNotExist();

            // Add the one allowed DOM data node to the DOM document node.
            var domDataCollection = this.CreateAndAddNode(() => DomDataCollection.Create());

            return(domDataCollection);
        }
Exemple #3
0
        internal DomDataCollection AddDataCollection()
        {
            // Validation
            this.ValidateDataCollectionDoesNotExist();
            this.ValidateDataAndErrorsWillNotCoexist();

            // Add the one allowed DOM data collection node to the DOM document node.
            var domDataCollection = this.CreateAndAddNode(() => DomDataCollection.Create());

            return(domDataCollection);
        }
        internal DomDataCollection SetDomDataCollection(IEnumerable <ResourceIdentifier> apiResourceIdentifierCollection, Type clrResourceType)
        {
            Contract.Requires(apiResourceIdentifierCollection != null);
            Contract.Requires(clrResourceType != null);

            // Validation
            this.ValidateDataDoesNotExist();

            // Add the one allowed DOM data collection node to the DOM document node.
            var domDataCollection = this.CreateAndAddNode(() => DomDataCollection.Create());

            // Add the many allowed DOM resource identifier nodes to the DOM document node.
            var domReadOnlyResourceIdentifierCollection =
                apiResourceIdentifierCollection.Select(x => domDataCollection.CreateAndAddNode(() => DomReadOnlyResourceIdentifier.Create(x, clrResourceType)))
                .ToList();

            return(domDataCollection);
        }