Example #1
0
        /// <summary>
        /// Constructs a default <see cref="TagNodeList"/> satisfying the constraints of this node.
        /// </summary>
        /// <returns>A <see cref="TagNodeList"/> with a sensible default value.  If a length is specified, default child <see cref="TagNode"/> objects of the necessary type will be created and added to the <see cref="TagNodeList"/>.</returns>
        public override TagNode BuildDefaultTree()
        {
            if (_length == 0)
            {
                return(new TagNodeList(_type));
            }

            TagNodeList list = new TagNodeList(_type);

            for (int i = 0; i < _length; i++)
            {
                list.Add(_subschema.BuildDefaultTree());
            }

            return(list);
        }