示例#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);
        }
示例#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);
        }
示例#5
0
        public static DomDataCollection CreateFromResourceIdentifiers(IEnumerable <DomReadWriteResourceIdentifier> domReadWriteResourceIdentifiers)
        {
            var domDataCollection = new DomDataCollection(domReadWriteResourceIdentifiers);

            return(domDataCollection);
        }
示例#6
0
        public static DomDataCollection CreateFromResourceIdentifiers(params DomReadWriteResourceIdentifier[] domReadWriteResourceIdentifiers)
        {
            var domDataCollection = new DomDataCollection(domReadWriteResourceIdentifiers);

            return(domDataCollection);
        }
示例#7
0
        public static DomDataCollection CreateFromResources(IEnumerable <DomReadOnlyResource> domReadOnlyResources)
        {
            var domDataCollection = new DomDataCollection(domReadOnlyResources);

            return(domDataCollection);
        }
示例#8
0
        public static DomDataCollection CreateFromResources(params DomReadOnlyResource[] domReadOnlyResources)
        {
            var domDataCollection = new DomDataCollection(domReadOnlyResources);

            return(domDataCollection);
        }
示例#9
0
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Factory Methods
        public static DomDataCollection Create(params Node <DomNodeType>[] domResourcesOrResourceIdentifiers)
        {
            var domDataCollection = new DomDataCollection(domResourcesOrResourceIdentifiers);

            return(domDataCollection);
        }