Example #1
0
        public void Initialize(HtmlTable htmlTable, HtmlCell[] htmlCells)
        {
            if (_htmlTable != null)
            {
                throw new InvalidOperationException("Row is already initialized.");
            }

            if (htmlCells.Select(c => c.RowIndex).Distinct().Count() != 1)
            {
                throw new ArgumentException("All cells must have the same RowIndex.", "htmlCells");
            }

            _htmlTable = htmlTable;
            RowIndex = htmlCells[0].RowIndex;

            ResetCache();
            foreach (var htmlCell in htmlCells)
            {
                _htmlCellCache.Set(htmlCell.ColumnIndex, htmlCell);
            }
        }