/// <summary>
        /// Initializes a new instance of the <see cref="Section"/> class.
        /// </summary>
        /// <param name="id">The section's unique identifier.</param>
        /// <param name="treeTable">The tree table.</param>
        /// <param name="name">OPTIONAL name of the section.  DEFAULT is a section with no name.</param>
        /// <param name="title">OPTIONAL title of the section.  DEFAULT is a section with no title.</param>
        /// <param name="format">OPTIONAL format to apply to the section.  DEFAULT is to leave the format unchanged.</param>
        public Section(
            string id,
            TreeTable treeTable,
            string name          = null,
            string title         = null,
            SectionFormat format = null)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentException(Invariant($"{nameof(id)} is white space."));
            }

            if (treeTable == null)
            {
                throw new ArgumentNullException(nameof(treeTable));
            }

            this.Id        = id;
            this.TreeTable = treeTable;
            this.Name      = name;
            this.Title     = title;
            this.Format    = format;
        }
Exemple #2
0
        public Section DeepCloneWithFormat(SectionFormat format)
        {
            var result = new Section(
                this.Id?.DeepClone(),
                this.TreeTable?.DeepClone(),
                this.Name?.DeepClone(),
                this.Title?.DeepClone(),
                format);

            return(result);
        }