Example #1
0
        public HeaderRows DeepCloneWithFormat(HeaderRowsFormat format)
        {
            var result = new HeaderRows(
                this.Rows?.DeepClone(),
                format);

            return(result);
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HeaderRows"/> class.
        /// </summary>
        /// <param name="rows">The rows.</param>
        /// <param name="format">OPTIONAL format to apply to all header rows.  DEFAULT is to leave the format unchanged.</param>
        public HeaderRows(
            IReadOnlyList <FlatRow> rows,
            HeaderRowsFormat format = null)
        {
            if (rows == null)
            {
                throw new ArgumentNullException(nameof(rows));
            }

            if (rows.Any(_ => _ == null))
            {
                throw new ArgumentException(Invariant($"{nameof(rows)} contains at least one null element."));
            }

            this.Rows   = rows;
            this.Format = format;
        }